[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fix for source includes in gendoc.sh for future consideration
From: |
Bruno Haible |
Subject: |
Re: fix for source includes in gendoc.sh for future consideration |
Date: |
Sun, 28 Jan 2024 15:36:26 +0100 |
Hi Patrice,
Patrice Dumas wrote:
> It seems to me that gendoc.sh is quite compatible with past versions of
> Texinfo makeinfo. Therefore I think that this patch is not acceptable
> as is, there need to be a way to determine that the makeinfo version is
> good
Yes, that's the approach we generally use for making use of features
that exist only in new versions of the tools:
1. Add an 'if' that tests whether the feature is available, and
make use of it. Hopefully with as little code duplication as possible.
2. Wait 10 years (or such), until no one uses the older versions
any more. Look at https://repology.org/project/texinfo/versions
to get a feeling when this time has come.
3. Remove the older code.
> I have
> no idea on what would be an acceptable way to check whether makeinfo has
> the right version.
In gnulib-tool we use this piece of code to test the version of 'sed':
case `sed --version | sed -e 's/^[^0-9]*//' -e 1q` in \
[1-3]* | 4.[01]*) false;; \
*) true;; \
esac
Similarly, I think the following piece of code should work to test the
version of 'makeinfo':
case `${MAKEINFO-makeinfo} --version | sed -e 's/^[^0-9]*//' -e 1q` in \
[1-6]* | 7.[01]*) false;; \
*) true;; \
esac
Bruno