From 24a97174475bdf521de06f7d97efe8da519cb03e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Fri, 19 Feb 2010 12:14:27 +0000 Subject: [PATCH] - add --show-avail-bconds Changed files: builder.sh -> 1.609 --- builder.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/builder.sh b/builder.sh index 66020e2..026a39e 100644 --- a/builder.sh +++ b/builder.sh @@ -361,6 +361,7 @@ Usage: builder [-D|--debug] [-V|--version] [--short-version] [-a|--as_anon] [-b| --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 - conditional build package depending on %_with_/ %_without_ macro switch. You may now use @@ -2225,6 +2226,10 @@ while [ $# -gt 0 ]; do COMMAND="show_bcond_args" shift ;; + --show-avail-bconds) + COMMAND="show_avail_bconds" + shift + ;; --nodeps) shift RPMOPTS="${RPMOPTS} --nodeps" @@ -2303,6 +2308,33 @@ case "$COMMAND" in 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 -- 2.44.0