[Slackbuilds-users] Github file name issue

Ryan P.C. McQuen ryan.q at linux.com
Mon May 25 14:52:52 UTC 2015


>tar xvf $PRGNAM-$VERSION.tar.gz || tar xvf v$VERSION.tar.gz

I use:

if [ -e $CWD/$VERSION.tar.gz ]; then
  tar xvf $CWD/$VERSION.tar.gz
else
  tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
fi

So that a 'no such file or directory' warning won't get displayed.

---

On Mon, May 25, 2015, 1:43 AM Heinz Wiesinger <pprkut at liwjatan.at> wrote:

> On Monday 25 May 2015 03:49:16 Thomas Morper wrote:
> > Hello there,
> >
> > A user of one of my SlackBuilds discovered an interesting problem:
> >
> > If you follow the download link from the info file, pointing to a release
> > on Github, you'll end up with different filenames depending on whether
> you
> > use a browser or a tool like 'wget', thanks to a 'Content-Disposition'
> > header. E.g.:
> >
> > 'Release' link on Github:
> > https://github.com/BlackIkeEagle/par2cmdline/archive/v0.6.11.tar.gz
> >
> > As expected, wget will save the archive as 'v0.6.11.tar.gz'. However,
> > Firefox will save it as 'par2cmdline-0.6.11.tar.gz', so anybody following
> > the download link from the slackbuilds.org web site will get a
> non-working
> > build. Most of the Github links I've checked behave this way.
> >
> > What would be a good way to handle this? Editing the SlackBuild script to
> > handle both names doesn't seem very desirable. Do we have to resort to
> > self hosting?
>
> There is actually a download URL scheme that works better (IMHO, anyway),
> but
> it's not easily discoverable.
>
> https://github.com/<user>/<project>/tarball/<tagname>/<tarballname>.tar.gz
>
> In your case this would translate to
>
>
> https://github.com/BlackIkeEagle/par2cmdline/tarball/v0.6.11/par2cmdline-0.6.11.tar.gz
>
> The downside of this download is that the foldername inside the tarball
> differs
> with every version since it includes the git hash of the release tag.
> Also, apparently this is using a github legacy API, so they might turn it
> off
> at some point, but for now it works fine for me.
>
> Grs,
> Heinz_______________________________________________
> SlackBuilds-users mailing list
> SlackBuilds-users at slackbuilds.org
> http://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
> Archives - http://lists.slackbuilds.org/pipermail/slackbuilds-users/
> FAQ - http://slackbuilds.org/faq/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20150525/174e5b91/attachment-0001.html>


More information about the SlackBuilds-users mailing list