logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

cvs: pear-core /PEAR/PackageFile v1.php: msg#00222

Subject: cvs: pear-core /PEAR/PackageFile v1.php
cellog          Fri Sep 23 01:06:41 2005 EDT

  Modified files:              
    /pear-core/PEAR/PackageFile v1.php 
  Log:
  add validation check for at least 1 lead maintainer
  (package.xml 2.0 already does this)
  
http://cvs.php.net/diff.php/pear-core/PEAR/PackageFile/v1.php?r1=1.59&r2=1.60&ty=u
Index: pear-core/PEAR/PackageFile/v1.php
diff -u pear-core/PEAR/PackageFile/v1.php:1.59 
pear-core/PEAR/PackageFile/v1.php:1.60
--- pear-core/PEAR/PackageFile/v1.php:1.59      Thu Sep 22 22:49:31 2005
+++ pear-core/PEAR/PackageFile/v1.php   Fri Sep 23 01:06:39 2005
@@ -15,7 +15,7 @@
  * @author     Greg Beaver <cellog@xxxxxxx>
  * @copyright  1997-2005 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    CVS: $Id: v1.php,v 1.59 2005/09/23 02:49:31 cellog Exp $
+ * @version    CVS: $Id: v1.php,v 1.60 2005/09/23 05:06:39 cellog Exp $
  * @link       http://pear.php.net/package/PEAR
  * @since      File available since Release 1.4.0a1
  */
@@ -266,6 +266,10 @@
 define('PEAR_PACKAGEFILE_ERROR_NO_DEPPHPVERSION', 50);
 
 /**
+ * Error code when a package has no lead developer
+ */
+define('PEAR_PACKAGEFILE_ERROR_NO_LEAD', 51);
+/**
  * package.xml encapsulator
  * @category   pear
  * @package    PEAR
@@ -975,6 +979,8 @@
                     'No release date found',
                 PEAR_PACKAGEFILE_ERROR_NO_NOTES =>
                     'No release notes found',
+                PEAR_PACKAGEFILE_ERROR_NO_LEAD =>
+                    'Package must have at least one lead maintainer',
                 PEAR_PACKAGEFILE_ERROR_NO_MAINTAINERS =>
                     'No maintainers found, at least one must be defined',
                 PEAR_PACKAGEFILE_ERROR_NO_MAINTHANDLE =>
@@ -1081,6 +1087,7 @@
         if (empty($info['maintainers'])) {
             $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_MAINTAINERS);
         } else {
+            $haslead = false;
             $i = 1;
             foreach ($info['maintainers'] as $m) {
                 if (empty($m['handle'])) {
@@ -1090,6 +1097,8 @@
                 if (empty($m['role'])) {
                     $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_MAINTROLE,
                         array('index' => $i, 'roles' => 
PEAR_Common::getUserRoles()));
+                } elseif ($m['role'] == 'lead') {
+                    $haslead = true;
                 }
                 if (empty($m['name'])) {
                     $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_MAINTNAME,
@@ -1101,6 +1110,9 @@
                 }
                 $i++;
             }
+            if (!$haslead) {
+                $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_LEAD);
+            }
         }
         if (!empty($info['release_deps'])) {
             $i = 1;

-- 
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>