SPECS: workcleanup.sh - don't assume everyone has ~/rpm/SPECS - ki...

glen glen at pld-linux.org
Fri Jul 28 00:13:29 CEST 2006


Author: glen                         Date: Thu Jul 27 22:13:29 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- don't assume everyone has ~/rpm/SPECS
- kill bashism

---- Files affected:
SPECS:
   workcleanup.sh (1.4 -> 1.5) 

---- Diffs:

================================================================
Index: SPECS/workcleanup.sh
diff -u SPECS/workcleanup.sh:1.4 SPECS/workcleanup.sh:1.5
--- SPECS/workcleanup.sh:1.4	Fri Jul 28 00:09:54 2006
+++ SPECS/workcleanup.sh	Fri Jul 28 00:13:24 2006
@@ -3,31 +3,33 @@
 # Its CRUDE
 # it just builds source rpm then cleans CVS/Entries, nothing more
 
-ARG=$1
+spec="$1"
 
-if [ ! -e ~/rpm/SPECS/specparser.pl ]; then
-	echo "I cant continue, i need specparser.pl"
-	exit;
+if [ -z "$spec" ]; then
+	echo "I need argument, preferably spec filename"
+	exit 1
 fi
 
-if [ "x$1" == x ]; then
-	echo "I need argument, preferably spec filename";
-	exit;
+dir=$(dirname "$0")
+
+if [ ! -x "$dir/specparser.pl" ]; then
+	echo "I can't continue, I need SPECS/specparser.pl"
+	exit 1
 fi
 
-if [ ! -e $1 ]; then
-	echo "$1 dont exist";
-	exit;
+if [ ! -e "$spec" ]; then
+	echo "$spec doesn't exist"
+	exit 1
 fi
 
-LIST=$(~/rpm/SPECS/specparser.pl --asf $1);
-if [ "x$PARTIAL" == x ]; then
-	rpmbuild -bs --rmsource --rmspec --clean $1
+LIST=$("$dir/specparser.pl" --asf "$spec");
+if [ "$PARTIAL" = "" ]; then
+	rpmbuild -bs --rmsource --rmspec --clean "$spec"
 fi
-if [ $? == 0 ]; then
+if [ $? = 0 ]; then
 	# /3DKit.spec/1.10/Wed Jan 18 12:46:16 2006//
-	sed -i -e "/^\/$1\//d" ~/rpm/SPECS/CVS/Entries
+	sed -i -e "/^\/$spec\//d" "$dir/CVS/Entries"
 	for i in $LIST; do
-		sed -i -e "/^\/$i\//d" ~/rpm/SPECS/CVS/Entries
+		sed -i -e "/^\/$i\//d" "$dir/../SOURCES/CVS/Entries"
 	done
 fi
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/workcleanup.sh?r1=1.4&r2=1.5&f=u



More information about the pld-cvs-commit mailing list