packages: builder - add --show-avail-bconds

glen glen at pld-linux.org
Fri Feb 19 13:14:32 CET 2010


Author: glen                         Date: Fri Feb 19 12:14:32 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- add --show-avail-bconds

---- Files affected:
packages:
   builder (1.608 -> 1.609) 

---- Diffs:

================================================================
Index: packages/builder
diff -u packages/builder:1.608 packages/builder:1.609
--- packages/builder:1.608	Fri Feb 19 11:41:20 2010
+++ packages/builder	Fri Feb 19 13:14:27 2010
@@ -361,6 +361,7 @@
 --show-bcond-args   - show active bconds, from ~/.bcondrc. this is used by
                       ./repackage.sh script. in other words, the output is
                       parseable by scripts.
+--show-avail-bconds - show available bconds
 --with/--without <feature>
                     - conditional build package depending on %_with_<feature>/
                       %_without_<feature> macro switch.  You may now use
@@ -2225,6 +2226,10 @@
 			COMMAND="show_bcond_args"
 			shift
 			;;
+		--show-avail-bconds)
+			COMMAND="show_avail_bconds"
+			shift
+			;;
 		--nodeps)
 			shift
 			RPMOPTS="${RPMOPTS} --nodeps"
@@ -2303,6 +2308,33 @@
 			set_bconds_values
 			echo "$BCOND"
 		fi
+		;;
+	"show_avail_bconds")
+		init_builder
+		if [ -n "$SPECFILE" ]; then
+			get_spec > /dev/null
+			parse_spec
+			local bcond_avail=$(find_spec_bcond $SPECFILE)
+			local opt bcond bconds
+			for opt in $bcond_avail; do
+				case "$opt" in
+				without_*)
+					bcond=${opt#without_}
+					bconds="$bconds $bcond"
+					;;
+				with_*)
+					bcond=${opt#with_}
+					bconds="$bconds $bcond"
+					;;
+				*)
+					echo >&2 "ERROR: unexpected '$opt' in show_avail_bconds"
+					exit 1
+					;;
+				esac
+			done
+			echo $bconds
+		fi
+
 		;;
 	"build" | "build-binary" | "build-source" | "build-prep" | "build-build" | "build-install" | "build-list")
 		init_builder
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/builder?r1=1.608&r2=1.609&f=u



More information about the pld-cvs-commit mailing list