]> granicus.if.org Git - php/commitdiff
* Remove package directory if empty during uninstall process
authorMartin Jansen <mj@php.net>
Sun, 21 Apr 2002 06:17:53 +0000 (06:17 +0000)
committerMartin Jansen <mj@php.net>
Sun, 21 Apr 2002 06:17:53 +0000 (06:17 +0000)
* Don't baseinstalldir for documentation.

pear/PEAR/Installer.php

index 9d98939b5bbd691fe6f4552f7c909162e59e42e5..79f3f7e9fd632ecb098ceffe68f2aa71a5907561 100644 (file)
@@ -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) != '.') {