packages: rpm-build-tools/builder.sh, rpm-build-tools/rpm-build-tools.spec ...

sparky sparky at pld-linux.org
Fri Jun 25 18:57:00 CEST 2010


Author: sparky                       Date: Fri Jun 25 16:57:00 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- correct md5

---- Files affected:
packages/rpm-build-tools:
   builder.sh (1.31 -> 1.32) , rpm-build-tools.spec (1.30 -> 1.31) 

---- Diffs:

================================================================
Index: packages/rpm-build-tools/builder.sh
diff -u packages/rpm-build-tools/builder.sh:1.31 packages/rpm-build-tools/builder.sh:1.32
--- packages/rpm-build-tools/builder.sh:1.31	Tue Apr 20 14:34:33 2010
+++ packages/rpm-build-tools/builder.sh	Fri Jun 25 18:56:54 2010
@@ -19,7 +19,6 @@
 #	100 - Unknown error (should not happen)
 
 # Notes (todo/bugs):
-# - builder -u fetches current version first (well that's okay, how you compare versions if you have no old spec?)
 # - when Icon: field is present, -5 and -a5 doesn't work
 # - builder -R skips installing BR if spec is not present before builder invocation (need to run builder twice)
 # - does not respect NoSource: X, and tries to cvs up such files [ example: VirtualBox-bin.spec and its Source0 ]
@@ -466,6 +465,7 @@
 %pyrequires_eq() %{nil}
 %requires_eq() %{nil}
 %requires_eq_to() %{nil}
+%requires_ge() %{nil}
 %releq_kernel_up(n:) ERROR
 %releq_kernel_smp(n:) ERROR
 %releq_kernel(n:) ERROR
@@ -738,7 +738,7 @@
 
 			# create symlinks for tools
 			if [ "$SYMLINK_TOOLS" != "no" ]; then
-				for a in dropin md5 adapter builder {relup,compile,repackage,rsync,pearize}.sh; do
+				for a in dropin md5 adapter builder {relup,compile,repackage,rsync,pearize}.sh pldnotify.awk; do
 					[ -f $a ] || continue
 					ln -s ../$a $ASSUMED_NAME
 					cvsignore_df $a
@@ -1412,19 +1412,13 @@
 	" $specfile
 }
 
-build_package() {
-	update_shell_title "build_package"
-	if [ -n "$DEBUG" ]; then
-		set -x
-		set -v
-	fi
-
-	cd "$PACKAGE_DIR"
-
+try_upgrade() {
 	if [ -n "$TRY_UPGRADE" ]; then
 		local TNOTIFY TNEWVER TOLDVER
 		update_shell_title "build_package: try_upgrade"
 
+		cd "$PACKAGE_DIR"
+		
 		if [ -n "$FLOAT_VERSION" ]; then
 			TNOTIFY=$($APPDIR/pldnotify.awk ${BE_VERBOSE:+-vDEBUG=1} $SPECFILE -n) || exit 1
 		else
@@ -1440,13 +1434,22 @@
 				cp -f $SPECFILE $SPECFILE.bak
 			fi
 			chmod +w $SPECFILE
-			set_release $SPECFILE $PACKAGE_RELEASE 0.1
+			set_release $SPECFILE $PACKAGE_RELEASE 1
 			set_version $SPECFILE $PACKAGE_VERSION $TNEWVER
 			parse_spec
-			NODIST="yes" get_files $SOURCES $PATCHES
-			update_md5 $SOURCES
+			return 1
 		fi
 	fi
+	return 0
+}
+
+build_package() {
+	update_shell_title "build_package"
+	if [ -n "$DEBUG" ]; then
+		set -x
+		set -v
+	fi
+
 	cd "$PACKAGE_DIR"
 
 	case "$COMMAND" in
@@ -1496,10 +1499,12 @@
 	fi
 	if [ "$RETVAL" -ne "0" ]; then
 		if [ -n "$TRY_UPGRADE" ]; then
-			echo "\n!!! Package with new version cannot be built automagically\n"
+			echo "\nUpgrade package to new version failed."
 			if [ "$REVERT_BROKEN_UPGRADE" = "yes" ]; then
+				echo "Restoring old spec file."
 				mv -f $SPECFILE.bak $SPECFILE
 			fi
+			echo ""
 		fi
 		Exit_error err_build_fail
 	fi
@@ -2438,8 +2443,17 @@
 			if [ -n "$NOSOURCE0" ] ; then
 				SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
 			fi
-			get_files $SOURCES $PATCHES
-			check_md5 $SOURCES
+			try_upgrade
+			case $? in
+				0)
+					get_files $SOURCES $PATCHES
+					check_md5 $SOURCES
+					;;
+				*)
+					NODIST="yes" get_files $SOURCES $PATCHES
+					update_md5 $SOURCES
+					;;
+			esac
 			build_package
 			if [ "$UPDATE_POLDEK_INDEXES" = "yes" -a "$COMMAND" != "build-prep" ]; then
 				run_poldek --sdir="${POLDEK_INDEX_DIR}" --mkidxz

================================================================
Index: packages/rpm-build-tools/rpm-build-tools.spec
diff -u packages/rpm-build-tools/rpm-build-tools.spec:1.30 packages/rpm-build-tools/rpm-build-tools.spec:1.31
--- packages/rpm-build-tools/rpm-build-tools.spec:1.30	Fri Jun 25 18:51:47 2010
+++ packages/rpm-build-tools/rpm-build-tools.spec	Fri Jun 25 18:56:55 2010
@@ -13,7 +13,7 @@
 Group:		Applications/File
 Group:		Base
 Source0:	http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/~checkout~/packages/builder?rev=%{builder_ver}#/builder.sh
-# Source0-md5:	3e9000561e11bd2385ac14880e45db12
+# Source0-md5:	bc6163cd6dd40cc394c57e3805629fba
 Source1:	adapter.awk
 Source2:	adapter.sh
 Source3:	pldnotify.awk
@@ -90,6 +90,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.31  2010/06/25 16:56:55  sparky
+- correct md5
+
 Revision 1.30  2010/06/25 16:51:47  sparky
 - df test - grab builder.sh from cvs web
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/rpm-build-tools/builder.sh?r1=1.31&r2=1.32&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/rpm-build-tools/rpm-build-tools.spec?r1=1.30&r2=1.31&f=u



More information about the pld-cvs-commit mailing list