MacPorts: Install non-dependencies past error

macportssoftware-update

Introduction

At times, MacPorts fails to build something because of an error. Previously, @tyilo asked on AskDifferent how to ignore these error and continue installing the other ports (link). Although some answers suggested using the -p flag, MacPorts dev (@ClemensLang) said that this should not be done because it can mess up things later.

Fair enough: it makes sense to not ignore errors when building a package that depends on a failed update.

However, there are several packages that I imagine I could safely update because they do not depend on the package that failed to build. I expect that there is a way to update everything possible, but when an error is encountered, to skip that package and anything that depends on it.

For example

Suppose I have the following packages to update with the following dependencies:

  • apple depends on flower
  • tree depends on seed

Suppose that flower fails to update. Therefore, I should not use -p because it would continue trying to update apple and the others, and building apple based on a botched flower could cause problems.

I expect there should be a way such that if flower fails, MacPorts can ignore apple and flower, but continue building seed and tree.

Is there a "best-practice" way to approach this situation? If not, why not?

Best Answer

I suppose that you could do this-

sudo port -v upgrade outdated and not rdependentof:flower and not flower

Which says in english, upgrade outdated packages but not those dependent on flower and not flower

Of course you would do this after making a copy of the failed install log then cleaned the tmp location and tried to upgrade again,and if that failed then file a ticket.