I can't seem to install anything with MacPorts. Problems inevitably arise when MacPorts gets to the stage where it tries to apply patches. It croaks because apparently /usr/bin/patch
has a security patch that prevents itself from patching upwa开发者_运维百科rds in the directory tree. A typical error message:
:info:patch /usr/bin/patch: **** rejecting file name with ".." component: ../libunwind/include/libunwind.h
I see some various bug reports on this issue such as https://trac.macports.org/ticket/29871 and https://trac.macports.org/ticket/29813, but no real solutions.
Is there a patch to patch?
I do not use Macports (so I cannot test this possible solution), but perhaps you could try installing the GNU version of patch
. There is indeed a portfile for it within Macports. It installs as gpatch
, but you could easily create a symbolic link such that /opt/bin/patch -> /opt/bin/gpatch
. Additionally, you will need to ensure that /opt/bin
appears before /usr/bin
in your path.
Although the portfile requires a patch to be applied, it fortunately does not use any ..
path components.
It appears as though this security patch originated in February of 2011. As 2.6.1 predates this, I believe this method should work.
精彩评论