diff --git a/baselibs.conf b/baselibs.conf index 2794a226..747ef8ff 100644 --- a/baselibs.conf +++ b/baselibs.conf @@ -1,4 +1,6 @@ targettype x86 package bash + +^/usr/bin/bash$ + +^/usr/bin/sh$ +^/bin/bash$ +^/bin/sh$ prereq -glibc-x86 diff --git a/bash.changes b/bash.changes index 5dc37da5..c6734b99 100644 --- a/bash.changes +++ b/bash.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jul 26 08:03:24 UTC 2021 - Dr. Werner Fink + +- Use a get_version_number.sh script + ------------------------------------------------------------------- Fri Jul 23 12:18:48 UTC 2021 - Callum Farmer diff --git a/bash.spec b/bash.spec index 6e895bc7..2f6f16e7 100644 --- a/bash.spec +++ b/bash.spec @@ -18,7 +18,7 @@ %define bextend %{nil} %define bversion 5.1 -%define bpatchlvl %(tar -jtf %{_sourcedir}/bash-%{bversion}-patches.tar.bz2 | tail -n 1 | cut -d '/' -f 2 | cut -d '-' -f 2 | tr -d 0) +%define bpatchlvl %(bash %{_sourcedir}/get_version_number.sh %{_sourcedir}) %global _incdir %{_includedir} %global _ldldir %{_libdir}/bash %global _minsh 0 @@ -37,6 +37,7 @@ URL: https://www.gnu.org/software/bash/bash.html # Git: http://git.savannah.gnu.org/cgit/bash.git Source0: ftp://ftp.gnu.org/gnu/bash/bash-%{bversion}%{bextend}.tar.gz Source1: bash-%{bversion}-patches.tar.bz2 +Source2: get_version_number.sh Source4: run-tests Source5: dot.bashrc Source6: dot.profile diff --git a/get_version_number.sh b/get_version_number.sh new file mode 100644 index 00000000..31214a76 --- /dev/null +++ b/get_version_number.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# Note: this file is used in the spec file, do not remove it +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]} +tar --wildcards -tf ${sourcedir}/bash-${version}-patches.tar.bz2 '*/bash[0-9][0-9]-[0-9]*' &> /dev/null || echo ${last[0]} +OFS="$IFS" +IFS=- +last=($(tar -tf ${sourcedir}/bash-${version}-patches.tar.bz2 | sed -r 's@\.patch$@@'| sort -t '-' -k 3,3 -n | tail -n 1)) +IFS="$OFS" +echo ${last[3]/*0/}