SPECS: builder - use cvsup() also when fetching spec

glen glen at pld-linux.org
Tue Jan 17 00:26:07 CET 2006


Author: glen                         Date: Mon Jan 16 23:26:07 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- use cvsup() also when fetching spec

---- Files affected:
SPECS:
   builder (1.374 -> 1.375) 

---- Diffs:

================================================================
Index: SPECS/builder
diff -u SPECS/builder:1.374 SPECS/builder:1.375
--- SPECS/builder:1.374	Tue Jan 17 00:19:03 2006
+++ SPECS/builder	Tue Jan 17 00:26:02 2006
@@ -471,50 +471,19 @@
 	fi
 
 	cd "$SPECS_DIR"
-	if [ \! -f "$SPECFILE" ]; then
+	if [ ! -f "$SPECFILE" ]; then
 		SPECFILE="`basename $SPECFILE .spec`.spec";
 	fi
 	if [ "$NOCVSSPEC" != "yes" ]; then
-		OPTIONS="up "
-
-		if [ -n "$CVSROOT" ]; then
-			OPTIONS="-d $CVSROOT $OPTIONS"
-		else
-			if [ ! -s CVS/Root -a "$NOCVSSPEC" != "yes" ]; then
-				echo "warning: No cvs access defined - using local .spec file"
-				NOCVSSPEC="yes"
-			fi
-		fi
 
-		if [ -z "$CVSDATE" -a -z "$CVSTAG" ]; then
-			OPTIONS="$OPTIONS -A"
-		else
-			if [ -n "$CVSDATE" ]; then
-				OPTIONS="$OPTIONS -D $CVSDATE"
-			fi
-			if [ -n "$CVSTAG" ]; then
-				OPTIONS="$OPTIONS -r $CVSTAG"
-			fi
+		if [ ! -s CVS/Root -a "$NOCVSSPEC" != "yes" ]; then
+			echo "Warning: No CVS access defined - using local .spec file"
+			NOCVSSPEC="yes"
 		fi
 
-		result=1
-		retries_counter=0
-		while [ "$result" != "0" -a "$retries_counter" -le "$CVS_RETRIES" ]
-		do
-			retries_counter=$(( $retries_counter + 1 ))
-			output=$(LC_ALL=C cvs $OPTIONS $SPECFILE 2>&1)
-			result=$?
-			[ -n "$output" ] && echo "$output"
-			if [ "$result" -ne "0" ]; then
-				if (echo "$output" | grep -qE "(Cannot connect to|connect to .* failed|Connection reset by peer|Connection timed out|Unknown host)") && [ "$retries_counter" -le "$CVS_RETRIES" ]; then
-					echo "Trying again [$SPECFILE]... ($retries_counter)"
-					sleep 2
-					continue
-				fi
-				Exit_error err_no_spec_in_repo;
-			fi
-		done
+		cvsup "$SPECFILE" || Exit_error err_no_spec_in_repo
 	fi
+
 	if [ ! -f "$SPECFILE" ]; then
 		Exit_error err_no_spec_in_repo;
 	fi
@@ -665,6 +634,7 @@
 		  fi
 	 done
 	 update_shell_title "cvsup: done!"
+	 return $result
 }
 
 get_files()
@@ -681,7 +651,7 @@
 		cd "$SOURCE_DIR"
 
 		if [ ! -s CVS/Root -a "$NOCVS" != "yes" ]; then
-			echo "warning: No cvs access defined for SOURCES"
+			echo "Warning: No CVS access defined for SOURCES"
 			NOCVS="yes"
 		fi
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/builder?r1=1.374&r2=1.375&f=u



More information about the pld-cvs-commit mailing list