]> granicus.if.org Git - php/commitdiff
Do NOT allow install packages with errors in its description file
authorTomas V.V.Cox <cox@php.net>
Wed, 19 Jun 2002 22:51:29 +0000 (22:51 +0000)
committerTomas V.V.Cox <cox@php.net>
Wed, 19 Jun 2002 22:51:29 +0000 (22:51 +0000)
pear/PEAR/Installer.php

index 67a14174ceb71ad2204ddf915f2771a2f40ddca7..2b6e43e2cb4e0b3464e6e5268a18b8a2ca7b9741 100644 (file)
@@ -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'];