diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2012-11-14 02:29:31 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2012-11-14 02:29:31 +0100 |
commit | 15f1f07a7f45a811382f44a083d5ecd471010b25 (patch) | |
tree | 6950839222929fb88d93859b0e574968123b9ec3 | |
parent | fcf93c95ac059ee50698ec9507f34fea01b0b5f4 (diff) | |
download | bcfg2-tools-15f1f07a7f45a811382f44a083d5ecd471010b25.tar.gz bcfg2-tools-15f1f07a7f45a811382f44a083d5ecd471010b25.tar.bz2 bcfg2-tools-15f1f07a7f45a811382f44a083d5ecd471010b25.zip |
buildfile: add simple wrapper script for bcfg2-info buildfile
buildfile uses the non-real repo to build a file for a host and hides
most unnecessary output. It could be used for a preflight check of
a custom genshi template.
-rwxr-xr-x | buildfile | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/buildfile b/buildfile new file mode 100755 index 0000000..963d706 --- /dev/null +++ b/buildfile @@ -0,0 +1,20 @@ +#!/bin/sh + +. settings.sh +$(dirname $0)/prepare-repository + +verbose=0 +if [ "$1" = "-v" ]; then + verbose=1 + shift +fi + +bcfg2-info -Q "$REPO" buildfile "$@" | \ + if [ "$verbose" = "1" ]; then + awk '/<Path/,/<\/Path>/{print}' + else + # only output lines between <Path></Path> (excluding </Path>) + awk '/<\/Path>/{p=0} /<Path/{p=1} p' | \ + # remove opening path tag + sed '1s/<Path\( [^=>]*="[^"]*"\)*>//' + fi |