Removing obsolete distfiles but keeping current ones

Ryan Schmidt ryandesign at macports.org
Tue Nov 18 15:52:53 PST 2008


On Nov 18, 2008, at 17:39, Michael Glauser wrote:

> On Nov 18, 2008, at 3:09 PM, Ryan Schmidt wrote:
>
>> On Nov 18, 2008, at 10:33, Michael Glauser wrote:
>>
>>> What would be the correct way to request something:
>>> "port -f uninstall inactive"
>>> would also clean out old dist ([port].tar.bz2) files?
>>> Seems like there is an ever growing mess there.
>>
>> You can clean out all of a port's distfiles with
>>
>> 	sudo port clean --dist [port]
>>
>> Or even all of all ports' distfiles with
>>
>> 	sudo port clean --dist all
>>
>> But there isn't a way to clean out only old distfiles and keep  
>> current distfiles. I'm in need of that right now. That makes two  
>> of us already. I'll send this message to macports-users where we  
>> can have a little discussion about it. :) (Please subscribe if  
>> you're not on the list, and Reply-All if you reply).
>>
>> This feature would be a good addition to base. How should it work?  
>> It would probably be a new switch to port clean. If so what would  
>> we call it? port clean --olddist? Do we have a ticket for this  
>> already? I'm sure I remember the request coming up before.
>
> I didn't know about the --dist switch, so THANK YOU!
>
> Old Ticket: I just registered so one wouldn't have come from me.

I know; I meant that for others on macports-users to consider and  
respond to. Let's keep the discussion there, so others can contribute  
to it, so please Reply All when you reply.


> sudo port clean --inactive-dist
> would seem to fit current nomenclature but --olddist works too.

"inactive" has an existing meaning in MacPorts: a port which is  
installed but not active. So I would avoid overloading the meaning of  
"inactive" for removing obsolete distfiles.


> I would like to propose that:
> sudo port -f uninstall inactive
> would automatically do:
> 	port clean  --inactive-dist
>
> It seems to me that when you want to clean out the junk, get the  
> big broom and save time.
> Use a switch like --keep-inactive-dist to prevent removing old dist  
> files if that is a concern.
> Just make the default to do the heavy lifting.
> It would keep us dummies from spending so much time hunting.

Hmm. You're asking specifically for "uninstall inactive" to remove  
obsolete distfiles, but no other "uninstall" action would do so?  
That's not going to be easy, and sounds confusing. You see, first  
port expands pseudoports like "inactive" into a list of real port  
names. Then it hands that to the verb, "uninstall" in this case. So  
probably by the time the uninstall procedure runs, it doesn't know  
whether you used the "inactive" pseudoport or listed a bunch of ports  
individually.

I rarely if ever run "port uninstall inactive". I have one or two  
inactive ports that I want to keep, to be able to switch back to  
them. But I might still like to be able to clean up the distfiles of  
old versions of ports that are no longer installed.

So I would not be in favor of bundling these tasks together. I'd  
prefer a separate command to clean out old distfiles when asked.



More information about the macports-users mailing list