Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

OSX Install Script - Can't unzip objconv #198

Open
jameslawson opened this issue Feb 10, 2019 · 1 comment
Open

OSX Install Script - Can't unzip objconv #198

jameslawson opened this issue Feb 10, 2019 · 1 comment

Comments

@jameslawson
Copy link
Contributor

jameslawson commented Feb 10, 2019

Hey there! Just ran the Mac OSX script from the first edition here to get a cross compiler, but it failed towards the end when trying to install objconv, specifically when it runs unzip objconv.zip -d build-objconv:

$ unzip objconv.zip -d build-objconv
Archive:  objconv.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of objconv.zip or
        objconv.zip.zip, and cannot find objconv.zip.ZIP, period.

Turns out the URL for objconv has moved (from http to https):

http://www.agner.org/optimize/objconv.zip
-> https://www.agner.org/optimize/objconv.zip

and response for the former HTTP URL is not the zip file but rather a HTTP redirect (301 Moved Permanently) to the latter HTTPS URL! This throws off curl and it downloads a 300B html page instead a 1MB zip file.

To fix the script, I changed the URL:

-curl http://www.agner.org/optimize/objconv.zip > objconv.zip
+curl https://www.agner.org/optimize/objconv.zip > objconv.zip

Also could consider adding the -L flag to make curl automatically follows HTTP redirects:

-curl http://www.agner.org/optimize/objconv.zip > objconv.zip
+curl -L https://www.agner.org/optimize/objconv.zip > objconv.zip

This is more future-proof in case the URL changes to a redirect again in the future.

@jameslawson
Copy link
Contributor Author

I know you're not working on first edition but if you're interested I've created a PR here (in case others encounter this): #199

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant