diff options
author | Aaron Griffin <aaronmgriffin@gmail.com> | 2009-09-24 01:05:18 +0200 |
---|---|---|
committer | Aaron Griffin <aaronmgriffin@gmail.com> | 2009-09-24 01:05:18 +0200 |
commit | 588cbbff128c72ac1871c26f9503ee41ea59bdfd (patch) | |
tree | 8ba508f57fc21a95473964aae425ae6ebbf5fb04 /misc-scripts | |
parent | b6ca5aa8ae15e98a01f3897fa4931319aad94732 (diff) | |
download | dbscripts-588cbbff128c72ac1871c26f9503ee41ea59bdfd.tar.gz dbscripts-588cbbff128c72ac1871c26f9503ee41ea59bdfd.tar.xz |
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 <aaronmgriffin@gmail.com>
Diffstat (limited to 'misc-scripts')
-rwxr-xr-x | misc-scripts/make-sourceball | 31 |
1 files changed, 26 insertions, 5 deletions
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 |