diff --git a/common/xbps-src/shutils/purge_distfiles.sh b/common/xbps-src/shutils/purge_distfiles.sh index 73df13932bc..1cfaf5bdc0b 100644 --- a/common/xbps-src/shutils/purge_distfiles.sh +++ b/common/xbps-src/shutils/purge_distfiles.sh @@ -4,10 +4,7 @@ purge_distfiles() { - # Ignore msg_error calls when sourcing templates - msg_error() { - : - } + readonly HASHLEN=64 if [ -z "$XBPS_SRCDISTDIR" ]; then msg_error "The variable \$XBPS_SRCDISTDIR is not set." exit 1 @@ -28,8 +25,7 @@ purge_distfiles() { pkg=${template#*/} pkg=${pkg%/*} if [ ! -L "srcpkgs/$pkg" ]; then - unset checksum - source $template 2>/dev/null + checksum="$(grep -Ehrow [0-9a-f]{$HASHLEN} ${template}|sort|uniq)" read -a _my_hashes <<< ${checksum} i=0 while [ -n "${_my_hashes[$i]}" ]; do @@ -77,7 +73,6 @@ purge_distfiles() { echo hashes=($XBPS_SRCDISTDIR/by_sha256/*) - readonly HASHLEN=64 for file in ${hashes[@]}; do hash_distfile=${file##*/} hash=${hash_distfile:0:$HASHLEN}