[Reproducible-commits] [misc] 01/01: display 404 URLs at the end

Holger Levsen holger at layer-acht.org
Mon May 16 16:26:01 UTC 2016


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository misc.

commit dd5aea9b2dfb5ce28891fb0b6c0091c5b55f5fb9
Author: Holger Levsen <holger at layer-acht.org>
Date:   Mon May 16 18:25:18 2016 +0200

    display 404 URLs at the end
---
 reports/bin/get-latest-data | 30 +++++++++++++-----------------
 1 file changed, 13 insertions(+), 17 deletions(-)

diff --git a/reports/bin/get-latest-data b/reports/bin/get-latest-data
index b486c94..648f948 100755
--- a/reports/bin/get-latest-data
+++ b/reports/bin/get-latest-data
@@ -25,6 +25,7 @@ week_start=$((week_end - 7*24*3600))
 week_path="week_${week}_ending_$(date -u -d@${week_end} +%Y-%m-%d)"
 
 echo >&2 "Getting data for the period $(date -u -d@${week_start} +%Y-%m-%d) to $(date -u -d@${week_end} +%Y-%m-%d)"
+failed_urls=$(mktemp)
 
 mkdir -p "data/$week_path"
 (cd "data/$week_path"
@@ -35,12 +36,13 @@ export RB_REPORT_WEEK_START=$week_start
 export RB_REPORT_WEEK_END=$week_end
 eof
 
-echo >&2 "- reproducible.db (>350MB)"
-$TORSOCKS wget -q -N https://reproducible.debian.net/reproducible.db
+echo -n >&2 "- reproducible.db (>350MB)"
+url=https://reproducible.debian.net/reproducible.db
+$TORSOCKS wget -q -N $url || ( echo $url >> $failed_urls ; echo -n " failed.")
+echo
 
 echo >&2 "- changelogs of newly-reproducible packages"
 mkdir -p changelogs
-export failed_urls=$(mktemp)
 
 for url in $("$scriptdir/newly-reproducible" -w "$week" | sed -n -e 's,.*<,,;s,>.*,,p' | sort -u); do
 	p=${url%/*}; p=${p##*/};
@@ -49,18 +51,6 @@ for url in $("$scriptdir/newly-reproducible" -w "$week" | sed -n -e 's,.*<,,;s,>
 	echo
 done
 
-# i'd love to move this codeblock to the end and remove the read command
-# but see the last two lines of this script…
-if [ -s $failed_urls ] ; then
-	echo
-	echo "these urls could not be downloaded: (please investigate and download manually)"
-	echo
-	cat $failed_urls
-	echo
-	echo "(press enter to continue)"
-	read
-fi
-rm -f $failed_urls
 
 echo >&2 "- bug reports that were modified (via ssh to alioth)"
 echo "SELECT DISTINCT bugs.id FROM bugs_usertags, bugs WHERE email = 'reproducible-builds at lists.alioth.debian.org' AND bugs.id = bugs_usertags.id AND bugs.last_modified > to_timestamp($week_start) AND bugs.last_modified < to_timestamp($week_end) ORDER BY bugs.id;" \
@@ -70,5 +60,11 @@ echo "SELECT DISTINCT bugs.id FROM bugs_usertags, bugs WHERE email = 'reproducib
 
 rm -f latest && ln -sf "data/$week_path" latest
 
-# this prints an empty line but should not. i dont get it.
-echo $failed_urls
+if [ -s $failed_urls ] ; then
+	echo
+	echo "These URLs could not be downloaded: (please investigate and download manually)"
+	echo
+	cat $failed_urls
+fi
+rm -f $failed_urls
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/misc.git



More information about the Reproducible-commits mailing list