cvs: pear-core /PEAR/PackageFile v2.php

From: Date: Tue, 09 Nov 2004 04:22:54 +0000
Subject: cvs: pear-core /PEAR/PackageFile v2.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-1260@lists.php.net to get a copy of this message
cellog Mon Nov 8 23:22:54 2004 EDT Modified files: /pear-core/PEAR/PackageFile v2.php Log: fix subpackage identification isSubpackage() and isSubpackageOf() http://cvs.php.net/diff.php/pear-core/PEAR/PackageFile/v2.php?r1=1.47&r2=1.48&ty=u Index: pear-core/PEAR/PackageFile/v2.php diff -u pear-core/PEAR/PackageFile/v2.php:1.47 pear-core/PEAR/PackageFile/v2.php:1.48 --- pear-core/PEAR/PackageFile/v2.php:1.47 Mon Nov 8 20:29:36 2004 +++ pear-core/PEAR/PackageFile/v2.php Mon Nov 8 23:22:53 2004 @@ -17,7 +17,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: v2.php,v 1.47 2004/11/09 01:29:36 cellog Exp $ +// $Id: v2.php,v 1.48 2004/11/09 04:22:53 cellog Exp $ require_once 'PEAR/ErrorStack.php'; require_once 'PEAR/Validate.php'; require_once 'PEAR/PackageFile/Generator/v2.php'; @@ -1241,11 +1241,15 @@ } /** - * Determines whether the passed in package is a subpackage of this package + * Determines whether the passed in package is a subpackage of this package. + * + * No version checking is done, only name verification. * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 + * @return bool */ function isSubpackage($p) { + $sub = array(); if (isset($this->_packageInfo['dependencies']['required']['subpackage'])) { $sub = $this->_packageInfo['dependencies']['required']['subpackage']; if (!isset($sub[0])) { @@ -1275,13 +1279,15 @@ } } foreach ($sub as $dep) { - if ($dep['name'] == $p->getPackage()) { + if (strtolower($dep['name']) == strtolower($p->getPackage())) { if (isset($dep['channel'])) { - if ($dep['channel'] == $p->getChannel()) { + if (strtolower($dep['channel']) == strtolower($p->getChannel())) { + return true; + } + } else { + if ($dep['uri'] == $p->getURI()) { return true; } - } else { // all uri deps are in the same virtual channel - return true; } } }

« previous php.pear.core (#1260) next »