]> granicus.if.org Git - php/commitdiff
Fix package-list not showing the right Install path
authorTomas V.V.Cox <cox@php.net>
Tue, 9 Apr 2002 13:49:47 +0000 (13:49 +0000)
committerTomas V.V.Cox <cox@php.net>
Tue, 9 Apr 2002 13:49:47 +0000 (13:49 +0000)
pear/PEAR/Command/Package.php

index cae9faffd76a866f0c32cb6fa729ae68988e2010..63e5a59eae812fd5d62888d7e512fffdb6f677a0 100644 (file)
@@ -160,7 +160,14 @@ class PEAR_Command_Package extends PEAR_Command_Common
             // {{{ package-list
 
             case 'package-list': {
+                // $params[0] -> the PEAR package to list its contents
+                if (sizeof($params) != 1) {
+                    $failmsg = "Command package-list requires a valid PEAR package filename ".
+                               " as the first argument. Try the command \"help package-list\"";
+                    break;
+                }
                 $obj = new PEAR_Common();
+
                 if (PEAR::isError($info = $obj->infoFromTgzFile($params[0]))) {
                     return $info;
                 }
@@ -173,9 +180,9 @@ class PEAR_Command_Package extends PEAR_Command_Common
                 foreach ($list as $file => $att) {
                     if (isset($att['baseinstalldir'])) {
                         $dest = $att['baseinstalldir'] . DIRECTORY_SEPARATOR .
-                                basename($file);
+                                $file;
                     } else {
-                        $dest = basename($file);
+                        $dest = $file;
                     }
                     switch ($att['role']) {
                         case 'test':