extras-repoclosure PackageOwnersTests.py, 1.4, 1.5 PackageOwners.py, 1.9, 1.10

Michael Schwendt (mschwendt) fedora-extras-commits at redhat.com
Fri Feb 2 13:26:23 UTC 2007


Author: mschwendt

Update of /cvs/fedora/extras-repoclosure
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31594

Modified Files:
	PackageOwnersTests.py PackageOwners.py 
Log Message:
* Support comma-separated email addresses in "initialowner" field.
First address becomes primary package owner.



Index: PackageOwnersTests.py
===================================================================
RCS file: /cvs/fedora/extras-repoclosure/PackageOwnersTests.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- PackageOwnersTests.py	9 Jan 2007 12:00:47 -0000	1.4
+++ PackageOwnersTests.py	2 Feb 2007 13:26:21 -0000	1.5
@@ -32,6 +32,17 @@
         b.sort()
         self.assertEqual(a,b)
     
+    def testownersmultiple(self):
+        po._parse(['Test|testpkg|test desc|owner at localhost,co-owner at localhost|qa at localhost|observer at localhost,upstream at localhost'])
+        self.assertEqual( po.GetOwner('testpkg'), 'owner at localhost')
+
+    def testownersmultiple2(self):
+        a = po.GetOwners('testpkg')
+        a.sort()
+        b = ['owner at localhost','co-owner at localhost','observer at localhost','upstream at localhost']
+        b.sort()
+        self.assertEqual(a,b)
+
     def testwrongpackage(self):
         self.assertEqual( po.GetOwner('thisPkgDoesNotExist'), '' )
     


Index: PackageOwners.py
===================================================================
RCS file: /cvs/fedora/extras-repoclosure/PackageOwners.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- PackageOwners.py	9 Jan 2007 12:08:50 -0000	1.9
+++ PackageOwners.py	2 Feb 2007 13:26:21 -0000	1.10
@@ -102,18 +102,28 @@
             if line.startswith('#') or line.isspace():
                 continue
             try:
-                (repo,pkgname,summary,email,qacontact,cc) = line.rstrip().split('|')
-                if len(cc):
-                    (ccowners) = cc.split(',')
-                else:
-                    ccowners = []
-                if email.find('@') < 0:  # owners.list is broken
+                (repo,pkgname,summary,emails,qacontact,cc) = line.rstrip().split('|')
+                addrs = []
+                mailto = '' # primary pkg owner
+                if len(emails):
+                    if emails.find(',')>=0:
+                        (addrs) = emails.split(',')
+                        mailto = addrs[0]
+                        addrs = addrs[1:]
+                    else:
+                        mailto = emails
+                if mailto.find('@') < 0:  # owners.list is broken
                     raise Exception
+                
+                ccaddrs = []
+                if len(cc):
+                    (ccaddrs) = cc.split(',')
+                addrs += ccaddrs
+
                 self.dict[pkgname] = {
-                    'mailto' : email,
-                    'cc' : ccowners
+                    'mailto' : mailto,
+                    'cc' : addrs
                     }
-                #print '%s -> %s' % (pkgname, self.dict[pkgname]['mailto'])
             except:
                 print 'ERROR: owners.list is broken'
                 print line




More information about the scm-commits mailing list