From fba7705c9988933c9544d70871f95a3937be925f Mon Sep 17 00:00:00 2001 From: Greg Beaver Date: Sat, 6 Sep 2003 02:37:15 +0000 Subject: [PATCH] make error code helpful if no releases of a package exist at all --- pear/PEAR/Installer.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pear/PEAR/Installer.php b/pear/PEAR/Installer.php index 6bc30cff9dd..1f6a4618963 100644 --- a/pear/PEAR/Installer.php +++ b/pear/PEAR/Installer.php @@ -560,10 +560,15 @@ class PEAR_Installer extends PEAR_Common $remote = new PEAR_Remote($config); if (!PEAR::isError($info = $remote->call('package.info', $origpkgfile))) { - return $this->raiseError('No releases of preferred state "' + if (!count($info['releases'])) { + return $this->raiseError('Package ' . $origpkgfile . + ' has no releases'); + } else { + return $this->raiseError('No releases of preferred state "' . $state . '" exist for package ' . $origpkgfile . '. Use ' . $origpkgfile . '-state to install another' . ' state (like ' . $origpkgfile .'-beta)'); + } } else { return $pkgfile; }