[Slackbuilds-users] Content Disposition part 2

Dave Woodfall dave at slackbuilds.org
Sat Apr 30 21:54:08 UTC 2022


On 30/04/22 17:24,
Andrew Payne <phalange at komputermatrix.com> put forth the proposition:
> D & B, it's the script I just took over for Sakura.
> https://github.com/dabisu/sakura/tags
> I'm sure there's a bespoke url that can be crafted, but I was curious
> about a more generic solution to a problem that pops up a lot.
> I can't visualize how the || "if" statement would cause trouble, but I
> accept it if this is not the right fix.
> In my experience, tweaking the url must be done by hand and is thus prone
> to typos.
> For example, my NC url had this typo:
> https://github.com/nextcloud/desktop/archive/refs/tags/v3.4.3/desktop-3.4.4.tar.gz
> (see the mismatched versions) and the 3.4.3 version was downloaded with no
> error. (?) Copy-paste from github tarball urls is mostly fool proof.

In the end the tag wins.  The file will download as any name you
choose, so in that link it will be version 3.4.3.  This is the
correct URL for version 3.4.4:

https://github.com/nextcloud/desktop/archive/v3.4.4/desktop-3.4.4.tar.gz


> As for my sakura slackbuild, the tarball naming is "sakura-SAKURA_3_8_5",
> which is silly so I did this:
> SRCNAM = SAKURA_3_8_5
> [...]
> tar xvf $CWD/$PRGNAM-$SRCNAM.tar.gz || tar xvf $CWD/$SRCNAM.tar.gz
> mv $TMP/$PRGNAM-$SRCNAM $TMP/$PRGNAM-$VERSION
> [...]

This seems the same as libxlswriter except you have SAKURA_ instead
of RELEASE_.

SAKURA_3_8_5 is the tag/version so:

https://github.com/dabisu/sakura/archive/SAKURA_3_8_5/sakura-SAKURA_3_8_5.tar.gz

Which will extract a directory: sakura-SAKURA_3_8_5

With a more normal version 3.8.5 and like you have:

> SRCNAM = SAKURA_3_8_5

That should be OK:

tar xvf $CWD/$PRGNAM-$SRCNAM.tar.gz

Should be all that's needed.  I might be tempted to use $SRCVER
perhaps, since it is the version according to github.

> >
> > On Sat, 30 Apr 2022, Andrew Payne wrote:
> >
> >> Hi all, revisiting the Github tarball 'content disposition' problem.
> >>
> >> While manually tweaking the tarball url to
> >>
> >> https://github.com/DEVELOPER/PRGNAM/archive/refs/tags/vVERSION/PRGNAM-VERSION.tar.gz
> >>
> >> works, I have a case where the devs use underscores instead of dots and
> >> I
> >> cannot seem to get a workable url with the above.
> >
> > Can you show us the actual URL you're having problems with?
> >
> >> tar xvf $CWD/$SRCNAM-$VERSION.tar.gz || tar xvf $CWD/$VERSION.tar.gz
> >>
> >> This means I can copy paste the Github tarball url into the *.info file,
> >> and it matters not how the user downloads it.
> >>
> >> Thoughts?
> >
> > That will work, but it's suboptimal. If there's no other way to get a
> > consistent filename, it'll have to be done that way.
> >
> > But it can cause problem for automated tools that people use to
> > download the file and check its md5sum. It can also cause problems
> > for the SBo source archive: https://slackware.uk/sbosrcarch/
> >
> > You might want to host the file on a different web server, if you have
> > one handy.
> >

--
Dave

sbo-maintainer-tools:
https://slackbuilds.org/repository/15.0/system/sbo-maintainer-tools/
SBo templates:
https://slackbuilds.org/templates/


More information about the SlackBuilds-users mailing list