Error: No ports matched the given expression

Thomas De Contes d.l.tDeContes at free.fr
Thu Feb 25 06:37:34 PST 2010


Le 25 févr. 10 à 14:07, Joshua Root a écrit :

> On 2010-2-25 22:47 , Thomas De Contes wrote:
>> hi :-)
>>
>>
>> + port -u upgrade outdated
>> Error: No ports matched the given expression
>> + exit 1
>>
>> i would like to keep "|| exit" because sometimes it doesn't  
>> success to
>> upgrade
>> could you make port to not give an error code when there are no  
>> ports to
>> manage, please ? :-)
>
> Not really. Internally it's no different to specifying something like
> port upgrade installed and name:thisportdoesnotexist

i'm not sure to understand

do you said that if i type
port upgrade installed and name:thisportdoesnotexist
it gives
Error: No ports matched the given expression
(like "port -u upgrade outdated"), and that it's true ?

"installed and name:thisportdoesnotexist" is a valid expression which  
results in no port,
so i expect that port upgrade understand that it has no port to  
upgrade this time, but not give an error code
i find that there is no good reason to not give an error code, since  
the given expression is valid ...


>
> Check port outdated first.


do you mean that i should do
port outdated && port -u upgrade outdated || exit "$?"
?

it doesn't works, because port outdated doesn't give an error code

moreover,
$ port installed and name:thisportdoesnotexist && echo n
+ port installed and name:thisportdoesnotexist
None of the specified ports are installed.
+ echo n
n


-- 
Téléassistance / Télémaintenance
http://www.portparallele.com/ThomasDECONTES/



More information about the macports-users mailing list