summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2012-12-03 12:50:55 +0100
committerHolger Levsen <holger@layer-acht.org>2012-12-03 12:50:55 +0100
commit2094fd7cc5050b9cc0343694c746503499f49d54 (patch)
tree2937402a278dc2880eeb593056e390e10b2c4e15
parent36ed0943166ac4e1ee1cc34c56097f322bcbda21 (diff)
downloadjenkins.debian.net-2094fd7cc5050b9cc0343694c746503499f49d54.tar.xz
count correctly
-rwxr-xr-xupdate_jdn.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/update_jdn.sh b/update_jdn.sh
index 2a310fd8..41fd8426 100755
--- a/update_jdn.sh
+++ b/update_jdn.sh
@@ -82,10 +82,11 @@ explain "Jenkins jobs updated."
#
# crappy tests for checking that jenkins-job-builder works correctly
#
-DEFINED_CHROOT_TRIGGERS=$(grep _trigger: chroot-tests.yaml|wc -l)
+#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
DEFINED_DI_TRIGGERS=$(grep "defaults: d-i-manual-html" d-i.yaml|wc -l)
-let DEFINED_TRIGGERS=DEFINED_CHROOT_TRIGGERS+DEFINED_DI_TRIGGERS+1 # add 1 as "wc -m" also counts one extra...
-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)
+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
if [ "$DEFINED_TRIGGERS" != "$CONFIGURED_TRIGGERS" ] ; then
figlet Warning
explain "Number of defined triggers ($DEFINED_TRIGGERS) differs from currently configured triggers ($CONFIGURED_TRIGGERS), please investigate."