[SOLVED] sbopkg installs "original" SlackBuild to /usr/doc/<pkg>/ instead of "local" SlackBuild
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
So @willysr did you find the patch needed for the intel-microcode SBo or was there some error in sbopkg? If the slackbuild I'll want to "note" in my Howto install Intel microcode thread to use latest intel-microcode.SlackBuild or users of sbopkg should now rebuild. Cheers
It has been updated in the last public update, so all you need is to run sbopkg -r and you will get the latest intel-microcode
1) I've never had this issue with either hand modifying and executing a slackbuild (and specifically didn't happen with the intel-microcode 20171117 modified to 20180108) or modifying the slackbuild within the sbopkg "Edit Slackbuild" or "Edit Info" functions.
You'd only see this issue if you look at the /usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild after installing a Slackware package created by sbopkg using a SlackBuild you modified and see that your changes aren't there. I just looked at my htpc, which I had modified the SlackBuild for kodi to build 17.6 (instead of the 17.4 that was on the repo). Yet, when I grep that SlackBuild, the version shows 17.4.
2) Examined the sbopkg code and I don't see any function to "cat" anything to /usr/doc, the slackbuild package does that function. Which is why a hand processed slackbuild will leave the correct files in /usr/doc just as using sbopkg does.
You're correct, the copying of the SlackBuild is not a function of sbopkg, but of the SlackBuild. Per SBo templates, SlackBuilds should contain the following line:
However, you're wrong in that a modified SlackBuild using sbopkg will leave the correct file. When you customize a SlackBuild, sbopkg doesn't overwrite the original file. That remains in place untouched. So, sbopkg adds .sbopkg to the modified file, so it reads $PRGNAM.SlackBuild.sbopkg. so when the SlackBuild is run, it copies the original SlackBuild to /usr/doc, not the modified SlackBuild. Have a look at the pick_file function for more info.
Quote:
Originally Posted by bamunds
3) sbopkg already recognizes that it has an original file and with original or modified it creates a package name to build using the .build extension. Then in both the process_package and build_package steps it will remove the .build in cleanup statements. This commit will eliminate that extension and cause a new issue, no cleanup in the process_package process of sbopkg.
It actually doesn't eliminate it since it just uses a copy when it creates the $PKGNAM.SlackBuild from PKGNAM.SlackBuild.build. And the cleanup still occurs without issue since the $PRGNAM.SlackBuild.original is mv'd over $PRGNAM.SlackBuild, so the only thing remaining that needs to be removed is $PRGNAM.SlackBuild.build, which is done during the cleanup
Quote:
Originally Posted by bamunds
My concern is that this modification will cause new issues for a corner case that probably should not have been done in the first place.
Out of curiosity, do you consider ensuring the SlackBuilds used to build the package are stored in /usr/doc/$PRGNAM-$VERSION a corner case? Not really relevant to the discussion, just curious.
Quote:
Originally Posted by bamunds
If I've put foot in mouth because of ignorance for reading code, I accept that I look foolish now. But that's how we learn....:-) Cheers.
And no worries on looking foolish, this is a lot of code to go through and I've spent probably more than 30 minutes digging through it all for my response (which I should've spent on my kitchen remodel).
I'm wondering when the patch is going to be made available to Slackware64-14.2? I ran sbopkg today and it is telling me the 0.38.1 is installed and latest.
Can I locally rebuild and apply the patch to the 14.2 version or are other issues introduced for stable's version?
Why sequester a patch that addresses a bug in the stable branch of SBo and Slackware?
Can I locally rebuild and apply the patch to the 14.2 version or are other issues introduced for stable's version?
Why don't you try it out? To my eyes, this commit looks to be the only change that you'll have to undo to run on 14.2. But you should be checking /etc/sbopkg/sbopkg.conf on any upgrade, anyway, so you should spot that if you decide to upgrade. Just make sure you change the REPO_BRANCH back to 14.2.
For what it's worth, my sbopkg is 0.38.1 plus this patch to /usr/sbin/sbopkg.
I don't want to speak for willysr, but I don't see any major bug fixes since 0.38.1 that warrant another release of sbopkg before Slackware 15.0 is released. But I am looking forward to the next release with all the new features that have been added!
Thanks, @willysr do you agree that simply applying the original patch listed in this thread is all that is needed for 14.2 and it won't break anything else? If possible, can I simply correct the sbopkg lines directly and not even rebuild?
Thanks, @willysr do you agree that simply applying the original patch listed in this thread is all that is needed for 14.2 and it won't break anything else? If possible, can I simply correct the sbopkg lines directly and not even rebuild?
Rebuilding is only required if a binary is produced. sbopkg is just a script, so it can be edited without issue.
Here's a quick run-through of what you'd need to do if you want to use the patch file rather than editing the script manually. First you'd need to download the patch (which I'm renaming to sbopkg.patch to simplify), then remove the lines editing the changelog and THANKS files (since they won't reside in the correct directory structure), which I'm doing with a sed command, then apply the patch.
Code:
su -
wget https://github.com/sbopkg/sbopkg/commit/371284cd8972641ece61957a76fe5629651e6c6a.patch -O sbopkg.patch
sed -i '1,56d;91,112d' sbopkg.patch
cd /usr/sbin
patch -p4 < ~/sbopkg.patch
Last edited by bassmadrigal; 01-19-2018 at 05:16 PM.
Reason: Add the home directory for the patch file
su -
wget https://github.com/sbopkg/sbopkg/commit/371284cd8972641ece61957a76fe5629651e6c6a.patch -O sbopkg.patch
sed -i '1,56d;91,112d' sbopkg.patch
cd /usr/sbin
patch -p4 < sbopkg.patch
Are the lines which you sed to add and replace do they line up with the sbopkg version 38.1 for 14.2? Otherwise I was thinking of simply looking at the commit on git and applying the changes at the proper points in the script I have using emacs as the editor. Thanks
Are the lines which you sed to add and replace do they line up with the sbopkg version 38.1 for 14.2? Otherwise I was thinking of simply looking at the commit on git and applying the changes at the proper points in the script I have using emacs as the editor. Thanks
Yes, this works perfectly for 14.2. The lines I use sed to remove are actually related to updating the THANKS and changelog files. The only reason I removed them is because the files aren't in the same location in the package as they are in the source, so the when running patch, it would complain it couldn't find them and then ask you where they are. I figured that was too much work, so it was easier to just not have those two files edited.
The patch lines doesn't match up exactly, but the patch program is smart enough to offset the line numbers to match what's in the latest stable binary. You'll see the following output stating it had to adjust 16 lines for each bit of code, but it still applies fine
Code:
patching file sbopkg
Hunk #1 succeeded at 3396 (offset -16 lines).
Hunk #2 succeeded at 3461 (offset -16 lines).
Hunk #3 succeeded at 3486 (offset -16 lines).
OK, thanks, I still have great respect for your ongoing support and help to all the users here. Even if we sometimes have differing opinions.
No worries. I figure with how much I'm on this forum and post that I'll have differing opinions with people, but I'm here to help people. The other discussions, while I usually do somewhat enjoy them, are not my primary focus on here. And I have no problem still helping people even if we have differing opinions
Quote:
Originally Posted by bamunds
For anyone else following this thread the last command needs the sbopatch file location prepended.
../usr/sbin# patch -p4 < /{folder where sbopkg.patch is located]/sbopkg.patch
It did work and the results where as you stated.
Whoops! My bad. That's what I get for typing without testing (although, I did test the patch on a local sbopkg script so I knew it worked). I added the location in the previous post so now it should be:
Code:
patch -p4 < ~/sbopkg.patch
That should work if you copy and paste all the commands, otherwise you might need to be a bit more specific with the location.
Quote:
Originally Posted by bamunds
How did the kitchen remodel go?
It went great and we're pretty happy with it. Thanks for asking
Glad to hear the kitchen went well. Hopefully it wasn't too cool for the final painting, or wallpaper, or if really extensive..exterior alerations. Cheers.
Thanks, @willysr do you agree that simply applying the original patch listed in this thread is all that is needed for 14.2 and it won't break anything else? If possible, can I simply correct the sbopkg lines directly and not even rebuild?
Yes, that patch is all you need to apply to fix the issue, although the one is master looks more interesting
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.