I’ve been working on updating the pkgsrc package for pike8.0 and ran into a problem (that I think I’ve seen before). The installation process uses a fake root to install pike into a temporary location before packaging that directory up. The problem occurs when pike is already installed into the destination location (minus the fake root). So, the prefix might be /opt/local, and the fake installation root might be /tmp/pkgsrc/.dest/, with files being installed into /tmp/pkgsrc/.dest/opt/local/….
The problem seems to be that in bin/install.pike, fix_smartlink() is called to prep and install a few files like specs and friends. fix_smartlink() then calls compare_to_file() to make sure a duplicate file isn’t being written, but it doesn’t apply the fake root prefix, so it sees the file already installed in the real install location and as a result skips writing the file into the temporary packaging directory. Then some minor mayhem ensues and the packaging process fails. I suspect this isn’t pkgsrc specific, though other packaging systems might use other approaches that avoid this problem (maybe a chroot somewhere)?
I _think_ this is a minor oversight and that changing
if(compare_to_file(data, dest)) {
To
if(compare_to_file(data, fakeroot(dest))) {
Will fix the problem without negative side effects. However, I’d like to get the okay before I make that change.
Any thoughts?
Thanks in advance!
Bill