[Slackbuilds-users] Automating re-compilation of all packages

Eric Pratt eric.b.pratt at gmail.com
Sun Aug 20 17:18:25 UTC 2017

On Sun, Aug 20, 2017 at 8:57 AM, Rich Shepard <rshepard at appl-ecosys.com>

>   I've just upgraded my desktop server/workstation from 14.1 to 14.2. I
> have
> 180 SBo packages installed and all (except postfix which I upgraded to get
> mail working again) need to be recompiled with the new libraries. This is
> separate from upgrading already installed packages using sbopkg ... I
> think.
>   Has anyone written a script that will go through each directory tree
> (e.g., Databases/, Developent/, GIS/) and recompile each package in there?

​I have not done this.  But here's a quick and dirty that should do the job
for you:

for i in $(find /var/log/packages -name *SBo -exec basename {} \; | sed -E
's/-(x86_64|i586|noarch).*// ' | sed 's/-[0-9._]*$//'); do sbopkg -e
continue -Bi; done

This finds all SBo packages installed on your system according to
/var/log/packages and strips all but the package names themselves out of
the results.​  You can see the package names it finds by replacing the
sbopkg command with an echo:

for i in $(find /var/log/packages -name *SBo -exec basename {} \; | sed -E
's/-(x86_64|i586|noarch).*// ' | sed 's/-[0-9._]*$//'); do echo $i; done

I have only tested it up to this point.  I didn't actually run sbopkg
because I'm about to head out for the rest of the day.  But the sbopkg
command included in the original one should download all newer versions
than you have installed and rebuild them.  It will not skip existing
versions so if you already have the latest version, it should not download
it but still rebuild from source.  If for some reason you want to skip
existing packages of the same version, add a '-k' option to the sbopkg

There are some unknowns here for me.  I don't upgrade Slackware in place.
I have always reinstalled from scratch so I don't know how sbopkg handles
this.  It's possible it will decide that since you are now looking at a
different repository that all of your packages are out of date even if you
have the same versions installed for some of them.  This would actually not
be a bad thing since there have been some changes to the standard
conventions in the 14.2 scripts over the 14.1 scripts.  Besides, the bulk
of the time in this is going to be from rebuilding, not downloading.
Unless there is a bandwidth cap issue, re-downloading all slackbuilds would
probably be the best way to go.

Also, I'm assuming you have already updated sbopkg to the latest version,
reconfigured sbopkg for 14.2, and run "sbopkg -r" before running this
script.  What I put together will not do any of this for you.  It will only
use your sbopkg installation as it is to download, build, and install

Feel free to give it a shot.  If you do, please let us know how it works

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20170820/c6078521/attachment-0001.html>

More information about the SlackBuilds-users mailing list