问题
I would like to know how to either ignore upgrading certain ports or unmark them as "outdated".
This is motivated by certain ports failing to upgrade, while I wish to upgrade all the rest. I know about sudo port install -n
, which allows one to install a port without upgrading port dependencies, as in the case of mongodb
requiring an older (not the current) version of theboost
libraries, but this is not applicable here.
For example:
$ sudo port list outdated
gdb @7.5 devel/gdb
py27-scikits-image @0.7.1 python/py-scikits-image
As gdb@7.5
fails to update, I would just like to upgrade the others, ie. py27-scikits-image
, without going thru the whole sudo port list outdated | awk '{print $1}' | grep -v gdb | xargs sudo port upgrade
pipeline.
Much appreciated.
回答1:
I would advise to create a local portfile for gdb with a lower version number.
- Create a local portfile repository: howto
- Copy the gdb portfile directory (a directory called "gdb" containing the file "Portfile" and directory "files") into your local portfile repository
- Change the version number in the portfile to e.g. 0.0
- Run
portindex
in your local portfile repository
The local portfile overrides the one downloaded from the default port repository. The low version number makes macports think your version of gdb is up to date.
I hope this can help.
BTW: you can do sudo port upgrade outdated and not gdb
来源:https://stackoverflow.com/questions/12945589/how-do-i-ignore-unmark-certain-ports