################################################################################
-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
################################################################################
Options = None
pu = {}
-re_isdeb = re.compile (r"^(.+)_(.+?)_(.+?).u?deb$")
-
################################################################################
def usage (exit_code=0):
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 *
################################################################################
###############################################################################
-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
###############################################################################
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):
################################################################################
+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
import apt_pkg, apt_inst
import daklib.database
import daklib.utils
+from daklib.regexes import re_isadeb
################################################################################
Cnf = None
projectB = None
-re_isadeb = re.compile (r"(.+?)_(.+?)(_(.+))?\.u?deb$")
-
################################################################################
def usage (exit_code=0):
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
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)')
################################################################################
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
################################################################################
from daklib import database
from daklib import queue
from daklib import utils
+from daklib.regexes import re_htmlescaping, html_escaping
################################################################################
### work around bug #487902 in debian-python 0.1.10
row_number = 1
-html_escaping = {'"':'"', '&':'&', '<':'<', '>':'>'}
-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)
################################################################################
-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
Options = None
projectB = None
-re_broken_package = re.compile(r"[a-zA-Z]\w+\s+\-.*")
-
################################################################################
#####################################
import apt_inst, apt_pkg
import utils, database
from dak_exceptions import *
+from regexes import re_isanum, 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):
--- /dev/null
+#!/usr/bin/env python
+# vim:set et sw=4:
+
+# Queue utility functions 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 = {'"':'"', '&':'&', '<':'<', '>':'>'}
+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_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 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+\-.*")
import database
import time
from dak_exceptions import *
+from regexes import *
################################################################################
-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 = {'"':'"', '&':'&', '<':'<', '>':'>'}
-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"