It's possible to tell MacPorts to install a port with any arbitrary subport name, for example:
$ sudo port install zlib subport=foo
Password:
---> Fetching distfiles for foo
---> Verifying checksum(s) for foo
---> Extracting foo
---> Configuring foo
---> Building foo
---> Staging foo into destroot
---> Installing foo @1.2.7_0
---> Activating foo @1.2.7_0
Error: org.macports.activate for port foo returned: Image error: /opt/local/include/zconf.h is being used by the active zlib port. Please deactivate this port first, or use 'port -f activate foo' to force the activation.
Please see the log file for port foo for details:
/opt/local/var/macports/logs/_Users_rschmidt_macports_dports_archivers_zlib/foo/main.log
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
Error: Processing of port zlib failed
You could even impersonate one port with another:
$ sudo port install zlib subport=expat
---> Fetching distfiles for expat
---> Verifying checksum(s) for expat
---> Extracting expat
---> Configuring expat
---> Building expat
---> Staging expat into destroot
---> Installing expat @1.2.7_0
---> Deactivating expat @2.1.0_0
---> Activating expat @1.2.7_0
Error: org.macports.activate for port expat returned: Image error: /opt/local/include/zconf.h is being used by the active zlib port. Please deactivate this port first, or use 'port -f activate expat' to force the activation.
Please see the log file for port expat for details:
/opt/local/var/macports/logs/_Users_rschmidt_macports_dports_archivers_zlib/expat/main.log
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
Error: Processing of port zlib failed
Obviously this only results in problems and MacPorts should prevent it. Expected result:
$ sudo port install zlib subport=foo
Error: port zlib does not have a subport foo
Cc Me!