[28304] in Source-Commits

home help back first fref pref prev next nref lref last post

build-system commit: Use the correct tar path for control file

daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Sat Jul 5 15:00:40 2014

Date: Sat, 5 Jul 2014 15:00:34 -0400
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201407051900.s65J0YE3025681@drugstore.mit.edu>
To: source-commits@MIT.EDU

https://github.com/mit-athena/build-system/commit/a86bcc4539c8d95ac88f92b7872fa9db2e5db7b5
commit a86bcc4539c8d95ac88f92b7872fa9db2e5db7b5
Author: Jonathan Reed <jdreed@mit.edu>
Date:   Sat Jul 5 14:55:01 2014 -0400

    Use the correct tar path for control file
    
    When dealing with 3.0 (native) packages, the path to the
    control file has a leading component with the source package
    name and version, just like it does in 1.0.  Set the
    controfile name to that, and override it for 3.0 (quilt)
    only.

 dabuildsys/apt.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dabuildsys/apt.py b/dabuildsys/apt.py
index 656b288..ba71c38 100644
--- a/dabuildsys/apt.py
+++ b/dabuildsys/apt.py
@@ -56,11 +56,13 @@ class APTSourcePackage(object):
     def get_control_file(self):
         """Extract control file from the source package."""
 
+        controlname = "%s-%s/debian/control" % (self.name, str(self.version))
         if self.format.startswith('3.0'):
             if self.format == '3.0 (native)':
                 tarname = "%s_%s.tar." % (self.name, str(self.version))
             elif self.format == '3.0 (quilt)':
                 tarname = "%s_%s.debian.tar." % (self.name, str(self.version))
+                controlname = "debian/control"
             else:
                 raise BuildError("Package %s has unsupported format %s in archive" % (self.name, self.format))
 
@@ -71,7 +73,7 @@ class APTSourcePackage(object):
 
             with tarfile.open(tarpath, 'r:*') as tar:
                 return list(debian.deb822.Deb822.iter_paragraphs(
-                    tar.extractfile('debian/control')  ))
+                    tar.extractfile(controlname)  ))
 
         # FIXME: this code should be gone once 1.0 packages are gone
         # I still can't believe I actually wrote this
@@ -82,7 +84,6 @@ class APTSourcePackage(object):
                 except:
                     raise BuildError("Package %s has format 1.0 and does not seem to have the tarball" % self.name)
 
-                controlname = "%s-%s/debian/control" % (self.name, str(self.version))
                 with tarfile.open(tarpath, 'r:*') as tar:
                     return list(debian.deb822.Deb822.iter_paragraphs(
                         tar.extractfile(controlname)  ))

home help back first fref pref prev next nref lref last post