[Secure-testing-commits] r50156 - bin

Paul Wise pabs at moszumanska.debian.org
Wed Mar 29 04:48:56 UTC 2017


Author: pabs
Date: 2017-03-29 04:48:56 +0000 (Wed, 29 Mar 2017)
New Revision: 50156

Modified:
   bin/tracker_service.py
Log:
Link to DLA details on www.d.o from the Source field (Closes: #761945)

Modified: bin/tracker_service.py
===================================================================
--- bin/tracker_service.py	2017-03-29 04:46:57 UTC (rev 50155)
+++ bin/tracker_service.py	2017-03-29 04:48:56 UTC (rev 50156)
@@ -397,7 +397,7 @@
             elif source == 'DTSA':
                 source_xref = 'Debian Testing Security Team'
             elif source == 'DLA':
-                source_xref = 'Debian LTS Team'
+                source_xref = self.make_dla_ref(url, bug.name, 'Debian LTS')
             elif source == 'TEMP':
                 source_xref = (
         'Automatically generated temporary name.  Not for external reference.')
@@ -1525,6 +1525,18 @@
                                     % (int(y), int(number)))
         return None
 
+    def url_dla(self, url, dla, re_dsa=re.compile(r'^DLA-(\d+)(?:-\d+)?$')):
+        match = re_dla.match(dla)
+        if match:
+            # We must determine the year because there is no generic URL.
+            (number,) = match.groups()
+            for (date,) in self.db.cursor().execute(
+                "SELECT release_date FROM bugs WHERE name = ?", (dla,)):
+                (y, m, d) = date.split('-')
+                return url.absolute("https://www.debian.org/security/%d/dla-%d"
+                                    % (int(y), int(number)))
+        return None
+
     def url_debian_bug(self, url, debian):
         return url.absolute("https://bugs.debian.org/cgi-bin/bugreport.cgi",
                             bug=str(debian))
@@ -1649,6 +1661,15 @@
         else:
             return name
 
+    def make_dla_ref(self, url, dla, name=None):
+        if name is None:
+            name = dla
+        u = self.url_dla(url, dla)
+        if u:
+            return A(u, name)
+        else:
+            return name
+
     def make_source_code_ref(self, url, pkg, name=None):
         if name is None:
             name = pkg




More information about the Secure-testing-commits mailing list