[Reportbug-commits] [SCM] Reportbug - reports bugs in the Debian distribution branch, master, updated. 6.0-101-gde75f77
Sandro Tosi
morph at debian.org
Fri Apr 6 23:45:28 UTC 2012
The following commit has been merged in the master branch:
commit de75f77e735d74425fceea0a057c0a6bfa7428a7
Author: Sandro Tosi <morph at debian.org>
Date: Sat Apr 7 01:40:39 2012 +0200
report foreign architectures information (if m-a); thanks to Cyril Brulebois for the report; Closes: #658795
diff --git a/debian/changelog b/debian/changelog
index 5857961..fc5e9f2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -24,8 +24,11 @@ reportbug (6.3.2) UNRELEASED; urgency=low
report; Closes: #661221
* debian/control
- added python-mock to b-d-i, needed for the test suite
+ * reportbug/{debbugs, utils}.py
+ - report foreign architectures information (if m-a); thanks to Cyril
+ Brulebois for the report; Closes: #658795
- -- Sandro Tosi <morph at debian.org> Wed, 04 Apr 2012 20:30:22 +0200
+ -- Sandro Tosi <morph at debian.org> Sat, 07 Apr 2012 01:37:58 +0200
reportbug (6.3.1) unstable; urgency=low
diff --git a/reportbug/debbugs.py b/reportbug/debbugs.py
index a8244bd..659f7dc 100644
--- a/reportbug/debbugs.py
+++ b/reportbug/debbugs.py
@@ -651,13 +651,17 @@ def handle_wnpp(package, bts, ui, fromaddr, timeout, online=True, http_proxy=Non
def dpkg_infofunc():
debarch = utils.get_arch()
utsmachine = os.uname()[4]
+ multiarch = utils.get_multiarch()
if debarch:
if utsmachine == debarch:
- debinfo = u'Architecture: %s\n\n' % debarch
+ debinfo = u'Architecture: %s\n' % debarch
else:
- debinfo = u'Architecture: %s (%s)\n\n' % (debarch, utsmachine)
+ debinfo = u'Architecture: %s (%s)\n' % (debarch, utsmachine)
else:
- debinfo = u'Architecture: ? (%s)\n\n' % utsmachine
+ debinfo = u'Architecture: ? (%s)\n' % utsmachine
+ if multiarch:
+ debinfo += u'Foreign Architectures: %s\n' % multiarch
+ debinfo += '\n'
return debinfo
def debian_infofunc():
diff --git a/reportbug/utils.py b/reportbug/utils.py
index c0f596a..a8614b5 100644
--- a/reportbug/utils.py
+++ b/reportbug/utils.py
@@ -762,6 +762,9 @@ def get_arch():
arch = re.sub(r'ppc', 'powerpc', arch)
return arch
+def get_multiarch():
+ return commands.getoutput('COLUMNS=79 dpkg --print-foreign-architectures 2>/dev/null')
+
def generate_blank_report(package, pkgversion, severity, justification,
depinfo, confinfo, foundfile='', incfiles='',
system='debian', exinfo=None, type=None, klass='',
diff --git a/test/test_debbugs.py b/test/test_debbugs.py
index 57575be..473bcff 100644
--- a/test/test_debbugs.py
+++ b/test/test_debbugs.py
@@ -59,7 +59,10 @@ class TestInfofunc(unittest2.TestCase):
def test_dpkg_infofunc(self):
info = debbugs.dpkg_infofunc()
+ arch = utils.get_arch()
self.assertIn('Architecture:', info)
+ self.assertIn(arch, info)
+ self.assertIn('Architecture: ' + arch, info)
self.assertTrue(info.endswith('\n\n'))
utils.get_arch = mock.MagicMock(return_value = 'non-existing-arch')
@@ -73,6 +76,13 @@ class TestInfofunc(unittest2.TestCase):
self.assertIn('Architecture: ?', info)
self.assertTrue(info.endswith('\n\n'))
+ # test with a dummy m-a setup
+ utils.get_multiarch = mock.MagicMock(return_value = 'multi-arch-ified')
+ info = debbugs.dpkg_infofunc()
+ self.assertIn('Foreign Architectures:', info)
+ self.assertIn('multi-arch-ified', info)
+ self.assertIn('Foreign Architectures: multi-arch-ified', info)
+
def test_debian_infofunc(self):
info = debbugs.debian_infofunc()
self.assertIn('Architecture:', info)
--
Reportbug - reports bugs in the Debian distribution
More information about the Reportbug-commits
mailing list