Changes between Version 62 and Version 63 of FAQ


Ignore:
Timestamp:
Mar 27, 2009, 1:48:59 AM (15 years ago)
Author:
blb@…
Comment:

Add info on using force option

Legend:

Unmodified
Added
Removed
Modified
  • FAQ

    v62 v63  
    188188Using separate ports for these modules (like py25-readline) avoids the need to completely rebuild the base port, and can be used as a dependency, but ends up having other issues.  One is that these modules are installed using the standard distutils method for python, which causes them to be installed in a different location than where they would be when installed normally (see ticket #12369).  The other is that many python developers have expectations when they install python, and installing python24 or python25 simply does not match that.
    189189
     190=== When should I use the force option (-f) === #whentoforce
     191
     192Use of the force option (-f) is rarely necessary, but some suggestions in the past have recommended its use quite frequently.  One of the few useful applications of it is in forcing a reinstall of an already-installed port to add a new variant, for example
     193{{{
     194sudo port -fn upgrade mysql5 +server
     195}}}
     196will install a new version of the mysql5 port with the current variants plus +server.  Note the use of the -n (don't follow dependencies) option, which is important in this case (otherwise ports depended on by mysql5 will be upgraded as well even when it isn't needed).
     197
     198One of the other times -f is needed is when you run into a stray file in your MacPorts prefix, not owned by a port, but blocks the install of one.  This is seen with an error message from port similar to
     199{{{
     200Error: Activating some-port @1.0_0 failed: Image error: /opt/local/path/to/stray/file already exists and does not belong to a registered port.  Unable to activate port some-port.
     201}}}
     202Unless you know the source of that file and that you need to keep it, this is a good use of force.  However, don't use it with '''install''' but with activate:
     203{{{
     204sudo port -f activate some-port
     205}}}
     206Outside of `-fn upgrade` and `-f activate` force can be extremely dangerous, and should be avoided unless you know precisely how port is going to act.
     207
    190208== Portfile Development and Maintenance Questions ==
    191209