From ea80b770cd64b475ffa7f59ed715e09bf2238f61 Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Dec 12 2016 09:23:09 +0000 Subject: [PATCH 1/2] Make curl follow redirects If the response returns a redirect status code, we want to get the actual file, not the response server sent us (which is most likely a useless HTML page). Signed-off-by: Lubomír Sedlář --- diff --git a/bin/fedpkg b/bin/fedpkg index b0cefea..520ccdd 100755 --- a/bin/fedpkg +++ b/bin/fedpkg @@ -34,13 +34,13 @@ if [[ -s sources ]]; then # Remove parenthesis around tarball name filename=${filename#(} tarball=${filename%)} - curl -H Pragma: -o "./$tarball" -R -S --fail "$baseurl/$pkgname/$tarball/$hashtype/$hash/$tarball" + curl -L -H Pragma: -o "./$tarball" -R -S --fail "$baseurl/$pkgname/$tarball/$hashtype/$hash/$tarball" done < sources "${hashtype}sum" -c sources else # Ok, we're working with MD5. while read -r md5sum tarball; do - curl -H Pragma: -o "./$tarball" -R -S --fail "$baseurl/$pkgname/$tarball/$md5sum/$tarball" + curl -L -H Pragma: -o "./$tarball" -R -S --fail "$baseurl/$pkgname/$tarball/$md5sum/$tarball" done < sources md5sum -c sources fi From 9953257337f07b76bd324e32f310af3789b45dbc Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Dec 12 2016 09:35:07 +0000 Subject: [PATCH 2/2] Update $baseurl to src.fpo Signed-off-by: Lubomír Sedlář --- diff --git a/bin/fedpkg b/bin/fedpkg index 520ccdd..42cd65d 100755 --- a/bin/fedpkg +++ b/bin/fedpkg @@ -18,7 +18,7 @@ # Abort on errors set -e -baseurl=http://pkgs.fedoraproject.org/repo/pkgs +baseurl=https://src.fedoraproject.org/repo/pkgs pkgname=$(basename "$PWD") if [[ -s sources ]]; then # Read first word of first line. For old MD5 format it's the 32 character