summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-01-13 22:34:37 +0100
committerHolger Levsen <holger@layer-acht.org>2015-01-13 23:40:54 +0100
commit0a3a4845cae3f44585f3183d890a4c85161fe825 (patch)
treef90ce6e16e30d672abe0412a0c9a77f7a567f1de
parent4fb126ebf3f176301df2fc6d0ce01367ab20c498 (diff)
downloadjenkins.debian.net-0a3a4845cae3f44585f3183d890a4c85161fe825.tar.xz
reproducible: common.sh: split packages list in chunk of 100 items to avoid "Argument list too long" error
-rwxr-xr-xbin/reproducible_common.sh22
-rwxr-xr-xbin/reproducible_html_packages.py5
2 files changed, 17 insertions, 10 deletions
diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh
index 7497fe8b..6a8b7896 100755
--- a/bin/reproducible_common.sh
+++ b/bin/reproducible_common.sh
@@ -328,16 +328,22 @@ link_packages() {
}
process_packages() {
- string='['
- delimiter=''
- for PKG in $@ ; do
- string+="${delimiter}\"${PKG}\""
- delimiter=','
- done
- string+=']'
CWD=$(pwd)
cd /srv/jenkins/bin
- python3 -c "from reproducible_html_packages import process_packages; process_packages(${string})"
+ for (( i=1; i<$#+1; i=i+100 )) ; do
+ string='['
+ delimiter=''
+ for (( j=0; j<100; j++)) ; do
+ item=$(( $j+$i ))
+ if (( $item < $#+1 )) ; then
+ string+="${delimiter}\"${!item}\""
+ delimiter=','
+ fi
+ done
+ string+=']'
+ python3 -c "from reproducible_html_packages import process_packages; process_packages(${string}, no_clean=True)"
+ done
+ python3 -c "from reproducible_html_packages import purge_old_pages; purge_old_pages()"
cd "$CWD"
}
diff --git a/bin/reproducible_html_packages.py b/bin/reproducible_html_packages.py
index 64316127..944e4afc 100755
--- a/bin/reproducible_html_packages.py
+++ b/bin/reproducible_html_packages.py
@@ -112,7 +112,7 @@ def gen_extra_links(package, version):
return (links, default_view)
-def process_packages(packages):
+def process_packages(packages, no_clean=False):
"""
generate the /rb-pkg/package.html page
packages should be a list
@@ -141,7 +141,8 @@ def process_packages(packages):
write_html_page(title=title, body=html, destfile=destfile,
noheader=True, nofooter=True, noendpage=True)
log.info("Package page generated at " + desturl)
- purge_old_pages() # housekeep is always good
+ if not no_clean:
+ purge_old_pages() # housekeep is always good
def purge_old_pages():