e1f9159
From ea80b770cd64b475ffa7f59ed715e09bf2238f61 Mon Sep 17 00:00:00 2001
e1f9159
From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= <lsedlar@redhat.com>
e1f9159
Date: Mon, 12 Dec 2016 10:23:09 +0100
e1f9159
Subject: [PATCH 3/4] Make curl follow redirects
e1f9159
MIME-Version: 1.0
e1f9159
Content-Type: text/plain; charset=UTF-8
e1f9159
Content-Transfer-Encoding: 8bit
e1f9159
e1f9159
If the response returns a redirect status code, we want to get the
e1f9159
actual file, not the response server sent us (which is most likely a
e1f9159
useless HTML page).
e1f9159
e1f9159
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
e1f9159
---
e1f9159
 bin/fedpkg | 4 ++--
e1f9159
 1 file changed, 2 insertions(+), 2 deletions(-)
e1f9159
e1f9159
diff --git a/bin/fedpkg b/bin/fedpkg
e1f9159
index b0cefea..520ccdd 100755
e1f9159
--- a/bin/fedpkg
e1f9159
+++ b/bin/fedpkg
e1f9159
@@ -34,13 +34,13 @@ if [[ -s sources ]]; then
e1f9159
             # Remove parenthesis around tarball name
e1f9159
 	    filename=${filename#(}
e1f9159
 	    tarball=${filename%)}
e1f9159
-            curl -H Pragma: -o "./$tarball" -R -S --fail "$baseurl/$pkgname/$tarball/$hashtype/$hash/$tarball"
e1f9159
+            curl -L -H Pragma: -o "./$tarball" -R -S --fail "$baseurl/$pkgname/$tarball/$hashtype/$hash/$tarball"
e1f9159
         done < sources
e1f9159
         "${hashtype}sum" -c sources
e1f9159
     else
e1f9159
         # Ok, we're working with MD5.
e1f9159
         while read -r md5sum tarball; do
e1f9159
-            curl -H Pragma: -o "./$tarball" -R -S --fail "$baseurl/$pkgname/$tarball/$md5sum/$tarball"
e1f9159
+            curl -L -H Pragma: -o "./$tarball" -R -S --fail "$baseurl/$pkgname/$tarball/$md5sum/$tarball"
e1f9159
         done < sources
e1f9159
         md5sum -c sources
e1f9159
     fi
e1f9159
-- 
e1f9159
2.11.0
e1f9159