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.
I wrote this rather silly script a few days ago; it will display distfiles that are most likely outdated. It does not remove them, one could pipe its output to xargs, though. I wrote this for my own build tool, but thought that a sbopkg version would be useful as well.
do you know of the sbopkg's command line option "-o"?
Code:
-o List the currently installed cached source files which are deemed obsolete,
and optionally delete them.
Source files are obsolete when no .info file's DOWNLOAD field(s) reference it
any more, which is something that can happen after syncing the local repository.
Please note that only the currently active repository is used to identify the
obsolete sources, so if the user builds packages with different repositories
(e.g., for different Slackware versions) the source files only used in the
``other'' repository will be listed.
Oops, no, I wasn't aware of that option, should have looked closer at sbopkg, I guess; now I made a fool out of myself. Please disregard this then, sorry!
Oops, no, I wasn't aware of that option, should have looked closer at sbopkg, I guess; now I made a fool out of myself. Please disregard this then, sorry!
You should compare the script that you wrote with the way that sbopkg does it. Maybe your way is better. If it isn't, you'll learn something from comparing what you did with what they did.
You should compare the script that you wrote with the way that sbopkg does it. Maybe your way is better. If it isn't, you'll learn something from comparing what you did with what they did.
Yes, I had a look at the code, and I don't think my script is any better. sbopkg's code is very well-written and it gave me some ideas, quoting the paths might be a good idea (though I sometimes have trouble understanding some of it as I'm only a beginner when it comes to shell programming and those kinds of things ...). As bormant wrote, sbopkg even has a dialog interface for this (and a progress bar). (From what I understand, sbopkg reads every .info file, while my script iterates over every SBo package installed. This would mean that the sources of a package that is no longer installed would be displayed as obsolete by my script.) Oh well, at least I had some exercise.
From my own amateur's perspective I thought the script was a worthy effort.
Thank you, gezley. I did learn quite a bit about shell programming and its commands by writing my own package manager and SlackBuilds.org build tool during the last two years. (I hope someday I might be able to learn a real scripting language like python, perl or ruby.)
Last edited by lems; 07-05-2015 at 08:08 AM.
Reason: typo
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.