cvs: pear-core(PEAR_1_3) /PEAR Downloader.php
| From: | Greg Beaver | Date: | Fri, 22 Oct 2004 22:54:04 +0000 |
| Subject: | cvs: pear-core(PEAR_1_3) /PEAR Downloader.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-1123@lists.php.net to get a copy of this message | ||
cellog Fri Oct 22 18:54:04 2004 EDT
Modified files: (Branch: PEAR_1_3)
/pear-core/PEAR Downloader.php
Log:
if dependencies are not in preferred_state, don't
download any of them (works with Arnaud's example)
http://cvs.php.net/diff.php/pear-core/PEAR/Downloader.php?r1=1.17&r2=1.17.2.1&ty=u
Index: pear-core/PEAR/Downloader.php
diff -u pear-core/PEAR/Downloader.php:1.17 pear-core/PEAR/Downloader.php:1.17.2.1
--- pear-core/PEAR/Downloader.php:1.17 Fri Jun 18 10:41:01 2004
+++ pear-core/PEAR/Downloader.php Fri Oct 22 18:54:03 2004
@@ -18,7 +18,7 @@
// | Martin Jansen <mj@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Downloader.php,v 1.17 2004/06/18 14:41:01 mj Exp $
+// $Id: Downloader.php,v 1.17.2.1 2004/10/22 22:54:03 cellog Exp $
require_once 'PEAR/Common.php';
require_once 'PEAR/Registry.php';
@@ -381,7 +381,8 @@
// there are no dependencies
continue;
}
- foreach($alldeps as $info) {
+ $fail = false;
+ foreach ($alldeps as $info) {
if ($info['type'] != 'pkg') {
continue;
}
@@ -389,11 +390,18 @@
if ($ret === false) {
continue;
}
+ if ($ret === 0) {
+ $fail = true;
+ continue;
+ }
if (PEAR::isError($ret)) {
return $ret;
}
$deppackages[] = $ret;
} // foreach($alldeps
+ if ($fail) {
+ $deppackages = array();
+ }
}
if (count($deppackages)) {
@@ -561,7 +569,7 @@
$savestate = array_shift($get);
$this->pushError( "Release for '$package' dependency
'$info[name]' " .
"has state '$savestate', requires '$state'");
- return false;
+ return 0;
}
if (in_array(strtolower($info['name']), $this->_toDownload) ||
isset($mywillinstall[strtolower($info['name'])])) {