[packages/bash-completion] builder-completion: parse bconds directly from .spec without builders "help"

glen glen at pld-linux.org
Sun Aug 12 20:24:05 CEST 2012


commit ce4b36ee62c08f09100f830c62834accd3ef0fc7
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sun Aug 12 21:24:02 2012 +0300

    builder-completion: parse bconds directly from .spec without builders "help"

 builder.bash-completion | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/builder.bash-completion b/builder.bash-completion
index d03896b..0b081c8 100644
--- a/builder.bash-completion
+++ b/builder.bash-completion
@@ -27,9 +27,16 @@ _builder()
 		return 0
 		;;
 	--with|--without)
-		local spec
+		local spec bconds
 		_builder_get_spec
-		$1 -nn -ncs --show-avail-bconds $spec
+		bconds=$(
+			awk '
+			/^%changelog/ { exit }
+			/^%bcond_with/{
+				print $2
+			}' $spec
+		)
+		COMPREPLY=( $( compgen -W "$bconds" -- "$cur" ) )
 		return 0
 		;;
 	esac


More information about the pld-cvs-commit mailing list