From 395a795126bcf0a683420db47a9afc0d672fe8ff Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Sat, 3 Jan 2009 09:04:15 +0000 Subject: [PATCH] abuild: implemented listpkg and cleanoldpkg --- abuild | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/abuild b/abuild index 1263741..bd82e4b 100755 --- a/abuild +++ b/abuild @@ -204,6 +204,19 @@ cleanpkg() { done } +# clean all packages except current +cleanoldpkg() { + local i j + msg "Cleaning all packages except $pkgver-r$pkgrel..." + for i in $pkgname $subpackages; do + for j in "$PKGDEST"/${i%:*}-[0-9]*.apk; do + [ "$j" != "$PKGDEST/${i%:*}-$pkgver-r$pkgrel.apk" ] \ + && rm -f "$j" + done + done + return 0 +} + runpart() { local part=$1 [ -n "$DEBUG" ] && msg "$part" @@ -465,6 +478,14 @@ stripbin() { return 0 } +# simply list target apks +listpkg() { + local i + for i in $pkgname $subpackages; do + echo "${i%:*}-$pkgver-r$pkgrel.apk" + done +} + usage() { echo "$(basename $0) $abuild_ver" echo "usage: $0 [options] [cmd] ..." @@ -482,9 +503,11 @@ usage() { echo " md5check Check md5sums" echo " unpack Unpack sources to \$srcdir" echo " build Compile and install package into \$pkgdir" + echo " listpkg List target packages" echo " package Create package in \$PKGDEST" echo " rootpkg Run '$0 build package' as fakeroot" echo " clean Remove temp build and install dirs" + echo " cleanoldpkg Remove binary packages except current version" echo " cleanpkg Remove already built binary and source package" echo " cleancache Remove downloaded files from \$SRCDEST" echo " srcpkg Make a source package"