commit:     f8f99ed3c0186e38b142f5cfb44bc057aaac802b
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 23 17:40:40 2016 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Wed Mar 23 17:40:40 2016 +0000
URL:        https://gitweb.gentoo.org/sites/www.git/commit/?id=f8f99ed3

Add explicit timeouts to all scripts; we had a wget that was stuck for a month

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 bin/update-devaway.sh   |  2 +-
 bin/update-downloads.sh | 17 +++++++++--------
 bin/update-glsa.sh      |  2 +-
 bin/update-mirrors.sh   |  4 ++--
 bin/update-packages.sh  |  2 +-
 bin/update-planet.sh    |  2 +-
 bin/update-use.sh       |  2 +-
 bin/update-userinfo.sh  |  4 ++--
 bin/update-wiki.sh      |  2 +-
 9 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/bin/update-devaway.sh b/bin/update-devaway.sh
index cea35e5..1c0e110 100755
--- a/bin/update-devaway.sh
+++ b/bin/update-devaway.sh
@@ -2,6 +2,6 @@
 
 # TODO: One day, fix up the json to be compatible with jekyll's parser
 echo -n 'Updating devaway information...'
-wget 'http://dev.gentoo.org/devaway/xml/' -O _data/devaway.xml.tmp 2>/dev/null
+wget -T 60 'http://dev.gentoo.org/devaway/xml/' -O _data/devaway.xml.tmp 
2>/dev/null
 [ $? -eq 0 ] && mv _data/devaway.xml.tmp _data/devaway.xml
 echo 'done.'

diff --git a/bin/update-downloads.sh b/bin/update-downloads.sh
index 386de1f..8dea718 100755
--- a/bin/update-downloads.sh
+++ b/bin/update-downloads.sh
@@ -3,20 +3,21 @@ ARCHES=(amd64 x86 alpha arm hppa ia64 mips ppc s390 sh sparc)
 
 echo -n 'Updating downloads...'
 
+# TODO: fix this handling for temp files and if one of the downloads fails but 
not others.
 for arch in "${ARCHES[@]}"; do
   mkdir -p _data/downloads/${arch}/
-  wget 
"http://distfiles.gentoo.org/releases/${arch}/autobuilds/latest-iso.txt"; -O 
_data/downloads/${arch}/iso.txt 2>/dev/null
-  wget 
"http://distfiles.gentoo.org/releases/${arch}/autobuilds/latest-stage3.txt"; -O 
_data/downloads/${arch}/stage3.txt 2>/dev/null
+  wget -T 60 
"http://distfiles.gentoo.org/releases/${arch}/autobuilds/latest-iso.txt"; -O 
_data/downloads/${arch}/iso.txt 2>/dev/null
+  wget -T 60 
"http://distfiles.gentoo.org/releases/${arch}/autobuilds/latest-stage3.txt"; -O 
_data/downloads/${arch}/stage3.txt 2>/dev/null
 
   if [ ${arch} = "amd64" ]; then
-    wget 
"http://distfiles.gentoo.org/releases/amd64/autobuilds/latest-admincd-amd64.txt";
 -O - >> _data/downloads/${arch}/iso.txt 2>/dev/null
+    wget -T 60 
"http://distfiles.gentoo.org/releases/amd64/autobuilds/latest-admincd-amd64.txt";
 -O - >> _data/downloads/${arch}/iso.txt 2>/dev/null
   elif [ ${arch} = "s390" ]; then
-    wget 
"http://distfiles.gentoo.org/releases/s390/autobuilds/latest-netboot-s390-initramfs.txt";
 -O - >> _data/downloads/${arch}/iso.txt 2>/dev/null
-    wget 
"http://distfiles.gentoo.org/releases/s390/autobuilds/latest-netboot-s390-kernel.txt";
 -O - >> _data/downloads/${arch}/iso.txt 2>/dev/null
-    wget 
"http://distfiles.gentoo.org/releases/s390/autobuilds/latest-netboot-s390x-initramfs.txt";
 -O - >> _data/downloads/${arch}/iso.txt 2>/dev/null
-    wget 
"http://distfiles.gentoo.org/releases/s390/autobuilds/latest-netboot-s390x-kernel.txt";
 -O - >> _data/downloads/${arch}/iso.txt 2>/dev/null
+    wget -T 60 
"http://distfiles.gentoo.org/releases/s390/autobuilds/latest-netboot-s390-initramfs.txt";
 -O - >> _data/downloads/${arch}/iso.txt 2>/dev/null
+    wget -T 60 
"http://distfiles.gentoo.org/releases/s390/autobuilds/latest-netboot-s390-kernel.txt";
 -O - >> _data/downloads/${arch}/iso.txt 2>/dev/null
+    wget -T 60 
"http://distfiles.gentoo.org/releases/s390/autobuilds/latest-netboot-s390x-initramfs.txt";
 -O - >> _data/downloads/${arch}/iso.txt 2>/dev/null
+    wget -T 60 
"http://distfiles.gentoo.org/releases/s390/autobuilds/latest-netboot-s390x-kernel.txt";
 -O - >> _data/downloads/${arch}/iso.txt 2>/dev/null
   elif [ ${arch} = "x86" ]; then
-    wget 
"http://distfiles.gentoo.org/releases/x86/autobuilds/latest-admincd-x86.txt"; -O 
- >> _data/downloads/${arch}/iso.txt 2>/dev/null
+    wget -T 60 
"http://distfiles.gentoo.org/releases/x86/autobuilds/latest-admincd-x86.txt"; -O 
- >> _data/downloads/${arch}/iso.txt 2>/dev/null
   fi
 done
 

diff --git a/bin/update-glsa.sh b/bin/update-glsa.sh
index 6a64069..81d4f65 100755
--- a/bin/update-glsa.sh
+++ b/bin/update-glsa.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 
 echo -n 'Updating GLSA information...'
-wget 'https://security.gentoo.org/glsa/feed.yaml' -O _data/glsa.yaml.tmp 
2>/dev/null
+wget -T 60 'https://security.gentoo.org/glsa/feed.yaml' -O _data/glsa.yaml.tmp 
2>/dev/null
 [ $? -eq 0 ] && mv _data/glsa.yaml.tmp _data/glsa.yaml
 echo 'done.'

diff --git a/bin/update-mirrors.sh b/bin/update-mirrors.sh
index 0f63bf9..19f6e51 100755
--- a/bin/update-mirrors.sh
+++ b/bin/update-mirrors.sh
@@ -1,8 +1,8 @@
 #!/bin/bash
 
 echo -n 'Updating mirror information...'
-wget 'https://api.gentoo.org/mirrors/distfiles.xml' -O 
_data/mirrors-distfiles.xml.tmp 2>/dev/null
+wget -T 60 'https://api.gentoo.org/mirrors/distfiles.xml' -O 
_data/mirrors-distfiles.xml.tmp 2>/dev/null
 [ $? -eq 0 ] && mv _data/mirrors-distfiles.xml.tmp _data/mirrors-distfiles.xml
-wget 'https://api.gentoo.org/mirrors/rsync.xml' -O _data/mirrors-rsync.xml.tmp 
2>/dev/null
+wget -T 60 'https://api.gentoo.org/mirrors/rsync.xml' -O 
_data/mirrors-rsync.xml.tmp 2>/dev/null
 [ $? -eq 0 ] && mv _data/mirrors-rsync.xml.tmp _data/mirrors-rsync.xml
 echo 'done.'

diff --git a/bin/update-packages.sh b/bin/update-packages.sh
index 592e1cf..b2577bd 100755
--- a/bin/update-packages.sh
+++ b/bin/update-packages.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 
 echo -n 'Updating Packages information...'
-wget 'https://packages.gentoo.org/packages/added.atom' -O 
_data/packages.xml.tmp 2>/dev/null
+wget -T 60 'https://packages.gentoo.org/packages/added.atom' -O 
_data/packages.xml.tmp 2>/dev/null
 [ $? -eq 0 ] && mv _data/packages.xml.tmp _data/packages.xml
 echo 'done.'

diff --git a/bin/update-planet.sh b/bin/update-planet.sh
index a0c8eb4..e15571d 100755
--- a/bin/update-planet.sh
+++ b/bin/update-planet.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 
 echo -n 'Updating Planet information...'
-wget 'http://planet.gentoo.org/rss20.xml' -O _data/planet.xml.tmp 2>/dev/null
+wget -T 60 'http://planet.gentoo.org/rss20.xml' -O _data/planet.xml.tmp 
2>/dev/null
 [ $? -eq 0 ] && mv _data/planet.xml.tmp _data/planet.xml
 echo 'done.'

diff --git a/bin/update-use.sh b/bin/update-use.sh
index 1a1b5a4..3265593 100755
--- a/bin/update-use.sh
+++ b/bin/update-use.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 
 echo -n 'Updating USE flag information...'
-wget 'https://api.gentoo.org/packages/use.json' -O _data/use.json.tmp 
2>/dev/null
+wget -T 60 'https://api.gentoo.org/packages/use.json' -O _data/use.json.tmp 
2>/dev/null
 [ $? -eq 0 ] && mv _data/use.json.tmp _data/use.json
 echo 'done.'

diff --git a/bin/update-userinfo.sh b/bin/update-userinfo.sh
index d2121be..613db4b 100755
--- a/bin/update-userinfo.sh
+++ b/bin/update-userinfo.sh
@@ -3,8 +3,8 @@
 echo -n 'Updating LDAP user information...'
 
 if [[ $(hostname -f) == *'gentoo.org'* ]] || [[ "$FORCE" == '1' ]]; then
-  bin/userinfo-export.rb > _data/userinfo.json
+  timeout 180 bin/userinfo-export.rb > _data/userinfo.json
   echo 'done.'
 else
   echo 'skipped (not a gentoo.org box, assuming no LDAP available, set FORCE=1 
to override).'
-fi
\ No newline at end of file
+fi

diff --git a/bin/update-wiki.sh b/bin/update-wiki.sh
index 2759813..76196df 100755
--- a/bin/update-wiki.sh
+++ b/bin/update-wiki.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 
 echo -n 'Updating Wiki information...'
-wget 
'https://wiki.gentoo.org/index.php?title=Special:NewPages&feed=rss&hidebots=1&hideredirs=1&limit=50&offset=&namespace=0&username=&tagfilter='
 -O _data/wiki.xml.tmp 2>/dev/null
+wget -T 60 
'https://wiki.gentoo.org/index.php?title=Special:NewPages&feed=rss&hidebots=1&hideredirs=1&limit=50&offset=&namespace=0&username=&tagfilter='
 -O _data/wiki.xml.tmp 2>/dev/null
 [ $? -eq 0 ] && mv _data/wiki.xml.tmp _data/wiki.xml
 echo 'done.'

Reply via email to