Files
xiaomi-ax3600/tools/gnulib/patches/010-autoconf-version.patch
Michael Pratt b07b8c8b43 tools/gnulib: update to branch stable-202407
Bump to the next stable branch with the May 2025 update.

Add a patch to compensate for gnulib-tool being further split up
into independent shell and python implementations
by using a non-hidden version of the main.py file.

Add a patch for the python implementation of gnulib-tool
in order to ignore the required version of autoconf in configure.ac
being lower than the required version of autoconf for gnulib
if the version that is being run exceeds the required version for both,
and adjust existing autoconf version shell script patch to new filename.

Backport a patch for a change in function naming convention
for forward compatibility with tool releases after this stable branch.

Added:
 - 020-python-version.patch
 - 021-python-main.patch
 - 500-acl-function-name.patch

Manually Adjusted:
 - 010-autoconf-version.patch
 - 160-flag-reallocarray.patch

Existing patches are automatically refreshed.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:07 +02:00

48 lines
1.3 KiB
Diff

--- a/gnulib-tool.sh
+++ b/gnulib-tool.sh
@@ -343,6 +343,34 @@ Options for --import, --add/remove-impor
Report bugs to <bug-gnulib@gnu.org>."
}
+get_version_sed='
+# Move version to start of line.
+s/.*[v ]\([0-9]\)/\1/
+
+# Skip lines that do not start with version.
+/^[0-9]/!d
+
+# Remove characters after the version.
+s/[^.a-z0-9-].*//
+
+# The first component must be digits only.
+s/^\([0-9]*\)[a-z-].*/\1/
+
+# The following essentially does s/5.005/5.5/
+s/\.0*\([1-9]\)/.\1/g
+p
+q'
+
+# get_version
+# copied from build-aux/bootstrap
+get_version () {
+ app=$1
+
+ $app --version >/dev/null 2>&1 || { $app --version; return 1; }
+
+ $app --version 2>&1 | sed -n "$get_version_sed"
+}
+
# func_version
# outputs to stdout the --version message.
func_version ()
@@ -1665,6 +1693,9 @@ func_determine_path_separator
fi
case "$autoconf_minversion" in
1.* | 2.[0-5]* | 2.6[0-3]*)
+ # if the version of autoconf in use is high enough, do not error
+ case "$(get_version autoconf)" in 1.* | 2.[0-5]* | 2.6[0-3]*) false ;; esac && \
+ func_warning "gnulib requires a newer version of autoconf than configure.ac ( $DEFAULT_AUTOCONF_MINVERSION > AC_PREREQ([$autoconf_minversion]) )" || \
func_fatal_error "minimum supported autoconf version is 2.64. Try adding AC_PREREQ([$DEFAULT_AUTOCONF_MINVERSION]) to your configure.ac." ;;
esac