packages: relup.sh - format -m message better - allow -n to equal -t

glen glen at pld-linux.org
Sun Aug 22 10:51:37 CEST 2010


Author: glen                         Date: Sun Aug 22 08:51:37 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- format -m message better
- allow -n to equal -t

---- Files affected:
packages:
   relup.sh (1.24 -> 1.25) 

---- Diffs:

================================================================
Index: packages/relup.sh
diff -u packages/relup.sh:1.24 packages/relup.sh:1.25
--- packages/relup.sh:1.24	Fri Jul 30 08:55:57 2010
+++ packages/relup.sh	Sun Aug 22 10:51:31 2010
@@ -17,15 +17,15 @@
 }
 
 usage="Usage:
-${0##*/} [-i] [-u] [-t] [-m <MESSAGE>] <SPECLIST>
+${0##*/} [-i] [-u] [-t] [-n] [-m <MESSAGE>] <SPECLIST>
 
 Options:
 -i
   Try to increment package release
 -u
   cvs update first
--t
-  Test mode. do not commit
+-t | -n
+  Test mode (dry-run). do not commit
 -m
   Specify commit message
 
@@ -56,7 +56,7 @@
 	exit 1
 fi
 
-t=$(getopt -o 'm:iuth' -n "${0##*/}" -- "$@") || exit $?
+t=$(getopt -o 'm:inuth' -n "${0##*/}" -- "$@") || exit $?
 # Note the quotes around `$t': they are essential!
 eval set -- "$t"
 
@@ -68,7 +68,7 @@
 	-u)
 		update=1
 		;;
-	-t)
+	-t | -n)
 		test=1
 		;;
 	-m)
@@ -115,10 +115,14 @@
 	echo "$spec" >> "$tmpd/$rel"
 done
 
+n="$(echo -e '\nn')"
+n="${n%%n}"
 for file in $(ls "$tmpd" 2>/dev/null); do
 	files=$(cat "$tmpd/$file")
 	rel=$(basename "$file")
-	msg="- release $rel${message:+ ($message)}"
+	msg=""
+	[ -n "$message" ] && msg="$msg- $message$n"
+	msg="$msg- release $rel$n"
 	echo cvs ci -m "'$msg'"
 	if [ "$test" != 1 ]; then
 		cvs ci -m "$msg" $files
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/relup.sh?r1=1.24&r2=1.25&f=u



More information about the pld-cvs-commit mailing list