I maintain a plan9port package for Alpine Linux. For this package, plan9port is installed to /usr/lib/plan9 not /usr/local/plan9 in order to comply with our packaging policy. Doing so is supported by plan9port via the PLAN9_TARGET environment variable and the ./INSTALL -r flag. The installation script replaces hardcoded references to /usr/local/plan9 with PLAN9_TARGET in various files via the ./lib/moveplan9.sh script.
A few days ago I was made aware that moveplan9.sh does not replace hardcoded references to /usr/local/plan9 in C source code files since it is invoked after the code has been compiled. The following files have been identified to contain such hardcoded paths:
src/lib9/get9root.c
src/cmd/sam/sam.c
src/cmd/upas/nfs/imap.c
As such, the affected code in these files does not work correctly if plan9port is installed to /usr/lib/plan9. For example, get9root does not work if $PLAN9 is not set (e.g. in a rc(1) login shell). This pull request fixes get9root by falling back to the configured PLAN9_TARGET via a CPP define instead of hardcoding /usr/local/plan9 in get9root.c. The remaining two files have been fixed by either using get9root (sam.c) or using the PLAN9_TARGET CPP define as well (imap.c).
Would be nice to get this merged in order to ease packaging plan9port for Linux distributions.
I maintain a plan9port package for Alpine Linux. For this package, plan9port is installed to
/usr/lib/plan9
not/usr/local/plan9
in order to comply with our packaging policy. Doing so is supported by plan9port via thePLAN9_TARGET
environment variable and the./INSTALL
-r flag. The installation script replaces hardcoded references to/usr/local/plan9
withPLAN9_TARGET
in various files via the./lib/moveplan9.sh
script.A few days ago I was made aware that moveplan9.sh does not replace hardcoded references to
/usr/local/plan9
in C source code files since it is invoked after the code has been compiled. The following files have been identified to contain such hardcoded paths:src/lib9/get9root.c
src/cmd/sam/sam.c
src/cmd/upas/nfs/imap.c
As such, the affected code in these files does not work correctly if plan9port is installed to
/usr/lib/plan9
. For example, get9root does not work if$PLAN9
is not set (e.g. in a rc(1) login shell). This pull request fixes get9root by falling back to the configuredPLAN9_TARGET
via a CPP define instead of hardcoding/usr/local/plan9
inget9root.c
. The remaining two files have been fixed by either using get9root (sam.c
) or using thePLAN9_TARGET
CPP define as well (imap.c
).Would be nice to get this merged in order to ease packaging plan9port for Linux distributions.