[Slackbuilds-users] Dependency cleanup after package removal

Erich Ritz erich.public at protonmail.com
Mon Jun 22 20:26:48 UTC 2020

Hi Dominik,

I use queue files with sbopkg.  All my top-level packages I put in a queue file called "all.sqf".  I don't use "all.sqf" to build anything; it's just self documentation.  When removing a package, I simply go through its dependencies and grep for each package name:
grep B *.sqf
If the only match is the just-removed package (and of course B.sqf itself) then I know it's safe to remove.  Because I use "all.sqf", all installed packages should appear in at least 2 .sqf files (including the package's own .sqf file).  For dependencies I never refer directly to a package; I always refer to its .sqf file.

Not automated, but efficient enough for me.

Sometimes instead of deleting an *.sqf file I'll move it to *.unused.sqf so I'll know what I've used in the past.

For example, here's SDL2_mixer.sqf:

And here's SDL2.sqf:

(Note even though SDL2 doesn't have any dependencies, SDL2_mixer.sqf refers to SDL2.sqf instead of the SDL2 package directly).


(Minor implementation detail: I have 2 machines so actually I have all_common.sqf, all_machineA.sqf, and all_machineB.sqf)

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Monday, June 22, 2020 12:56 PM, Dominik Drobek <dominik.drobek at o2.pl> wrote:

> Hi,
> I was wondering how do people manage dependency cleanup when
> uninstalling SBo packages?
> Suppose the user first installs package A what depends on packages X, Y
> and Z (all from SBo). Later the user installs package B that depends on
> Y, and finally installs C that depends on X.
> When A is removed, then Z is clearly not needed anymore. This is easy to
> figure out in this simple example, but when ~200 SBo packages are
> installed in the system it's not straightforward.
> Is there any tool for automatic detection of such "orphaned"
> dependencies that can be safely removed?
> Regards,
> Dominik
> SlackBuilds-users mailing list
> SlackBuilds-users at slackbuilds.org
> https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
> Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
> FAQ - https://slackbuilds.org/faq/

More information about the SlackBuilds-users mailing list