SPECS: builder - switch to rpm-specdump if available

glen glen at pld-linux.org
Wed Jan 23 18:30:40 CET 2008


Author: glen                         Date: Wed Jan 23 17:30:40 2008 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- switch to rpm-specdump if available

---- Files affected:
SPECS:
   builder (1.532 -> 1.533) 

---- Diffs:

================================================================
Index: SPECS/builder
diff -u SPECS/builder:1.532 SPECS/builder:1.533
--- SPECS/builder:1.532	Sat Jan 19 14:49:43 2008
+++ SPECS/builder	Wed Jan 23 18:30:34 2008
@@ -478,33 +478,37 @@
 	fi
 
 	update_shell_title "cache_rpm_dump"
-	local rpm_dump
-	rpm_dump=`
-		# what we need from dump is NAME, VERSION, RELEASE and PATCHES/SOURCES.
-		dump='%{echo:dummy: PACKAGE_NAME %{name} }%dump'
-		case "$RPMBUILD" in
-		rpm)
-			ARGS='-bp'
-			;;
-		rpmbuild)
-			ARGS='--nodigest --nosignature --nobuild'
-			;;
-		esac
-		minirpm $ARGS --define "'prep $dump'" --nodeps $SPECFILE
-	`
-	if [ $? -gt 0 ]; then
-		error=$(echo "$rpm_dump" | sed -ne '/^error:/,$p')
-		echo "$error" >&2
-		Exit_error err_build_fail
-	fi
+	if [ -x /usr/bin/rpm-specdump ]; then
+		rpm_dump_cache=`rpm-specdump $BCOND $TARGET_SWITCH $SPECFILE`
+	else
+		local rpm_dump
+		rpm_dump=`
+			# what we need from dump is NAME, VERSION, RELEASE and PATCHES/SOURCES.
+			dump='%{echo:dummy: PACKAGE_NAME %{name} }%dump'
+			case "$RPMBUILD" in
+			rpm)
+				ARGS='-bp'
+				;;
+			rpmbuild)
+				ARGS='--nodigest --nosignature --nobuild'
+				;;
+			esac
+			minirpm $ARGS --define "'prep $dump'" --nodeps $SPECFILE
+		`
+		if [ $? -gt 0 ]; then
+			error=$(echo "$rpm_dump" | sed -ne '/^error:/,$p')
+			echo "$error" >&2
+			Exit_error err_build_fail
+		fi
 
-	# make small dump cache
-	rpm_dump_cache=`echo "$rpm_dump" | awk '
-		$2 ~ /^SOURCEURL/ {print}
-		$2 ~ /^PATCHURL/  {print}
-		$2 ~ /^nosource/ {print}
-		$2 ~ /^PACKAGE_/ {print}
-	'`
+		# make small dump cache
+		rpm_dump_cache=`echo "$rpm_dump" | awk '
+			$2 ~ /^SOURCEURL/ {print}
+			$2 ~ /^PATCHURL/  {print}
+			$2 ~ /^nosource/ {print}
+			$2 ~ /^PACKAGE_/ {print}
+		'`
+	fi
 
 	update_shell_title "cache_rpm_dump: OK!"
 }
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/builder?r1=1.532&r2=1.533&f=u



More information about the pld-cvs-commit mailing list