SPECS: relup.sh - add -m option for message (NOTE: use it without ...

glen glen at pld-linux.org
Fri Dec 8 15:22:51 CET 2006


Author: glen                         Date: Fri Dec  8 14:22:51 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- add -m option for message (NOTE: use it without leading dash!)

---- Files affected:
SPECS:
   relup.sh (1.8 -> 1.9) 

---- Diffs:

================================================================
Index: SPECS/relup.sh
diff -u SPECS/relup.sh:1.8 SPECS/relup.sh:1.9
--- SPECS/relup.sh:1.8	Thu Oct 19 16:57:39 2006
+++ SPECS/relup.sh	Fri Dec  8 15:22:46 2006
@@ -29,6 +29,33 @@
 	echo $rel
 }
 
+if [ ! -x /usr/bin/getopt ]; then
+	echo >&1 "You need to install util-linux to use relup.sh"
+	exit 1
+fi
+
+t=`getopt -o 'm:' -n $(dirname "$0") -- "$@"` || exit $?
+# Note the quotes around `$TEMP': they are essential!
+eval set -- "$t"
+
+while true; do
+	case "$1" in
+	-m)
+		shift
+		message="$1"
+		;;
+	--)
+		shift
+	   	break
+	;;
+	*)
+	   	echo 2>&1 "Internal error: [$1] not recognized!"
+		exit 1
+	   	;;
+	esac
+	shift
+done
+
 tmpd=$(mktemp -d "${TMPDIR:-/tmp}/relXXXXXX")
 for spec in "$@"; do
 	spec=${spec%.spec}.spec
@@ -39,6 +66,7 @@
 for file in $(ls "$tmpd" 2>/dev/null); do
 	files=$(cat "$tmpd/$file")
 	rel=$(basename "$file")
-	cvs ci -m "- rel $rel" $files
+	echo cvs ci -m "'- rel $rel${message:+ ($message)}'"
+	cvs ci -m "$msg" $files
 done
 rm -rf $tmpd
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/relup.sh?r1=1.8&r2=1.9&f=u



More information about the pld-cvs-commit mailing list