From aa99618dd6f9ccb7e71250f4c27f9613ab4bbd3c Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Tue, 16 Aug 2011 01:17:25 +0200 Subject: [PATCH 1/3] backportpackage: Backport from local source packages again (LP: #801945) --- debian/changelog | 1 + ubuntutools/archive.py | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 516ac3c..86390cd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ ubuntu-dev-tools (0.128) UNRELEASED; urgency=low [ Stefano Rivera ] * ubuntutools.builder: Detect missing builder and fail early. + * backportpackage: Backport from local source packages again (LP: #801945) [ Julian Taylor ] * lp-shell: use ipython shell if available diff --git a/ubuntutools/archive.py b/ubuntutools/archive.py index 2f90416..f54c4dd 100644 --- a/ubuntutools/archive.py +++ b/ubuntutools/archive.py @@ -101,7 +101,7 @@ class SourcePackage(object): Use DebianSourcePackage or UbuntuSourcePackage instead of using this directly. """ - distribution = 'unknown' + distribution = None def __init__(self, package=None, version=None, component=None, dscfile=None, lp=None, mirrors=(), workdir='.'): @@ -124,8 +124,9 @@ class SourcePackage(object): # Mirrors self._dsc_source = dscfile self.mirrors = list(mirrors) - self.masters = [UDTConfig.defaults['%s_MIRROR' - % self.distribution.upper()]] + if self.distribution: + self.masters = [UDTConfig.defaults['%s_MIRROR' + % self.distribution.upper()]] if dscfile is not None: if self.source is None: self.source = 'unknown' From 0744d360cc793eaf9950cd8a857e328a14dbad95 Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Tue, 16 Aug 2011 10:25:48 +0200 Subject: [PATCH 2/3] Upload to unstable --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 86390cd..eb0d1fb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -ubuntu-dev-tools (0.128) UNRELEASED; urgency=low +ubuntu-dev-tools (0.128) unstable; urgency=low [ Stefano Rivera ] * ubuntutools.builder: Detect missing builder and fail early. @@ -7,7 +7,7 @@ ubuntu-dev-tools (0.128) UNRELEASED; urgency=low [ Julian Taylor ] * lp-shell: use ipython shell if available - -- Julian Taylor Sun, 14 Aug 2011 18:56:52 +0200 + -- Stefano Rivera Tue, 16 Aug 2011 10:25:24 +0200 ubuntu-dev-tools (0.127) unstable; urgency=low From abfdd76f01aa6b5299278b0482ce7d6f6897579e Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Tue, 16 Aug 2011 11:19:15 +0200 Subject: [PATCH 3/3] ubuntutools.test.test_archive: Forgive newer python-debian's for calling GpgInfo.from_sequence() with the optional keyrings arguments. --- debian/changelog | 4 +++- ubuntutools/test/test_archive.py | 29 +++++++++++++++++++++-------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index eb0d1fb..302af1b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,11 +3,13 @@ ubuntu-dev-tools (0.128) unstable; urgency=low [ Stefano Rivera ] * ubuntutools.builder: Detect missing builder and fail early. * backportpackage: Backport from local source packages again (LP: #801945) + * ubuntutools.test.test_archive: Forgive newer python-debian's for calling + GpgInfo.from_sequence() with the optional keyrings arguments. [ Julian Taylor ] * lp-shell: use ipython shell if available - -- Stefano Rivera Tue, 16 Aug 2011 10:25:24 +0200 + -- Stefano Rivera Tue, 16 Aug 2011 11:15:18 +0200 ubuntu-dev-tools (0.127) unstable; urgency=low diff --git a/ubuntutools/test/test_archive.py b/ubuntutools/test/test_archive.py index f977291..1e45ef8 100644 --- a/ubuntutools/test/test_archive.py +++ b/ubuntutools/test/test_archive.py @@ -21,6 +21,7 @@ import os.path import shutil import StringIO import tempfile +import types import urllib2 import debian.deb822 @@ -299,11 +300,17 @@ class DebianLocalSourcePackageTestCase(LocalSourcePackageTestCase): self.mock_opener.open(mirror + base + 'example_1.0-1.debian.tar.gz' ).WithSideEffects(self.urlopen_proxy) - self.mox.StubOutWithMock(debian.deb822.GpgInfo, 'from_sequence') - debian.deb822.GpgInfo.from_sequence(mox.IsA(str)).WithSideEffects( - lambda x: debian.deb822.GpgInfo.from_output( + def fake_gpg_info(self, message, keyrings=None): + return debian.deb822.GpgInfo.from_output( '[GNUPG:] GOODSIG DEADBEEF Joe Developer ' - '')) + '') + # We have to stub this out without mox because there some versions of + # python-debian will pass keyrings=None, others won't. + # http://code.google.com/p/pymox/issues/detail?id=37 + self.mox.stubs.Set(debian.deb822.GpgInfo, 'from_sequence', + types.MethodType(fake_gpg_info, + debian.deb822.GpgInfo, + debian.deb822.GpgInfo)) self.mox.ReplayAll() @@ -323,10 +330,16 @@ class DebianLocalSourcePackageTestCase(LocalSourcePackageTestCase): self.mock_opener.open(mirror + base + 'example_1.0-1.dsc' ).WithSideEffects(self.urlopen_proxy) - self.mox.StubOutWithMock(debian.deb822.GpgInfo, 'from_sequence') - debian.deb822.GpgInfo.from_sequence(mox.IsA(str)).WithSideEffects( - lambda x: debian.deb822.GpgInfo.from_output( - '[GNUPG:] ERRSIG DEADBEEF')) + def fake_gpg_info(self, message, keyrings=None): + return debian.deb822.GpgInfo.from_output( + '[GNUPG:] ERRSIG DEADBEEF') + # We have to stub this out without mox because there some versions of + # python-debian will pass keyrings=None, others won't. + # http://code.google.com/p/pymox/issues/detail?id=37 + self.mox.stubs.Set(debian.deb822.GpgInfo, 'from_sequence', + types.MethodType(fake_gpg_info, + debian.deb822.GpgInfo, + debian.deb822.GpgInfo)) self.mox.ReplayAll()