[Pkg-bazaar-commits] ./bzr-builddeb/trunk.old r270: Merge 2.0 fixes.

James Westby jw+debian at jameswestby.net
Wed Dec 10 08:33:02 UTC 2008


------------------------------------------------------------
revno: 270
committer: James Westby <jw+debian at jameswestby.net>
branch nick: trunk
timestamp: Fri 2008-08-29 14:06:37 +0100
message:
  Merge 2.0 fixes.
modified:
  __init__.py
  builder.py
  debian/changelog
  tests/test_builder.py
    ------------------------------------------------------------
    revno: 266.1.2
    committer: James Westby <jw+debian at jameswestby.net>
    branch nick: 2.0
    timestamp: Fri 2008-08-29 14:01:27 +0100
    message:
      Don't move the result if the source and destination are the same location.
      
      This is bug #262621. Trying to move a file to itself isn't a good idea.
    modified:
      builder.py
      debian/changelog
      tests/test_builder.py
    ------------------------------------------------------------
    revno: 266.1.3
    committer: James Westby <jw+debian at jameswestby.net>
    branch nick: 2.0
    timestamp: Fri 2008-08-29 14:04:00 +0100
    message:
      Correct --result-dir -> --result in the help for "builddeb". (bug #262619)
    modified:
      __init__.py
      debian/changelog
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py	2008-08-29 12:46:07 +0000
+++ b/__init__.py	2008-08-29 13:06:37 +0000
@@ -152,9 +152,9 @@
   You can also specify directories to use for different things. --build-dir
   is the directory to build the packages beneath, which defaults to
   '../build-area'. '--orig-dir' specifies the directory that contains the
-  .orig.tar.gz files , which defaults to '..'. '--result-dir' specifies where
+  .orig.tar.gz files , which defaults to '..'. '--result' specifies where
   the resulting package files should be placed, which defaults to '..'.
-  --result-dir will have problems if you use a build command that places
+  --result will have problems if you use a build command that places
   the results in a different directory.
 
   The --reuse option will be useful if you are in merge mode, and the upstream

=== modified file 'builder.py'
--- a/builder.py	2008-08-28 10:44:37 +0000
+++ b/builder.py	2008-08-29 13:01:27 +0000
@@ -337,6 +337,11 @@
     files = changes.files()
     if not os.path.exists(result):
       os.makedirs(result)
+    dir, base = os.path.split(changes.filename())
+    if dir == result:
+      mutter("Not moving result as source and destination locations "
+             "are the same")
+      return
     mutter("Moving %s to %s", changes.filename(), result)
     shutil.move(changes.filename(), result)
     mutter("Moving all files given in %s", changes.filename())

=== modified file 'debian/changelog'
--- a/debian/changelog	2008-08-29 12:47:37 +0000
+++ b/debian/changelog	2008-08-29 13:06:37 +0000
@@ -9,8 +9,11 @@
   * Fix retrieval of the upstream source from a watch file of the archive.
     - It would download to the specified tarball directory, but then
       report it as stored in the compatibility directory. (bug #262618)
+  * Don't move the result if the source and destination are the same location.
+    (bug #262621)
+  * Correct --result-dir -> --result in the help for "builddeb". (bug #262619)
 
- -- James Westby <james.westby at canonical.com>  Thu, 28 Aug 2008 11:41:35 +0100
+ -- James Westby <james.westby at canonical.com>  Fri, 29 Aug 2008 14:02:42 +0100
 
 bzr-builddeb (2.0) experimental; urgency=low
 

=== modified file 'tests/test_builder.py'
--- a/tests/test_builder.py	2008-08-26 15:41:59 +0000
+++ b/tests/test_builder.py	2008-08-29 13:01:27 +0000
@@ -433,6 +433,12 @@
     self.make_changes_file()
     self.assertRaises(errors.DebianError, builder.move_result, self.result_dir)
 
+  def test_move_result_handles_moving_to_same_place(self):
+    builder = self.get_builder()
+    self.make_changes_file()
+    self.make_result_files()
+    builder.move_result(self.build_dir)
+
 
 class TestNativeBuilder(BuilderTestCase):
   """Test the native builder."""



More information about the Pkg-bazaar-commits mailing list