Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Say I have the following outdated packages:

  • foo
  • bar
  • baz

I want to update as many as them as possible, so I try to run:

sudo port -n -f upgrade outdated

However this fails with:

Error: org.macports.build for port foo returned: command execution failed
Please see the log file for port foo for details: ...

How can I make macports try to upgrade bar and baz, if foo fails?

I would like to generally make macports try to install/upgrade other ports if installing/upgrading some of them fails and just continue.


From the man page:

 -f       force mode (ignore state file)

 

 -n       don't upgrade dependencies (affects upgrade and install)

Edit: foo, bar & baz, are 3 total unrelated ports, that doesn't depend on each other in any way.


Edit 2: Next time I run this the outdated ports might be a, b & c, instead of foo, bar & baz, so I can't hardcode the failing ones and I can't just do:

sudo port update foo
sudo port update bar
sudo port update baz
share|improve this question

4 Answers 4

up vote 5 down vote accepted

The -p seems to work for me.

From the manpage:

-p       Despite any errors encountered, proceed to process multiple
         ports and commands.
share|improve this answer

MacPorts dev here; the correct answer to your question is: you don't.

There is a reason why MacPorts doesn't attempt to install a package when a dependency fails to build.

This exact question has been discussed on the macports-users mailing list not so long ago:

share|improve this answer
    
foo, bar & baz, are 3 total unrelated ports, that doesn't depend on each other in any way. –  Tyilo Oct 6 '12 at 12:36
    
In that case you can always update them manually, i.e. sudo port upgrade baz, sudo port upgrade bar, sudo port upgrade foo. –  Clemens Lang Oct 6 '12 at 15:55
    
see "edit 2" in question. –  Tyilo Oct 6 '12 at 20:27

You can also specify "outdated and not foo" in the upgrade command, rather than just "outdated".

share|improve this answer
    
see "edit 2" in question. –  Tyilo Oct 6 '12 at 20:28

Considering an old closed ticket, a defect that was fixed:

333 (dependancy failure are ignored and port continues to try and install) – MacPorts

If I understand correctly: to continue following a failure may, in some cases, be defective.

In other words:

  • it's proper (least risky) to not continue.

Postscript: I was too lazy to read the man page in its entirety (not found by the Help menu of Terminal, but that's no excuse). Following advice from someone in irc://irc.freenode.net/#macports I decided to leave this answer.

enter image description here

I never realised the -p option. Thanks to Tyilo.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.