[Reproducible-commits] [misc] 01/01: reports: more robust way of not-doing-redundant-downloads

Ximin Luo infinity0 at debian.org
Wed Jun 15 14:32:10 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 17067c745e17748dcb94e7b46d7cd6597c6aaa12
Author: Ximin Luo <infinity0 at debian.org>
Date:   Wed Jun 15 16:30:29 2016 +0200

    reports: more robust way of not-doing-redundant-downloads
---
 reports/bin/get-latest-data | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/reports/bin/get-latest-data b/reports/bin/get-latest-data
index 313c715..6c9fbd3 100755
--- a/reports/bin/get-latest-data
+++ b/reports/bin/get-latest-data
@@ -57,15 +57,15 @@ echo >&2 "- changelogs of newly-reproducible packages"
 mkdir -p changelogs
 rm -f changelogs-failed && touch changelogs-failed
 
-for url in $(REPRODUCIBLE_DB=reproducible.db "$scriptdir/newly-reproducible" | sed -n -e 's,.*<,,;s,>.*,,p' | sort -u); do
+(cd changelogs
+for url in $(REPRODUCIBLE_DB=../reproducible.db "$scriptdir/newly-reproducible" | sed -n -e 's,.*<,,;s,>.*,,p' | sort -u); do
 	p=${url%/*}; p=${p##*/};
-	if [ ! -e "changelogs/$p" ]; then
-		echo -n "  * $p"
-		$TORSOCKS wget -q -O changelogs/$p "$url" || (
-			rm changelogs/$p; echo $url >> changelogs-failed ; echo -n " failed." )
-		echo
-	fi
+	ln -sf "$(basename "$url")" "$p"
+	echo -n "  * $p"
+	$TORSOCKS wget -q -N "$url" || ( echo $url >> ../changelogs-failed ; echo -n " failed." )
+	echo
 done
+)
 
 echo >&2 "- mails describing uploads to debian (will ssh to $mailbase)"
 current_month="$(date -u +%Y%m)"

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