cvs: pear-core /PEAR/Command Package.php
| From: | Helgi �ormar �orbj�rnsson | Date: | Wed, 25 Mar 2009 02:15:57 +0000 |
| Subject: | cvs: pear-core /PEAR/Command Package.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-cvs+get-55852@lists.php.net to get a copy of this message | ||
dufuz Wed Mar 25 02:15:57 2009 UTC
Modified files:
/pear-core/PEAR/Command Package.php
Log:
Bug #14331 pear cvstag only works from inside the package directory
http://cvs.php.net/viewvc.cgi/pear-core/PEAR/Command/Package.php?r1=1.132&r2=1.133&diff_format=u
Index: pear-core/PEAR/Command/Package.php
diff -u pear-core/PEAR/Command/Package.php:1.132 pear-core/PEAR/Command/Package.php:1.133
--- pear-core/PEAR/Command/Package.php:1.132 Tue Feb 24 23:39:29 2009
+++ pear-core/PEAR/Command/Package.php Wed Mar 25 02:15:57 2009
@@ -12,7 +12,7 @@
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php
New BSD License
- * @version CVS: $Id: Package.php,v 1.132 2009/02/24 23:39:29 dufuz Exp $
+ * @version CVS: $Id: Package.php,v 1.133 2009/03/25 02:15:57 dufuz Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -385,9 +385,9 @@
return $this->raiseError("$command: missing parameter: $help[0]");
}
- $file = realpath($params[0]);
+ $packageFile = realpath($params[0]);
$obj = &$this->getPackageFile($this->config, $this->_debug);
- $info = $obj->fromAnyFile($file, PEAR_VALIDATE_NORMAL);
+ $info = $obj->fromAnyFile($packageFile, PEAR_VALIDATE_NORMAL);
if (PEAR::isError($info)) {
return $this->raiseError($info);
}
@@ -437,7 +437,12 @@
$files = array_merge($files, $params);
}
+ $dir = dirname($packageFile);
+ $dir = substr($dir, strrpos($dir, '/') + 1);
foreach ($files as $file) {
+ if (!file_exists($file)) {
+ $file = $dir . DIRECTORY_SEPARATOR . $file;
+ }
$command .= ' ' . escapeshellarg($file);
}