[sysadmin-bin] ftpadmin: use DOAP to determine Bugzilla product (fixes gnome-system-monitor vs system-monitor)



commit 70b37b88661abc99e7f7f4067a3e445b34c28a16
Author: Olav Vitters <olav vitters nl>
Date:   Sat Mar 26 15:28:52 2011 +0100

    ftpadmin: use DOAP to determine Bugzilla product (fixes gnome-system-monitor vs system-monitor)

 ftpadmin |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/ftpadmin b/ftpadmin
index ae72b67..26b952f 100755
--- a/ftpadmin
+++ b/ftpadmin
@@ -652,6 +652,15 @@ class ModuleInfo(DirectoryInfo):
             for property in node.find_properties((self.DOAP, needle)):
                 yield property
 
+    def get_bz_product_from_doap(self):
+        import urlparse
+        for bz in self.get_from_doap('bug-database'):
+            url = urlparse.urlparse(bz)
+            if url.netloc == 'bugzilla.gnome.org':
+                d = urlparse.parse_qs(url.query)
+                if 'product' in d:
+                    yield d['product'][0]
+
     @property
     def versions(self):
         return self._versions[self.module]
@@ -967,9 +976,13 @@ Install %s? [Y/n]""" % self.module,
         retcode = self._send_email("forced", subject, to, [to])
         print ", done"
 
-        sys.stdout.write(" - Adding new version to GNOME Bugzilla")
-        cmd = ['/usr/bin/curl', '-q', '-L', 'https://bugzilla.gnome.org/add-version.cgi?%s|%s' % (self.module, self.version)]
-        self._call_cmd(cmd)
+        products = self.moduleinfo.get_bz_product_from_doap()
+        if not products:
+            products = [self.module]
+        for product in products:
+            sys.stdout.write(" - Adding new version to GNOME Bugzilla")
+            cmd = ['/usr/bin/curl', '-q', '-L', 'https://bugzilla.gnome.org/add-version.cgi?%s|%s' % (product, self.version)]
+            self._call_cmd(cmd)
 
         sys.stdout.write(" - Triggering ftp.gnome.org update")
         syncscript = ['/usr/local/bin/signal-ftp-sync']
@@ -1185,6 +1198,9 @@ def cmd_show_doap(options, parser):
     for paragraph in desc.split("\n\n"):
         print textwrap.fill(paragraph)
         print ""
+    bz = moduleinfo.get_bz_product_from_doap()
+    if bz:
+        print "Bugzilla: %s" % ", ".join(bz)
 
 def cmd_validate_tarballs(options, parser):
     print options.module, options.section



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