[packages/rpm-build-tools] relup: add -g option to only get packages (like builder)

glen glen at pld-linux.org
Fri Aug 24 00:29:54 CEST 2012


commit 409001f78d68294c86fe5801279431cf56096a38
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Fri Aug 24 01:29:33 2012 +0300

    relup: add -g option to only get packages (like builder)

 relup.sh | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/relup.sh b/relup.sh
index 852bcee..618d10e 100755
--- a/relup.sh
+++ b/relup.sh
@@ -17,13 +17,15 @@ get_dump() {
 }
 
 usage="Usage:
-${0##*/} [-i] [-u] [-t] [-n] [-m <MESSAGE>] <SPECLIST>
+${0##*/} [-i] [-g] [-u] [-t|-n] [-m <MESSAGE>] <SPECLIST>
 
 Options:
 -i
   Try to increment package release
+-g
+ get packages if missing, do nothing else
 -u
-  git pull first
+ update packages (git pull)
 -t | -n
   Test mode (dry-run). do not commit
 -m
@@ -88,7 +90,7 @@ if [ ! -x /usr/bin/getopt ]; then
 	exit 1
 fi
 
-t=$(getopt -o 'm:inuth' -n "${0##*/}" -- "$@") || exit $?
+t=$(getopt -o 'm:inguth' -n "${0##*/}" -- "$@") || exit $?
 # Note the quotes around `$t': they are essential!
 eval set -- "$t"
 
@@ -100,6 +102,9 @@ while true; do
 	-u)
 		update=1
 		;;
+	-g)
+		get=1
+		;;
 	-t | -n)
 		test=1
 		;;
@@ -147,10 +152,14 @@ for pkg in "$@"; do
 	echo "$pkg ..."
 
 	# get package
-	if [ "$update" = "1" ]; then
+	[ "$get" = 1 -a -d "$pkgdir" ] && continue
+
+	if [ "$update" = "1" -o "$get" = "1" ]; then
 		./builder -g -ns "$spec"
 	fi
 
+	[ "$get" = 1 ] && continue
+
 	# update .spec files
 	rel=$(get_release "$spec")
 	if [ "$inc" = 1 ]; then


More information about the pld-cvs-commit mailing list