SPECS: builder - work better if package BR has perl(Package::Name)...

glen glen at pld-linux.org
Tue Jan 15 20:31:38 CET 2008


Author: glen                         Date: Tue Jan 15 19:31:38 2008 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- work better if package BR has perl(Package::Name) and -R is wanted

---- Files affected:
SPECS:
   builder (1.530 -> 1.531) 

---- Diffs:

================================================================
Index: SPECS/builder
diff -u SPECS/builder:1.530 SPECS/builder:1.531
--- SPECS/builder:1.530	Tue Jan 15 01:51:51 2008
+++ SPECS/builder	Tue Jan 15 20:31:33 2008
@@ -354,6 +354,16 @@
 "
 }
 
+# change dependency to specname
+# common changes:
+# - perl(Package::Name) -> perl-Package-Name
+depspecname() {
+	local package="$1"
+
+	package=$(echo "$package" | sed -e '/perl(.*)/{s,perl(\(.*\)),perl-\1,;s,::,-,g}')
+	echo "$package"
+}
+
 update_shell_title() {
 	[ -t 1 ] || return
 	local len=${COLUMNS:-80}
@@ -1709,13 +1719,12 @@
 					echo "Trying to install dependencies ($DEPS):"
 					local log=.${SPECFILE}_poldek.log
 					$SU_SUDO /usr/bin/poldek --caplookup -uGq $DEPS | tee $log
-					failed=$(awk -F: '/^error:/{print $2}' $log)
+					failed=$(awk '/^error:/{a=$2; sub(/^error: /, "", a); sub(/:$/, "", a); print a}' $log)
 					rm -f $log
 					local ok
 					if [ -n "$failed" ]; then
 						for package in $failed; do
-							# FIXME: sanitise, deps could be not .spec files
-							spawn_sub_builder -bb $package && ok="$ok $package"
+							spawn_sub_builder -bb $(depspecname $package) && ok="$ok $package"
 						done
 						DEPS="$ok"
 					else
================================================================

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



More information about the pld-cvs-commit mailing list