#3 Fix downloading
Merged 7 years ago by ausil. Opened 7 years ago by lsedlar.

file modified
+3 -3
@@ -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
@@ -34,13 +34,13 @@ 

              # 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

  • Update $baseurl to avoid redirect
  • But also make curl follow redirects to make sure we avoid problems next time.

Should we update it to use https while we're at it?

yes we should use https://

2 new commits added

  • Update $baseurl to src.fpo
  • Make curl follow redirects
7 years ago

Ok, updated to use https.

Pull-Request has been merged by ausil

7 years ago
Metadata