port -u upgrade outdated

Emmanuel Hainry ehainry at free.fr
Thu Oct 4 13:44:11 PDT 2007


Citando Thomas De Contes :
>
> 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 ... :-( !
>

I must be misunderstanding what you want to achieve. I thought you
wanted a script that updates all your outdated ports and does not leave
inactive. In this case, there is no reason to use the -n flag : you want
the dependencies to be updated too if they are outdated, don't you? (Or
else why do you upgrade all outdated ports?)

Then, I would do:

While there exist an outdated port, 
do
	let foo be an outdated port,
	'port update foo'
loop
port -f uninstall inactive

Everything will have been updated in the good order, nothing will have
been built twice, the only argument against this I see is that it will
run port outdated a big number of times (and of course that some ports
depending on updated ones will be broken, which is why port update does
not uninstall by default in the first place...).


Emmanuel



More information about the macports-users mailing list