X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fbinary.py;h=3137e22953ab56805b9ac0e3a5965f701c795747;hb=1fc2bf300a251648e71f85979e20f3d649c3caad;hp=a2601a7205799afd91cc4a79b7e2bdab20d0453c;hpb=11bb7cb6579d8843fdfd1dadfc55fa5ccc6a4ff1;p=dak.git diff --git a/daklib/binary.py b/daklib/binary.py index a2601a72..3137e229 100755 --- a/daklib/binary.py +++ b/daklib/binary.py @@ -24,6 +24,21 @@ Functions related debian binary packages ################################################################################ +# are we going the xorg way? +# a dak without a dak.conf? +# automatically detect the wrong settings at runtime? +# yes! +# well, we'll probably always need dak.conf (how do you get the database setting +# but removing most of the config into the database seems sane +# mhy: dont spoil the fun +# mhy: and i know how. we nmap localhost and check all open ports +# maybe one answers to sql +# we will discover projectb via avahi +# you're both sick +# really fucking sick + +################################################################################ + import os import shutil import tempfile @@ -141,24 +156,23 @@ class Binary(object): os.chdir(self.tmpdir) if self.chunks[1] == "control.tar.gz": control = tarfile.open(os.path.join(self.tmpdir, "control.tar.gz" ), "r:gz") - - + control.extract('control', self.tmpdir ) if self.chunks[2] == "data.tar.gz": data = tarfile.open(os.path.join(self.tmpdir, "data.tar.gz"), "r:gz") elif self.chunks[2] == "data.tar.bz2": data = tarfile.open(os.path.join(self.tmpdir, "data.tar.bz2" ), "r:bz2") if bootstrap_id: - result = DBConn().insert_content_paths(bootstrap_id, [ tarinfo.name for tarinfo in data if not tarinfo.isdir()]) + result = DBConn().insert_content_paths(bootstrap_id, [tarinfo.name for tarinfo in data if not tarinfo.isdir()]) else: - pkg = deb822.Packages.iter_paragraphs( control.extractfile('./control') ).next() - result = DBConn().insert_pending_content_paths(pkg, [ tarinfo.name for tarinfo in data if not tarinfo.isdir()]) + pkg = deb822.Packages.iter_paragraphs(file(os.path.join(self.tmpdir,'control'))).next() + result = DBConn().insert_pending_content_paths(pkg, [tarinfo.name for tarinfo in data if not tarinfo.isdir()]) except: traceback.print_exc() result = False - os.chdir( cwd ) + os.chdir(cwd) return result if __name__ == "__main__":