cvs: pear-core /PEAR/Downloader Package.php

From: Date: Thu, 21 Oct 2004 23:30:52 +0000
Subject: cvs: pear-core /PEAR/Downloader Package.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-1110@lists.php.net to get a copy of this message
cellog Thu Oct 21 19:30:52 2004 EDT Modified files: /pear-core/PEAR/Downloader Package.php Log: implement the <nodefault/> option for a package dependency http://cvs.php.net/diff.php/pear-core/PEAR/Downloader/Package.php?r1=1.32&r2=1.33&ty=u Index: pear-core/PEAR/Downloader/Package.php diff -u pear-core/PEAR/Downloader/Package.php:1.32 pear-core/PEAR/Downloader/Package.php:1.33 --- pear-core/PEAR/Downloader/Package.php:1.32 Thu Oct 21 19:22:21 2004 +++ pear-core/PEAR/Downloader/Package.php Thu Oct 21 19:30:52 2004 @@ -16,7 +16,7 @@ // | Authors: Gregory Beaver <cellog@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Package.php,v 1.32 2004/10/21 23:22:21 cellog Exp $ +// $Id: Package.php,v 1.33 2004/10/21 23:30:52 cellog Exp $ require_once 'Archive/Tar.php'; require_once 'PEAR/Dependency2.php'; /** @@ -304,7 +304,11 @@ // get requested dependency group, if any $groupname = $this->getGroup(); if (!$groupname) { - $groupname = 'default'; // try the default dependency group + if ($this->canDefault()) { + $groupname = 'default'; // try the default dependency group + } else { + return; + } $explicit = false; } else { $explicit = true; @@ -406,6 +410,9 @@ return false; } } + if (isset($dep['nodefault'])) { + $ret['nodefault'] = true; + } return $ret; } @@ -523,6 +530,16 @@ return $this->_downloadURL; } + function canDefault() + { + if (isset($this->_downloadURL)) { + if (isset($this->_downloadURL['nodefault'])) { + return false; + } + } + return true; + } + function getPackage() { if (isset($this->_packagefile)) {

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