[Pkg-bazaar-commits] ./bzr-builddeb/trunk r201: * Be more careful in excluding the root entry when extracting a tarball

James Westby jw+debian at jameswestby.net
Thu May 15 13:29:36 UTC 2008


------------------------------------------------------------
revno: 201
committer: James Westby <jw+debian at jameswestby.net>
branch nick: trunk
timestamp: Fri 2008-01-25 11:17:14 +0000
message:
        * Be more careful in excluding the root entry when extracting a tarball
          from import of a package.
modified:
  debian/changelog
  import_dsc.py
  tests/test_import_dsc.py
-------------- next part --------------
=== modified file 'debian/changelog'
--- a/debian/changelog	2008-01-24 18:09:30 +0000
+++ b/debian/changelog	2008-01-25 11:17:14 +0000
@@ -1,9 +1,13 @@
-bzr-builddeb (0.93) UNRELEASED; urgency=low
+bzr-builddeb (0.93) gutsy; urgency=low
 
   [ Arnaud Fontaine ]
   * Add Vcs-Bzr field (dpkg supports it now) in debian/control.
   * Update GPL path to GPL-2 in debian/copyright as GPL-3 is now the default.
 
+  [ Jelmer Vernooij ]
+  * Allow building snapshots of packages based on version in changelog.
+    (Closes: #452130)
+
   [ James Westby ]
   * Stop specifying a specific branch format when importing a .dsc.
     This improves performance significantly as packs will now be used.
@@ -11,12 +15,10 @@
   * Fix the import diff code to not deadlock on large diffs. Thanks to
     Jamie Wilkinson. (Closes: #451248)
   * Exclude more files/directories than just .bzr when importing.
-
-  [ Jelmer Vernooij ]
-  * Allow building snapshots of packages based on version in changelog.
-    (Closes: #452130)
-
- -- James Westby <jw2328 at dell.linuxdev.us.dell.com>  Thu, 24 Jan 2008 18:08:16 +0000
+  * Be more careful in excluding the root entry when extracting a tarball
+    from import of a package.
+
+ -- James Westby <jw+debian at jameswestby.net>  Fri, 25 Jan 2008 11:16:09 +0000
 
 bzr-builddeb (0.92) unstable; urgency=low
 

=== modified file 'import_dsc.py'
--- a/import_dsc.py	2008-01-25 10:42:06 +0000
+++ b/import_dsc.py	2008-01-25 11:17:14 +0000
@@ -113,10 +113,10 @@
             # type 'g' is a header
             continue
         relative_path = member.name
+        relative_path = relative_path.rstrip('/')
         if prefix is not None:
             relative_path = relative_path[len(prefix)+1:]
-            relative_path = relative_path.rstrip('/')
-        if relative_path == '':
+        if relative_path == '' or relative_path == '.':
             continue
         if should_ignore(relative_path):
             continue

=== modified file 'tests/test_import_dsc.py'
--- a/tests/test_import_dsc.py	2008-01-24 18:09:30 +0000
+++ b/tests/test_import_dsc.py	2008-01-25 11:17:14 +0000
@@ -1052,5 +1052,21 @@
     self.check_revision_message(tree, merged_parents[0],
                           'import upstream from %s' % self.orig_2)
 
+  def test_import_no_prefix(self):
+    write_to_file('README', 'hello\n')
+    write_to_file('NEWS', 'bye bye\n')
+    tar = tarfile.open(self.native_1, 'w:gz')
+    try:
+      tar.add('./', recursive=False)
+      tar.add('README')
+      tar.add('NEWS')
+    finally:
+      tar.close()
+      os.unlink('README')
+      os.unlink('NEWS')
+    self.make_dsc(self.native_dsc_1, '0.1', self.native_1)
+    DscImporter([self.native_dsc_1]).import_dsc(self.target)
+    self.failUnlessExists(self.target)
+
 # vim: sw=2 sts=2 ts=2 
 



More information about the Pkg-bazaar-commits mailing list