Blob Blame History Raw
From ea80b770cd64b475ffa7f59ed715e09bf2238f61 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= <lsedlar@redhat.com>
Date: Mon, 12 Dec 2016 10:23:09 +0100
Subject: [PATCH 3/4] Make curl follow redirects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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ář <lsedlar@redhat.com>
---
 bin/fedpkg | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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