LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-03-2015, 07:04 AM   #1
lems
Member
 
Registered: May 2004
Distribution: BSD
Posts: 269

Rep: Reputation: 119Reputation: 119
Script to display obsolete distfiles (sbopkg)


Hello,

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.

Here it is:
https://gist.github.com/1ems/80e82c42bfbca70280cd
 
Old 07-03-2015, 07:10 AM   #2
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,096

Rep: Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173
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.
 
2 members found this post helpful.
Old 07-03-2015, 08:27 AM   #3
lems
Member
 
Registered: May 2004
Distribution: BSD
Posts: 269

Original Poster
Rep: Reputation: 119Reputation: 119
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!
 
Old 07-03-2015, 08:39 AM   #4
bormant
Member
 
Registered: Jan 2008
Posts: 426

Rep: Reputation: 240Reputation: 240Reputation: 240
sbopkg has an interactive mode menu command too: Utilities -> Obsoleted sources.
 
Old 07-03-2015, 10:33 PM   #5
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by lems View Post
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.
 
Old 07-04-2015, 12:20 AM   #6
lems
Member
 
Registered: May 2004
Distribution: BSD
Posts: 269

Original Poster
Rep: Reputation: 119Reputation: 119
Quote:
Originally Posted by Richard Cranium View Post
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.

Last edited by lems; 07-04-2015 at 12:25 AM.
 
1 members found this post helpful.
Old 07-04-2015, 02:01 PM   #7
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Leinster, IE
Distribution: Slackware, NetBSD
Posts: 2,177

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
Quote:
Originally Posted by lems View Post
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 ...
From my own amateur's perspective I thought the script was a worthy effort.
 
Old 07-05-2015, 07:47 AM   #8
lems
Member
 
Registered: May 2004
Distribution: BSD
Posts: 269

Original Poster
Rep: Reputation: 119Reputation: 119
Quote:
Originally Posted by gezley View Post
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] change a build script from sbopkg localy a4z Slackware 4 06-11-2015 01:35 PM
getting distfiles for offline installation. mimithebrain Linux - Distributions 19 05-08-2014 06:51 AM
SBOPKG errors viewing obsolete source cache vdemuth Slackware 1 04-10-2010 12:28 PM
Can't clean Distfiles Frank Soranno *BSD 3 02-07-2007 10:42 AM
gentoo sound, and distfiles pauloref Linux - Newbie 19 10-10-2004 04:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration