SPECS: builder - pass --target to --showrc to give proper macros (...

glen glen at pld-linux.org
Tue Apr 15 02:17:38 CEST 2008


Author: glen                         Date: Tue Apr 15 00:17:38 2008 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- pass --target to --showrc to give proper macros (fixes kernel-desktop noarch build for laptop)
- use secure mktemp by default for tmpfiles

---- Files affected:
SPECS:
   builder (1.551 -> 1.552) 

---- Diffs:

================================================================
Index: SPECS/builder
diff -u SPECS/builder:1.551 SPECS/builder:1.552
--- SPECS/builder:1.551	Sat Apr 12 19:17:39 2008
+++ SPECS/builder	Tue Apr 15 02:17:33 2008
@@ -204,7 +204,7 @@
 
 run_poldek()
 {
-	RES_FILE=~/tmp/poldek-exit-status.$RANDOM
+	RES_FILE=$(mktemp -t builder.XXXXXX || ${TMPDIR:-/tmp}/builder.$RANDOM)
 	if [ -n "$LOGFILE" ]; then
 		LOG=`eval echo $LOGFILE`
 		if [ -n "$LASTLOG_FILE" ]; then
@@ -423,7 +423,7 @@
 	# we reset macros not to contain macros.build as all the %() macros are
 	# executed here, while none of them are actually needed.
 	# at the time of this writing macros.build + macros contained 70 "%(...)" macros.
-	safe_macrofiles=$(rpm --showrc | awk -F: '/^macrofiles/ { gsub(/^macrofiles[ \t]+:/, "", $0); gsub(/:.*macros.build:/, ":", $0); print $0 } ')
+	safe_macrofiles=$(rpm $TARGET_SWITCH --showrc | awk -F: '/^macrofiles/ { gsub(/^macrofiles[ \t]+:/, "", $0); gsub(/:.*macros.build:/, ":", $0); print $0 } ')
 
 	# TODO: move these to /usr/lib/rpm/macros
 	cat > $BUILDER_MACROS <<'EOF'
@@ -484,10 +484,11 @@
 		set -v
 	fi
 
-	update_shell_title "cache_rpm_dump"
 	if [ -x /usr/bin/rpm-specdump ]; then
-		rpm_dump_cache=`rpm-specdump $BCOND $TARGET_SWITCH $SPECFILE`
+		update_shell_title "cache_rpm_dump using rpm-specdump command"
+		rpm_dump_cache=$(rpm-specdump $BCOND $TARGET_SWITCH $SPECFILE)
 	else
+		update_shell_title "cache_rpm_dump using rpmbuild command"
 		local rpm_dump
 		rpm_dump=`
 			# what we need from dump is NAME, VERSION, RELEASE and PATCHES/SOURCES.
@@ -1393,7 +1394,8 @@
 		if [ -n "$LASTLOG_FILE" ]; then
 			echo "LASTLOG=$LOG" > $LASTLOG_FILE
 		fi
-		RES_FILE=~/tmp/$RPMBUILD-exit-status.$RANDOM
+		RES_FILE=$(mktemp -t builder.XXXXXX || ${TMPDIR:-/tmp}/builder.$RANDOM)
+
 		(time eval ${NICE_COMMAND} $RPMBUILD $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $RPMBUILDOPTS $BCOND $TARGET_SWITCH $SPECFILE; echo $? > $RES_FILE) 2>&1 |tee $LOG
 		RETVAL=`cat $RES_FILE`
 		rm $RES_FILE
================================================================

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



More information about the pld-cvs-commit mailing list