From: Tomas V.V.Cox Date: Wed, 19 Jun 2002 22:51:29 +0000 (+0000) Subject: Do NOT allow install packages with errors in its description file X-Git-Tag: php-4.3.0dev_zend2_alpha2~182 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fa2ee37313929e5004997ba540fe47a634be40cc;p=php Do NOT allow install packages with errors in its description file --- diff --git a/pear/PEAR/Installer.php b/pear/PEAR/Installer.php index 67a14174ce..2b6e43e2cb 100644 --- a/pear/PEAR/Installer.php +++ b/pear/PEAR/Installer.php @@ -182,7 +182,8 @@ class PEAR_Installer extends PEAR_Common $this->source_files++; return; default: - break; + // Files with no role will end in "/" + return $this->raiseError("Invalid role `$atts[role]' for file $file"); } if (!empty($atts['baseinstalldir'])) { $dest_dir .= DIRECTORY_SEPARATOR . $atts['baseinstalldir']; @@ -394,6 +395,12 @@ class PEAR_Installer extends PEAR_Common if (PEAR::isError($pkginfo)) { return $pkginfo; } + $this->validatePackageInfo($pkginfo, $errors, $warnings); + // XXX We allow warnings, have we to do it? + if (count($errors)) { + return $this->raiseError("The following errors where found:\n". + implode("\n", $errors)); + } $pkgname = $pkginfo['package'];