From cd4d1f86366ee5a65c99d09a47d6c575afcbd1ef Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Wed, 12 Dec 2007 01:07:25 +0100 Subject: [PATCH] cron.d: Allow central override of the wget options Use this to set tries and timeout to something more reasonable. Pressed by the ddtp outage. --- config.sh.sed.in | 2 ++ cron.d/100syncarchive | 18 +++++++++--------- cron.d/100syncarchive_amd64 | 8 ++++---- cron.d/100syncarchive_backports | 10 +++++----- cron.d/100syncarchive_debports | 8 ++++---- cron.d/100syncarchive_installer | 2 +- cron.d/100syncarchive_m68k | 10 +++++----- cron.d/100syncarchive_maintainers | 2 +- cron.d/100syncarchive_volatile | 10 +++++----- cron.d/110debtags | 2 +- cron.d/120synctrans | 2 +- 11 files changed, 38 insertions(+), 36 deletions(-) diff --git a/config.sh.sed.in b/config.sh.sed.in index 9a95654..afc9987 100644 --- a/config.sh.sed.in +++ b/config.sh.sed.in @@ -32,6 +32,8 @@ amd64_ftpsite=http://amd64.debian.net/debian debports_ftpsite=http://ftp.debian-ports.org/debian ddtp_ftpsite=http://ddtp.debian.net/debian +wget_cmd="wget --no-verbose --tries=2 --timeout=60" + root="" # Architectures diff --git a/cron.d/100syncarchive b/cron.d/100syncarchive index 5cb5af4..a6b0e83 100755 --- a/cron.d/100syncarchive +++ b/cron.d/100syncarchive @@ -15,8 +15,8 @@ then echo "retrieve Release(.gpg) $dist" test -d us/${dist} || mkdir -p us/${dist} (cd us/${dist} && - wget -q -N ${ftpsite}/dists/${dist}/Release && - wget -q -N ${ftpsite}/dists/${dist}/Release.gpg ) + $wget_cmd -N ${ftpsite}/dists/${dist}/Release && + $wget_cmd -N ${ftpsite}/dists/${dist}/Release.gpg ) foo=\$arch_${dist//-/_} for arch in `eval echo $foo` @@ -29,20 +29,20 @@ then echo retrieve Packages $dist/$part/$arch test -d us/${dist}/${part}/binary-${arch} || mkdir -p us/${dist}/${part}/binary-${arch} (cd us/${dist}/${part}/binary-${arch} && - wget -q -N ${ftpsite}/dists/${dist}/${part}/binary-${arch}/Packages.gz) + $wget_cmd -N ${ftpsite}/dists/${dist}/${part}/binary-${arch}/Packages.gz) done #FIXME: no Contents files for p-u test ! "$dist" = "experimental" || continue echo retrieve Contents $dist/$arch (cd us/${dist} && - wget -q -N ${ftpsite}/dists/${dist}/Contents-${arch}.gz) + $wget_cmd -N ${ftpsite}/dists/${dist}/Contents-${arch}.gz) done for part in ${parts} do echo retrieve Sources $dist/$part test -d us/${dist}/${part}/source || mkdir -p us/${dist}/${part}/source (cd us/${dist}/${part}/source && - wget -q -N ${ftpsite}/dists/${dist}/${part}/source/Sources.gz) + $wget_cmd -N ${ftpsite}/dists/${dist}/${part}/source/Sources.gz) done done else @@ -90,8 +90,8 @@ do echo "retrieve Release(.gpg) $dist" test -d security/${dist} || mkdir -p security/${dist} (cd security/${dist} && - wget -q -N ${security_ftpsite}/dists/${dist}/updates/Release && - wget -q -N ${security_ftpsite}/dists/${dist}/updates/Release.gpg ) + $wget_cmd -N ${security_ftpsite}/dists/${dist}/updates/Release && + $wget_cmd -N ${security_ftpsite}/dists/${dist}/updates/Release.gpg ) foo=\$arch_${dist//-/_} for arch in `eval echo $foo` @@ -101,7 +101,7 @@ do echo retrieve Packages $dist/$part/security/$arch test -d security/${dist}/${part}/binary-${arch} || mkdir -p security/${dist}/${part}/binary-${arch} (cd security/${dist}/${part}/binary-${arch} && - wget -q -N ${security_ftpsite}/dists/${dist}/updates/${part}/binary-${arch}/Packages.gz) + $wget_cmd -N ${security_ftpsite}/dists/${dist}/updates/${part}/binary-${arch}/Packages.gz) done done for part in ${parts} @@ -109,6 +109,6 @@ do echo retrieve Sources $dist/$part/security test -d security/${dist}/${part}/source || mkdir -p security/${dist}/${part}/source (cd security/${dist}/${part}/source && - wget -q -N ${security_ftpsite}/dists/${dist}/updates/${part}/source/Sources.gz) + $wget_cmd -N ${security_ftpsite}/dists/${dist}/updates/${part}/source/Sources.gz) done done diff --git a/cron.d/100syncarchive_amd64 b/cron.d/100syncarchive_amd64 index 417e8c6..535604f 100755 --- a/cron.d/100syncarchive_amd64 +++ b/cron.d/100syncarchive_amd64 @@ -14,18 +14,18 @@ for dist in sarge echo "retrieve Release(.gpg) $dist" test -d amd64/${dist} || mkdir -p amd64/${dist} (cd amd64/${dist} && - wget -q -N ${amd64_ftpsite}/dists/${dist}/Release && - wget -q -N ${amd64_ftpsite}/dists/${dist}/Release.gpg ) + $wget_cmd -N ${amd64_ftpsite}/dists/${dist}/Release && + $wget_cmd -N ${amd64_ftpsite}/dists/${dist}/Release.gpg ) for part in ${parts} main/debian-installer do echo retrieve Packages $dist/$part/$arch test -d amd64/${dist}/${part}/binary-${arch} || mkdir -p amd64/${dist}/${part}/binary-${arch} (cd amd64/${dist}/${part}/binary-${arch} && - wget -q -N ${amd64_ftpsite}/dists/${dist}/${part}/binary-${arch}/Packages.gz) + $wget_cmd -N ${amd64_ftpsite}/dists/${dist}/${part}/binary-${arch}/Packages.gz) done echo retrieve Contents $dist/$arch (cd amd64/${dist} && - wget -q -N ${amd64_ftpsite}/dists/${dist}/Contents-${arch}.gz) + $wget_cmd -N ${amd64_ftpsite}/dists/${dist}/Contents-${arch}.gz) done diff --git a/cron.d/100syncarchive_backports b/cron.d/100syncarchive_backports index be82d5f..069b1e4 100755 --- a/cron.d/100syncarchive_backports +++ b/cron.d/100syncarchive_backports @@ -12,8 +12,8 @@ do echo "retrieve Release(.gpg) $dist-backports" test -d backports/${dist}-backports || mkdir -p backports/${dist}-backports (cd backports/${dist}-backports && - wget -q -N ${backports_ftpsite}/dists/${dist}-backports/Release && - wget -q -N ${backports_ftpsite}/dists/${dist}-backports/Release.gpg ) + $wget_cmd -N ${backports_ftpsite}/dists/${dist}-backports/Release && + $wget_cmd -N ${backports_ftpsite}/dists/${dist}-backports/Release.gpg ) foo=\$arch_${dist//-/_} for arch in `eval echo $foo` @@ -23,17 +23,17 @@ do echo retrieve Packages $dist-backports/$part/$arch test -d backports/${dist}-backports/${part}/binary-${arch} || mkdir -p backports/${dist}-backports/${part}/binary-${arch} (cd backports/${dist}-backports/${part}/binary-${arch} && - wget -q -N ${backports_ftpsite}/dists/${dist}-backports/${part}/binary-${arch}/Packages.gz) + $wget_cmd -N ${backports_ftpsite}/dists/${dist}-backports/${part}/binary-${arch}/Packages.gz) done echo retrieve Contents $dist-backports/$arch (cd backports/${dist}-backports && - wget -q -N ${backports_ftpsite}/dists/${dist}-backports/Contents-${arch}.gz) + $wget_cmd -N ${backports_ftpsite}/dists/${dist}-backports/Contents-${arch}.gz) done for part in ${parts} do echo retrieve Sources $dist-backports/$part test -d backports/${dist}-backports/${part}/source || mkdir -p backports/${dist}-backports/${part}/source (cd backports/${dist}-backports/${part}/source && - wget -q -N ${backports_ftpsite}/dists/${dist}-backports/${part}/source/Sources.gz) + $wget_cmd -N ${backports_ftpsite}/dists/${dist}-backports/${part}/source/Sources.gz) done done diff --git a/cron.d/100syncarchive_debports b/cron.d/100syncarchive_debports index 897d1dd..05b967f 100755 --- a/cron.d/100syncarchive_debports +++ b/cron.d/100syncarchive_debports @@ -14,8 +14,8 @@ for dist in sid experimental echo "retrieve Release(.gpg) $dist" test -d debports/${dist} || mkdir -p debports/${dist} (cd debports/${dist} && - wget -q -N ${debports_ftpsite}/dists/${dist}/Release && - wget -q -N ${debports_ftpsite}/dists/${dist}/Release.gpg ) + $wget_cmd -N ${debports_ftpsite}/dists/${dist}/Release && + $wget_cmd -N ${debports_ftpsite}/dists/${dist}/Release.gpg ) for arch in $architectures do @@ -24,10 +24,10 @@ for dist in sid experimental echo retrieve Packages $dist/$part/$arch test -d debports/${dist}/${part}/binary-${arch} || mkdir -p debports/${dist}/${part}/binary-${arch} (cd debports/${dist}/${part}/binary-${arch} && - wget -q -N ${debports_ftpsite}/dists/${dist}/${part}/binary-${arch}/Packages.gz) + $wget_cmd -N ${debports_ftpsite}/dists/${dist}/${part}/binary-${arch}/Packages.gz) done echo retrieve Contents $dist/$arch (cd debports/${dist} && - wget -q -N ${debports_ftpsite}/dists/${dist}/Contents-${arch}.gz) + $wget_cmd -N ${debports_ftpsite}/dists/${dist}/Contents-${arch}.gz) done done diff --git a/cron.d/100syncarchive_installer b/cron.d/100syncarchive_installer index 396b249..6e07052 100755 --- a/cron.d/100syncarchive_installer +++ b/cron.d/100syncarchive_installer @@ -25,7 +25,7 @@ then echo retrieve Packages $dist/$part/$arch test -d us/${dist}/${part}/binary-${arch} || mkdir -p us/${dist}/${part}/binary-${arch} (cd us/${dist}/${part}/binary-${arch} && - wget -q -N ${ftpsite}/dists/${dist}/${part}/binary-${arch}/Packages.gz) + $wget_cmd -N ${ftpsite}/dists/${dist}/${part}/binary-${arch}/Packages.gz) done done done diff --git a/cron.d/100syncarchive_m68k b/cron.d/100syncarchive_m68k index f8aa4f5..f0d0aac 100755 --- a/cron.d/100syncarchive_m68k +++ b/cron.d/100syncarchive_m68k @@ -16,8 +16,8 @@ then echo "retrieve Release(.gpg) $dist" test -d us/${dist}-${arch} || mkdir -p us/${dist}-${arch} (cd us/${dist} && - wget -q -N ${ftpsite}/dists/${dist}-${arch}/Release && - wget -q -N ${ftpsite}/dists/${dist}-${arch}/Release.gpg ) + $wget_cmd -N ${ftpsite}/dists/${dist}-${arch}/Release && + $wget_cmd -N ${ftpsite}/dists/${dist}-${arch}/Release.gpg ) # foo=\$arch_${dist//-/_} # for arch in `eval echo $foo` @@ -27,20 +27,20 @@ then echo retrieve Packages $dist-${arch}/$part/$arch test -d us/${dist}-${arch}/${part}/binary-${arch} || mkdir -p us/${dist}-${arch}/${part}/binary-${arch} (cd us/${dist}-${arch}/${part}/binary-${arch} && - wget -q -N ${ftpsite}/dists/${dist}-${arch}/${part}/binary-${arch}/Packages.gz) + $wget_cmd -N ${ftpsite}/dists/${dist}-${arch}/${part}/binary-${arch}/Packages.gz) done #FIXME: no Contents files for p-u test ! "$dist" = "experimental" || continue echo retrieve Contents $dist/$arch (cd us/${dist}-${arch} && - wget -q -N ${ftpsite}/dists/${dist}-${arch}/Contents-${arch}.gz) + $wget_cmd -N ${ftpsite}/dists/${dist}-${arch}/Contents-${arch}.gz) # done for part in ${parts} do echo retrieve Sources $dist-${arch}/$part test -d us/${dist}-${arch}/${part}/source || mkdir -p us/${dist}-${arch}/${part}/source (cd us/${dist}-${arch}/${part}/source && - wget -q -N ${ftpsite}/dists/${dist}-${arch}/${part}/source/Sources.gz) + $wget_cmd -N ${ftpsite}/dists/${dist}-${arch}/${part}/source/Sources.gz) done done else diff --git a/cron.d/100syncarchive_maintainers b/cron.d/100syncarchive_maintainers index adb5f7f..e42a1c6 100755 --- a/cron.d/100syncarchive_maintainers +++ b/cron.d/100syncarchive_maintainers @@ -16,6 +16,6 @@ then else if [ ! -L Maintainers ] then - wget -q -O Maintainers ftp://ftp.debian.org/debian/indices/Maintainers + $wget_cmd -O Maintainers ftp://ftp.debian.org/debian/indices/Maintainers fi fi diff --git a/cron.d/100syncarchive_volatile b/cron.d/100syncarchive_volatile index ab2bf5e..a01d19f 100755 --- a/cron.d/100syncarchive_volatile +++ b/cron.d/100syncarchive_volatile @@ -12,8 +12,8 @@ do echo "retrieve Release(.gpg) $dist-volatile" test -d volatile/${dist}-volatile || mkdir -p volatile/${dist}-volatile (cd volatile/${dist}-volatile && - wget -q -N ${volatile_ftpsite}/dists/${dist}/volatile/Release && - wget -q -N ${volatile_ftpsite}/dists/${dist}/volatile/Release.gpg ) + $wget_cmd -N ${volatile_ftpsite}/dists/${dist}/volatile/Release && + $wget_cmd -N ${volatile_ftpsite}/dists/${dist}/volatile/Release.gpg ) foo=\$arch_${dist//-/_} for arch in `eval echo $foo` @@ -23,11 +23,11 @@ do echo retrieve Packages $dist-volatile/$part/$arch test -d volatile/${dist}-volatile/${part}/binary-${arch} || mkdir -p volatile/${dist}-volatile/${part}/binary-${arch} (cd volatile/${dist}-volatile/${part}/binary-${arch} && - wget -q -N ${volatile_ftpsite}/dists/${dist}/volatile/${part}/binary-${arch}/Packages.gz) + $wget_cmd -N ${volatile_ftpsite}/dists/${dist}/volatile/${part}/binary-${arch}/Packages.gz) done echo retrieve Contents $dist-volatile/$arch (cd volatile/${dist}-volatile && - wget -q -N ${volatile_ftpsite}/dists/${dist}/volatile/Contents-${arch}.gz) + $wget_cmd -N ${volatile_ftpsite}/dists/${dist}/volatile/Contents-${arch}.gz) done for part in ${parts} @@ -35,6 +35,6 @@ do echo retrieve Sources $dist-volatile/$part test -d volatile/${dist}-volatile/${part}/source || mkdir -p volatile/${dist}-volatile/${part}/source (cd volatile/${dist}-volatile/$part/source && - wget -q -N ${volatile_ftpsite}/dists/${dist}/volatile/${part}/source/Sources.gz) + $wget_cmd -N ${volatile_ftpsite}/dists/${dist}/volatile/${part}/source/Sources.gz) done done diff --git a/cron.d/110debtags b/cron.d/110debtags index 7d361fc..a2be695 100755 --- a/cron.d/110debtags +++ b/cron.d/110debtags @@ -7,7 +7,7 @@ debtagsdir="$filesdir/debtags" test -d ${debtagsdir} || mkdir -p ${debtagsdir} cd ${debtagsdir} -wget -q -N http://debtags.alioth.debian.org/tags/vocabulary.gz && +$wget_cmd -N http://debtags.alioth.debian.org/tags/vocabulary.gz && gunzip -f vocabulary.gz cd "$topdir" diff --git a/cron.d/120synctrans b/cron.d/120synctrans index 0816c03..07511f8 100755 --- a/cron.d/120synctrans +++ b/cron.d/120synctrans @@ -22,7 +22,7 @@ then locale=$(echo $lang|perl -p -e 's/^([a-z]{2})-([a-z]{2})$/"$1_".uc($2)/e') echo "retrieve translated Descs $dist/$part/$lang ($locale)" (cd us/${dist}/${part}/i18n && - wget -q -N ${ddtp_ftpsite}/dists/${dist}/${part}/i18n/Translation-$locale.gz) + $wget_cmd -N ${ddtp_ftpsite}/dists/${dist}/${part}/i18n/Translation-$locale.gz) done done done -- 2.39.2