]> git.decadent.org.uk Git - dak.git/commitdiff
Merge commit 'stew/categorize-bts' into merge
authorJoerg Jaspert <joerg@debian.org>
Sun, 25 Jan 2009 16:51:40 +0000 (17:51 +0100)
committerJoerg Jaspert <joerg@debian.org>
Sun, 25 Jan 2009 16:51:40 +0000 (17:51 +0100)
* commit 'stew/categorize-bts':
  git rid of useless email realeted imports.  added docstring for module
  Use dak's facility for sending email.  Add bts-categorize to cron.dinstall
  dont send email unless there is something to categorize
  move bts_categorize into dak, send email
  drop logging level
  a script that categorizes bugs against ftp.debian.org

Signed-off-by: Joerg Jaspert <joerg@debian.org>
48 files changed:
dak/check_archive.py
dak/check_overrides.py [changed mode: 0644->0755]
dak/check_proposed_updates.py
dak/clean_proposed_updates.py
dak/clean_queues.py
dak/clean_suites.py
dak/compare_suites.py
dak/control_overrides.py [changed mode: 0644->0755]
dak/control_suite.py [changed mode: 0644->0755]
dak/cruft_report.py
dak/dakdb/update1.py [changed mode: 0644->0755]
dak/dakdb/update2.py
dak/dakdb/update3.py
dak/decode_dot_dak.py [changed mode: 0644->0755]
dak/examine_package.py
dak/find_null_maintainers.py
dak/generate_index_diffs.py
dak/generate_releases.py
dak/import_archive.py
dak/import_keyring.py
dak/import_ldap_fingerprints.py
dak/import_users_from_passwd.py
dak/ls.py
dak/make_maintainers.py
dak/make_overrides.py
dak/make_suite_file_list.py
dak/new_security_install.py
dak/override.py
dak/poolize.py [changed mode: 0644->0755]
dak/process_accepted.py
dak/process_new.py
dak/process_unchecked.py
dak/queue_report.py
dak/reject_proposed_updates.py
dak/rm.py
dak/show_deferred.py
dak/show_new.py
dak/split_done.py
dak/stats.py
dak/transitions.py
dak/update_db.py
daklib/dak_exceptions.py [changed mode: 0644->0755]
daklib/database.py
daklib/extensions.py [changed mode: 0644->0755]
daklib/logging.py [changed mode: 0644->0755]
daklib/queue.py
daklib/regexes.py [new file with mode: 0644]
daklib/utils.py

index 33dc8481bc2aeac659c4e055e7917ebfa06829da..004fcddd8c25694cc2d24130d75b99171fd83cdf 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Various different sanity checks
+""" Various different sanity checks """
 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
@@ -30,6 +30,7 @@ import commands, os, pg, stat, sys, time
 import apt_pkg, apt_inst
 from daklib import database
 from daklib import utils
+from daklib.regexes import re_issource
 
 ################################################################################
 
@@ -287,7 +288,7 @@ def check_missing_tar_gz_in_dsc():
         dsc_files = utils.build_file_list(dsc, is_a_dsc=1)
         has_tar = 0
         for f in dsc_files.keys():
-            m = utils.re_issource.match(f)
+            m = re_issource.match(f)
             if not m:
                 utils.fubar("%s not recognised as source." % (f))
             ftype = m.group(3)
old mode 100644 (file)
new mode 100755 (executable)
index f276dba..ff01306
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Cruft checker and hole filler for overrides
+""" Cruft checker and hole filler for overrides """
 # Copyright (C) 2000, 2001, 2002, 2004, 2006  James Troup <james@nocrew.org>
 # Copyright (C) 2005  Jeroen van Wolffelaar <jeroen@wolffelaar.nl>
 
index afb0faaeb9a1832552e6bd75c762f5bfcf0fda43..5b9283f712e3cee0d54711991ec795cb2c760ea8 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Dependency check proposed-updates
+""" Dependency check proposed-updates """
 # Copyright (C) 2001, 2002, 2004, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
@@ -32,6 +32,7 @@ import pg, sys, os
 import apt_pkg, apt_inst
 from daklib import database
 from daklib import utils
+from daklib.regexes import re_no_epoch
 
 ################################################################################
 
@@ -91,7 +92,7 @@ def check_dep (depends, dep_type, check_archs, filename, files):
                             unsat = 0
                             break
                 # As part of the same .changes?
-                epochless_version = utils.re_no_epoch.sub('', version)
+                epochless_version = re_no_epoch.sub('', version)
                 dep_filename = "%s_%s_%s.deb" % (dep, epochless_version, arch)
                 if files.has_key(dep_filename):
                     if Options["debug"]:
index 3dd6e6f3dbad3bd34a3489751d5f769c3c825fa0..0e9c0b6eec2bf5c283317a0f28840ad2d87af27b 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Remove obsolete .changes files from proposed-updates
+""" Remove obsolete .changes files from proposed-updates """
 # Copyright (C) 2001, 2002, 2003, 2004, 2006, 2008  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
 
 ################################################################################
 
-import os, pg, re, sys
+import os, pg, sys
 import apt_pkg
 from daklib import database
 from daklib import utils
+from daklib.regexes import re_isdeb, re_isadeb, re_issource, re_no_epoch
 
 ################################################################################
 
@@ -31,8 +32,6 @@ projectB = None
 Options = None
 pu = {}
 
-re_isdeb = re.compile (r"^(.+)_(.+?)_(.+?).u?deb$")
-
 ################################################################################
 
 def usage (exit_code=0):
@@ -56,7 +55,7 @@ def check_changes (filename):
         return
     num_files = len(files.keys())
     for f in files.keys():
-        if utils.re_isadeb.match(f):
+        if re_isadeb.match(f):
             m = re_isdeb.match(f)
             pkg = m.group(1)
             version = m.group(2)
@@ -64,7 +63,7 @@ def check_changes (filename):
             if Options["debug"]:
                 print "BINARY: %s ==> %s_%s_%s" % (f, pkg, version, arch)
         else:
-            m = utils.re_issource.match(f)
+            m = re_issource.match(f)
             if m:
                 pkg = m.group(1)
                 version = m.group(2)
@@ -86,7 +85,7 @@ def check_changes (filename):
             # FIXME
             utils.warn("%s doesn't seem to exist for %s in %s?? (from %s [%s])" % (pkg, arch, Options["suite"], f, filename))
             continue
-        pu_version = utils.re_no_epoch.sub('', pu[pkg][arch])
+        pu_version = re_no_epoch.sub('', pu[pkg][arch])
         if pu_version == version:
             if Options["verbose"]:
                 print "%s: ok" % (f)
index 9f771b7261e6fbd8c846c9966327fe43d4ebfff4..34d90473a1b345715996029b6bb50ad2541b317c 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Clean incoming of old unused files
+""" Clean incoming of old unused files """
 # Copyright (C) 2000, 2001, 2002, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
index fc4b8473669e6554ee7ab2d343a81880755a9d10..5523d63353bfa34f1eddb44174f6e74b8aed18de 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Cleans up unassociated binary and source packages
+""" Cleans up unassociated binary and source packages """
 # Copyright (C) 2000, 2001, 2002, 2003, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
index 8c367582663622701c48ea49803931050ccb846c..ab0ab3c0d6d8c04f5456c15cf72258321ef3e572 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Check for fixable discrepancies between stable and unstable
+""" Check for fixable discrepancies between stable and unstable """
 # Copyright (C) 2000, 2001, 2002, 2003, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
old mode 100644 (file)
new mode 100755 (executable)
index 0af5c48..730ce25
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Bulk manipulation of the overrides
+""" Bulk manipulation of the overrides """
 # Copyright (C) 2000, 2001, 2002, 2003, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
@@ -54,6 +54,7 @@ import apt_pkg
 from daklib import utils
 from daklib import database
 from daklib import logging
+from daklib.regexes import re_comments
 
 ################################################################################
 
@@ -118,7 +119,7 @@ def process_file (file, suite, component, type, action):
     start_time = time.time()
     projectB.query("BEGIN WORK")
     for line in file.readlines():
-        line = utils.re_comments.sub('', line).strip()
+        line = re_comments.sub('', line).strip()
         if line == "":
             continue
 
old mode 100644 (file)
new mode 100755 (executable)
index 4b704b9..95b24bc
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Manipulate suite tags
+""" Manipulate suite tags """
 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
index 0f1125f81bc3c8f7eba5dcf9b170a81449ee0a9e..d88c799b019d857ecaf689530a2ce6174e58a994 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Check for obsolete binary packages
+""" Check for obsolete binary packages """
 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
@@ -31,6 +31,7 @@ import commands, pg, os, sys, time, re
 import apt_pkg
 from daklib import database
 from daklib import utils
+from daklib.regexes import re_extract_src_version
 
 ################################################################################
 
@@ -456,7 +457,7 @@ def main ():
                     bin2source[package]["version"] = version
                     bin2source[package]["source"] = source
                 if source.find("(") != -1:
-                    m = utils.re_extract_src_version.match(source)
+                    m = re_extract_src_version.match(source)
                     source = m.group(1)
                     version = m.group(2)
                 if not bin_pkgs.has_key(package):
old mode 100644 (file)
new mode 100755 (executable)
index 3f0aa80..7778b1b
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Debian Archive Kit Database Update Script
+""" Database Update Script - Saner DM db schema """
 # Copyright (C) 2008  Michael Casadevall <mcasadevall@debian.org>
 
 # This program is free software; you can redistribute it and/or modify
index 20154b07e007ef636d6fd5cde8713cbaf48c65c3..71b43fa701ccd73caab555e9e878097ad4a15e24 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 # coding=utf8
 
-# Debian Archive Kit Database Update Script
+""" Database Update Script - debversion """
 # Copyright Â© 2008  Michael Casadevall <mcasadevall@debian.org>
 # Copyright Â© 2008  Roger Leigh <rleigh@debian.org>
 
index cc297863ccafcccab7a12e26e966a03b1babcd9a..df89fb9d6300710e85ec890d51a830b25f8b3a76 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Debian Archive Kit Database Update Script
+""" Database Update Script - Remove unused versioncmp """
 # Copyright (C) 2008  Michael Casadevall <mcasadevall@debian.org>
 # Copyright (C) 2009  Joerg Jaspert <joerg@debian.org>
 
old mode 100644 (file)
new mode 100755 (executable)
index 7ea342b..e6bc45b
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Dump variables from a .dak file to stdout
+""" Dump variables from a .dak file to stdout """
 # Copyright (C) 2001, 2002, 2004, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
index 2a1a711e04ed4dd50f98855bf18770376d095553..d0e1e53aed7a0d357a67838fda6a84fe7231a977 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Script to automate some parts of checking NEW packages
+""" Script to automate some parts of checking NEW packages """
 # Copyright (C) 2000, 2001, 2002, 2003, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
@@ -36,24 +36,9 @@ import errno, os, pg, re, sys, md5
 import apt_pkg, apt_inst
 from daklib import database
 from daklib import utils
-
-################################################################################
-
-re_package = re.compile(r"^(.+?)_.*")
-re_doc_directory = re.compile(r".*/doc/([^/]*).*")
-
-re_contrib = re.compile('^contrib/')
-re_nonfree = re.compile('^non\-free/')
-
-re_arch = re.compile("Architecture: .*")
-re_builddep = re.compile("Build-Depends: .*")
-re_builddepind = re.compile("Build-Depends-Indep: .*")
-
-re_localhost = re.compile("localhost\.localdomain")
-re_version = re.compile('^(.*)\((.*)\)')
-
-re_newlinespace = re.compile('\n')
-re_spacestrip = re.compile('(\s)')
+from daklib.regexes import html_escaping, re_html_escaping, re_version, re_spacestrip, \
+                           re_contrib, re_nonfree, re_localhost, re_newlinespace, \
+                           re_package, re_doc_directory
 
 ################################################################################
 
@@ -88,7 +73,7 @@ PACKAGE can be a .changes, .dsc, .deb or .udeb filename."""
 
 def escape_if_needed(s):
     if use_html:
-        return utils.re_html_escaping.sub(lambda x: utils.html_escaping.get(x.group(0)), s)
+        return re_html_escaping.sub(lambda x: html_escaping.get(x.group(0)), s)
     else:
         return s
 
index 652edfd2e3ef9c403b1ab812aed04bb522d631b5..c943335ab18f6b2a70024da3ca76e621893f14d5 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Check for users with no packages in the archive
+""" Check for users with no packages in the archive """
 # Copyright (C) 2003, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
index f3f7a4a16bfec70f48db0b62268519c36031c6e1..2b06146b3b1e00aeff6bfaacebe56cbd0932605d 100755 (executable)
@@ -1,7 +1,8 @@
 #!/usr/bin/env python
 
+""" generates partial package updates list"""
+
 ###########################################################
-# generates partial package updates list
 
 # idea and basic implementation by Anthony, some changes by Andreas
 # parts are stolen from 'dak generate-releases'
@@ -253,11 +254,8 @@ def genchanges(Options, outdir, oldfile, origfile, maxdiffs = 14):
         if not os.path.isdir(outdir):
             os.mkdir(outdir)
 
-        cmd = "diff --ed - %s | gzip -c -9 > %s.gz" % (newfile, difffile)
-        # Do we need shell=True?
-        w = subprocess.Popen(cmd, shell=True, stdin=PIPE).stdin
-
-        # I bet subprocess can do that better than this, but lets do little steps
+        w = os.popen("diff --ed - %s | gzip -c -9 > %s.gz" %
+                     (newfile, difffile), "w")
         pipe_file(oldf, w)
         oldf.close()
 
index a1552451051f2a189b9ab57cd8093da8ca2673fb..1c258bd5c511d292757d59f678d86fcbab0f56b3 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Create all the Release files
+""" Create all the Release files """
 
 # Copyright (C) 2001, 2002, 2006  Anthony Towns <ajt@debian.org>
 
index 53635e2acac63b7f086cb4b5b208f138ef0acd56..d87d6ca9e3fd98e638620807aed50be1929cbdb3 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Populate the DB
+""" Populate the DB """
 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
 
 ###############################################################################
 
-import commands, os, pg, re, sys, time
+import commands, os, pg, sys, time
 import apt_pkg
 from daklib import database
 from daklib import utils
 from daklib.dak_exceptions import *
-
-###############################################################################
-
-re_arch_from_filename = re.compile(r"binary-[^/]+")
+from daklib.regexes import re_arch_from_filename, re_taint_free, re_no_epoch, \
+                           re_extract_src_version
 
 ###############################################################################
 
@@ -94,7 +92,7 @@ def reject (str, prefix="Rejected: "):
 ###############################################################################
 
 def check_signature (filename):
-    if not utils.re_taint_free.match(os.path.basename(filename)):
+    if not re_taint_free.match(os.path.basename(filename)):
         reject("!!WARNING!! tainted filename: '%s'." % (filename))
         return None
 
@@ -332,12 +330,12 @@ def process_sources (filename, suite, component, archive):
         package = Scanner.Section["package"]
         version = Scanner.Section["version"]
         directory = Scanner.Section["directory"]
-        dsc_file = os.path.join(Cnf["Dir::Root"], directory, "%s_%s.dsc" % (package, utils.re_no_epoch.sub('', version)))
+        dsc_file = os.path.join(Cnf["Dir::Root"], directory, "%s_%s.dsc" % (package, re_no_epoch.sub('', version)))
         # Sometimes the Directory path is a lie; check in the pool
         if not os.path.exists(dsc_file):
             if directory.split('/')[0] == "dists":
                 directory = Cnf["Dir::PoolRoot"] + utils.poolify(package, component)
-                dsc_file = os.path.join(Cnf["Dir::Root"], directory, "%s_%s.dsc" % (package, utils.re_no_epoch.sub('', version)))
+                dsc_file = os.path.join(Cnf["Dir::Root"], directory, "%s_%s.dsc" % (package, re_no_epoch.sub('', version)))
         if not os.path.exists(dsc_file):
             utils.fubar("%s not found." % (dsc_file))
         install_date = time.strftime("%Y-%m-%d", time.localtime(os.path.getmtime(dsc_file)))
@@ -355,7 +353,7 @@ def process_sources (filename, suite, component, archive):
         directory = poolify (directory, location)
         if directory != "" and not directory.endswith("/"):
             directory += '/'
-        no_epoch_version = utils.re_no_epoch.sub('', version)
+        no_epoch_version = re_no_epoch.sub('', version)
         # Add all files referenced by the .dsc to the files table
         ids = []
         for line in Scanner.Section["files"].split('\n'):
@@ -427,7 +425,7 @@ def process_packages (filename, suite, component, archive):
             source = Scanner.Section["source"]
         source_version = ""
         if source.find("(") != -1:
-            m = utils.re_extract_src_version.match(source)
+            m = re_extract_src_version.match(source)
             source = m.group(1)
             source_version = m.group(2)
         if not source_version:
index c8013d6e7f10c598414a3b77690f9f0160c33efe..ca325d0da290da53abf7e818ba8c047988461a9a 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Imports a keyring into the database
+""" Imports a keyring into the database """
 # Copyright (C) 2007  Anthony Towns <aj@erisian.com.au>
 
 # This program is free software; you can redistribute it and/or modify
index 49b5b056cd00f67877ee7b172a9c110bc6c3556e..cdffbd0a6894adc3437197e22fa3f2d22dfbccaf 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Sync fingerprint and uid tables with a debian.org LDAP DB
+""" Sync fingerprint and uid tables with a debian.org LDAP DB """
 # Copyright (C) 2003, 2004, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
@@ -48,15 +48,13 @@ import commands, ldap, pg, re, sys
 import apt_pkg
 from daklib import database
 from daklib import utils
+from daklib.regexes import re_gpg_fingerprint, re_debian_address
 
 ################################################################################
 
 Cnf = None
 projectB = None
 
-re_gpg_fingerprint = re.compile(r"^\s+Key fingerprint = (.*)$", re.MULTILINE)
-re_debian_address = re.compile(r"^.*<(.*)@debian\.org>$", re.MULTILINE)
-
 ################################################################################
 
 def usage(exit_code=0):
index b182f604ea01e6875a468c85f88c28e8f47f2fd4..d38a3c93fa3b9a982fa497abcd216a6ba4752f5b 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Sync PostgreSQL users with system users
+""" Sync PostgreSQL users with system users """
 # Copyright (C) 2001, 2002, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
index baf137335739ea4fb313e07db41602e560a85c50..b9753b483e265303246ac6e533059c550790ec93 100755 (executable)
--- a/dak/ls.py
+++ b/dak/ls.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Display information about package(s) (suite, version, etc.)
+""" Display information about package(s) (suite, version, etc.) """
 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
index 679ed22367ce62e3a8229fd81d9d89202853ba00..913537500c47688e8cbe53275f8c69d45fd63e8b 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Generate Maintainers file used by e.g. the Debian Bug Tracking System
+""" Generate Maintainers file used by e.g. the Debian Bug Tracking System """
 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
@@ -29,6 +29,7 @@ import pg, sys
 import apt_pkg
 from daklib import database
 from daklib import utils
+from daklib.regexes import re_comments
 
 ################################################################################
 
@@ -132,7 +133,7 @@ def main():
     for filename in extra_files:
         extrafile = utils.open_file(filename)
         for line in extrafile.readlines():
-            line = utils.re_comments.sub('', line).strip()
+            line = re_comments.sub('', line).strip()
             if line == "":
                 continue
             split = line.split()
index 2ed4f4bafeabac1fec9f84da65b4776402d341fb..176e563f6358ff45a7b4f0923903831e3165b45a 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Output override files for apt-ftparchive and indices/
+""" Output override files for apt-ftparchive and indices/ """
 # Copyright (C) 2000, 2001, 2002, 2004, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
index dbbab7ec4712bcc3eacfe28ee55e2dadd99a0d91..87dfbdf9cb7a66e36aa1424fc40958a2cc1c9bc0 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Generate file lists used by apt-ftparchive to generate Packages and Sources files
+""" Generate file lists used by apt-ftparchive to generate Packages and Sources files """
 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
@@ -82,7 +82,7 @@ def delete_packages(delete_versions, pkg, dominant_arch, suite,
         if not packages.has_key(delete_unique_id):
             continue
         delete_version = version[0]
-        delete_id = packages[delete_unique_id]["id"]
+        delete_id = packages[delete_unique_id]["sourceid"]
         delete_arch = packages[delete_unique_id]["arch"]
         if not Cnf.Find("Suite::%s::Untouchable" % (suite)) or Options["Force"]:
             if Options["No-Delete"]:
@@ -264,7 +264,7 @@ def write_filelists(packages, dislocated_files):
         suite = packages[unique_id]["suite"]
         component = packages[unique_id]["component"]
         arch = packages[unique_id]["arch"]
-        packagetype = packages[unique_id]["type"]
+        packagetype = packages[unique_id]["filetype"]
         d.setdefault(suite, {})
         d[suite].setdefault(component, {})
         d[suite][component].setdefault(arch, {})
index 4071b78afdac79db33db354880ea7fbc6c138729..b1a47dba8f2527bbe733afea5f014f064acf4634 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Wrapper for Debian Security team
+""" Wrapper for Debian Security team """
 # Copyright (C) 2006  Anthony Towns <ajt@debian.org>
 
 # This program is free software; you can redistribute it and/or modify
 
 ################################################################################
 
+import apt_pkg, os, sys, pwd, time, commands
+
 from daklib import queue
 from daklib import logging
 from daklib import utils
 from daklib import database
-import apt_pkg, os, sys, pwd, time, re, commands
-
-re_taint_free = re.compile(r"^['/;\-\+\.~\s\w]+$")
+from daklib.regexes import re_taint_free
 
 Cnf = None
 Options = None
index 0bda5e769996f64f6cbaed6996aa4e3190178277..4b92ae1105bf989eef06e41642c674de29c3de49 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Microscopic modification and query tool for overrides in projectb
+""" Microscopic modification and query tool for overrides in projectb """
 # Copyright (C) 2004, 2006  Daniel Silverstone <dsilvers@digital-scurf.org>
 
 # This program is free software; you can redistribute it and/or modify
old mode 100644 (file)
new mode 100755 (executable)
index 5b7ffbf..ef41d74
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Poolify (move packages from "legacy" type locations to pool locations)
+""" Poolify (move packages from "legacy" type locations to pool locations) """
 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
@@ -29,14 +29,13 @@ import os, pg, re, stat, sys
 import apt_pkg, apt_inst
 import daklib.database
 import daklib.utils
+from daklib.regexes import re_isadeb, re_extract_src_version, re_no_epoch, re_issource
 
 ################################################################################
 
 Cnf = None
 projectB = None
 
-re_isadeb = re.compile (r"(.+?)_(.+?)(_(.+))?\.u?deb$")
-
 ################################################################################
 
 def usage (exit_code=0):
@@ -84,17 +83,17 @@ def poolize (q, limit, verbose, no_action):
             package = control.Find("Package", "")
             source = control.Find("Source", package)
             if source.find("(") != -1:
-                m = daklib.utils.re_extract_src_version.match(source)
+                m = re_extract_src_version.match(source)
                 source = m.group(1)
             # If it's a binary, we need to also rename the file to include the architecture
             version = control.Find("Version", "")
             architecture = control.Find("Architecture", "")
             if package == "" or version == "" or architecture == "":
                 daklib.utils.fubar("%s: couldn't determine required information to rename .deb file." % (legacy_filename))
-            version = daklib.utils.re_no_epoch.sub('', version)
+            version = re_no_epoch.sub('', version)
             destination_filename = "%s_%s_%s.deb" % (package, version, architecture)
         else:
-            m = daklib.utils.re_issource.match(base_filename)
+            m = re_issource.match(base_filename)
             if m:
                 source = m.group(1)
             else:
index a25c391fc374f9d286d8e515ecf74adfa64e9684..683b1191ad6974ecbe72673ffeda85d6e5e5da88 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Installs Debian packages from queue/accepted into the pool
+""" Installs Debian packages from queue/accepted into the pool """
 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
@@ -36,6 +36,7 @@ from daklib import logging
 from daklib import queue
 from daklib import utils
 from daklib.dak_exceptions import *
+from daklib.regexes import re_default_answer, re_issource, re_fdnic
 
 ###############################################################################
 
@@ -220,7 +221,7 @@ def action ():
 
     while prompt.find(answer) == -1:
         answer = utils.our_raw_input(prompt)
-        m = queue.re_default_answer.match(prompt)
+        m = re_default_answer.match(prompt)
         if answer == "":
             answer = m.group(1)
         answer = answer[:1].upper()
@@ -538,11 +539,11 @@ def stable_install (summary, short_summary):
     for newfile in files.keys():
         if files[newfile]["type"] == "deb":
             new_changelog.write("stable/%s/binary-%s/%s\n" % (files[newfile]["component"], files[newfile]["architecture"], newfile))
-        elif utils.re_issource.match(newfile):
+        elif re_issource.match(newfile):
             new_changelog.write("stable/%s/source/%s\n" % (files[newfile]["component"], newfile))
         else:
             new_changelog.write("%s\n" % (newfile))
-    chop_changes = queue.re_fdnic.sub("\n", changes["changes"])
+    chop_changes = re_fdnic.sub("\n", changes["changes"])
     new_changelog.write(chop_changes + '\n\n')
     if os.access(changelog_filename, os.R_OK) != 0:
         changelog = utils.open_file(changelog_filename)
index 496e5689babf47ba026018b6437a1bb765ccb4a5..8741d25ec887e0e19304b174473772ab47ae5119 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 # vim:set et ts=4 sw=4:
 
-# Handles NEW and BYHAND packages
+""" Handles NEW and BYHAND packages """
 # Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
@@ -44,6 +44,7 @@ from daklib import database
 from daklib import logging
 from daklib import queue
 from daklib import utils
+from daklib.regexes import re_no_epoch, re_default_answer, re_isanum
 
 # Globals
 Cnf = None
@@ -82,7 +83,7 @@ def recheck():
             source_package = files[f]["source package"]
             if not Upload.pkg.changes["architecture"].has_key("source") \
                and not Upload.source_exists(source_package, source_version, Upload.pkg.changes["distribution"].keys()):
-                source_epochless_version = utils.re_no_epoch.sub('', source_version)
+                source_epochless_version = re_no_epoch.sub('', source_version)
                 dsc_filename = "%s_%s.dsc" % (source_package, source_epochless_version)
                 found = 0
                 for q in ["Accepted", "Embargoed", "Unembargoed"]:
@@ -110,7 +111,7 @@ def recheck():
 
         while prompt.find(answer) == -1:
             answer = utils.our_raw_input(prompt)
-            m = queue.re_default_answer.match(prompt)
+            m = re_default_answer.match(prompt)
             if answer == "":
                 answer = m.group(1)
             answer = answer[:1].upper()
@@ -367,7 +368,7 @@ def edit_index (new, index):
 
         while prompt.find(answer) == -1:
             answer = utils.our_raw_input(prompt)
-            m = queue.re_default_answer.match(prompt)
+            m = re_default_answer.match(prompt)
             if answer == "":
                 answer = m.group(1)
             answer = answer[:1].upper()
@@ -437,7 +438,7 @@ def edit_overrides (new):
                 answer = answer[:1].upper()
             if answer == "E" or answer == "D":
                 got_answer = 1
-            elif queue.re_isanum.match (answer):
+            elif re_isanum.match (answer):
                 answer = int(answer)
                 if (answer < 1) or (answer > index):
                     print "%s is not a valid index (%s).  Please retry." % (answer, index_range(index))
@@ -474,7 +475,7 @@ def edit_note(note):
         answer = "XXX"
         while prompt.find(answer) == -1:
             answer = utils.our_raw_input(prompt)
-            m = queue.re_default_answer.search(prompt)
+            m = re_default_answer.search(prompt)
             if answer == "":
                 answer = m.group(1)
             answer = answer[:1].upper()
@@ -577,7 +578,7 @@ def prod_maintainer ():
         answer = "XXX"
         while prompt.find(answer) == -1:
             answer = utils.our_raw_input(prompt)
-            m = queue.re_default_answer.search(prompt)
+            m = re_default_answer.search(prompt)
             if answer == "":
                 answer = m.group(1)
             answer = answer[:1].upper()
@@ -664,7 +665,7 @@ def do_new():
 
         while prompt.find(answer) == -1:
             answer = utils.our_raw_input(prompt)
-            m = queue.re_default_answer.search(prompt)
+            m = re_default_answer.search(prompt)
             if answer == "":
                 answer = m.group(1)
             answer = answer[:1].upper()
@@ -773,7 +774,7 @@ def do_byhand():
 
         while prompt.find(answer) == -1:
             answer = utils.our_raw_input(prompt)
-            m = queue.re_default_answer.search(prompt)
+            m = re_default_answer.search(prompt)
             if answer == "":
                 answer = m.group(1)
             answer = answer[:1].upper()
index fae2fffb98a1d7dd65c35a19ac93ee269608e913..6761a419fa4ef0887ee3b3a125df07700ec28313 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Checks Debian packages from Incoming
+""" Checks Debian packages from Incoming """
 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
@@ -35,17 +35,15 @@ from daklib import logging
 from daklib import queue
 from daklib import utils
 from daklib.dak_exceptions import *
+from daklib.regexes import re_valid_version, re_valid_pkg_name, re_changelog_versions, \
+                           re_strip_revision, re_strip_srcver, re_spacestrip, \
+                           re_isanum, re_no_epoch, re_no_revision, re_taint_free, \
+                           re_isadeb, re_extract_src_version, re_issource
 
 from types import *
 
 ################################################################################
 
-re_valid_version = re.compile(r"^([0-9]+:)?[0-9A-Za-z\.\-\+:~]+$")
-re_valid_pkg_name = re.compile(r"^[\dA-Za-z][\dA-Za-z\+\-\.]+$")
-re_changelog_versions = re.compile(r"^\w[-+0-9a-z.]+ \([^\(\) \t]+\)")
-re_strip_revision = re.compile(r"-([^-]+)$")
-re_strip_srcver = re.compile(r"\s+\(\S+\)$")
-re_spacestrip = re.compile('(\s)')
 
 ################################################################################
 
@@ -246,13 +244,13 @@ def check_changes():
     # Ensure all the values in Closes: are numbers
     if changes.has_key("closes"):
         for i in changes["closes"].keys():
-            if queue.re_isanum.match (i) == None:
+            if re_isanum.match (i) == None:
                 reject("%s: `%s' from Closes field isn't a number." % (filename, i))
 
 
     # chopversion = no epoch; chopversion2 = no epoch and no revision (e.g. for .orig.tar.gz comparison)
-    changes["chopversion"] = utils.re_no_epoch.sub('', changes["version"])
-    changes["chopversion2"] = utils.re_no_revision.sub('', changes["chopversion"])
+    changes["chopversion"] = re_no_epoch.sub('', changes["version"])
+    changes["chopversion2"] = re_no_revision.sub('', changes["chopversion"])
 
     # Check there isn't already a changes file of the same name in one
     # of the queue directories.
@@ -393,7 +391,7 @@ def check_files():
             if not Cnf.has_key("Dir::Queue::%s" % (d)): continue
             if os.path.exists(Cnf["Dir::Queue::%s" % (d) ] + '/' + f):
                 reject("%s file already exists in the %s directory." % (f, d))
-        if not utils.re_taint_free.match(f):
+        if not re_taint_free.match(f):
             reject("!!WARNING!! tainted filename: '%s'." % (f))
         # Check the file is readable
         if os.access(f, os.R_OK) == 0:
@@ -411,7 +409,7 @@ def check_files():
             files[f]["byhand"] = 1
             files[f]["type"] = "byhand"
         # Checks for a binary package...
-        elif utils.re_isadeb.match(f):
+        elif re_isadeb.match(f):
             has_binaries = 1
             files[f]["type"] = "deb"
 
@@ -497,7 +495,7 @@ def check_files():
             source = files[f]["source"]
             source_version = ""
             if source.find("(") != -1:
-                m = utils.re_extract_src_version.match(source)
+                m = re_extract_src_version.match(source)
                 source = m.group(1)
                 source_version = m.group(2)
             if not source_version:
@@ -506,12 +504,12 @@ def check_files():
             files[f]["source version"] = source_version
 
             # Ensure the filename matches the contents of the .deb
-            m = utils.re_isadeb.match(f)
+            m = re_isadeb.match(f)
             #  package name
             file_package = m.group(1)
             if files[f]["package"] != file_package:
                 reject("%s: package part of filename (%s) does not match package name in the %s (%s)." % (f, file_package, files[f]["dbtype"], files[f]["package"]))
-            epochless_version = utils.re_no_epoch.sub('', control.Find("Version"))
+            epochless_version = re_no_epoch.sub('', control.Find("Version"))
             #  version
             file_version = m.group(2)
             if epochless_version != file_version:
@@ -531,7 +529,7 @@ def check_files():
                 # Check in the SQL database
                 if not Upload.source_exists(source_package, source_version, changes["distribution"].keys()):
                     # Check in one of the other directories
-                    source_epochless_version = utils.re_no_epoch.sub('', source_version)
+                    source_epochless_version = re_no_epoch.sub('', source_version)
                     dsc_filename = "%s_%s.dsc" % (source_package, source_epochless_version)
                     if os.path.exists(Cnf["Dir::Queue::Byhand"] + '/' + dsc_filename):
                         files[f]["byhand"] = 1
@@ -553,7 +551,7 @@ def check_files():
 
         # Checks for a source package...
         else:
-            m = utils.re_issource.match(f)
+            m = re_issource.match(f)
             if m:
                 has_source = 1
                 files[f]["package"] = m.group(1)
@@ -748,7 +746,7 @@ def check_dsc():
                 pass
 
     # Ensure the version number in the .dsc matches the version number in the .changes
-    epochless_dsc_version = utils.re_no_epoch.sub('', dsc["version"])
+    epochless_dsc_version = re_no_epoch.sub('', dsc["version"])
     changes_version = files[dsc_filename]["version"]
     if epochless_dsc_version != files[dsc_filename]["version"]:
         reject("version ('%s') in .dsc does not match version ('%s') in .changes." % (epochless_dsc_version, changes_version))
@@ -756,7 +754,7 @@ def check_dsc():
     # Ensure there is a .tar.gz in the .dsc file
     has_tar = 0
     for f in dsc_files.keys():
-        m = utils.re_issource.match(f)
+        m = re_issource.match(f)
         if not m:
             reject("%s: %s in Files field not recognised as source." % (dsc_filename, f))
             continue
@@ -806,7 +804,7 @@ def get_changelog_versions(source_dir):
 
     # Create a symlink mirror of the source files in our temporary directory
     for f in files.keys():
-        m = utils.re_issource.match(f)
+        m = re_issource.match(f)
         if m:
             src = os.path.join(source_dir, f)
             # If a file is missing for whatever reason, give up.
@@ -836,7 +834,7 @@ def get_changelog_versions(source_dir):
         return
 
     # Get the upstream version
-    upstr_version = utils.re_no_epoch.sub('', dsc["version"])
+    upstr_version = re_no_epoch.sub('', dsc["version"])
     if re_strip_revision.search(upstr_version):
         upstr_version = re_strip_revision.sub('', upstr_version)
 
@@ -1174,7 +1172,7 @@ def action ():
 
     while prompt.find(answer) == -1:
         answer = utils.our_raw_input(prompt)
-        m = queue.re_default_answer.match(prompt)
+        m = re_default_answer.match(prompt)
         if answer == "":
             answer = m.group(1)
         answer = answer[:1].upper()
index 29d0788124082c672d84eebebca86670d2a8608d..fe8a4a1b2ffab54bfda37ef7759ff8a2a464982c 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Produces a report on NEW and BYHAND packages
+""" Produces a report on NEW and BYHAND packages """
 # Copyright (C) 2001, 2002, 2003, 2005, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
index 4510ee0e4747bed24c843d5f4ae4cbac6fb297ed..7770f66ec4bba695e78422f3df4704062d79d8da 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Manually reject packages for proprosed-updates
+""" Manually reject packages for proprosed-updates """
 # Copyright (C) 2001, 2002, 2003, 2004, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
@@ -25,6 +25,7 @@ from daklib import database
 from daklib import logging
 from daklib import queue
 from daklib import utils
+from daklib.regexes import re_default_answer
 
 ################################################################################
 
@@ -97,7 +98,7 @@ def main():
 
             while prompt.find(answer) == -1:
                 answer = utils.our_raw_input(prompt)
-                m = queue.re_default_answer.search(prompt)
+                m = re_default_answer.search(prompt)
                 if answer == "":
                     answer = m.group(1)
                 answer = answer[:1].upper()
@@ -137,7 +138,7 @@ def reject (reject_message = ""):
             answer = "XXX"
             while prompt.find(answer) == -1:
                 answer = utils.our_raw_input(prompt)
-                m = queue.re_default_answer.search(prompt)
+                m = re_default_answer.search(prompt)
                 if answer == "":
                     answer = m.group(1)
                 answer = answer[:1].upper()
index c2c5fa4827be337d3170f754029d044e3a8162e9..005653e536727858f859b2aef4a26ab9a23d9a04 100755 (executable)
--- a/dak/rm.py
+++ b/dak/rm.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# General purpose package removal tool for ftpmaster
+""" General purpose package removal tool for ftpmaster """
 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
@@ -44,11 +44,7 @@ import apt_pkg, apt_inst
 from daklib import database
 from daklib import utils
 from daklib.dak_exceptions import *
-
-################################################################################
-
-re_strip_source_version = re.compile (r'\s+.*$')
-re_build_dep_arch = re.compile(r"\[[^]]+\]")
+from daklib.regexes import re_strip_source_version, re_build_dep_arch
 
 ################################################################################
 
index 833cad282992fe94b1f400294627f8de9dba4b32..e9266bcc03f4aa33a60483b9dc24779e5b146323 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# based on queue-report
+""" Overview of the DEFERRED queue, based on queue-report """
 #    Copyright (C) 2001, 2002, 2003, 2005, 2006  James Troup <james@nocrew.org>
 # Copyright (C) 2008 Thomas Viehmann <tv@beamnet.de>
 
@@ -27,6 +27,7 @@ from debian_bundle import deb822
 from daklib import database
 from daklib import queue
 from daklib import utils
+from daklib.regexes import re_html_escaping, html_escaping
 
 ################################################################################
 ### work around bug #487902 in debian-python 0.1.10
@@ -40,8 +41,6 @@ deb822.Changes._multivalued_fields = {
 
 row_number = 1
 
-html_escaping = {'"':'&quot;', '&':'&amp;', '<':'&lt;', '>':'&gt;'}
-re_html_escaping = re.compile('|'.join(map(re.escape, html_escaping.keys())))
 def html_escape(s):
     return re_html_escaping.sub(lambda x: html_escaping.get(x.group(0)), s)
 
index f650f9aa03aae6271eee09fb6f8c42c6c296f603..e355c37f7f42c4a119fdbcc081b0aa573cd7a898 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Output html for packages in NEW
+""" Output html for packages in NEW """
 # Copyright (C) 2007 Joerg Jaspert <joerg@debian.org>
 
 # This program is free software; you can redistribute it and/or modify
index 5f8faddaf8e4041e05fffdc1b0ef7915ed91547b..8b5b57fe2ef2db0cf2b1a882ad7aa30615eb3422 100755 (executable)
@@ -1,6 +1,8 @@
 #!/usr/bin/env python
 
+""" Split queue/done into date based subdirectories """
 # Copyright (C) 2004, 2005, 2006  James Troup <james@nocrew.org>
+# Copyright (C) 2008  Joerg Jaspert <joerg@debian.org>
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
index 20a02b55cac3c0d4345efe5f8d4017ed5a2f02e2..105bf6c9f64aec6347a728f8acb5bf8c9ecf49b0 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Various statistical pr0nography fun and games
+""" Various statistical pr0nography fun and games """
 # Copyright (C) 2000, 2001, 2002, 2003, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
index b7e50651e8d4daf7b8d284f89bf4a9e5c0fe10cf..750d146b872b9fa67266e6a07fded87b0e1c1f68 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Display, edit and check the release manager's transition file.
+""" Display, edit and check the release manager's transition file. """
 # Copyright (C) 2008 Joerg Jaspert <joerg@debian.org>
 
 # This program is free software; you can redistribute it and/or modify
 
 ################################################################################
 
-import os, pg, sys, time, errno, fcntl, tempfile, pwd, re
+import os, pg, sys, time, errno, fcntl, tempfile, pwd
 import apt_pkg
 from daklib import database
 from daklib import utils
 from daklib.dak_exceptions import TransitionsError
+from daklib.regexes import re_broken_package
 import yaml
 
 # Globals
@@ -35,8 +36,6 @@ Cnf = None
 Options = None
 projectB = None
 
-re_broken_package = re.compile(r"[a-zA-Z]\w+\s+\-.*")
-
 ################################################################################
 
 #####################################
index d4aefe24c93b64b8404835f77e98a9cdf0c5dd85..f9b6e478fd6686ecde9d3b15f56b8f61ded2a645 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Debian Archive Kit Database Update Script
+""" Database Update Main Script """
 # Copyright (C) 2008  Michael Casadevall <mcasadevall@debian.org>
 
 # This program is free software; you can redistribute it and/or modify
@@ -53,7 +53,7 @@ Updates dak's database schema to the lastest version. You should disable crontab
 ################################################################################
 
     def update_db_to_zero(self):
-        # This function will attempt to update a pre-zero database schema to zero
+        """ This function will attempt to update a pre-zero database schema to zero """
 
         # First, do the sure thing, and create the configuration table
         try:
old mode 100644 (file)
new mode 100755 (executable)
index 9404ee9..2fe87a0
@@ -1,4 +1,6 @@
-# Exception classes used in dak
+#!/usr/bin/env python
+
+""" Exception classes used in dak """
 
 # Copyright (C) 2008  Mark Hymers <mhy@debian.org>
 
index e2c596a6feb89bf3d9fc367b11f71268fedca7ac..90e16d5e002f4352026c752b14065aaf46a1c6f0 100755 (executable)
@@ -1,7 +1,16 @@
 #!/usr/bin/env python
 
-# DB access fucntions
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006  James Troup <james@nocrew.org>
+""" DB access functions
+@group readonly: get_suite_id, get_section_id, get_priority_id, get_override_type_id,
+                 get_architecture_id, get_archive_id, get_component_id, get_location_id,
+                 get_source_id, get_suite_version, get_files_id, get_maintainer, get_suites
+@group read/write: get_or_set*, set_files_id
+
+@contact: Debian FTPMaster <ftpmaster@debian.org>
+@copyright: 2000, 2001, 2002, 2003, 2004, 2006  James Troup <james@nocrew.org>
+@copyright: 2009  Joerg Jaspert <joerg@debian.org>
+@license: GNU General Public License version 2 or later
+"""
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -25,45 +34,59 @@ import types
 
 ################################################################################
 
-Cnf = None
-projectB = None
-suite_id_cache = {}
-section_id_cache = {}
-priority_id_cache = {}
-override_type_id_cache = {}
-architecture_id_cache = {}
-archive_id_cache = {}
-component_id_cache = {}
-location_id_cache = {}
-maintainer_id_cache = {}
-keyring_id_cache = {}
-source_id_cache = {}
-files_id_cache = {}
-maintainer_cache = {}
-fingerprint_id_cache = {}
-queue_id_cache = {}
-uid_id_cache = {}
-suite_version_cache = {}
+Cnf = None                    #: Configuration, apt_pkg.Configuration
+projectB = None               #: database connection, pgobject
+suite_id_cache = {}           #: cache for suites
+section_id_cache = {}         #: cache for sections
+priority_id_cache = {}        #: cache for priorities
+override_type_id_cache = {}   #: cache for overrides
+architecture_id_cache = {}    #: cache for architectures
+archive_id_cache = {}         #: cache for archives
+component_id_cache = {}       #: cache for components
+location_id_cache = {}        #: cache for locations
+maintainer_id_cache = {}      #: cache for maintainers
+keyring_id_cache = {}         #: cache for keyrings
+source_id_cache = {}          #: cache for sources
+files_id_cache = {}           #: cache for files
+maintainer_cache = {}         #: cache for maintainer names
+fingerprint_id_cache = {}     #: cache for fingerprints
+queue_id_cache = {}           #: cache for queues
+uid_id_cache = {}             #: cache for uids
+suite_version_cache = {}      #: cache for suite_versions (packages)
 
 ################################################################################
 
 def init (config, sql):
-    """ database module init. Just sets two variables"""
+    """
+    database module init.
+
+    @type config: apt_pkg.Configuration
+    @param config: apt config, see U{http://apt.alioth.debian.org/python-apt-doc/apt_pkg/cache.html#Configuration}
+
+    @type sql: pgobject
+    @param sql: database connection
+
+    """
     global Cnf, projectB
 
     Cnf = config
     projectB = sql
 
 
-def do_query(q):
+def do_query(query):
     """
-    Executes a database query q. Writes statistics to stderr and returns
-    the result.
+    Executes a database query. Writes statistics / timing to stderr.
+
+    @type query: string
+    @param query: database query string, passed unmodified
 
+    @return: db result
+
+    @warning: The query is passed B{unmodified}, so be careful what you use this for.
     """
-    sys.stderr.write("query: \"%s\" ... " % (q))
+    sys.stderr.write("query: \"%s\" ... " % (query))
     before = time.time()
-    r = projectB.query(q)
+    r = projectB.query(query)
     time_diff = time.time()-before
     sys.stderr.write("took %.3f seconds.\n" % (time_diff))
     if type(r) is int:
@@ -77,7 +100,17 @@ def do_query(q):
 ################################################################################
 
 def get_suite_id (suite):
-    """ Returns database suite_id for given suite, caches result. """
+    """
+    Returns database id for given C{suite}.
+    Results are kept in a cache during runtime to minimize database queries.
+
+    @type suite: string
+    @param suite: The name of the suite
+
+    @rtype: int
+    @return: the database id for the given suite
+
+    """
     global suite_id_cache
 
     if suite_id_cache.has_key(suite):
@@ -94,7 +127,17 @@ def get_suite_id (suite):
     return suite_id
 
 def get_section_id (section):
-    """ Returns database section_id for given section, caches result. """
+    """
+    Returns database id for given C{section}.
+    Results are kept in a cache during runtime to minimize database queries.
+
+    @type section: string
+    @param section: The name of the section
+
+    @rtype: int
+    @return: the database id for the given section
+
+    """
     global section_id_cache
 
     if section_id_cache.has_key(section):
@@ -111,7 +154,17 @@ def get_section_id (section):
     return section_id
 
 def get_priority_id (priority):
-    """ Returns database priority_id for given priority, caches result. """
+    """
+    Returns database id for given C{priority}.
+    Results are kept in a cache during runtime to minimize database queries.
+
+    @type priority: string
+    @param priority: The name of the priority
+
+    @rtype: int
+    @return: the database id for the given priority
+
+    """
     global priority_id_cache
 
     if priority_id_cache.has_key(priority):
@@ -128,7 +181,17 @@ def get_priority_id (priority):
     return priority_id
 
 def get_override_type_id (type):
-    """ Returns database override_id for given override_type type, caches result. """
+    """
+    Returns database id for given override C{type}.
+    Results are kept in a cache during runtime to minimize database queries.
+
+    @type type: string
+    @param type: The name of the override type
+
+    @rtype: int
+    @return: the database id for the given override type
+
+    """
     global override_type_id_cache
 
     if override_type_id_cache.has_key(type):
@@ -145,7 +208,17 @@ def get_override_type_id (type):
     return override_type_id
 
 def get_architecture_id (architecture):
-    """ Returns database architecture_id for given architecture, caches result. """
+    """
+    Returns database id for given C{architecture}.
+    Results are kept in a cache during runtime to minimize database queries.
+
+    @type architecture: string
+    @param architecture: The name of the override type
+
+    @rtype: int
+    @return: the database id for the given architecture
+
+    """
     global architecture_id_cache
 
     if architecture_id_cache.has_key(architecture):
@@ -162,7 +235,17 @@ def get_architecture_id (architecture):
     return architecture_id
 
 def get_archive_id (archive):
-    """ Returns database archive_id for given archive, caches result. """
+    """
+    Returns database id for given C{archive}.
+    Results are kept in a cache during runtime to minimize database queries.
+
+    @type archive: string
+    @param archive: The name of the override type
+
+    @rtype: int
+    @return: the database id for the given archive
+
+    """
     global archive_id_cache
 
     archive = archive.lower()
@@ -181,7 +264,17 @@ def get_archive_id (archive):
     return archive_id
 
 def get_component_id (component):
-    """ Returns database component_id for given component, caches result. """
+    """
+    Returns database id for given C{component}.
+    Results are kept in a cache during runtime to minimize database queries.
+
+    @type component: string
+    @param component: The name of the override type
+
+    @rtype: int
+    @return: the database id for the given component
+
+    """
     global component_id_cache
 
     component = component.lower()
@@ -201,15 +294,23 @@ def get_component_id (component):
 
 def get_location_id (location, component, archive):
     """
-    Returns database location_id for given combination of
-    location
-    component
-    archive.
+    Returns database id for the location behind the given combination of
+      - B{location} - the path of the location, eg. I{/srv/ftp.debian.org/ftp/pool/}
+      - B{component} - the id of the component as returned by L{get_component_id}
+      - B{archive} - the id of the archive as returned by L{get_archive_id}
+    Results are kept in a cache during runtime to minimize database queries.
+
+    @type location: string
+    @param location: the path of the location
+
+    @type component: int
+    @param component: the id of the component
 
-    The 3 parameters are the database ids returned by the respective
-    "get_foo_id" functions.
+    @type archive: int
+    @param archive: the id of the archive
 
-    The result will be cached.
+    @rtype: int
+    @return: the database id for the location
 
     """
     global location_id_cache
@@ -235,7 +336,22 @@ def get_location_id (location, component, archive):
     return location_id
 
 def get_source_id (source, version):
-    """ Returns database source_id for given combination of source and version, caches result. """
+    """
+    Returns database id for the combination of C{source} and C{version}
+      - B{source} - source package name, eg. I{mailfilter}, I{bbdb}, I{glibc}
+      - B{version}
+    Results are kept in a cache during runtime to minimize database queries.
+
+    @type source: string
+    @param source: source package name
+
+    @type version: string
+    @param version: the source version
+
+    @rtype: int
+    @return: the database id for the source
+
+    """
     global source_id_cache
 
     cache_key = source + '_' + version + '_'
@@ -253,7 +369,24 @@ def get_source_id (source, version):
     return source_id
 
 def get_suite_version(source, suite):
-    """ Returns database version for a given source in a given suite, caches result. """
+    """
+    Returns database id for a combination of C{source} and C{suite}.
+
+      - B{source} - source package name, eg. I{mailfilter}, I{bbdb}, I{glibc}
+      - B{suite} - a suite name, eg. I{unstable}
+
+    Results are kept in a cache during runtime to minimize database queries.
+
+    @type source: string
+    @param source: source package name
+
+    @type suite: string
+    @param suite: the suite name
+
+    @rtype: string
+    @return: the version for I{source} in I{suite}
+
+    """
     global suite_version_cache
     cache_key = "%s_%s" % (source, suite)
 
@@ -280,11 +413,17 @@ def get_suite_version(source, suite):
 
 def get_or_set_maintainer_id (maintainer):
     """
-    If maintainer does not have an entry in the maintainer table yet, create one
-    and return its id.
-    If maintainer already has an entry, simply return its id.
+    If C{maintainer} does not have an entry in the maintainer table yet, create one
+    and return the new id.
+    If C{maintainer} already has an entry, simply return the existing id.
 
-    Result is cached.
+    Results are kept in a cache during runtime to minimize database queries.
+
+    @type maintainer: string
+    @param maintainer: the maintainer name
+
+    @rtype: int
+    @return: the database id for the maintainer
 
     """
     global maintainer_id_cache
@@ -305,11 +444,17 @@ def get_or_set_maintainer_id (maintainer):
 
 def get_or_set_keyring_id (keyring):
     """
-    If keyring does not have an entry in the keyring table yet, create one
-    and return its id.
-    If keyring already has an entry, simply return its id.
+    If C{keyring} does not have an entry in the C{keyrings} table yet, create one
+    and return the new id.
+    If C{keyring} already has an entry, simply return the existing id.
+
+    Results are kept in a cache during runtime to minimize database queries.
 
-    Result is cached.
+    @type keyring: string
+    @param keyring: the keyring name
+
+    @rtype: int
+    @return: the database id for the keyring
 
     """
     global keyring_id_cache
@@ -330,13 +475,20 @@ def get_or_set_keyring_id (keyring):
 
 def get_or_set_uid_id (uid):
     """
-    If uid does not have an entry in the uid table yet, create one
-    and return its id.
-    If uid already has an entry, simply return its id.
+    If C{uid} does not have an entry in the uid table yet, create one
+    and return the new id.
+    If C{uid} already has an entry, simply return the existing id.
+
+    Results are kept in a cache during runtime to minimize database queries.
+
+    @type uid: string
+    @param uid: the uid.
 
-    Result is cached.
+    @rtype: int
+    @return: the database id for the uid
 
     """
+
     global uid_id_cache
 
     if uid_id_cache.has_key(uid):
@@ -355,11 +507,17 @@ def get_or_set_uid_id (uid):
 
 def get_or_set_fingerprint_id (fingerprint):
     """
-    If fingerprintd does not have an entry in the fingerprint table yet, create one
-    and return its id.
-    If fingerprint already has an entry, simply return its id.
+    If C{fingerprint} does not have an entry in the fingerprint table yet, create one
+    and return the new id.
+    If C{fingerprint} already has an entry, simply return the existing id.
+
+    Results are kept in a cache during runtime to minimize database queries.
+
+    @type fingerprint: string
+    @param fingerprint: the fingerprint
 
-    Result is cached.
+    @rtype: int
+    @return: the database id for the fingerprint
 
     """
     global fingerprint_id_cache
@@ -380,22 +538,35 @@ def get_or_set_fingerprint_id (fingerprint):
 
 def get_files_id (filename, size, md5sum, location_id):
     """
-    Returns -1, -2 or the file_id for a given combination of
-    filename
-    size
-    md5sum
-    location_id.
+    Returns -1, -2 or the file_id for filename, if its C{size} and C{md5sum} match an
+    existing copy.
+
+    The database is queried using the C{filename} and C{location_id}. If a file does exist
+    at that location, the existing size and md5sum are checked against the provided
+    parameters. A size or checksum mismatch returns -2. If more than one entry is
+    found within the database, a -1 is returned, no result returns None, otherwise
+    the file id.
+
+    Results are kept in a cache during runtime to minimize database queries.
 
-    The database is queried using filename and location_id, size and md5sum are for
-    extra checks.
+    @type filename: string
+    @param filename: the filename of the file to check against the DB
 
-    Return values:
-    -1 - The given combination of arguments result in more (or less) than
-         one result from the database
-    -2 - The given size and md5sum do not match the values in the database
-    anything else is a file_id
+    @type size: int
+    @param size: the size of the file to check against the DB
 
-    Result is cached.
+    @type md5sum: string
+    @param md5sum: the md5sum of the file to check against the DB
+
+    @type location_id: int
+    @param location_id: the id of the location as returned by L{get_location_id}
+
+    @rtype: int / None
+    @return: Various return values are possible:
+               - -2: size/checksum error
+               - -1: more than one file found in database
+               - None: no file found in database
+               - int: file id
 
     """
     global files_id_cache
@@ -425,11 +596,17 @@ def get_files_id (filename, size, md5sum, location_id):
 
 def get_or_set_queue_id (queue):
     """
-    If queue does not have an entry in the queue_name table yet, create one
-    and return its id.
-    If queue already has an entry, simply return its id.
+    If C{queue} does not have an entry in the queue table yet, create one
+    and return the new id.
+    If C{queue} already has an entry, simply return the existing id.
+
+    Results are kept in a cache during runtime to minimize database queries.
 
-    Result is cached.
+    @type queue: string
+    @param queue: the queue name (no full path)
+
+    @rtype: int
+    @return: the database id for the queue
 
     """
     global queue_id_cache
@@ -450,9 +627,28 @@ def get_or_set_queue_id (queue):
 
 def set_files_id (filename, size, md5sum, sha1sum, sha256sum, location_id):
     """
-    Insert a new entry into the files table.
+    Insert a new entry into the files table and return its id.
+
+    @type filename: string
+    @param filename: the filename
+
+    @type size: int
+    @param size: the size in bytes
 
-    Returns the new file_id
+    @type md5sum: string
+    @param md5sum: md5sum of the file
+
+    @type sha1sum: string
+    @param sha1sum: sha1sum of the file
+
+    @type sha256sum: string
+    @param sha256sum: sha256sum of the file
+
+    @type location_id: int
+    @param location_id: the id of the location as returned by L{get_location_id}
+
+    @rtype: int
+    @return: the database id for the new file
 
     """
     global files_id_cache
@@ -474,7 +670,18 @@ def set_files_id (filename, size, md5sum, sha1sum, sha256sum, location_id):
 ################################################################################
 
 def get_maintainer (maintainer_id):
-    """ Return the name of the maintainer behind maintainer_id """
+    """
+    Return the name of the maintainer behind C{maintainer_id}.
+
+    Results are kept in a cache during runtime to minimize database queries.
+
+    @type maintainer_id: int
+    @param maintainer_id: the id of the maintainer, eg. from L{get_or_set_maintainer_id}
+
+    @rtype: string
+    @return: the name of the maintainer
+
+    """
     global maintainer_cache
 
     if not maintainer_cache.has_key(maintainer_id):
@@ -486,7 +693,20 @@ def get_maintainer (maintainer_id):
 ################################################################################
 
 def get_suites(pkgname, src=False):
-    """ Return the suites in which pkgname is. If src is True, query for source package, else binary. """
+    """
+    Return the suites in which C{pkgname} can be found. If C{src} is True query for source
+    package, else binary package.
+
+    @type pkgname: string
+    @param pkgname: name of the package
+
+    @type src: bool
+    @param src: if True look for source packages, false (default) looks for binary.
+
+    @rtype: list
+    @return: list of suites, or empty list if no match
+
+    """
     if src:
         sql = """
         SELECT suite_name
old mode 100644 (file)
new mode 100755 (executable)
index 9befa7b..668cc27
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Utility functions for extensions
+""" Utility functions for extensions """
 # Copyright (C) 2008 Anthony Towns <ajt@dbeian.org>
 
 ################################################################################
old mode 100644 (file)
new mode 100755 (executable)
index f0dcd9c..125aa4a
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Logging functions
+""" Logging functions """
 # Copyright (C) 2001, 2002, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
index d7e813a972ff362a853f42f581ac99c6ac3f7ced..3010c9d6a8037c52a696441a204efd2394cdf7e0 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 # vim:set et sw=4:
 
-# Queue utility functions for dak
+""" Queue utility functions for dak """
 # Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006  James Troup <james@nocrew.org>
 
 # This program is free software; you can redistribute it and/or modify
@@ -24,18 +24,12 @@ import cPickle, errno, os, pg, re, stat, sys, time
 import apt_inst, apt_pkg
 import utils, database
 from dak_exceptions import *
+from regexes import re_default_answer, re_fdnic, re_bin_only_nmu
 
 from types import *
 
 ###############################################################################
 
-re_isanum = re.compile (r"^\d+$")
-re_default_answer = re.compile(r"\[(.*)\]")
-re_fdnic = re.compile(r"\n\n")
-re_bin_only_nmu = re.compile(r"\+b\d+$")
-
-################################################################################
-
 # Determine what parts in a .changes are NEW
 
 def determine_new(changes, files, projectB, warn=1):
diff --git a/daklib/regexes.py b/daklib/regexes.py
new file mode 100644 (file)
index 0000000..48b5281
--- /dev/null
@@ -0,0 +1,94 @@
+#!/usr/bin/env python
+# vim:set et sw=4:
+
+"""Central repository of regexes for dak"""
+# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006  James Troup <james@nocrew.org>
+# Copyright (C) 2009  Mark Hymers <mhy@debian.org>
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+###############################################################################
+
+import re
+
+re_isanum = re.compile (r"^\d+$")
+re_default_answer = re.compile(r"\[(.*)\]")
+re_fdnic = re.compile(r"\n\n")
+re_bin_only_nmu = re.compile(r"\+b\d+$")
+
+re_comments = re.compile(r"\#.*")
+re_no_epoch = re.compile(r"^\d+\:")
+re_no_revision = re.compile(r"-[^-]+$")
+re_arch_from_filename = re.compile(r"/binary-[^/]+/")
+re_extract_src_version = re.compile (r"(\S+)\s*\((.*)\)")
+re_isadeb = re.compile (r"(.+?)_(.+?)_(.+)\.u?deb$")
+
+re_issource = re.compile (r"(.+)_(.+?)\.(orig\.tar\.gz|diff\.gz|tar\.gz|dsc)$")
+
+re_single_line_field = re.compile(r"^(\S*)\s*:\s*(.*)")
+re_multi_line_field = re.compile(r"^\s(.*)")
+re_taint_free = re.compile(r"^[-+~/\.\w]+$")
+
+re_parse_maintainer = re.compile(r"^\s*(\S.*\S)\s*\<([^\>]+)\>")
+re_gpg_uid = re.compile('^uid.*<([^>]*)>')
+
+re_srchasver = re.compile(r"^(\S+)\s+\((\S+)\)$")
+re_verwithext = re.compile(r"^(\d+)(?:\.(\d+))(?:\s+\((\S+)\))?$")
+
+re_srchasver = re.compile(r"^(\S+)\s+\((\S+)\)$")
+
+html_escaping = {'"':'&quot;', '&':'&amp;', '<':'&lt;', '>':'&gt;'}
+re_html_escaping = re.compile('|'.join(map(re.escape, html_escaping.keys())))
+
+# From clean_proposed_updates.py
+re_isdeb = re.compile (r"^(.+)_(.+?)_(.+?).u?deb$")
+
+# From examine_package.py
+re_package = re.compile(r"^(.+?)_.*")
+re_doc_directory = re.compile(r".*/doc/([^/]*).*")
+
+re_contrib = re.compile('^contrib/')
+re_nonfree = re.compile('^non\-free/')
+
+re_localhost = re.compile("localhost\.localdomain")
+re_version = re.compile('^(.*)\((.*)\)')
+
+re_newlinespace = re.compile('\n')
+re_spacestrip = re.compile('(\s)')
+
+# From import_archive.py
+re_arch_from_filename = re.compile(r"binary-[^/]+")
+
+# From import_ldap_fingerprints.py
+re_gpg_fingerprint = re.compile(r"^\s+Key fingerprint = (.*)$", re.MULTILINE)
+re_debian_address = re.compile(r"^.*<(.*)@debian\.org>$", re.MULTILINE)
+
+# From new_security_install.py
+re_taint_free = re.compile(r"^['/;\-\+\.~\s\w]+$")
+
+# From process_unchecked.py
+re_valid_version = re.compile(r"^([0-9]+:)?[0-9A-Za-z\.\-\+:~]+$")
+re_valid_pkg_name = re.compile(r"^[\dA-Za-z][\dA-Za-z\+\-\.]+$")
+re_changelog_versions = re.compile(r"^\w[-+0-9a-z.]+ \([^\(\) \t]+\)")
+re_strip_revision = re.compile(r"-([^-]+)$")
+re_strip_srcver = re.compile(r"\s+\(\S+\)$")
+re_spacestrip = re.compile('(\s)')
+
+# From dak/rm.py
+re_strip_source_version = re.compile (r'\s+.*$')
+re_build_dep_arch = re.compile(r"\[[^]]+\]")
+
+# From dak/transitions.py
+re_broken_package = re.compile(r"[a-zA-Z]\w+\s+\-.*")
index 9e26e9e7f07c707a79b5ca08ef5f3f1661007f59..dbc8c16c0fce391c8b8f5fc9764f57223d15bd22 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 # vim:set et ts=4 sw=4:
 
-# Utility functions
+""" Utility functions """
 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006  James Troup <james@nocrew.org>
 
 ################################################################################
@@ -28,32 +28,12 @@ import apt_pkg
 import database
 import time
 from dak_exceptions import *
+from regexes import re_html_escaping, html_escaping, re_single_line_field, \
+                    re_multi_line_field, re_srchasver, re_verwithext, \
+                    re_parse_maintainer, re_taint_free, re_gpg_uid
 
 ################################################################################
 
-re_comments = re.compile(r"\#.*")
-re_no_epoch = re.compile(r"^\d+\:")
-re_no_revision = re.compile(r"-[^-]+$")
-re_arch_from_filename = re.compile(r"/binary-[^/]+/")
-re_extract_src_version = re.compile (r"(\S+)\s*\((.*)\)")
-re_isadeb = re.compile (r"(.+?)_(.+?)_(.+)\.u?deb$")
-re_issource = re.compile (r"(.+)_(.+?)\.(orig\.tar\.gz|diff\.gz|tar\.gz|dsc)$")
-
-re_single_line_field = re.compile(r"^(\S*)\s*:\s*(.*)")
-re_multi_line_field = re.compile(r"^\s(.*)")
-re_taint_free = re.compile(r"^[-+~/\.\w]+$")
-
-re_parse_maintainer = re.compile(r"^\s*(\S.*\S)\s*\<([^\>]+)\>")
-re_gpg_uid = re.compile('^uid.*<([^>]*)>')
-
-re_srchasver = re.compile(r"^(\S+)\s+\((\S+)\)$")
-re_verwithext = re.compile(r"^(\d+)(?:\.(\d+))(?:\s+\((\S+)\))?$")
-
-re_srchasver = re.compile(r"^(\S+)\s+\((\S+)\)$")
-
-html_escaping = {'"':'&quot;', '&':'&amp;', '<':'&lt;', '>':'&gt;'}
-re_html_escaping = re.compile('|'.join(map(re.escape, html_escaping.keys())))
-
 default_config = "/etc/dak/dak.conf"
 default_apt_config = "/etc/dak/apt.conf"