From d5a37be5d25b605a3896c6245d818bcd2614d57e Mon Sep 17 00:00:00 2001 From: bill-auger Date: Fri, 15 Sep 2023 09:02:35 -0400 Subject: housekeeping - nornmalize _version_constraint() implementations across PKGBUILDs --- pcr-testing/calamares/PKGBUILD | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'pcr-testing') diff --git a/pcr-testing/calamares/PKGBUILD b/pcr-testing/calamares/PKGBUILD index 6c27f1e6e..962cd6416 100644 --- a/pcr-testing/calamares/PKGBUILD +++ b/pcr-testing/calamares/PKGBUILD @@ -30,7 +30,7 @@ _version_constraint() # (dep_pkgname [precision]) local n_dots=$(tmp=${full_version%-*} ; tmp=${tmp//[^\.]} ; echo "${#tmp}" ;) local def_precision=$(( n_dots + 1 )) local is_prec_valid=$(( req_precision > 0 && req_precision <= def_precision )) - local precision=$( (( is_prec_valid )) && echo ${req_precision} || echo ${def_precision} ) + local precision=$((( is_prec_valid )) && echo ${req_precision} || echo ${def_precision}) local pkgver_rx='[0-9A-Za-z_]+' pkgver_rx=$(sed 's|\]|\+]|' <<<${pkgver_rx}) # according to the wiki, '+' is not allowed, # but some pkgver have it (eg: 5.15.10+kde+r130) @@ -39,16 +39,16 @@ _version_constraint() # (dep_pkgname [precision]) local garbage_rx='[^0-9].*' local capture_rx=${pkgver_rx} for (( n_dots=1 ; n_dots < precision ; ++n_dots )) ; do capture_rx+=${subver_rx} ; done ; - local version pkgrel has_split_char version_min version_max constraint_string + local version pkgrel has_dot_char version_min version_max constraint_string declare -i subver subver_inc pkgrel_inc if [[ "${full_version}" =~ ^(${capture_rx})(${subver_rx})*-(${pkgrel_rx}).*$ ]] then version=${BASH_REMATCH[1]} # pkgver cut to the requested precision #unused=${BASH_REMATCH[2]} # discarded pkgver segments pkgrel=${BASH_REMATCH[3]} # pkgrel with non-numerics right-trimmed - has_split_char=$(grep '\.' <<<${version} &> /dev/null ; echo $((! $?)) ; ) + has_dot_char=$([[ "${version}" =~ \. ]] ; echo $(( ! $? )) ; ) subver=$(sed "s|${garbage_rx}||" <<<${version##*.}) # right-trim from any non-numeric - version=$( ((has_split_char)) && echo ${version%.*}.${subver} || echo ${subver} ) + version=$( (( has_dot_char )) && echo ${version%.*}.${subver} || echo ${subver} ) subver_inc=$(( subver + 1 )) pkgrel_inc=$(( pkgrel + 1 )) version_min=$( (( ! is_prec_valid )) && echo ${full_version%-*}-${pkgrel} || \ @@ -93,10 +93,11 @@ build() package() { - depends+=( $(_version_constraint 'boost-libs') \ - $(_version_constraint 'icu' ) \ - $(_version_constraint 'kpmcore' ) \ - $(_version_constraint 'qt5-base' ) ) + # pin to strongly-coupled dependency versions + depends=( ${depends[*]/boost-libs/} $(_version_constraint 'boost-libs') ) + depends=( ${depends[*]/icu/} $(_version_constraint 'icu' ) ) + depends=( ${depends[*]/kpmcore/} $(_version_constraint 'kpmcore' ) ) + depends=( ${depends[*]/qt5-base/} $(_version_constraint 'qt5-base' ) ) cd "${srcdir}"/${pkgname}/build -- cgit v1.2.2