port -u upgrade outdated

Thomas De Contes d.l.tDeContes at free.fr
Thu Oct 4 06:21:56 PDT 2007


Le 4 oct. 07 à 03:23, Daniel J. Luke a écrit :

> On Oct 3, 2007, at 9:19 PM, Paul Phillips wrote:
>> On Thu, Oct 04, 2007 at 01:54:43AM +0200, Thomas De Contes wrote:
>>>  there is still a minor problem : waste of disk space
>>>  since each old version remains on the disk, whereas they are  
>>> completely
>>>  useless :-/
>>>
>>>  do you see what i mean ?
>>
>> I deal with this by running this inelegant alias once in a while:
>>
>>   alias portclean="sudo port installed|grep -v active|grep -v
>>   following|xargs -L 1 sudo port -f uninstall"
>>
>> It uninstalls all inactive ports.  Don't use it if that's not what  
>> you want.
>
> Why not just:
>
> sudo port -f uninstall inactive
>
> ?

ok :-))


port -u uninstall
is equvalent to
port uninstall inactive
?

port -u upgrade anything
is equvalent to
port upgrade anything
port uninstall inactive
am I right ?


so,

port -u upgrade outdated
doesn't works because it needs -f to uninstall

port -fu upgrade outdated
is not fine, because with upgrade it rebuilds all dependencies, so it  
needs -n to build only outdated

port -nfu upgrade outdated
doesn't works because the upgrade is not done in the right  
order ... :-( !

but,
we can split it in 2 commands :
port upgrade outdated
port -fu uninstall
:-)
(am I right ?)



well, there is still a problem :
what if i manually deactivate a port which have dependents, before  
run this ?

in fact, why is it not possible to uninstall a port which have  
dependents after it was upgraded, without -f ?
the dependents should depend on the new version, aren't they ?

would it be possible to improve macports to allow that ?


if it's not possible, i have an idea :-)

is it possible to store the output of "port echo inactive" to use it  
later ?

if yes, i think i could make my script like :

port echo inactive > somewhere
port activate inactive
port upgrade outdated
port -fu uninstall
port deactivate < somewhere

what do you think about it ? :-)
how to do that ?



-- 
j'agis contre l'assistanat, je travaille dans une SCOP !





More information about the macports-users mailing list