diff options
author | Holger Levsen <holger@layer-acht.org> | 2012-12-07 13:27:42 +0100 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2012-12-07 13:27:42 +0100 |
commit | b9b88f8fe3903f2f2327fa00ea6a67414da5e2b2 (patch) | |
tree | 78973965cba174aad5233fcd8dde065c130f994a | |
parent | f8da4dfe10a8f67b3ae971272b7099821044e3a5 (diff) | |
download | jenkins.debian.net-b9b88f8fe3903f2f2327fa00ea6a67414da5e2b2.tar.xz |
let xargs run only when matches were found
-rwxr-xr-x | update_jdn.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/update_jdn.sh b/update_jdn.sh index e910f5b1..8eddb24e 100755 --- a/update_jdn.sh +++ b/update_jdn.sh @@ -83,10 +83,10 @@ explain "Jenkins jobs updated." # crappy tests for checking that jenkins-job-builder works correctly # #wc -m counts one byte too many, so we substract one -let DEFINED_MY_TRIGGERS=$(grep my_trigger: *.yaml|wc -l)+$(grep my_trigger: *.yaml|grep , |xargs echo | sed 's/[^,]//g'| wc -m)-1 +let DEFINED_MY_TRIGGERS=$(grep my_trigger: *.yaml|wc -l)+$(grep my_trigger: *.yaml|grep , |xargs -r echo | sed 's/[^,]//g'| wc -m)-1 DEFINED_DI_TRIGGERS=$(grep "defaults: d-i-manual-html" d-i.yaml|wc -l) let DEFINED_TRIGGERS=DEFINED_MY_TRIGGERS+DEFINED_DI_TRIGGERS -let CONFIGURED_TRIGGERS=$(grep \<childProjects /var/lib/jenkins/jobs/*/config.xml|wc -l)+$(grep \<childProjects /var/lib/jenkins/jobs/*/config.xml |grep , |xargs echo | sed 's/[^,]//g'| wc -m)-1 +let CONFIGURED_TRIGGERS=$(grep \<childProjects /var/lib/jenkins/jobs/*/config.xml|wc -l)+$(grep \<childProjects /var/lib/jenkins/jobs/*/config.xml |grep , |xargs -r echo | sed 's/[^,]//g'| wc -m)-1 if [ "$DEFINED_TRIGGERS" != "$CONFIGURED_TRIGGERS" ] ; then figlet Warning explain "Number of defined triggers ($DEFINED_TRIGGERS) differs from currently configured triggers ($CONFIGURED_TRIGGERS), please investigate." |