[Pkg-bazaar-maint] Bug#463349: updated patch

Mark A. Hershberger mah at everybody.org
Thu Jan 31 21:23:07 UTC 2008


After a few more packages last night, I have a new patch.  My old patch
didn't handle the (common) case of a single top-level directory in the
tarball.

--- builder.py	2008-01-30 23:59:16 +0000
+++ builder.py	2008-01-31 04:00:15 +0000
@@ -284,9 +284,13 @@
       finally:
         tar.close()
       files = glob.glob(tempdir+'/*')
-      os.makedirs(source_dir)
-      for file in files:
-        shutil.move(file, source_dir)
+      if len(files) > 1:
+        os.makedirs(source_dir)
+        for file in files:
+          dest = os.path.join(source_dir, os.path.basename(file))
+          shutil.move(file, dest)
+      else:
+        shutil.move(files.pop(), source_dir)
       shutil.rmtree(tempdir)
       if not upstream:
         shutil.copy(tarball, build_dir)





More information about the Pkg-bazaar-maint mailing list