diff options
author | Mattia Rizzolo <mattia@mapreri.org> | 2015-01-13 22:34:37 +0100 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-01-13 23:40:54 +0100 |
commit | 0a3a4845cae3f44585f3183d890a4c85161fe825 (patch) | |
tree | f90ce6e16e30d672abe0412a0c9a77f7a567f1de /bin/reproducible_common.sh | |
parent | 4fb126ebf3f176301df2fc6d0ce01367ab20c498 (diff) | |
download | jenkins.debian.net-0a3a4845cae3f44585f3183d890a4c85161fe825.tar.xz |
reproducible: common.sh: split packages list in chunk of 100 items to avoid "Argument list too long" error
Diffstat (limited to 'bin/reproducible_common.sh')
-rwxr-xr-x | bin/reproducible_common.sh | 22 |
1 files changed, 14 insertions, 8 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" } |