Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.15

Bug #11657 Installer generate bad "dirtree" using INSTALL_ROOT
Submitted: 2007-07-21 11:05 UTC
From: remicollet Assigned: remicollet
Status: Closed Package: PEAR (version 1.6.1)
PHP Version: 5.2.3 OS: Linux (Fedora)
Roadmaps: 1.6.2    
Subscription  


 [2007-07-21 11:05 UTC] remicollet (Remi Collet)
Description: ------------ When installing with INSTALL-ROOT option, Installer generates bad path in <package>.reg dirtree. in _installFile2 : $this->addFileOperation("installed_as", array($file, $installed_as, $save_destdir, dirname(substr($dest_file, strlen($save_destdir))))); "dest_file" is relative to INSTALL_ROOT while "save_destdir" isn't. So substring doesn't return the expected result should use "installed_as" (not relative). $this->addFileOperation("installed_as", array($file, $save_destdir, dirname(substr($installed_as, strlen($save_destdir))))); As in _installFile Join patch sould solve this minor issue. Test script: --------------- cd /usr/share/pear/.registry php -r "print_r(unserialize(file_get_contents('pear.reg')));" Expected result: ---------------- (extract) ... [dirtree] => Array ( [/usr/share/pear/OS] => 1 [/usr/share/pear/PEAR/ChannelFile] => 1 [/usr/share/pear/PEAR] => 1 [/usr/share/pear/PEAR/Command] => 1 ... Actual result: -------------- (extract) ... [dirtree] => Array ( [/usr/share/pear/OS] => 1 [/usr/share/pearar-1.6.1-1.fc8-root-extras/usr/share/pear/OS] => 1 [/usr/share/pearar-1.6.1-1.fc8-root-extras/usr/share/pear] => 1 [/usr/share/pearar-1.6.1-1.fc8-root-extras/usr/share] => 1 [/usr/share/pearar-1.6.1-1.fc8-root-extras/usr] => 1 [/usr/share/pearar-1.6.1-1.fc8-root-extras] => 1 [/usr/share/pear/PEAR/ChannelFile] => 1 [/usr/share/pearar-1.6.1-1.fc8-root-extras/usr/share/pear/PEAR/ChannelFile] => 1 [/usr/share/pearar-1.6.1-1.fc8-root-extras/usr/share/pear/PEAR] => 1 [/usr/share/pear/PEAR/Command] => 1 ...

Comments

 [2007-07-21 11:16 UTC] remicollet (Remi Collet)
> "dest_file" is relative to INSTALL_ROOT while "save_destdir" isn't. Bug redaction error, sorry. "dest_file" contains INSTALL_ROOT "save_destdir" and "installed_as" doesn't (are relative). Remi
 [2007-08-18 21:50 UTC] cellog (Greg Beaver)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. nice work remicollet! You're hired!