From 77acb22bbaab3088a95395b951f8ac87ca450113 Mon Sep 17 00:00:00 2001 From: "Tomas V.V.Cox" Date: Wed, 19 Jun 2002 23:38:59 +0000 Subject: - Force params to version_compare() to be strings, otherwise some comparations will fail (ex. 0.9 will be equal to 0.90) - Other minor cleanup's --- pear/PEAR/Command/Remote.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'pear/PEAR/Command/Remote.php') diff --git a/pear/PEAR/Command/Remote.php b/pear/PEAR/Command/Remote.php index c92d6e36cc..e373abb50a 100644 --- a/pear/PEAR/Command/Remote.php +++ b/pear/PEAR/Command/Remote.php @@ -125,7 +125,7 @@ version of DB is 1.2, the downloaded file will be DB-1.2.tgz.', $info['installed'] = $installed['version'] ? $installed['version'] : '- no -'; $this->ui->outputData($info, $command); - + return true; } @@ -190,7 +190,7 @@ version of DB is 1.2, the downloaded file will be DB-1.2.tgz.', continue; if ($options['mode'] == 'notinstalled' && isset($installed['version'])) continue; - if ($options['mode'] == 'upgrades' + if ($options['mode'] == 'upgrades' && (!isset($installed['version']) || $installed['version'] == $info['stable'])) { continue; @@ -329,7 +329,7 @@ version of DB is 1.2, the downloaded file will be DB-1.2.tgz.', } extract($info); $inst_version = $reg->packageInfo($package, 'version'); - if (version_compare($version, $inst_version, "le")) { + if (version_compare("$version", "$inst_version", "le")) { // installed version is up-to-date continue; } @@ -344,7 +344,11 @@ version of DB is 1.2, the downloaded file will be DB-1.2.tgz.', } $data['data'][] = array($package, $version, $fs); } - $this->ui->outputData($data, $command); + if (empty($data['data'])) { + $this->ui->outputData('No upgrades avaible'); + } else { + $this->ui->outputData($data, $command); + } return true; } -- cgit v1.2.1