summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-05-13 19:41:29 +0200
committerHolger Levsen <holger@layer-acht.org>2015-08-15 12:48:52 +0200
commit955e4ceb12b155d3dc840f25197a11b663d09ecc (patch)
tree57f885c8469ede350f678dd6d72983278fa9a115 /bin
parent26b1d8a3cf6655232d03bf4c9688ea1b6009a717 (diff)
downloadjenkins.debian.net-955e4ceb12b155d3dc840f25197a11b663d09ecc.tar.xz
reproducible: fix all users of gen_packages_html() after the refactoring of it
notable changes: * gen_packages_html() in common.sh got renamed to the singular version gen_package_html() and now accept only one argument (a package name) + thus reproducible_blacklist.sh got fixed to pass one package at time + this greatly semplify the code, by removing *a lot* of crappy code * _html_all_packages.py really becomed a 2-liner, with part of its login being now either in _html_packages.py or removed.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/reproducible_blacklist.sh6
-rwxr-xr-xbin/reproducible_build.sh2
-rwxr-xr-xbin/reproducible_common.sh25
-rwxr-xr-xbin/reproducible_html_all_packages.py8
-rwxr-xr-xbin/reproducible_html_notes.py4
-rwxr-xr-xbin/reproducible_html_packages.py12
-rwxr-xr-xbin/reproducible_scheduler.py2
7 files changed, 22 insertions, 37 deletions
diff --git a/bin/reproducible_blacklist.sh b/bin/reproducible_blacklist.sh
index f541deee..cbe153dc 100755
--- a/bin/reproducible_blacklist.sh
+++ b/bin/reproducible_blacklist.sh
@@ -81,9 +81,11 @@ else
revert_blacklisted_packages
fi
-# notify
-gen_packages_html $SUITE $PACKAGES
+for PACKAGE in "$PACKAGES" ; do
+ gen_package_html $PACKAGE
+done
echo
+# notify
echo "$MESSAGE"
kgb-client --conf /srv/jenkins/kgb/debian-reproducible.conf --relay-msg "$MESSAGE"
echo
diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh
index 09b493d8..7cd501e4 100755
--- a/bin/reproducible_build.sh
+++ b/bin/reproducible_build.sh
@@ -138,7 +138,7 @@ update_db_and_html() {
fi
# unmark build since it's properly finished
sqlite3 -init $INIT ${PACKAGES_DB} "DELETE FROM schedule WHERE package_id='$SRCPKGID';"
- gen_packages_html $SUITE $SRCPACKAGE
+ gen_package_html $SRCPACKAGE
echo
echo "Successfully updated the database and updated $REPRODUCIBLE_URL/rb-pkg/${SUITE}/${ARCH}/$SRCPACKAGE.html"
echo
diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh
index 64854c4f..1ce6f630 100755
--- a/bin/reproducible_common.sh
+++ b/bin/reproducible_common.sh
@@ -346,27 +346,12 @@ link_packages() {
if "$DEBUG" ; then set -x ; fi
}
-gen_packages_html() {
- local suite="$1"
- shift
- CWD=$(pwd)
+gen_package_html() {
cd /srv/jenkins/bin
- local i
- for (( i=1; i<$#+1; i=i+100 )) ; do
- local string='['
- local delimiter=''
- local j
- for (( j=0; j<100; j++)) ; do
- local item=$(( $j+$i ))
- if (( $item < $#+1 )) ; then
- string+="${delimiter}\"${!item}\""
- delimiter=','
- fi
- done
- string+=']'
- python3 -c "from reproducible_html_packages import gen_packages_html; gen_packages_html(${string}, suite=\"${suite}\", no_clean=True)" || echo "Warning: cannot update html pages for ${string} in ${suite}"
- done
- cd "$CWD"
+ python3 -c "import reproducible_html_packages as rep
+pkg = rep.Package('$1', no_notes=True)
+rep.gen_packages_html([pkg], no_clean=True)" || echo "Warning: cannot update html pages for $1"
+ cd - > /dev/null
}
calculate_build_duration() {
diff --git a/bin/reproducible_html_all_packages.py b/bin/reproducible_html_all_packages.py
index 3d347053..e339adf0 100755
--- a/bin/reproducible_html_all_packages.py
+++ b/bin/reproducible_html_all_packages.py
@@ -11,11 +11,7 @@
# code already written in reproducible_html_packages
-from reproducible_common import *
-from reproducible_html_packages import gen_all_rb_pkg_pages, purge_old_pages
+from reproducible_html_packages import gen_all_rb_pkg_pages
-for suite in SUITES:
- for arch in ARCHS:
- gen_all_rb_pkg_pages(suite=suite, arch=arch, no_clean=True)
-purge_old_pages()
+gen_all_rb_pkg_pages(no_clean=True)
diff --git a/bin/reproducible_html_notes.py b/bin/reproducible_html_notes.py
index b9c9bcea..8249ed87 100755
--- a/bin/reproducible_html_notes.py
+++ b/bin/reproducible_html_notes.py
@@ -322,7 +322,7 @@ def purge_old_notes(notes):
except IndexError: # the package is not tested. this can happen if
pass # a package got removed from the archive
if to_rebuild:
- gen_packages_html(to_rebuild, no_clean=True)
+ gen_packages_html([Package(x) for x in to_rebuild])
def purge_old_issues(issues):
@@ -431,7 +431,7 @@ if __name__ == '__main__':
index_issues(issues)
purge_old_notes(notes)
purge_old_issues(issues)
- gen_packages_html(notes) # regenerate all rb-pkg/ pages
+ gen_packages_html([Package(x) for x in notes])
for suite in SUITES:
for arch in ARCHS:
build_page('notes', suite, arch)
diff --git a/bin/reproducible_html_packages.py b/bin/reproducible_html_packages.py
index ffc6aece..42fcf77e 100755
--- a/bin/reproducible_html_packages.py
+++ b/bin/reproducible_html_packages.py
@@ -232,12 +232,14 @@ def gen_packages_html(packages, no_clean=False):
purge_old_pages() # housekeep is always good
-def gen_all_rb_pkg_pages(suite='unstable', arch='amd64', no_clean=False):
- query = 'SELECT name FROM sources WHERE suite="%s" AND architecture="%s"' % (suite, arch)
+def gen_all_rb_pkg_pages(no_clean=False):
+ query = 'SELECT DISTINCT name FROM sources'
rows = query_db(query)
- pkgs = [str(i[0]) for i in rows]
- log.info('Processing all ' + str(len(pkgs)) + ' package pages for ' + suite + '/' + arch +'.')
- gen_packages_html(pkgs, suite=suite, arch=arch, no_clean=no_clean)
+ pkgs = [Package(str(i[0]), no_notes=True) for i in rows]
+ log.info('Processing all ' + str(len(pkgs)) + ' package from all suites/architectures')
+ gen_packages_html(pkgs, no_clean=True) # we clean at the end
+ purge_old_pages()
+
def purge_old_pages():
for suite in SUITES:
diff --git a/bin/reproducible_scheduler.py b/bin/reproducible_scheduler.py
index 4af23092..9a317eaa 100755
--- a/bin/reproducible_scheduler.py
+++ b/bin/reproducible_scheduler.py
@@ -149,7 +149,7 @@ def update_sources_db(suite, arch, sources):
sys.exit(1)
if pkgs_to_add:
log.info('Building pages for the new packages')
- gen_packages_html(pkgs_to_add, no_clean=True)
+ gen_packages_html([Package(x) for x in pkgs_to_add], no_clean=True)
def print_schedule_result(suite, criteria, packages):