]> git.donarmstrong.com Git - dak.git/blobdiff - daklib/utils.py
add our own deb_extract_control function
[dak.git] / daklib / utils.py
index 9afd420e8d154f4824440c7c304812dadc0a68fa..0b8a08d5700a67951d2d6c297d810b2373b0c3b1 100755 (executable)
@@ -33,6 +33,7 @@ import sys
 import tempfile
 import traceback
 import stat
+import apt_inst
 import apt_pkg
 import time
 import re
@@ -765,7 +766,7 @@ def which_conf_file ():
         homedir = os.getenv("HOME")
         confpath = os.path.join(homedir, "/etc/dak.conf")
         if os.path.exists(confpath):
-            apt_pkg.ReadConfigFileISC(Cnf,default_config)
+            apt_pkg.ReadConfigFileISC(Cnf,confpath)
 
     # We are still in here, so there is no local config file or we do
     # not allow local files. Do the normal stuff.
@@ -1625,3 +1626,9 @@ def get_packages_from_ftp(root, suite, component, architecture):
     Packages = apt_pkg.ParseTagFile(packages)
     os.unlink(temp_file)
     return Packages
+
+################################################################################
+
+def deb_extract_control(fh):
+    """extract DEBIAN/control from a binary package"""
+    return apt_inst.DebFile(fh).control.extractdata("control")