2021-07-26 10:58:19 +02:00
|
|
|
#!/bin/bash
|
|
|
|
# Note: this file is used in the spec file, do not remove it
|
2022-09-27 09:37:07 +02:00
|
|
|
# Print the highest version number of the patches from the archive
|
2021-07-26 10:58:19 +02:00
|
|
|
sourcedir=$1
|
|
|
|
test -n "${sourcedir}" || sourcedir=$PWD
|
|
|
|
test -e ${sourcedir}/bash.spec || exit 1
|
|
|
|
version=$(sed -rn '/^%define[[:space:]]+bversion/{s/^%define[[:space:]]+bversion[[:space:]]+([0-9]+\.[0-9]+)(\.[^\.]+)?/\1/p}' ${sourcedir}/bash.spec) || exit 1
|
|
|
|
test -e ${sourcedir}/bash-${version}.tar.gz || exit 1
|
|
|
|
last=($(tar Oxf ${sourcedir}/bash-${version}.tar.gz bash-${version}/configure.ac | sed -rn '/^define.bashvers/{s/^define\(bashvers,[[:space:]]([0-9\.]+)\)/\1/p}')) || exit 1
|
|
|
|
test -e ${sourcedir}/bash-${version}-patches.tar.bz2 || echo ${last[0]}
|
2022-02-24 09:40:56 +01:00
|
|
|
tar --wildcards -tf ${sourcedir}/bash-${version}-patches.tar.bz2 '*/bash[0-9][0-9]-*[0-9]' &> /dev/null || echo ${last[0]}
|
2021-07-26 10:58:19 +02:00
|
|
|
OFS="$IFS"
|
|
|
|
IFS=-
|
2022-02-24 09:40:56 +01:00
|
|
|
last=($(tar --wildcards -tf ${sourcedir}/bash-${version}-patches.tar.bz2 '*/bash[0-9][0-9]-*[0-9]' | sed -r 's@\.patch$@@'| sort -t '-' -k 3,3 -n | tail -n 1))
|
2021-07-26 10:58:19 +02:00
|
|
|
IFS="$OFS"
|
2024-01-16 10:08:48 +01:00
|
|
|
shopt -s extglob
|
|
|
|
echo ${last[3]##+(0)}
|