apply_patches: Sort patch list before applying

The apply_patches script wasn't sorting the list of patches in
the "patches" directory before applying them. This left the list
in an indeterminate order. In most cases, the list is actually
sorted but rarely, they can be out of order and cause dependent
patches to fail to apply.

We now sort the list but the "sort" program wasn't in the
configure scripts so we needed to add that and regenerate
the scripts as well.

Resolves: #193
This commit is contained in:
George Joseph
2023-07-06 06:37:50 -06:00
parent 0fa022a39c
commit 90069a94b0
5 changed files with 53 additions and 34 deletions

View File

@@ -7,6 +7,7 @@ fi
PATCH=${PATCH:-patch}
FIND=${FIND:-find}
SORT=${SORT:-sort}
patchdir=${1:?You must supply a patches directory}
sourcedir=${2?:You must supply a source directory}
@@ -21,7 +22,7 @@ if [ ! -d "$sourcedir" ] ; then
exit 1
fi
patches=$(${FIND} "$patchdir" -name "*.patch")
patches=$(${FIND} "$patchdir" -name "*.patch" | ${SORT})
if [ x"$patches" = x"" ] ; then
echo "No patches in $patchdir" >&2
exit 0