diff options
Diffstat (limited to 'maintainers/scripts/evacuate-urls.sh')
-rwxr-xr-x | maintainers/scripts/evacuate-urls.sh | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/maintainers/scripts/evacuate-urls.sh b/maintainers/scripts/evacuate-urls.sh index d2d611352d8a..8e745f887a8a 100755 --- a/maintainers/scripts/evacuate-urls.sh +++ b/maintainers/scripts/evacuate-urls.sh @@ -6,26 +6,29 @@ find . -name "*.nix" | while read fn; do if oldURL=$(echo "$line" | sed 's^url = \(.*\);^\1^'); then - if ! echo "$oldURL" | grep -q -E "www.cs.uu.nl|nix.cs.uu.nl|.stratego-language.org|java.sun.com|ut2004|linuxq3a|RealPlayer|Adbe"; then + if ! echo "$oldURL" | grep -q -E "www.cs.uu.nl|nix.cs.uu.nl|.stratego-language.org|java.sun.com|ut2004|linuxq3a|RealPlayer|Adbe|belastingdienst|microsoft|armijn/.nix"; then base=$(basename $oldURL) newURL="http://nix.cs.uu.nl/dist/tarballs/$base" newPath="/data/webserver/dist/tarballs/$base" echo "$fn: $oldURL -> $newURL" -# if test -e "$newPath"; then -# echo "WARNING: $newPath exists!" -# else + if test -e "$newPath"; then + echo "WARNING: $newPath exists!" + else - if ! test -e "$newPath"; then - curl --fail --location --max-redirs 20 "$oldURL" > "$newPath".tmp - mv -f "$newPath".tmp "$newPath" + if test -n "$doMove"; then - fi + if ! test -e "$newPath"; then + curl --fail --location --max-redirs 20 "$oldURL" > "$newPath".tmp + mv -f "$newPath".tmp "$newPath" + fi + + sed "s^$oldURL^$newURL^" < "$fn" > "$fn".tmp + mv -f "$fn".tmp "$fn" - sed "s^$oldURL^$newURL^" < "$fn" > "$fn".tmp - mv -f "$fn".tmp "$fn" + fi -# fi + fi fi |