[Slackbuilds-users] DOWNLOAD advice for github

Alexander Verbovetsky alik at ejik.org
Thu Jun 2 17:35:36 UTC 2016


Hello,

On Sat, May 14, 2016, at 19:35, David Spencer wrote:
> Hi everybody,
> 
> For maintainers, here's some advice about what to put in DOWNLOAD in
> the .info file for github URLs.
> 
> NOTE: you don't need to change any of your existing files, this is
> just some general advice that we hope you will find helpful and
> interesting and useful. Also, this is not related to 14.2, it is
> actually some new advice about github that Heinz worked out yesterday
> :)
> 
> Hopefully, most of you know already that github is "clever" with
> download URLs. It uses an HTTP "content disposition" header to tell
> browsers the name of the archive that githib has dynamically created.
> But by default wget and curl do not use the "content disposition"
> header and use the last component of the URL as a filename. Therefore
> (until now) our SlackBuilds have needed to try both possible names for
> the download, e.g.
> 
> tar xvf $CWD/v$VERSION.tar.gz || tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
> 
> So, here's the new advice: Heinz has worked out that if we use (for
> example)
> 
> DOWNLOAD="https://github.com/trizen/clyrics/archive/0.04/clyrics-0.04.tar.gz"
> 
> then the archive will *always* be named clyrics-0.04.tar.gz, even if
> we use wget or curl, and so we can just do the usual tar command in
> the SlackBuild:
> 
> tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
> 
> Apparently this will even work nicely for projects that include the
> project name in the git tag, e.g.
> 
> DOWNLOAD="https://github.com/christophgysin/pasystray/archive/0.5.2/pasystray-0.5.2.tar.gz"
> 
> so we can now stop using confusing and ugly commands like these:
> 
> rm -rf $PRGNAM-$PRGNAM-$VERSION
> tar xvf $CWD/$PRGNAM-$PRGNAM-$VERSION.tar.gz
> cd $PRGNAM-$PRGNAM-$VERSION
> 
> I hope this is helpful to you.  Thanks to Heinz for finally working
> out the right way of handling this!
> 
> Best regards to everybody
> -D.
> 
> ps. If I've made any mistakes above, corrections will be gratefully
> received :D

Apparently, there are some minor variations here, e.g.,

wget
https://github.com/Microsoft/cpprestsdk/archive/2.8.0/cpprestsdk-2.8.0.tar.gz

doesn't work (with ERROR 404: Not Found), but with additional letter "v"
before the version number, it works:

wget
https://github.com/Microsoft/cpprestsdk/archive/v2.8.0/cpprestsdk-2.8.0.tar.gz

Best regards,
Alexander


More information about the SlackBuilds-users mailing list