From: Martin Jansen Date: Sun, 21 Apr 2002 06:17:53 +0000 (+0000) Subject: * Remove package directory if empty during uninstall process X-Git-Tag: php-4.3.0dev-ZendEngine2-Preview1~526 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dc8c2c9a6cce5e564bb30a63eddf2b45e71e2048;p=php * Remove package directory if empty during uninstall process * Don't baseinstalldir for documentation. --- diff --git a/pear/PEAR/Installer.php b/pear/PEAR/Installer.php index 9d98939b5b..79f3f7e9fd 100644 --- a/pear/PEAR/Installer.php +++ b/pear/PEAR/Installer.php @@ -111,10 +111,10 @@ class PEAR_Installer extends PEAR_Common } foreach ($filelist as $file => $props) { $path = $props['installed_as']; - // XXX TODO: do a "rmdir -p dirname($path)" to maintain clean the fs if (!@unlink($path)) { $this->log(2, "unable to delete: $path"); } else { + @rmdir(dirname($path)); // Delete package directory if it's empty $this->log(2, "+ deleted file: $path"); } } @@ -148,7 +148,7 @@ class PEAR_Installer extends PEAR_Common default: break; } - if (isset($atts['baseinstalldir'])) { + if (isset($atts['baseinstalldir']) && $atts['role'] != 'doc') { $dest_dir .= DIRECTORY_SEPARATOR . $atts['baseinstalldir']; } if (dirname($file) != '.') {