cvs: pear-core /PEAR/PackageFile v1.php
| From: | Greg Beaver | Date: | Thu, 28 Oct 2004 03:47:49 +0000 |
| Subject: | cvs: pear-core /PEAR/PackageFile v1.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-1170@lists.php.net to get a copy of this message | ||
cellog Wed Oct 27 23:47:49 2004 EDT
Modified files:
/pear-core/PEAR/PackageFile v1.php
Log:
re-organize dependency methods
add methods to manipulate configure options
http://cvs.php.net/diff.php/pear-core/PEAR/PackageFile/v1.php?r1=1.23&r2=1.24&ty=u
Index: pear-core/PEAR/PackageFile/v1.php
diff -u pear-core/PEAR/PackageFile/v1.php:1.23 pear-core/PEAR/PackageFile/v1.php:1.24
--- pear-core/PEAR/PackageFile/v1.php:1.23 Mon Oct 25 12:25:22 2004
+++ pear-core/PEAR/PackageFile/v1.php Wed Oct 27 23:47:49 2004
@@ -586,51 +586,12 @@
return false;
}
- function getDependencyGroup($group)
- {
- return false;
- }
-
- function isCompatible($pf)
- {
- return false;
- }
-
- function isSubpackageOf($p)
- {
- return $p->isSubpackage($this);
- }
-
- function isSubpackage($p)
- {
- return false;
- }
-
- function dependsOn($package, $channel)
- {
- if (strtolower($channel) != 'pear.php.net') {
- return false;
- }
- if (!($deps = $this->getDeps())) {
- return false;
- }
- foreach ($deps as $dep) {
- if ($dep['type'] != 'pkg') {
- continue;
- }
- if (strtolower($dep['name']) == strtolower($package)) {
- return true;
- }
- }
- return false;
- }
-
/**
* Reset dependencies prior to adding new ones
*/
function clearDeps()
{
- $this->_packageInfo['release_deps'] = array();
+ unset($this->_packageInfo['release_deps']);
}
function addPhpDep($version, $rel)
@@ -670,18 +631,49 @@
count($this->_packageInfo['release_deps']);
}
- function getConfigureOptions()
+ function getDependencyGroup($group)
{
- if (isset($this->_packageInfo['configure_options'])) {
- return $this->_packageInfo['configure_options'];
+ return false;
+ }
+
+ function isCompatible($pf)
+ {
+ return false;
+ }
+
+ function isSubpackageOf($p)
+ {
+ return $p->isSubpackage($this);
+ }
+
+ function isSubpackage($p)
+ {
+ return false;
+ }
+
+ function dependsOn($package, $channel)
+ {
+ if (strtolower($channel) != 'pear.php.net') {
+ return false;
+ }
+ if (!($deps = $this->getDeps())) {
+ return false;
+ }
+ foreach ($deps as $dep) {
+ if ($dep['type'] != 'pkg') {
+ continue;
+ }
+ if (strtolower($dep['name']) == strtolower($package)) {
+ return true;
+ }
}
return false;
}
- function getProvides()
+ function getConfigureOptions()
{
- if (isset($this->_packageInfo['provides'])) {
- return $this->_packageInfo['provides'];
+ if (isset($this->_packageInfo['configure_options'])) {
+ return $this->_packageInfo['configure_options'];
}
return false;
}
@@ -692,6 +684,31 @@
count($this->_packageInfo['configure_options']);
}
+ function addConfigureOption($name, $prompt, $default = false)
+ {
+ $o = array('name' => $name, 'prompt' => $prompt);
+ if ($default !== false) {
+ $o['default'] = $default;
+ }
+ if (!isset($this->_packageInfo['configure_options'])) {
+ $this->_packageInfo['configure_options'] = array();
+ }
+ $this->_packageInfo['configure_options'][] = $o;
+ }
+
+ function clearConfigureOptions()
+ {
+ unset($this->_packageInfo['configure_options']);
+ }
+
+ function getProvides()
+ {
+ if (isset($this->_packageInfo['provides'])) {
+ return $this->_packageInfo['provides'];
+ }
+ return false;
+ }
+
function addFile($dir, $file, $attrs)
{
$this->_packageInfo['filelist'][$dir . '/' . $file] = $attrs;