From dc8c2c9a6cce5e564bb30a63eddf2b45e71e2048 Mon Sep 17 00:00:00 2001 From: Martin Jansen Date: Sun, 21 Apr 2002 06:17:53 +0000 Subject: [PATCH] * Remove package directory if empty during uninstall process * Don't baseinstalldir for documentation. --- pear/PEAR/Installer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) != '.') { -- 2.40.0