cvs: php4 /pear/PEAR Dependency.php
| From: | Tomas V.V.Cox | Date: | Wed, 22 May 2002 01:23:13 +0000 |
| Subject: | cvs: php4 /pear/PEAR Dependency.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-4027@lists.php.net to get a copy of this message | ||
cox Tue May 21 21:23:13 2002 EDT
Modified files:
/php4/pear/PEAR Dependency.php
Log:
Test first if the package exists before comparing the version
(fix the version_compare() segfault)
Index: php4/pear/PEAR/Dependency.php
diff -u php4/pear/PEAR/Dependency.php:1.9 php4/pear/PEAR/Dependency.php:1.10
--- php4/pear/PEAR/Dependency.php:1.9 Sun May 19 12:32:18 2002
+++ php4/pear/PEAR/Dependency.php Tue May 21 21:23:12 2002
@@ -17,7 +17,7 @@
// | Stig Bakken <ssb@fast.no> |
// +----------------------------------------------------------------------+
//
-// $Id: Dependency.php,v 1.9 2002/05/19 16:32:18 ssb Exp $
+// $Id: Dependency.php,v 1.10 2002/05/22 01:23:12 cox Exp $
/**
* Methods for dependencies check. Based on Stig's dependencies RFC
@@ -111,9 +111,11 @@
case 'ge':
case 'gt':
$version = $this->registry->packageInfo($name, 'version');
- if (!version_compare($version, $req, $relation)) {
+ if (!$this->registry->packageExists($name)
+ || !version_compare($version, $req, $relation))
+ {
return "requires package `$name' " .
- $this->signOperator($relation) . " $req";
+ $this->signOperator($relation) . " $req";
}
}
return "Relation '$relation' with requirement '$req' is not
supported (name=$name)";