[Reproducible-commits] [misc] 01/01: reports: just put failed downloads in changelogs-failed, instead of a tempfile

Ximin Luo infinity0 at debian.org
Mon May 16 16:33:47 UTC 2016


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

infinity0 pushed a commit to branch master
in repository misc.

commit 247ef985f0aff6fae3aa88949d26df7f82aca9e2
Author: Ximin Luo <infinity0 at debian.org>
Date:   Mon May 16 18:33:26 2016 +0200

    reports: just put failed downloads in changelogs-failed, instead of a tempfile
---
 reports/bin/get-latest-data | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/reports/bin/get-latest-data b/reports/bin/get-latest-data
index 648f948..263cfad 100755
--- a/reports/bin/get-latest-data
+++ b/reports/bin/get-latest-data
@@ -25,7 +25,6 @@ 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"
@@ -43,11 +42,12 @@ echo
 
 echo >&2 "- changelogs of newly-reproducible packages"
 mkdir -p changelogs
+rm -f changelogs-failed && touch changelogs-failed
 
 for url in $("$scriptdir/newly-reproducible" -w "$week" | sed -n -e 's,.*<,,;s,>.*,,p' | sort -u); do
 	p=${url%/*}; p=${p##*/};
 	echo -n "  * $p"
-	$TORSOCKS wget -q -O changelogs/$p "$url" || ( echo $url >> $failed_urls ; echo -n " failed.")
+	$TORSOCKS wget -q -O changelogs/$p "$url" || ( echo $url >> changelogs-failed ; echo -n " failed." )
 	echo
 done
 
@@ -56,15 +56,16 @@ 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;" \
   | ssh alioth.debian.org psql service=udd -t \
   | awk '/[0-9]/ { print $1 }' > bugs
-)
 
-rm -f latest && ln -sf "data/$week_path" latest
+### report failures
 
-if [ -s $failed_urls ] ; then
+if [ -s changelogs-failed ] ; then
 	echo
-	echo "These URLs could not be downloaded: (please investigate and download manually)"
+	echo "These URLs could not be downloaded; please investigate and download manually:"
 	echo
-	cat $failed_urls
+	cat changelogs-failed
 fi
-rm -f $failed_urls
 
+)
+
+rm -f latest && ln -sf "data/$week_path" latest

-- 
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