From 588cbbff128c72ac1871c26f9503ee41ea59bdfd Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Wed, 23 Sep 2009 19:05:18 -0400 Subject: make-sourceball: Re-add file parsing of name/ver getpkgname / getpkgver were replaced with versions that scanned the .PKGINFO file. These don't work for source packages, so add the functionality back in for this case Signed-off-by: Aaron Griffin --- misc-scripts/make-sourceball | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'misc-scripts/make-sourceball') diff --git a/misc-scripts/make-sourceball b/misc-scripts/make-sourceball index 75eee07..865e0e7 100755 --- a/misc-scripts/make-sourceball +++ b/misc-scripts/make-sourceball @@ -43,6 +43,27 @@ die() { cleanup 1 } +pkgname_from_src() { + local tmp + tmp=${1##*/} + tmp=${tmp%$SRCEXT} + for a in ${ARCHES[@]}; do + tmp=${tmp%-$a} + done + tmp=${tmp%-any} + echo ${tmp%-*-*} +} + +pkgver_from_src() { + tmp=${1##*/} + tmp=${tmp%$SRCEXT} + for a in ${ARCHES[@]}; do + tmp=${tmp%-$a} + done + tmp=${tmp%-any} + echo $tmp | sed 's|.*-\(.*-.*\)$|\1|g' +} + #usage: chk_license ${license[@]}" chk_license() { #The -f flag skips this check @@ -109,11 +130,11 @@ remove_old() { cd .. done - for pkg in "$srcpath/$packagename-"*; do - [ -f "$pkg" ] || continue - if [ "$(getpkgname $pkg)" == "$packagename" ]; then + for srcpkg in "$srcpath/$packagename-"*; do + [ -f "$srcpkg" ] || continue + if [ "$(pkgname_from_src $srcpkg)" == "$packagename" ]; then skip=0 - pver="$(getpkgver $pkg)" + pver="$(pkgver_from_src $srcpkg)" for v in $PKGVERS; do if [ "$v" = "$pver" ]; then skip=1 @@ -121,7 +142,7 @@ remove_old() { fi done if [ $skip -ne 1 ]; then - rm -f "$pkg" + rm -f "$srcpkg" fi fi done -- cgit v1.2.3-24-g4f1b