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

Bug#805238: marked as done (debian-timeline: Add script for automatic update of the bug events database)

Your message dated Mon, 15 Aug 2016 22:06:25 +0000
with message-id <E1bZQ1Z-0008BA-5i@franck.debian.org>
and subject line Bug#805238: fixed in debian-timeline 38
has caused the Debian Bug report #805238,
regarding debian-timeline: Add script for automatic update of the bug events database
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org

805238: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=805238
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: debian-timeline
Version: 37
Severity: wishlist
Tags: patch

You will find attached to this bug report, as a patch for Git, a script called update-bug-list.py. Launching it from the top level directory like this:


will automatically update the database in data/events/bugs, by querying the bugs.d.o database through the SOAP interface.

You might be interested in integrating this script into the debian-timeline package.

Best regards,

Rafael Laboissière

-- System Information: Debian Release: stretch/sid APT prefers testing APT policy: (650, 'testing'), (600, 'unstable'), (550, 'stable'), (500, 'experimental') Architecture: i386 (i686)

Kernel: Linux 3.18.0-trunk-686-pae (SMP w/2 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages debian-timeline depends on: ii libjs-simile-timeline 2.3.0+dfsg1-2

debian-timeline recommends no packages.

debian-timeline suggests no packages.

-- no debconf information
>From 20a84014590733ea1faab44899e87522327b0ac4 Mon Sep 17 00:00:00 2001
From: Rafael Laboissiere <rafael@laboissiere.net>
Date: Sun, 15 Nov 2015 22:54:35 +0100
Subject: [PATCH] update-bug-list.py: Add script for automatic update of bug
 events list

 update-bug-list.py | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 93 insertions(+)
 create mode 100755 update-bug-list.py

diff --git a/update-bug-list.py b/update-bug-list.py
new file mode 100755
index 0000000..aaa039f
--- /dev/null
+++ b/update-bug-list.py
@@ -0,0 +1,93 @@
+#!/usr/bin/env python
+## Copyright (C) 2015 Rafael Laboissiere
+## This program is in the public domain
+## Use this script for updating file data/events/bugs with more recent
+## bugs.  Launch the script from the top level directory, like this:
+##    ./update-bug-list.py
+## The file data/events/bugs will be overwritten.
+import re
+import SOAPpy
+from debian import deb822
+from datetime import datetime
+### This is the granularity for inclusion of bugs in the events database
+granularity = 10000
+### URL of the Debian bugs website
+debbug_url = 'https://bugs.debian.org'
+### Initialize the SOAP server for accessing the Debian bugs database
+url = '%s/cgi-bin/soap.cgi' % debbug_url
+namespace = 'Debbugs/SOAP'
+server = SOAPpy.SOAPProxy (url, namespace)
+### Get the newest bug number
+newest_bug = server.newest_bugs (1) [0]
+### Read the bugs database
+bug_events_file = 'data/events/bugs'
+input = file (bug_events_file).read ().decode ('utf-8').split ('\n')
+current_bugs = []
+bug_list = deb822.Deb822.iter_paragraphs (input, use_apt_pkg = False)
+### Initialize the array for storing the information on the bugs
+bug_paras = []
+### Regular expression for getting the bug number from the source field
+debbug_url_re = re.compile ('%s/(\d+)' % debbug_url)
+### Iterate over the paragraphs, storing the bug numbers and building
+### their string representation
+for para in bug_list:
+    m = debbug_url_re.search (para ['source'])
+    if m:
+        current_bugs.append (int (m.group (1)))
+    bug_paras.append ('''Title: %s
+Date: %s
+Source: %s''' % (para ['title'], para ['date'], para ['source']))
+### Get the bug recorded with highest number
+last_recorded_bug = max (current_bugs)
+### Regular expression for extracting the full name of the bug origniator
+email_re = re.compile ('([^<]+)')
+### Check whether there are new bugs to retrieve
+if newest_bug >= last_recorded_bug + granularity:
+    ## Yes : get them
+    for i in range (1, 1 + (newest_bug - last_recorded_bug) / granularity):
+        ## Get next bug
+        bug = last_recorded_bug + i * granularity
+        status = server.get_status (bug) [0]
+        ## Get the full name of the submitter
+        originator = status.value.originator
+        m = email_re.search (originator)
+        if m:
+            originator = m.group (1).rstrip ()
+        ## Get the date of submission
+        date =  datetime.fromtimestamp (status.value.date).strftime ("%b %d %Y")
+        ## Add paragraph to the database
+        bug_paras.append ('\n'.join (['Title: Debian Bug #%d reported by %s' % (bug, originator),
+                                      'Date: %s' % date,
+                                      'Source: %s/%d' % (debbug_url, bug)]))
+        print 'New bug found: #%d' % bug
+    ## Write the new database
+    output = open (bug_events_file, 'w')
+    output.write ('\n\n'.join (bug_paras).encode ('utf-8') + '\n')
+    output.close ()
+    ## No: nothing to do
+    print "No new bugs."

--- End Message ---
--- Begin Message ---
Source: debian-timeline
Source-Version: 38

We believe that the bug you reported is fixed in the latest version of
debian-timeline, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 805238@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
Ana Beatriz Guerrero Lopez <ana@debian.org> (supplier of updated debian-timeline package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)

Hash: SHA256

Format: 1.8
Date: Mon, 15 Aug 2016 22:01:27 +0200
Source: debian-timeline
Binary: debian-timeline
Architecture: source all
Version: 38
Distribution: unstable
Urgency: medium
Maintainer: Debian publicity team <debian-publicity@lists.debian.org>
Changed-By: Ana Beatriz Guerrero Lopez <ana@debian.org>
 debian-timeline - Web-based timeline of the Debian Project
Closes: 805238 805248
 debian-timeline (38) unstable; urgency=medium
   * Team upload.
   * Many updates by Ondřej Nový, Ana Guerrero Lopez, Paul Wise and
     Martin Zobel-Helas.
   * Add script update-bug-list.py thanks to Rafael Laboissiere to automatically
     update data/events/bugs. (Closes: #805238)
   * Update data/events/bugs, use the new script to add old bugs.
     (Closes: #805248)
   * Bump Standards-Version to 3.9.8, no changes required.
 0da7f3df94de72d4843ed36e440b8cf6b2e217af 1776 debian-timeline_38.dsc
 dbecb7bd90deec65e1424432ded6a54302a8c8b6 25340 debian-timeline_38.tar.xz
 7a7a714f38c1f265aeb63757cde6b105a478cf79 24996 debian-timeline_38_all.deb
 4e8b7c4e074b5cbd86c915d6ddf2a749217e293123ba0c13763e265ff758cd1f 1776 debian-timeline_38.dsc
 5b57e1ce23e8e3b57d9234b740d4c96c8f870836025f8f2b0fb4129cbaeecfee 25340 debian-timeline_38.tar.xz
 7aab1a3ea845a07fb75348bfeddc3905737777f8d7246d96517e1f51c5dbc742 24996 debian-timeline_38_all.deb
 a225834601df47292858155c3a209ca6 1776 web optional debian-timeline_38.dsc
 700e43a79929230896a5b6d556739aec 25340 web optional debian-timeline_38.tar.xz
 9388f1a3f4f83a181a6c7216a0f26d2c 24996 web optional debian-timeline_38_all.deb

Comment: Signed by Ana Guerrero


--- End Message ---

Reply to: