[Pkg-bazaar-commits] ./bzr-builddeb/trunk r336: Merge fixes from the 2.1 branch.

James Westby james.westby at canonical.com
Sat Jul 4 20:49:02 UTC 2009


------------------------------------------------------------
revno: 336
committer: James Westby <james.westby at canonical.com>
branch nick: trunk
timestamp: Wed 2009-05-06 17:57:26 +0100
message:
  Merge fixes from the 2.1 branch.
modified:
  cmds.py
  config.py
  debian/changelog
  debian/control
  import_dsc.py
  tests/test_repack_tarball.py
  tests/test_upstream.py
  upstream.py
  util.py
    ------------------------------------------------------------
    revno: 327.1.51
    committer: James Westby <jw+debian at jameswestby.net>
    branch nick: 2.1
    timestamp: Tue 2009-03-10 10:37:32 +1000
    message:
      Only create .bzr-builddeb on import if it doesn't exist.
    modified:
      import_dsc.py
    ------------------------------------------------------------
    revno: 327.1.52
    committer: James Westby <james.westby at canonical.com>
    branch nick: 2.1
    timestamp: Mon 2009-03-30 12:51:42 +0100
    message:
      Add --download-version to the uscan command line.
    modified:
      debian/changelog
      upstream.py
    ------------------------------------------------------------
    revno: 327.1.53
    committer: James Westby <james.westby at canonical.com>
    branch nick: 2.1
    timestamp: Mon 2009-03-30 12:52:51 +0100
    message:
      Use multiply_tests rather than adapt_modules.
    modified:
      tests/__init__.py
      tests/test_repack_tarball.py
    ------------------------------------------------------------
    revno: 327.1.54
    committer: James Westby <james.westby at canonical.com>
    branch nick: 2.1
    timestamp: Mon 2009-03-30 12:58:12 +0100
    message:
      Make --export-upstream work again by not trying to use a removed attribute
      in config.py. (LP: #345747)
    modified:
      cmds.py
      config.py
      debian/changelog
      util.py
    ------------------------------------------------------------
    revno: 327.1.55
    committer: James Westby <james.westby at canonical.com>
    branch nick: 2.1
    timestamp: Mon 2009-03-30 13:03:22 +0100
    message:
      Fix up the tarfile tests with python2.6.
    modified:
      tests/test_repack_tarball.py
    ------------------------------------------------------------
    revno: 327.1.56
    committer: James Westby <james.westby at canonical.com>
    branch nick: 2.1
    timestamp: Mon 2009-03-30 13:32:36 +0100
    message:
      Look in the correct place for the tarball created by get-orig-source.
    modified:
      debian/changelog
      tests/test_upstream.py
      upstream.py
    ------------------------------------------------------------
    revno: 327.1.57
    committer: James Westby <james.westby at canonical.com>
    branch nick: 2.1
    timestamp: Mon 2009-03-30 19:23:39 +0100
    message:
      Correct thinko in get_export_upstream_revision.
    modified:
      util.py
    ------------------------------------------------------------
    revno: 327.1.58
    committer: James Westby <james.westby at canonical.com>
    branch nick: 2.1
    timestamp: Tue 2009-03-31 15:48:29 +0100
    message:
      Upload to jaunty.
    modified:
      debian/changelog
      debian/control
    ------------------------------------------------------------
    revno: 327.1.59
    committer: James Westby <james.westby at canonical.com>
    branch nick: 2.1
    timestamp: Wed 2009-05-06 17:56:52 +0100
    message:
      Don't remove the debian part of the version number twice. (LP: #372792)
    modified:
      cmds.py
      debian/changelog
-------------- next part --------------
=== modified file 'cmds.py'
--- a/cmds.py	2009-03-16 15:52:52 +0000
+++ b/cmds.py	2009-05-06 16:57:26 +0000
@@ -75,6 +75,7 @@
         )
 from bzrlib.plugins.builddeb.upstream import UpstreamProvider
 from bzrlib.plugins.builddeb.util import (find_changelog,
+        get_export_upstream_revision,
         lookup_distribution,
         suite_to_distribution,
         tarball_name,
@@ -310,7 +311,7 @@
         return branch, build_options, source
 
     def _get_upstream_branch(self, merge, export_upstream,
-            export_upstream_revision, config):
+            export_upstream_revision, config, version):
         upstream_branch = None
         upstream_revision = None
         if merge:
@@ -322,7 +323,8 @@
                 try:
                     if export_upstream_revision is None:
                         export_upstream_revision = \
-                                    config.export_upstream_revision
+                                    get_export_upstream_revision(config,
+                                            version=version)
                     if export_upstream_revision is None:
                         upstream_revision = \
                                 upstream_branch.last_revision()
@@ -365,10 +367,11 @@
 
             upstream_branch, upstream_revision = \
                     self._get_upstream_branch(merge, export_upstream,
-                            export_upstream_revision, config)
+                            export_upstream_revision, config,
+                            changelog.version)
 
             upstream_provider = UpstreamProvider(tree, branch,
-                    changelog.package, changelog.version.upstream_version,
+                    changelog.package, changelog.version,
                     orig_dir, larstiq=larstiq, upstream_branch=upstream_branch,
                     upstream_revision=upstream_revision, allow_split=split)
 

=== modified file 'config.py'
--- a/config.py	2009-03-04 13:25:53 +0000
+++ b/config.py	2009-03-30 11:58:12 +0000
@@ -21,7 +21,6 @@
 from bzrlib.config import ConfigObj, TreeConfig
 from bzrlib.trace import mutter, warning
 from bzrlib.util.configobj.configobj import ParseError
-from bzrlib.plugins.builddeb.util import get_snapshot_revision
 
 
 class SvnBuildPackageMappedConfig(object):
@@ -268,21 +267,6 @@
   export_upstream = _opt_property('export-upstream',
                          "Get the upstream source from another branch")
 
-  def _get_export_upstream_revision(self):
-    rev = None
-    if self.version is not None:
-      rev = get_snapshot_revision(str(self.version.upstream_version))
-    if rev is None:
-      rev = self._get_best_opt('export-upstream-revision')
-      if rev is not None and self.version is not None:
-        rev = rev.replace('$UPSTREAM_VERSION',
-                          str(self.version.upstream_version))
-    return rev
-
-  export_upstream_revision = property(_get_export_upstream_revision, None,
-                         None,
-                         "The revision of the upstream branch to export.")
-
 
 def _test():
   import doctest

=== modified file 'debian/changelog'
--- a/debian/changelog	2009-03-08 23:05:19 +0000
+++ b/debian/changelog	2009-05-06 16:56:52 +0000
@@ -1,6 +1,15 @@
-bzr-builddeb (2.1.2) UNRELEASED; urgency=low
-
-  * 
+bzr-builddeb (2.1.2~ubuntu2) jaunty; urgency=low
+
+  * Don't remove the debian part of the version number twice. (LP: #372792)
+
+ -- James Westby <james.westby at ubuntu.com>  Wed, 06 May 2009 17:49:49 +0100
+
+bzr-builddeb (2.1.2~ubuntu1) jaunty; urgency=low
+
+  * Add --download-version to the uscan command line.
+  * Make --export-upstream work again by not trying to use a removed attribute
+    in config.py. (LP: #345747)
+  * Look in the correct place for the tarball created by get-orig-source.
 
  -- James Westby <james.westby at ubuntu.com>  Mon, 09 Mar 2009 09:04:48 +1000
 

=== modified file 'debian/control'
--- a/debian/control	2009-03-05 16:22:04 +0000
+++ b/debian/control	2009-03-31 14:48:29 +0000
@@ -1,7 +1,8 @@
 Source: bzr-builddeb
 Section: devel
 Priority: optional
-Maintainer: Debian Bazaar Maintainers <pkg-bazaar-maint at lists.alioth.debian.org>
+Maintainer: Ubuntu MOTU Developers <ubuntu-motu at lists.ubuntu.com>
+XSBC-Original-Maintainer: Debian Bazaar Maintainers <pkg-bazaar-maint at lists.alioth.debian.org>
 Uploaders: Reinhard Tartler <siretart at tauware.de>, James Westby <james.westby at ubuntu.com>
 Build-Depends: debhelper (>= 5.0.37.2), python-all (>= 2.3.5-11)
 Build-Depends-Indep: bzr (>= 1.10~), python-central (>= 0.5.8), python-docutils, python-debian (>= 0.1.11), python-apt, bzrtools (>= 1.2~), patchutils

=== modified file 'import_dsc.py'
--- a/import_dsc.py	2009-03-11 07:23:20 +0000
+++ b/import_dsc.py	2009-05-06 16:57:26 +0000
@@ -1118,7 +1118,8 @@
                 '.bzr-builddeb')
         if current_config is not None:
             # Add that back to the current tree
-            os.mkdir(dirname)
+            if not os.path.exists(dirname):
+                os.mkdir(dirname)
             current_config.filename = os.path.join(dirname,
                     'default.conf')
             current_config.write()

=== modified file 'tests/test_repack_tarball.py'
--- a/tests/test_repack_tarball.py	2009-03-11 03:05:26 +0000
+++ b/tests/test_repack_tarball.py	2009-05-06 16:57:26 +0000
@@ -98,7 +98,7 @@
         finally:
             tar.close()
         self.assertEqual(members,
-                         [self.basedir] +
+                         [self.basedir.rstrip("/")] +
                          [os.path.join(self.basedir, file).rstrip("/") for file in self.files])
 
     def test_repack_tarball_with_target_dir(self):

=== modified file 'tests/test_upstream.py'
--- a/tests/test_upstream.py	2009-03-08 23:18:01 +0000
+++ b/tests/test_upstream.py	2009-03-30 12:32:36 +0000
@@ -130,15 +130,13 @@
         self.find = find
         self.called_times = 0
         self.source_dir = None
-        self.fetch_dir = None
         self.desired_tarball_name = None
         self.target_dir = None
 
-    def provide(self, source_dir, fetch_dir, desired_tarball_name,
+    def provide(self, source_dir, desired_tarball_name,
             target_dir):
         self.called_times += 1
         self.source_dir = source_dir
-        self.fetch_dir = fetch_dir
         self.desired_tarball_name = desired_tarball_name
         self.target_dir = target_dir
         if self.find:

=== modified file 'upstream.py'
--- a/upstream.py	2009-03-07 23:54:46 +0000
+++ b/upstream.py	2009-03-30 12:32:36 +0000
@@ -73,8 +73,9 @@
     info("Using uscan to look for the upstream tarball.")
     r = os.system("uscan --upstream-version %s --force-download --rename "
                   "--package %s --watchfile %s --check-dirname-level 0 " 
-                  "--download --repack --destdir %s" %
-                  (upstream_version, package, watch_file, target_dir))
+                  "--download --repack --destdir %s --download-version %s" %
+                  (upstream_version, package, watch_file, target_dir,
+                   upstream_version))
     if r != 0:
         info("uscan could not find the needed tarball.")
         return False
@@ -94,7 +95,7 @@
     return True
 
 
-def provide_with_get_orig_source(source_dir, fetch_dir, desired_tarball_name,
+def provide_with_get_orig_source(source_dir, desired_tarball_name,
         target_dir):
     info("Trying to use get-orig-source to retrieve needed tarball.")
     command = ["/usr/bin/make", "-f", "debian/rules", "get-orig-source"]
@@ -103,7 +104,7 @@
     if ret != 0:
         info("Trying to run get-orig-source rule failed")
         return False
-    fetched_tarball = os.path.join(fetch_dir, desired_tarball_name)
+    fetched_tarball = os.path.join(source_dir, desired_tarball_name)
     if not os.path.exists(fetched_tarball):
         info("get-orig-source did not create %s"
                 % desired_tarball_name)
@@ -294,7 +295,7 @@
                     os.mkdir(export_dir)
                     export_dir = os.path.join(export_dir, "debian")
                 export(self.tree, export_dir, format="dir")
-                return self._orig_source_provider(base_export_dir, tmpdir,
+                return self._orig_source_provider(base_export_dir,
                         desired_tarball_name, target_dir)
             finally:
                 shutil.rmtree(tmpdir)

=== modified file 'util.py'
--- a/util.py	2009-03-11 07:23:20 +0000
+++ b/util.py	2009-05-06 16:57:26 +0000
@@ -183,6 +183,18 @@
     return None
 
 
+def get_export_upstream_revision(config, version=None):
+    rev = None
+    if version is not None:
+        rev = get_snapshot_revision(str(version.upstream_version))
+    if rev is None:
+        rev = config._get_best_opt('export-upstream-revision')
+        if rev is not None and version is not None:
+            rev = rev.replace('$UPSTREAM_VERSION',
+                              str(version.upstream_version))
+    return rev
+
+
 def suite_to_distribution(suite):
     """Infer the distribution from a suite.
 



More information about the Pkg-bazaar-commits mailing list