| 37 |
# the link) |
# the link) |
| 38 |
cp -a $2 $2.new || true |
cp -a $2 $2.new || true |
| 39 |
# Beware that -N conflicts with -O (#88176, #202911) |
# Beware that -N conflicts with -O (#88176, #202911) |
| 40 |
if wget -U pts -q -O $2.new $1 ; then |
if wget -U pts -q -O $2.new "$1" ; then |
| 41 |
mv $2.new $2 |
mv $2.new $2 |
| 42 |
else |
else |
| 43 |
echo "Downloading $1 failed, $2 is stale now" |
echo "Downloading $1 failed, $2 is stale now" |
| 45 |
fi |
fi |
| 46 |
} |
} |
| 47 |
|
|
| 48 |
|
http_head() { |
| 49 |
|
# $1: url |
| 50 |
|
# return 0 if the URL exists (HEAD was OK), non-0 otherwise |
| 51 |
|
curl --head --fail --silent "$1" > /dev/null |
| 52 |
|
return $? |
| 53 |
|
} |
| 54 |
|
|
| 55 |
nice_redirect_to() { |
nice_redirect_to() { |
| 56 |
# $1 : target file |
# $1 : target file |
| 57 |
# $2-... : shell command |
# $2-... : shell command |
| 120 |
nice_redirect_to bugs.help.txt $root/bin/tagged_bugs.py "help" |
nice_redirect_to bugs.help.txt $root/bin/tagged_bugs.py "help" |
| 121 |
nice_redirect_to bugs.gift.txt \ |
nice_redirect_to bugs.gift.txt \ |
| 122 |
$root/bin/tagged_bugs.py "gift" "debian-qa@lists.debian.org" |
$root/bin/tagged_bugs.py "gift" "debian-qa@lists.debian.org" |
| 123 |
|
piuparts_url="http://piuparts.debian.org/results-per-source.txt" |
| 124 |
|
# extra care because $piuparts_url doesn't work yet |
| 125 |
|
if http_head $piuparts_url ; then |
| 126 |
|
nice_wget $piuparts_url piuparts.txt |
| 127 |
|
else |
| 128 |
|
test -f piuparts.txt || touch piuparts.txt |
| 129 |
|
fi |
| 130 |
|
|
| 131 |
# Download debcheck lists |
# Download debcheck lists |
| 132 |
DCROOT=http://qa.debian.org/data/debcheck/result |
DCROOT=http://qa.debian.org/data/debcheck/result |