From: martin f. krafft Date: Wed, 12 Nov 2014 21:15:10 +0000 (+0100) Subject: properly rewrite di-update X-Git-Url: https://git.madduck.net/code/vinst.git/commitdiff_plain/01675c106afc9d3c07b770c25464a5f8c31da4c4 properly rewrite di-update --- diff --git a/di-update b/di-update index a004ce7..1caf918 100755 --- a/di-update +++ b/di-update @@ -1,12 +1,32 @@ #!/bin/sh set -eu -MIRROR=ftp://ftp2.de.debian.org/debian -SUITES="wheezy jessie" - -for s in $SUITES; do - mkdir -p installer-amd64/$s - cd installer-amd64/$s - wget -c -np -nH -m --cut-dirs=5 $MIRROR/dists/$s/main/installer-amd64/current/images/netboot - cd - +: ${MIRROR:=ftp://ftp2.de.debian.org} +: ${SUBDIR:=debian/dists/%SUITE%/main/installer-%ARCH%/current/images} + +: ${ARCHS:=amd64} +: ${SUITES:=wheezy jessie} + +: ${MIRROR_jessie:=http://d-i.debian.org} +: ${SUBDIR_jessie:=daily-images/%ARCH%/daily/} + +for a in $ARCHS; do + + for s in $SUITES; do + + eval m=\${MIRROR_$s:-$MIRROR} + eval p=\${SUBDIR_$s:-$SUBDIR} + p=$(echo $p | sed -e "s,%ARCH%,$a,;s,%SUITE%,$s,;s,/$,,") + + # count number of path components + n=1; t=$p; while [ "${t%/*}" != "$t" ]; do t=${t%/*}; n=$((n+1)); done + + wget -c -np -nH -m --cut-dirs=$n \ + --directory-prefix=installer-$a/$s/current/images \ + -X $p/cdrom,$p/hd-media \ + -R index.html\* \ + $m/$p/ + + done + done