[sysadmin-bin: 160/168] Really require DOAP files



commit 2f237ab1e8da2fa1d30115b35b88dec995b21768
Author: Olav Vitters <olav vitters nl>
Date:   Wed Aug 24 10:01:40 2011 +0200

    Really require DOAP files
    
    Do not fallback to a MAINTAINERS file. Furthermore, be more strict when
    parsing doap files (check for valid userid).

 pre-receive-check-maintainers |    7 ++-----
 validate-doap                 |    6 ++++++
 2 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/pre-receive-check-maintainers b/pre-receive-check-maintainers
index 441e071..0415f6c 100755
--- a/pre-receive-check-maintainers
+++ b/pre-receive-check-maintainers
@@ -55,11 +55,8 @@ check_maintainers() {
 	    fi
 	fi
     else
-        # See if there is a old-style MAINTAINERS file
-	if ! git cat-file blob $newrev:MAINTAINERS 2>/dev/null | /bin/grep -q "^Userid:" ; then
-            echo "A valid $projectshort.doap file is required. See http://live.gnome.org/MaintainersCorner#maintainers"; >&2
-            return 1
-	fi
+        echo "A valid $projectshort.doap file is required. See http://live.gnome.org/MaintainersCorner#maintainers"; >&2
+        return 1
     fi
 }
 
diff --git a/validate-doap b/validate-doap
index 8ee1dee..be43417 100755
--- a/validate-doap
+++ b/validate-doap
@@ -3,6 +3,7 @@
 from cStringIO import StringIO
 import os
 import sys
+import pwd
 from xml.sax import SAXParseException
 
 script_path = os.path.realpath(os.path.abspath(sys.argv[0]))
@@ -92,6 +93,11 @@ for node in nodes:
             if uid is not None:
                 if not is_literal(uid):
                     die("Invalid gnome:userid property (should be a string literal)")
+                try:
+                    # XXX - only checks if userid exists; doesn't check if it has any Git access
+                    pwd.getpwnam(uid)
+                except KeyError:
+                    die("Invalid gnome:userid property (%s is not a valid GNOME userid)" % uid)
                 have_maintainer = True
             mbox = maintainer.find_property((FOAF, "mbox"))
             if mbox is not None:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]