prevent install/upgrade of port dependency

I have come accross and posted threads about this problem many times, but have not as yet satisfactorily solved the issue. The problem mostly arises when building an aglomerated port (like gnome2, gnome-2-fifth-toe) which only serves to pull-in a series of other ports. The problem also persists when trying to upgrade or re-build the ports (portmaster -af)

As an example from my specific situation, gnome2-fifth-toe pulls in net/straw but the port is marked DEPRECIATED, while gnome2-power-tools pulls in thefish which is marked BROKEN. These ports break the install or re-build process.

I have found these 2 solutions, but they do not work in a consistent manner:
1. go to /var/db/pkg/port-name and
touch +IGNOREME
this did work for thefish but not for straw. I suspect this is due to the fact that when initially installing gnome2, as a work-around I had installed this port as a package (pkg_add) and this port therefore had a folder in db/pkg. However, the other port is not yet installed on the system and I manually created the folder for port-version and placed the +IGNOREME in there. This is probably why the trick did not work for straw.

2. Edit the Makefile - this does not work well, as you subsequently start getting pretty messages like:
Code:
pkg_info: the package info for package '[color="Purple"]xyz[/color]' is corrupt
[: -le: argument expected
[: -le: argument expected

I'm pretty sure there is a more elegant solution than just running portmaster -x with exclude flags; any update process which aborts and has to be re-started by adding -x flags until you have all the necessary excludes in place (iterative process) is foolish!
 
Solution:
The +IGNOREME method in /var/db/pkg/port-name works, but for ports not-yet installed or which you do not want installed, you must add a +CONTENTS file in the same folder. The file is prepared by first looking in the Makefile for the port and getting the portname + version number.

So as an example, +CONTENTS for straw would be placed in a folder named straw-0.27 and would consist of:
Code:
@comment PKG_FORMAT_REVISION:0.27
@name straw-0.27
@comment ORIGIN:net/straw
Place into the file corresponding information for the 3 lines about the port, you can (and should) leave all @depends variables blank, and there you have it - no more errors or "install missing port" requests

p.s: after you do this, run portmaster --check-depends
 
Messing with /var/db/pkg entries seems fragile and likely to cause problems down the road. What do the GNOME maintainers say about the broken and deprecated (no "i") ports? Are there PRs for the problems?
 
Back
Top