summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-03-16 13:40:05 +0100
committerHolger Levsen <holger@layer-acht.org>2015-03-16 13:40:05 +0100
commite84bd4035f694c5e0a49e00e4e9381743424963b (patch)
tree4ef12d3f88859b17e2d302b58aeec51311735cfa /bin
parent4a5cb458425536110618df97805ae12ae6d873e7 (diff)
downloadjenkins.debian.net-e84bd4035f694c5e0a49e00e4e9381743424963b.tar.xz
reproducible: move check_candidates() and schedule_packages() to common_functions.sh
Diffstat (limited to 'bin')
-rwxr-xr-xbin/reproducible_common.sh36
-rwxr-xr-xbin/reproducible_schedule_on_demand.sh36
2 files changed, 36 insertions, 36 deletions
diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh
index b55dbdb4..3df77370 100755
--- a/bin/reproducible_common.sh
+++ b/bin/reproducible_common.sh
@@ -73,6 +73,42 @@ META_PKGSET[11]="grml"
META_PKGSET[12]="grml_build-depends"
META_PKGSET[13]="maint_pkg-perl-maintainers"
+schedule_packages() {
+ # these packages are manually scheduled, so should have high priority,
+ # so schedule them in the past, so they are picked earlier :)
+ DATE="2014-10-01 00:23"
+ TMPFILE=$(mktemp)
+ for PKG_ID in $@ ; do
+ echo "REPLACE INTO schedule (package_id, date_scheduled, date_build_started) VALUES ('$PKG_ID', '$DATE', '');" >> $TMPFILE
+ done
+ cat $TMPFILE | sqlite3 -init $INIT ${PACKAGES_DB}
+ rm $TMPFILE
+ cd /srv/jenkins/bin
+ python3 -c "from reproducible_html_indexes import build_page; build_page('scheduled')"
+}
+
+check_candidates() {
+ PACKAGES=""
+ PACKAGES_NAMES=""
+ TOTAL=0
+ for PKG in $CANDIDATES ; do
+ RESULT=$(sqlite3 -init $INIT ${PACKAGES_DB} "SELECT id, name from sources WHERE name='$PKG' AND suite='$SUITE';")
+ if [ ! -z "$RESULT" ] ; then
+ PACKAGES="$PACKAGES $(echo $RESULT|cut -d '|' -f 1)"
+ PACKAGES_NAMES="$PACKAGES_NAMES $(echo $RESULT|cut -d '|' -f 2)"
+ let "TOTAL+=1"
+ fi
+ done
+ case $TOTAL in
+ 1)
+ PACKAGES_TXT="package"
+ ;;
+ *)
+ PACKAGES_TXT="packages"
+ ;;
+ esac
+}
+
write_page() {
echo "$1" >> $PAGE
}
diff --git a/bin/reproducible_schedule_on_demand.sh b/bin/reproducible_schedule_on_demand.sh
index 3ffdde57..0866ea0b 100755
--- a/bin/reproducible_schedule_on_demand.sh
+++ b/bin/reproducible_schedule_on_demand.sh
@@ -11,42 +11,6 @@ common_init "$@"
# common code defining db access
. /srv/jenkins/bin/reproducible_common.sh
-schedule_packages() {
- # these packages are manually scheduled, so should have high priority,
- # so schedule them in the past, so they are picked earlier :)
- DATE="2014-10-01 00:23"
- TMPFILE=$(mktemp)
- for PKG_ID in $@ ; do
- echo "REPLACE INTO schedule (package_id, date_scheduled, date_build_started) VALUES ('$PKG_ID', '$DATE', '');" >> $TMPFILE
- done
- cat $TMPFILE | sqlite3 -init $INIT ${PACKAGES_DB}
- rm $TMPFILE
- cd /srv/jenkins/bin
- python3 -c "from reproducible_html_indexes import build_page; build_page('scheduled')"
-}
-
-check_candidates() {
- PACKAGES=""
- PACKAGES_NAMES=""
- TOTAL=0
- for PKG in $CANDIDATES ; do
- RESULT=$(sqlite3 -init $INIT ${PACKAGES_DB} "SELECT id, name from sources WHERE name='$PKG' AND suite='$SUITE';")
- if [ ! -z "$RESULT" ] ; then
- PACKAGES="$PACKAGES $(echo $RESULT|cut -d '|' -f 1)"
- PACKAGES_NAMES="$PACKAGES_NAMES $(echo $RESULT|cut -d '|' -f 2)"
- let "TOTAL+=1"
- fi
- done
- case $TOTAL in
- 1)
- PACKAGES_TXT="package"
- ;;
- *)
- PACKAGES_TXT="packages"
- ;;
- esac
-}
-
#
# main
#