From hello at matthewgraybosch.com Tue Jun 9 18:03:24 2020 From: hello at matthewgraybosch.com (Matthew Graybosch) Date: Tue, 9 Jun 2020 14:03:24 -0400 Subject: [sbopkg-users] Using sbopkg with Slackbuilds that pull tarballs from Github, Sourcehut, etc. Message-ID: <20200609140324.fba03297ccc8add6bc318c52@matthewgraybosch.com> Hi. I'm trying to test a new slackbuild using my local sbopkg repository and running into a build failure. I think I know why it's happening, but I'm trying to figure out how best to ensure it doesn't happen before I submit my build to slackbuilds.org. My slackbuild gets its source from a Sourcehut release tarball located at . While clicking the link to the tarball on results in Firefox downloading "castor-0.8.14.tar.gz", hitting the URL with wget results in a download of "0.8.14.tar.gz", which causes the slackbuild to fail because it's expecting "castor-0.8.14.tar.gz". Is this a problem I can safely resolve by adding "-o ${NAME}-${VERSION}.tar.gz" to WGETFLAGS in sbopkg.conf, or is there a better way to go about ensuring that the source file gets downloaded ${NAME}-${VERSION}.tar.gz? Is this even something I should be worrying about when prepping a new slackbuild for submission to slackbuilds.org? Thanks in advance. PS: I can provide a tarball for my castor slackbuild on request. Likewise for my sbopkg.conf. I just didn't want my first post to the list to contain unsolicited attachments. -- Matthew Graybosch https://www.matthewgraybosch.com #include gemini://starbreaker.org Harrisburg,PA gemini://demifiend.org "Out of order?! Even in the future nothing works." From yalhcru at gmail.com Tue Jun 9 18:24:27 2020 From: yalhcru at gmail.com (B Watson) Date: Tue, 9 Jun 2020 14:24:27 -0400 Subject: [sbopkg-users] Using sbopkg with Slackbuilds that pull tarballs from Github, Sourcehut, etc. In-Reply-To: <20200609140324.fba03297ccc8add6bc318c52@matthewgraybosch.com> References: <20200609140324.fba03297ccc8add6bc318c52@matthewgraybosch.com> Message-ID: Hi, welcome to the mailing list. This ended up longer than I expected, but hopefully it's helpful. On 6/9/20, Matthew Graybosch wrote: > > Is this a problem I can safely resolve by adding "-o > ${NAME}-${VERSION}.tar.gz" to WGETFLAGS in sbopkg.conf, or is there a > better way to go about ensuring that the source file gets downloaded > ${NAME}-${VERSION}.tar.gz? That would work for sbopkg, but not everyone uses sbopkg... you have no way to ensure anything about how the source file gets downloaded (some people even use a browser). > Is this even something I should be worrying about when prepping a new > slackbuild for submission to slackbuilds.org? Yes. The issue is the same one that happens with github: the server is sending a Content-disposition header, which sets the filename to save as. You have no way to know what the user's going to use to download the file, so you don't know if it'll obey the header... For github, there's a way to rewrite the URL so it ends up saving the file with the same name, whether or not Content-disposition is honored. For this git.sr.ht server, it doesn't look like that's going to work. The thing to do here is make the SlackBuild handle either filename. One way to do it: tar xvf $VERSION.tar.gz || tar xvf $PRGNAM-$VERSION.tar.gz cd $PRGNAM-$VERSION # rest of script proceeds normally This works, but if $VERSION.tar.gz didn't exist, the user might notice a scary-looking but harmless "tar: 0.8.14.tar.gz: Cannot open: No such file or directory" message in the build output. Another way to do it: if [ -e $CWD/$VERSION.tar.gz ]; then TARBALL=$CWD/$VERSION.tar.gz else TARBALL=$CWD/$PRGNAM-$VERSION.tar.gz fi tar xvf $TARBALL cd $PRGNAM-$VERSION # etc etc. You could write the "if" clause more compactly: TARBALL=$CWD/$PRGNAM-$VERSION.tar.gz [ -e $CWD/$VERSION.tar.gz ] && TARBALL=$CWD/$VERSION.tar.gz YMMV on whether that's easier or harder to read. From hello at matthewgraybosch.com Tue Jun 9 19:16:02 2020 From: hello at matthewgraybosch.com (Matthew Graybosch) Date: Tue, 9 Jun 2020 15:16:02 -0400 Subject: [sbopkg-users] [SOLVED] Using sbopkg with Slackbuilds that pull tarballs from Github, Sourcehut, etc. In-Reply-To: References: <20200609140324.fba03297ccc8add6bc318c52@matthewgraybosch.com> Message-ID: <20200609151602.11faace381905f5dadfd65f7@matthewgraybosch.com> On Tue, 9 Jun 2020 14:24:27 -0400 B Watson wrote: > Hi, welcome to the mailing list. This ended up longer than I expected, > but hopefully it's helpful. Very much so. Thank you. > Another way to do it: > > if [ -e $CWD/$VERSION.tar.gz ]; then > TARBALL=$CWD/$VERSION.tar.gz > else > TARBALL=$CWD/$PRGNAM-$VERSION.tar.gz > fi > > tar xvf $TARBALL > cd $PRGNAM-$VERSION # etc etc. Hard to believe I didn't even think about adjusting my slackbuild. I'll probably start doing this for every slackbuild I write. Thanks again! -- Matthew Graybosch https://www.matthewgraybosch.com #include gemini://starbreaker.org Harrisburg,PA gemini://demifiend.org "Out of order?! Even in the future nothing works." From willysr at sbopkg.org Tue Jun 9 21:35:10 2020 From: willysr at sbopkg.org (Willy Sudiarto Raharjo) Date: Wed, 10 Jun 2020 04:35:10 +0700 Subject: [sbopkg-users] Using sbopkg with Slackbuilds that pull tarballs from Github, Sourcehut, etc. In-Reply-To: <20200609140324.fba03297ccc8add6bc318c52@matthewgraybosch.com> References: <20200609140324.fba03297ccc8add6bc318c52@matthewgraybosch.com> Message-ID: > Hi. I'm trying to test a new slackbuild using my local sbopkg > repository and running into a build failure. I think I know why it's > happening, but I'm trying to figure out how best to ensure it doesn't > happen before I submit my build to slackbuilds.org. > > My slackbuild gets its source from a Sourcehut release > tarball located at > . While > clicking the link to the tarball on > results in Firefox > downloading "castor-0.8.14.tar.gz", hitting the URL with wget results > in a download of "0.8.14.tar.gz", which causes the slackbuild to fail > because it's expecting "castor-0.8.14.tar.gz". > > Is this a problem I can safely resolve by adding "-o > ${NAME}-${VERSION}.tar.gz" to WGETFLAGS in sbopkg.conf, or is there a > better way to go about ensuring that the source file gets downloaded > ${NAME}-${VERSION}.tar.gz? > > Is this even something I should be worrying about when prepping a new > slackbuild for submission to slackbuilds.org? > > Thanks in advance. > > PS: I can provide a tarball for my castor slackbuild on request. > Likewise for my sbopkg.conf. I just didn't want my first post to the > list to contain unsolicited attachments. if you can mirror it on github (assuming you are using castor as project name and matthew as username), and then you can put it something like https://github.com/matthew/castor/archive/0.8.14/castor-0.8.14.tar.gz another way is modifying the SlackBuild to look for 2 tarball names possibilities like B. Watson said. -- Willy Sudiarto Raharjo -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From hello at matthewgraybosch.com Wed Jun 10 00:06:24 2020 From: hello at matthewgraybosch.com (Matthew Graybosch) Date: Tue, 9 Jun 2020 20:06:24 -0400 Subject: [sbopkg-users] [SOLVED] Using sbopkg with Slackbuilds that pull tarballs from Github, Sourcehut, etc. In-Reply-To: References: <20200609140324.fba03297ccc8add6bc318c52@matthewgraybosch.com> Message-ID: <20200609200624.5e054e9c96ddd3a445c603a7@matthewgraybosch.com> On Wed, 10 Jun 2020 04:35:10 +0700 Willy Sudiarto Raharjo wrote: > if you can mirror it on github (assuming you are using castor as > project name and matthew as username), and then you can put it > something like > https://github.com/matthew/castor/archive/0.8.14/castor-0.8.14.tar.gz Thanks, Willy. I had already tried out B. Watson's suggestion and found it satisfactory. -- Matthew Graybosch https://www.matthewgraybosch.com #include gemini://starbreaker.org Harrisburg,PA gemini://demifiend.org "Out of order?! Even in the future nothing works."