SPECS: builder - reading rcfile from '-' doesn't always work, go f...

glen glen at pld-linux.org
Tue Jan 17 23:02:14 CET 2006


Author: glen                         Date: Tue Jan 17 22:02:13 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- reading rcfile from '-' doesn't always work, go figure

---- Files affected:
SPECS:
   builder (1.384 -> 1.385) 

---- Diffs:

================================================================
Index: SPECS/builder
diff -u SPECS/builder:1.384 SPECS/builder:1.385
--- SPECS/builder:1.384	Tue Jan 17 21:39:29 2006
+++ SPECS/builder	Tue Jan 17 23:02:08 2006
@@ -339,17 +339,21 @@
 	# what we need from dump is NAME, VERSION, RELEASE and PATCHES/SOURCES.
 	# macros.build + macros contained at the time of this writing 70 %() macros
 	local macrofiles='/usr/lib/rpm/macros:~/etc/.rpmmacros:~/.rpmmacros'
-	local dump='prep %{echo:z: PACKAGE_NAME %{name} }%dump'
+	local dump='%{echo:z: PACKAGE_NAME %{name} }%dump'
+	# FIXME: better ideas than .rpmrc?
+	printf 'include:/usr/lib/rpm/rpmrc\nmacrofiles:%s\n' $macrofiles > .rpmrc
 	case "$RPMBUILD" in
 		rpm )
-			echo -e "include:/usr/lib/rpm/rpmrc\nmacrofiles:$macrofiles" | \
-			rpm --rcfile - -bp --nodeps --define "prep $dump" $BCOND $TARGET_SWITCH $SPECFILE 2>&1
+			rpm --rcfile .rpmrc -bp --nodeps --define "prep $dump" $BCOND $TARGET_SWITCH $SPECFILE 2>&1
 			;;
 		rpmbuild )
-			echo -e "include:/usr/lib/rpm/rpmrc\nmacrofiles:$macrofiles" | \
-			rpmbuild --rcfile - --nodigest --nosignature --define "prep $dump" $BCOND $TARGET_SWITCH $SPECFILE 2>&1
+			rpmbuild --rcfile .rpmrc --nodigest --nosignature --nobuild --define "prep $dump" $BCOND $TARGET_SWITCH $SPECFILE 2>&1
 			;;
 	esac`
+#	if [ $? -gt 0 ]; then
+#		echo "$rpm_dump_cache" | sed -ne '/^error:/,$p'  >&2
+#		Exit_error err_build_fail;
+#	fi
 	update_shell_title "cache_rpm_dump: OK!"
 }
 
@@ -374,6 +378,7 @@
 	if [ "$NOSRCS" != "yes" ]; then
 		SOURCES="`rpm_dump | awk '/SOURCEURL[0-9]+/ {print $3}'`"
 	fi
+
 	if (rpm_dump | grep -qEi ":.*nosource.*1"); then
 		FAIL_IF_NO_SOURCES="no"
 	fi
@@ -644,7 +649,7 @@
 
 get_files()
 {
-	update_shell_title "fetching sources"
+	update_shell_title "get_files"
 
 	if [ -n "$DEBUG" ]; then
 		set -x;
================================================================

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



More information about the pld-cvs-commit mailing list