-k, --key keyid of the User
-u, --user userid of the User
- -c, --create create a system account for the user
-h, --help show this help and exit."""
sys.exit(exit_code)
-################################################################################
-# Stolen from userdir-ldap
-# Compute a random password using /dev/urandom.
-def GenPass():
- # Generate a 10 character random string
- SaltVals = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/."
- Rand = open("/dev/urandom")
- Password = ""
- for i in range(0,15):
- Password = Password + SaltVals[ord(Rand.read(1)[0]) % len(SaltVals)]
- return Password
-
-# Compute the MD5 crypted version of the given password
-def HashPass(Password):
- import crypt
- # Hash it telling glibc to use the MD5 algorithm - if you dont have
- # glibc then just change Salt = "$1$" to Salt = ""
- SaltVals = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789/."
- Salt = "$1$"
- Rand = open("/dev/urandom")
- for x in range(0,10):
- Salt = Salt + SaltVals[ord(Rand.read(1)[0]) % len(SaltVals)]
- Pass = crypt.crypt(Password,Salt)
- if len(Pass) < 14:
- raise RuntimeError("MD5 password hashing failed, not changing the password!")
- return Pass
-
-################################################################################
-
-def createMail(login, passwd, keyid, keyring):
- import GnuPGInterface
-
- message= """
-
-Additionally there is now an account created for you.
-
-"""
- message+= "\nYour password for the login %s is: %s\n" % (login, passwd)
-
- gnupg = GnuPGInterface.GnuPG()
- gnupg.options.armor = 1
- gnupg.options.meta_interactive = 0
- gnupg.options.extra_args.append("--no-default-keyring")
- gnupg.options.extra_args.append("--always-trust")
- gnupg.options.extra_args.append("--no-secmem-warning")
- gnupg.options.extra_args.append("--keyring=%s" % keyring)
- gnupg.options.recipients = [keyid]
- proc = gnupg.run(['--encrypt'], create_fhs=['stdin', 'stdout'])
- proc.handles['stdin'].write(message)
- proc.handles['stdin'].close()
- output = proc.handles['stdout'].read()
- proc.handles['stdout'].close()
- proc.wait()
- return output
-
################################################################################
def main():
Cnf = utils.get_conf()
Arguments = [('h',"help","Add-User::Options::Help"),
- ('c',"create","Add-User::Options::Create"),
('k',"key","Add-User::Options::Key", "HasArg"),
('u',"user","Add-User::Options::User", "HasArg"),
]
- for i in [ "help", "create" ]:
+ for i in [ "help" ]:
if not Cnf.has_key("Add-User::Options::%s" % (i)):
Cnf["Add-User::Options::%s" % (i)] = ""
- apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv)
+ apt_pkg.parse_commandline(Cnf, Arguments, sys.argv)
- Options = Cnf.SubTree("Add-User::Options")
+ Options = Cnf.subtree("Add-User::Options")
if Options["help"]:
usage()
name, primary_key)
# Should we send mail to the newly added user?
- if Cnf.FindB("Add-User::SendEmail"):
+ if Cnf.find_b("Add-User::SendEmail"):
mail = name + "<" + emails[0] +">"
Subst = {}
Subst["__NEW_MAINTAINER__"] = mail
################################################################################
def __architecture_list(d, args):
- q = d.session().query(Architecture).order_by('arch_string')
+ q = d.session().query(Architecture).order_by(Architecture.arch_string)
for j in q.all():
# HACK: We should get rid of source from the arch table
if j.arch_string == 'source': continue
def __suite_list(d, args):
s = d.session()
- for j in s.query(Suite).order_by('suite_name').all():
+ for j in s.query(Suite).order_by(Suite.suite_name).all():
print j.suite_name
def __suite_show(d, args):
if addallarches:
arches = []
- q = s.query(Architecture).order_by('arch_string')
+ q = s.query(Architecture).order_by(Architecture.arch_string)
for arch in q.all():
suite.architectures.append(arch)
arches.append(arch.arch_string)
def __suite_architecture_list(d, args):
s = d.session()
- for j in s.query(Suite).order_by('suite_name'):
+ for j in s.query(Suite).order_by(Suite.suite_name):
architectures = j.get_architectures(skipsrc = True, skipall = True)
print j.suite_name + ': ' + \
', '.join([a.arch_string for a in architectures])
def __version_check_list(d):
session = d.session()
- for s in session.query(Suite).order_by('suite_name'):
+ for s in session.query(Suite).order_by(Suite.suite_name):
__version_check_list_suite(d, s.suite_name)
def __version_check_list_suite(d, suite_name):
if not Cnf.has_key("Admin::Options::%s" % (i)):
Cnf["Admin::Options::%s" % (i)] = ""
- arguments = apt_pkg.ParseCommandLine(Cnf, arguments, sys.argv)
+ arguments = apt_pkg.parse_commandline(Cnf, arguments, sys.argv)
- options = Cnf.SubTree("Admin::Options")
+ options = Cnf.subtree("Admin::Options")
if options["Help"] or len(arguments) < 1:
usage()
if options["Dry-Run"]:
if not Cnf.has_key(opt):
Cnf[opt] = ""
- packages = apt_pkg.ParseCommandLine(Cnf, arguments, sys.argv)
- Options = Cnf.SubTree('BtsCategorize::Options')
+ packages = apt_pkg.parse_commandline(Cnf, arguments, sys.argv)
+ Options = Cnf.subtree('BtsCategorize::Options')
if Options["Help"]:
usage()
if not cnf.has_key("Check-Archive::Options::%s" % (i)):
cnf["Check-Archive::Options::%s" % (i)] = ""
- args = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
+ args = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
- Options = cnf.SubTree("Check-Archive::Options")
+ Options = cnf.subtree("Check-Archive::Options")
if Options["Help"]:
usage()
for i in [ "help", "no-action" ]:
if not cnf.has_key("Check-Overrides::Options::%s" % (i)):
cnf["Check-Overrides::Options::%s" % (i)] = ""
- apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
- Options = cnf.SubTree("Check-Overrides::Options")
+ apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
+ Options = cnf.subtree("Check-Overrides::Options")
if Options["Help"]:
usage()
('n',"no-action","Clean-Queues::Options::No-Action"),
('v',"verbose","Clean-Queues::Options::Verbose")]
- apt_pkg.ParseCommandLine(cnf.Cnf,Arguments,sys.argv)
- Options = cnf.SubTree("Clean-Queues::Options")
+ apt_pkg.parse_commandline(cnf.Cnf,Arguments,sys.argv)
+ Options = cnf.subtree("Clean-Queues::Options")
if Options["Help"]:
usage()
('n',"no-action","Clean-Suites::Options::No-Action"),
('m',"maximum","Clean-Suites::Options::Maximum", "HasArg")]
- apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
- Options = cnf.SubTree("Clean-Suites::Options")
+ apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
+ Options = cnf.subtree("Clean-Suites::Options")
if cnf["Clean-Suites::Options::Maximum"] != "":
try:
('l', "limit", 'Contents::Options::Limit', "HasArg"),
('f', "force", 'Contents::Options::Force'),
]
- args = apt_pkg.ParseCommandLine(cnf.Cnf, arguments, sys.argv)
- options = cnf.SubTree('Contents::Options')
+ args = apt_pkg.parse_commandline(cnf.Cnf, arguments, sys.argv)
+ options = cnf.subtree('Contents::Options')
if (len(args) != 1) or options['Help']:
usage()
if not cnf.has_key("Control-Overrides::Options::Type"):
cnf["Control-Overrides::Options::Type"] = "deb"
- file_list = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
+ file_list = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
if cnf["Control-Overrides::Options::Help"]:
usage()
new = {}
for p in current.keys():
if p in old.keys():
- if apt_pkg.VersionCompare(current[p], old[p]) > 0:
+ if apt_pkg.version_compare(current[p], old[p]) > 0:
new[p] = [current[p], old[p]]
else:
new[p] = [current[p], 0]
violations = False
for suite, version in suite_version_list:
- cmp = apt_pkg.VersionCompare(new_version, version)
+ cmp = apt_pkg.version_compare(new_version, version)
if suite in must_be_newer_than and cmp < 1:
utils.warn("%s (%s): version check violated: %s targeted at %s is *not* newer than %s in %s" % (package, architecture, new_version, target_suite, version, suite))
violations = True
cmp_package = cmp(a[0], b[0])
if cmp_package != 0:
return cmp_package
- return apt_pkg.VersionCompare(a[1], b[1])
+ return apt_pkg.version_compare(a[1], b[1])
#######################################################################################
cnf["Control-Suite::Options::%s" % (i)] = ""
try:
- file_list = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv);
+ file_list = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv);
except SystemError as e:
print "%s\n" % e
usage(1)
- Options = cnf.SubTree("Control-Suite::Options")
+ Options = cnf.subtree("Control-Suite::Options")
if Options["Help"]:
usage()
for option in [ "help", "source", "destination", "no-action" ]:
if not cnf.has_key("Copy-Installer::Options::%s" % (option)):
cnf["Copy-Installer::Options::%s" % (option)] = ""
- extra_arguments = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
- Options = cnf.SubTree("Copy-Installer::Options")
+ extra_arguments = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
+ Options = cnf.subtree("Copy-Installer::Options")
if Options["Help"]:
usage()
version = i[1]
if architectures.has_key(arch):
versions.append(version)
- versions.sort(apt_pkg.VersionCompare)
+ versions.sort(apt_pkg.version_compare)
if versions:
latest_version = versions.pop()
else:
if versions_d != {}:
anais_output += "\n (*) %s_%s [%s]: %s\n" % (binary, latest_version, source, architecture)
versions = versions_d.keys()
- versions.sort(apt_pkg.VersionCompare)
+ versions.sort(apt_pkg.version_compare)
for version in versions:
arches = versions_d[version]
arches.sort()
source_binaries.get(source, "(source does not exist)"))
print " won't admit to building:"
versions = dubious_nbs[source].keys()
- versions.sort(apt_pkg.VersionCompare)
+ versions.sort(apt_pkg.version_compare)
for version in versions:
packages = dubious_nbs[source][version].keys()
packages.sort()
if not cnf.has_key("Cruft-Report::Options::Wanna-Build-Dump"):
cnf["Cruft-Report::Options::Wanna-Build-Dump"] = "/srv/ftp-master.debian.org/scripts/nfu"
- apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
+ apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
- Options = cnf.SubTree("Cruft-Report::Options")
+ Options = cnf.subtree("Cruft-Report::Options")
if Options["Help"]:
usage()
if source == "":
source = package
if bin2source.has_key(package) and \
- apt_pkg.VersionCompare(version, bin2source[package]["version"]) > 0:
+ apt_pkg.version_compare(version, bin2source[package]["version"]) > 0:
bin2source[package]["version"] = version
bin2source[package]["source"] = source
else:
for source in nbs.keys():
for package in nbs[source].keys():
versions = nbs[source][package].keys()
- versions.sort(apt_pkg.VersionCompare)
+ versions.sort(apt_pkg.version_compare)
latest_version = versions.pop()
source_version = source_versions.get(source,"0")
- if apt_pkg.VersionCompare(latest_version, source_version) == 0:
+ if apt_pkg.version_compare(latest_version, source_version) == 0:
add_nbs(dubious_nbs, source, latest_version, package, suite_id, session)
if "nviu" in checks:
c.execute("UPDATE queue SET path = %s WHERE id = %s", (dir, row[0]))
print "Adding missing queues to the queue table"
- for q in cnf.SubTree("Dir::Queue").keys():
+ for q in cnf.subtree("Dir::Queue").keys():
qname = q.lower()
if qname in seenqueues.keys():
continue
cnf = Config()
c.execute("""INSERT INTO queue (queue_name, path) VALUES ('buildd', '%s')""" % cnf["Dir::QueueBuild"].rstrip('/'))
- for s in cnf.ValueList("Dinstall::QueueBuildSuites"):
+ for s in cnf.value_list("Dinstall::QueueBuildSuites"):
c.execute("""INSERT INTO suite_queue_copy (suite, queue)
VALUES ( (SELECT id FROM suite WHERE suite_name = '%s'),
(SELECT id FROM queue WHERE queue_name = 'buildd'))""" % s.lower())
"""
return a list of suites to operate on
"""
- suites = Config().SubTree("Suite").List()
+ suites = Config().subtree("Suite").list()
return suites
def arches(cursor, suite):
for suite in s:
suites[suite[1]]=suite[0]
- for suite in Cnf.SubTree("Suite").List():
+ for suite in Cnf.subtree("Suite").list():
print "Processing suite %s" % (suite)
- architectures = Cnf.SubTree("Suite::" + suite).ValueList("Architectures")
+ architectures = Cnf.subtree("Suite::" + suite).value_list("Architectures")
suite = suite.lower()
for arch in architectures:
c.execute(query, [suites[suite], archs[arch]])
for check in ["Enhances", "MustBeNewerThan", "MustBeOlderThan"]:
for suite_name in suite_id_map.keys():
- for reference_name in [ s.lower() for s in cnf.ValueList("Suite::%s::VersionChecks::%s" % (suite_name, check)) ]:
+ for reference_name in [ s.lower() for s in cnf.value_list("Suite::%s::VersionChecks::%s" % (suite_name, check)) ]:
c.execute("""INSERT INTO version_check (suite, "check", reference) VALUES (%s, %s, %s)""", (suite_id_map[suite_name], check, suite_id_map[reference_name]))
c.execute("UPDATE config SET value = '52' WHERE name = 'db_revision'")
c.execute("ALTER TABLE suite ADD COLUMN untouchable BOOLEAN NOT NULL DEFAULT FALSE;")
query = "UPDATE suite SET untouchable = TRUE WHERE suite_name = %s" #: Update query
- for suite in Cnf.SubTree("Suite").List():
- untouchable = Cnf.Find("Suite::%s::Untouchable" % (suite))
+ for suite in Cnf.subtree("Suite").list():
+ untouchable = Cnf.find("Suite::%s::Untouchable" % (suite))
if not untouchable:
continue
print "[Untouchable] Processing suite %s" % (suite)
c.execute("ALTER TABLE suite ADD COLUMN announce text NOT NULL DEFAULT 'debian-devel-changes@lists.debian.org';")
query = "UPDATE suite SET announce = %s WHERE suite_name = %s" #: Update query
- for suite in Cnf.SubTree("Suite").List():
- announce_list = Cnf.Find("Suite::%s::Announce" % (suite))
+ for suite in Cnf.subtree("Suite").list():
+ announce_list = Cnf.find("Suite::%s::Announce" % (suite))
print "[Announce] Processing suite %s" % (suite)
suite = suite.lower()
c.execute(query, [announce_list, suite])
c.execute("ALTER TABLE suite ADD COLUMN codename text;")
query = "UPDATE suite SET codename = %s WHERE suite_name = %s" #: Update query
- for suite in Cnf.SubTree("Suite").List():
- codename = Cnf.Find("Suite::%s::CodeName" % (suite))
+ for suite in Cnf.subtree("Suite").list():
+ codename = Cnf.find("Suite::%s::CodeName" % (suite))
print "[Codename] Processing suite %s" % (suite)
suite = suite.lower()
c.execute(query, [codename, suite])
c.execute("ALTER TABLE suite ADD COLUMN overridecodename text;")
query = "UPDATE suite SET overridecodename = %s WHERE suite_name = %s" #: Update query
- for suite in Cnf.SubTree("Suite").List():
- codename = Cnf.Find("Suite::%s::OverrideCodeName" % (suite))
+ for suite in Cnf.subtree("Suite").list():
+ codename = Cnf.find("Suite::%s::OverrideCodeName" % (suite))
print "[OverrideCodeName] Processing suite %s" % (suite)
suite = suite.lower()
c.execute(query, [codename, suite])
c.execute("ALTER TABLE suite ADD COLUMN validtime integer NOT NULL DEFAULT 604800;")
query = "UPDATE suite SET validtime = %s WHERE suite_name = %s" #: Update query
- for suite in Cnf.SubTree("Suite").List():
- validtime = Cnf.Find("Suite::%s::ValidTime" % (suite))
+ for suite in Cnf.subtree("Suite").list():
+ validtime = Cnf.find("Suite::%s::ValidTime" % (suite))
print "[ValidTime] Processing suite %s" % (suite)
if not validtime:
validtime = 0
c.execute("ALTER TABLE suite ADD COLUMN priority integer NOT NULL DEFAULT 0;")
query = "UPDATE suite SET priority = %s WHERE suite_name = %s" #: Update query
- for suite in Cnf.SubTree("Suite").List():
- priority = Cnf.Find("Suite::%s::Priority" % (suite))
+ for suite in Cnf.subtree("Suite").list():
+ priority = Cnf.find("Suite::%s::Priority" % (suite))
print "[Priority] Processing suite %s" % (suite)
if not priority:
priority = 0
c.execute("ALTER TABLE suite ADD COLUMN notautomatic BOOLEAN NOT NULL DEFAULT FALSE;")
query = "UPDATE suite SET notautomatic = TRUE WHERE suite_name = %s" #: Update query
- for suite in Cnf.SubTree("Suite").List():
- notautomatic = Cnf.Find("Suite::%s::NotAutomatic" % (suite))
+ for suite in Cnf.subtree("Suite").list():
+ notautomatic = Cnf.find("Suite::%s::NotAutomatic" % (suite))
print "[NotAutomatic] Processing suite %s" % (suite)
if not notautomatic:
continue
# Migrate config file values into database
if cnf.has_key("Check-Overrides::OverrideSuites"):
- for suitename in cnf.SubTree("Check-Overrides::OverrideSuites").List():
+ for suitename in cnf.subtree("Check-Overrides::OverrideSuites").list():
if cnf.get("Check-Overrides::OverrideSuites::%s::Process" % suitename, "0") == "1":
print "Marking %s to have overrides processed automatically" % suitename.lower()
c.execute("UPDATE suite SET overrideprocess = TRUE WHERE suite_name = %s", [suitename.lower()])
--- /dev/null
+#!/usr/bin/env python
+# coding=utf8
+
+"""
+Remove redundant indices
+
+@contact: Debian FTP Master <ftpmaster@debian.org>
+@copyright: 2012 Ansgar Burchardt <ansgar@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
+# 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 psycopg2
+from daklib.dak_exceptions import DBUpdateError
+from daklib.config import Config
+
+################################################################################
+def do_update(self):
+ """
+ Remove redundant indices
+ """
+ print __doc__
+ try:
+ cnf = Config()
+
+ c = self.db.cursor()
+
+ indices = [
+ # table 'binaries':
+ "binaries_id", # (id). already covered by binaries_pkey (id)
+ "binaries_by_package", # (id, package). already covered by binaries_pkey (id)
+ "binaries_files", # (file). already covered by binaries_file_key (file)
+ "jjt5", # (id, source). already covered by binaries_pkey (id)
+ # table 'changes':
+ "changesin_queue_approved_for", # (in_queue, approved_for). already covered by changesin_queue (in_queue)
+ # table 'files':
+ "jjt", # (id). already covered by files_pkey (id)
+ "jjt3", # (id, location). already covered by files_pkey (id)
+ # table 'override':
+ "override_suite_key", # (suite, component, package, type). same as override_pkey
+ # table 'suite':
+ "suite_hash", # (suite_name). already covered by suite_name_unique (suite_name)
+ # table 'suite_architectures':
+ "suite_architectures_suite_key", # (suite, architecture). same as suite_architectures_pkey
+ ]
+ for index in indices:
+ c.execute("DROP INDEX IF EXISTS {0}".format(index))
+
+ c.execute("UPDATE config SET value = '72' WHERE name = 'db_revision'")
+ self.db.commit()
+
+ except psycopg2.ProgrammingError as msg:
+ self.db.rollback()
+ raise DBUpdateError('Unable to apply sick update 72, rollback issued. Error message : %s' % (str(msg)))
c.execute("ALTER TABLE suite ADD COLUMN copychanges TEXT;")
query = "UPDATE suite SET copychanges = %s WHERE suite_name = %s" #: Update query
- for suite in Cnf.SubTree("Suite").List():
- copychanges = Cnf.Find("Suite::%s::CopyChanges" % (suite))
+ for suite in Cnf.subtree("Suite").list():
+ copychanges = Cnf.find("Suite::%s::CopyChanges" % (suite))
print "[CopyChanges] Processing suite %s" % (suite)
if not copychanges:
continue
c.execute("ALTER TABLE suite ADD COLUMN copydotdak TEXT;")
query = "UPDATE suite SET copydotdak = %s WHERE suite_name = %s" #: Update query
- for suite in Cnf.SubTree("Suite").List():
- copydotdak = Cnf.Find("Suite::%s::CopyDotDak" % (suite))
+ for suite in Cnf.subtree("Suite").list():
+ copydotdak = Cnf.find("Suite::%s::CopyDotDak" % (suite))
print "[CopyDotDak] Processing suite %s" % (suite)
if not copydotdak:
continue
c.execute("ALTER TABLE suite ADD COLUMN commentsdir TEXT;")
query = "UPDATE suite SET commentsdir = %s WHERE suite_name = %s" #: Update query
- for suite in Cnf.SubTree("Suite").List():
- commentsdir = Cnf.Find("Suite::%s::CommentsDir" % (suite))
+ for suite in Cnf.subtree("Suite").list():
+ commentsdir = Cnf.find("Suite::%s::CommentsDir" % (suite))
print "[CommentsDir] Processing suite %s" % (suite)
if not commentsdir:
continue
c.execute("ALTER TABLE suite ADD COLUMN overridesuite TEXT;")
query = "UPDATE suite SET overridesuite = %s WHERE suite_name = %s" #: Update query
- for suite in Cnf.SubTree("Suite").List():
- overridesuite = Cnf.Find("Suite::%s::OverrideSuite" % (suite))
+ for suite in Cnf.subtree("Suite").list():
+ overridesuite = Cnf.find("Suite::%s::OverrideSuite" % (suite))
print "[OverrideSuite] Processing suite %s" % (suite)
if not overridesuite:
continue
c.execute("ALTER TABLE suite ADD COLUMN changelogbase TEXT;")
query = "UPDATE suite SET changelogbase = %s WHERE suite_name = %s" #: Update query
- for suite in Cnf.SubTree("Suite").List():
- changelogbase = Cnf.Find("Suite::%s::ChangeLogBase" % (suite))
+ for suite in Cnf.subtree("Suite").list():
+ changelogbase = Cnf.find("Suite::%s::ChangeLogBase" % (suite))
print "[ChangeLogBase] Processing suite %s" % (suite)
if not changelogbase:
continue
('s', "suite", "Obsolete::Options::Suite", "HasArg"),
('n', "no-action", "Obsolete::Options::No-Action"),
('f', "force", "Obsolete::Options::Force")]
- query_suites = DBConn().session().query(Suite)
- suites = [suite.suite_name for suite in query_suites.all()]
- if not cnf.has_key('Obsolete::Options::Suite'):
- cnf['Obsolete::Options::Suite'] = ','.join(suites)
cnf['Obsolete::Options::Help'] = ''
cnf['Obsolete::Options::No-Action'] = ''
cnf['Obsolete::Options::Force'] = ''
- apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
- Options = cnf.SubTree("Obsolete::Options")
+ apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
+ Options = cnf.subtree("Obsolete::Options")
if Options['Help']:
usage()
+ if 'Suite' not in Options:
+ query_suites = DBConn().session().query(Suite)
+ suites = [suite.suite_name for suite in query_suites.all()]
+ cnf['Obsolete::Options::Suite'] = ','.join(suites)
Logger = daklog.Logger("dominate")
session = DBConn().session()
for suite_name in utils.split_args(Options['Suite']):
deb_file = utils.open_file(filename)
try:
- extracts = apt_inst.debExtractControl(deb_file)
- control = apt_pkg.ParseSection(extracts)
+ extracts = utils.deb_extract_control(deb_file)
+ control = apt_pkg.TagSection(extracts)
except:
print formatted_text("can't parse control info")
deb_file.close()
control_keys = control.keys()
- if control.has_key("Depends"):
- depends_str = control.Find("Depends")
+ if "Depends" in control:
+ depends_str = control["Depends"]
# create list of dependancy lists
depends = split_depends(depends_str)
- if control.has_key("Recommends"):
- recommends_str = control.Find("Recommends")
+ if "Recommends" in control:
+ recommends_str = control["Recommends"]
recommends = split_depends(recommends_str)
- if control.has_key("Section"):
- section_str = control.Find("Section")
+ if "Section" in control:
+ section_str = control["Section"]
c_match = re_contrib.search(section_str)
nf_match = re_nonfree.search(section_str)
else :
# main
section = colour_output(section_str, 'main')
- if control.has_key("Architecture"):
- arch_str = control.Find("Architecture")
+ if "Architecture" in control:
+ arch_str = control["Architecture"]
arch = colour_output(arch_str, 'arch')
- if control.has_key("Maintainer"):
- maintainer = control.Find("Maintainer")
+ if "Maintainer" in control:
+ maintainer = control["Maintainer"]
localhost = re_localhost.search(maintainer)
if localhost:
#highlight bad email
field_value = maintainer
elif key == 'Description':
if use_html:
- field_value = formatted_text(control.Find(key), strip=True)
+ field_value = formatted_text(control.find(key), strip=True)
else:
- desc = control.Find(key)
+ desc = control.find(key)
desc = re_newlinespace.sub('\n ', desc)
field_value = escape_if_needed(desc)
else:
- field_value = escape_if_needed(control.Find(key))
+ field_value = escape_if_needed(control.find(key))
to_print += " "+format_field(key,field_value)+'\n'
return to_print
if not Cnf.has_key("Examine-Package::Options::%s" % (i)):
Cnf["Examine-Package::Options::%s" % (i)] = ""
- args = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv)
- Options = Cnf.SubTree("Examine-Package::Options")
+ args = apt_pkg.parse_commandline(Cnf,Arguments,sys.argv)
+ Options = Cnf.subtree("Examine-Package::Options")
if Options["Help"]:
usage()
Arguments = [('h',"help","External-Overrides::Options::Help"),
('f','force','External-Overrides::Options::Force')]
- args = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
+ args = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
try:
- Options = cnf.SubTree("External-Overrides::Options")
+ Options = cnf.subtree("External-Overrides::Options")
except KeyError:
Options = {}
if not cnf.has_key("Find-Null-Maintainers::Options::%s" % (i)):
cnf["Find-Null-Maintainers::Options::%s" % (i)] = ""
- apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
+ apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
- Options = cnf.SubTree("Find-Null-Maintainers::Options")
+ Options = cnf.subtree("Find-Null-Maintainers::Options")
if Options["Help"]:
usage()
cnf['Filelist::Options::Architecture'] = ','.join(architectures).encode()
cnf['Filelist::Options::Help'] = ''
cnf['Filelist::Options::Incremental'] = ''
- apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
- Options = cnf.SubTree("Filelist::Options")
+ apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
+ Options = cnf.subtree("Filelist::Options")
if Options['Help']:
usage()
pool = DakProcessPool()
('m', "maxdiffs", "Generate-Index-Diffs::Options::MaxDiffs", "hasArg"),
('n', "n-act", "Generate-Index-Diffs::Options::NoAct"),
]
- suites = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv)
- Options = Cnf.SubTree("Generate-Index-Diffs::Options")
+ suites = apt_pkg.parse_commandline(Cnf,Arguments,sys.argv)
+ Options = Cnf.subtree("Generate-Index-Diffs::Options")
if Options.has_key("Help"): usage()
maxdiffs = Options.get("MaxDiffs::Default", "56")
Cnf["Dir::Root"] = Options["RootDir"]
if not suites:
- suites = Cnf.SubTree("Suite").List()
+ suites = Cnf.subtree("Suite").list()
for suitename in suites:
print "Processing: " + suitename
- SuiteBlock = Cnf.SubTree("Suite::" + suitename)
+ SuiteBlock = Cnf.subtree("Suite::" + suitename)
suiteobj = get_suite(suitename.lower())
architectures = get_suite_architectures(suite, skipall=True)
if SuiteBlock.has_key("Components"):
- components = SuiteBlock.ValueList("Components")
+ components = SuiteBlock.value_list("Components")
else:
components = []
- suite_suffix = Cnf.Find("Dinstall::SuiteSuffix")
+ suite_suffix = Cnf.find("Dinstall::SuiteSuffix")
if components and suite_suffix:
longsuite = suite + "/" + suite_suffix
else:
('s',"suite","Generate-Packages-Sources::Options::Suite"),
('f',"force","Generate-Packages-Sources::Options::Force")]
- suite_names = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
- Options = cnf.SubTree("Generate-Packages-Sources::Options")
+ suite_names = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
+ Options = cnf.subtree("Generate-Packages-Sources::Options")
if Options["Help"]:
usage()
('f',"force","Generate-Packages-Sources::Options::Force"),
('o','option','','ArbItem')]
- suite_names = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
+ suite_names = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
try:
- Options = cnf.SubTree("Generate-Packages-Sources::Options")
+ Options = cnf.subtree("Generate-Packages-Sources::Options")
except KeyError:
Options = {}
cnf = Config()
- suite_suffix = "%s" % (cnf.Find("Dinstall::SuiteSuffix"))
+ suite_suffix = "%s" % (cnf.find("Dinstall::SuiteSuffix"))
outfile = os.path.join(cnf["Dir::Root"], 'dists', "%s/%s" % (suite.suite_name, suite_suffix), "Release")
out = open(outfile + ".new", "w")
('f',"force","Generate-Releases::Options::Force"),
('o','option','','ArbItem')]
- suite_names = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
- Options = cnf.SubTree("Generate-Releases::Options")
+ suite_names = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
+ Options = cnf.subtree("Generate-Releases::Options")
if Options["Help"]:
usage()
if not Cnf.has_key("Graph::Options::%s" % (i)):
Cnf["Graph::Options::%s" % (i)] = ""
- apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv)
+ apt_pkg.parse_commandline(Cnf, Arguments, sys.argv)
- Options = Cnf.SubTree("Graph::Options")
+ Options = Cnf.subtree("Graph::Options")
if Options["Help"]:
usage()
for i in Cnf["Graph::Options::Names"].split(","):
names.append(i)
elif Cnf.has_key("Graph::Names"):
- names = Cnf.ValueList("Graph::Names")
+ names = Cnf.value_list("Graph::Names")
else:
names = default_names
extra_rrdtool_args.extend(f.read().strip().split("\n"))
f.close()
elif Cnf.has_key("Graph::Extra-Rrd"):
- for i in Cnf.ValueList("Graph::Extra-Rrd"):
+ for i in Cnf.value_list("Graph::Extra-Rrd"):
f = open(i)
extra_rrdtool_args.extend(f.read().strip().split("\n"))
f.close()
if not cnf.has_key("Import-Keyring::Options::%s" % (i)):
cnf["Import-Keyring::Options::%s" % (i)] = ""
- keyring_names = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
+ keyring_names = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
### Parse options
- Options = cnf.SubTree("Import-Keyring::Options")
+ Options = cnf.subtree("Import-Keyring::Options")
if Options["Help"]:
usage()
('v',"verbose", "%s::%s" % (options_prefix,"Verbose")),
]
- args = apt_pkg.ParseCommandLine(cnf.Cnf, arguments,sys.argv)
+ args = apt_pkg.parse_commandline(cnf.Cnf, arguments,sys.argv)
num_threads = 1
if not cnf.has_key("Import-LDAP-Fingerprints::Options::%s" % (i)):
cnf["Import-LDAP-Fingerprints::Options::%s" % (i)] = ""
- apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
+ apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
- Options = cnf.SubTree("Import-LDAP-Fingerprints::Options")
+ Options = cnf.subtree("Import-LDAP-Fingerprints::Options")
if Options["Help"]:
usage()
print "Assigning %s to 0x%s." % (uid, fingerprint)
else:
extra_keyrings = ""
- for keyring in cnf.ValueList("Import-LDAP-Fingerprints::ExtraKeyrings"):
+ for keyring in cnf.value_list("Import-LDAP-Fingerprints::ExtraKeyrings"):
extra_keyrings += " --keyring=%s" % (keyring)
cmd = "gpg %s %s --list-key %s" \
% (utils.gpg_keyring_args(), extra_keyrings, fingerprint)
('v',"verbose", "%s::%s" % (options_prefix,"Verbose")),
]
- args = apt_pkg.ParseCommandLine(cnf.Cnf, arguments,sys.argv)
+ args = apt_pkg.parse_commandline(cnf.Cnf, arguments,sys.argv)
num_threads = 1
if not cnf.has_key("Import-Users-From-Passwd::Options::%s" % (i)):
cnf["Import-Users-From-Passwd::Options::%s" % (i)] = ""
- arguments = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
- Options = cnf.SubTree("Import-Users-From-Passwd::Options")
+ arguments = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
+ Options = cnf.subtree("Import-Users-From-Passwd::Options")
if Options["Help"]:
usage()
def process_tree(config, tree):
"""Create directories for a config tree."""
- for entry in config.SubTree(tree).List():
+ for entry in config.subtree(tree).list():
entry = entry.lower()
config_name = "%s::%s" % (tree, entry)
target = config[config_name]
for subdir in [ "Clean-Queues", "Clean-Suites" ]:
process_morguesubdir(subdir)
- suite_suffix = "%s" % (Cnf.Find("Dinstall::SuiteSuffix"))
+ suite_suffix = "%s" % (Cnf.find("Dinstall::SuiteSuffix"))
# Process secret keyrings
if Cnf.has_key('Dinstall::SigningKeyring'):
d = DBConn()
- arguments = apt_pkg.ParseCommandLine(Cnf, arguments, sys.argv)
+ arguments = apt_pkg.parse_commandline(Cnf, arguments, sys.argv)
- options = Cnf.SubTree("Init-Dirs::Options")
+ options = Cnf.subtree("Init-Dirs::Options")
if options["Help"]:
usage()
elif arguments:
if not cnf.has_key("Ls::Options::%s" % (i)):
cnf["Ls::Options::%s" % (i)] = ""
- packages = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
- Options = cnf.SubTree("Ls::Options")
+ packages = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
+ Options = cnf.subtree("Ls::Options")
if Options["Help"]:
usage()
highver.setdefault(pkg,"")
if not d[pkg].has_key(version):
d[pkg][version] = {}
- if apt_pkg.VersionCompare(version, highver[pkg]) > 0:
+ if apt_pkg.version_compare(version, highver[pkg]) > 0:
highver[pkg] = version
if not d[pkg][version].has_key(suite):
d[pkg][version][suite] = []
packages.sort()
for pkg in packages:
versions = d[pkg].keys()
- versions.sort(apt_pkg.VersionCompare)
+ versions.sort(apt_pkg.version_compare)
for version in versions:
suites = d[pkg][version].keys()
suites.sort()
if not Cnf.has_key('Make-Changelog::Options::%s' % (i)):
Cnf['Make-Changelog::Options::%s' % (i)] = ''
- apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv)
- Options = Cnf.SubTree('Make-Changelog::Options')
+ apt_pkg.parse_commandline(Cnf, Arguments, sys.argv)
+ Options = Cnf.subtree('Make-Changelog::Options')
suite = Cnf['Make-Changelog::Options::Suite']
base_suite = Cnf['Make-Changelog::Options::Base-Suite']
binnmu = Cnf['Make-Changelog::Options::binNMU']
if not cnf.has_key("Make-Maintainers::Options::Help"):
cnf["Make-Maintainers::Options::Help"] = ""
- extra_files = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
- Options = cnf.SubTree("Make-Maintainers::Options")
+ extra_files = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
+ Options = cnf.subtree("Make-Maintainers::Options")
if Options["Help"]:
usage()
for i in [ "help" ]:
if not cnf.has_key("Make-Overrides::Options::%s" % (i)):
cnf["Make-Overrides::Options::%s" % (i)] = ""
- apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
- Options = cnf.SubTree("Make-Overrides::Options")
+ apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
+ Options = cnf.subtree("Make-Overrides::Options")
if Options["Help"]:
usage()
('n',"no-action","Manage-Build-Queues::Options::No-Action"),
('a',"all","Manage-Build-Queues::Options::All")]
- queue_names = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
- Options = cnf.SubTree("Manage-Build-Queues::Options")
+ queue_names = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
+ Options = cnf.subtree("Manage-Build-Queues::Options")
if Options["Help"]:
usage()
('l', "limit", 'Metadata::Options::Limit', "HasArg"),
('f', "force", 'Metadata::Options::Force'),
]
- args = apt_pkg.ParseCommandLine(cnf.Cnf, arguments, sys.argv)
- options = cnf.SubTree('Metadata::Options')
+ args = apt_pkg.parse_commandline(cnf.Cnf, arguments, sys.argv)
+ options = cnf.subtree('Metadata::Options')
if (len(args) != 1) or options['Help']:
usage()
if not cnf.has_key("Security::Options::%s" % (i)):
cnf["Security::Options::%s" % (i)] = ""
- changes_files = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
+ changes_files = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
- Options = cnf.SubTree("Security::Options")
+ Options = cnf.subtree("Security::Options")
if Options['Help']:
usage()
if not cnf.has_key("Override::Options::Suite"):
cnf["Override::Options::Suite"] = "unstable"
- arguments = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
- Options = cnf.SubTree("Override::Options")
+ arguments = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
+ Options = cnf.subtree("Override::Options")
if Options["Help"]:
usage()
Subst["__OVERRIDE_ADDRESS__"] = cnf["Dinstall::MyEmailAddress"]
Subst["__BUG_SERVER__"] = cnf["Dinstall::BugServer"]
bcc = []
- if cnf.Find("Dinstall::Bcc") != "":
+ if cnf.find("Dinstall::Bcc") != "":
bcc.append(cnf["Dinstall::Bcc"])
if bcc:
Subst["__BCC__"] = "Bcc: " + ", ".join(bcc)
if not cnf.has_key('Override-Disparity::Options::Suite'):
cnf['Override-Disparity::Options::Suite'] = 'unstable'
- apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
- Options = cnf.SubTree('Override-Disparity::Options')
+ apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
+ Options = cnf.subtree('Override-Disparity::Options')
if Options['help']:
usage()
summary = ""
for f in files.keys():
if files[f]["type"] == "deb":
- control = apt_pkg.ParseSection(apt_inst.debExtractControl(utils.open_file(f)))
+ control = apt_pkg.TagSection(utils.deb_extract_control(utils.open_file(f)))
summary += "\n"
- summary += "Package: %s\n" % (control.Find("Package"))
- summary += "Description: %s\n" % (control.Find("Description"))
+ summary += "Package: %s\n" % (control.find("Package"))
+ summary += "Description: %s\n" % (control.find("Description"))
upload.Subst["__BINARY_DESCRIPTIONS__"] = summary
bxa_mail = utils.TemplateSubst(upload.Subst,Config()["Dir::Templates"]+"/process-new.bxa_notification")
utils.send_mail(bxa_mail)
session.commit()
- if Config().FindB("Dinstall::BXANotify"):
+ if Config().find_b("Dinstall::BXANotify"):
do_bxa_notification(upload)
################################################################################
if not cnf.has_key("Process-New::Options::%s" % (i)):
cnf["Process-New::Options::%s" % (i)] = ""
- changes_files = apt_pkg.ParseCommandLine(cnf.Cnf,Arguments,sys.argv)
+ changes_files = apt_pkg.parse_commandline(cnf.Cnf,Arguments,sys.argv)
if len(changes_files) == 0:
new_queue = get_policy_queue('new', session );
changes_paths = [ os.path.join(new_queue.path, j) for j in utils.get_changes_files(new_queue.path) ]
else:
changes_paths = [ os.path.abspath(j) for j in changes_files ]
- Options = cnf.SubTree("Process-New::Options")
+ Options = cnf.subtree("Process-New::Options")
if Options["Help"]:
usage()
if not cnf.has_key("Process-Policy::Options::%s" % (i)):
cnf["Process-Policy::Options::%s" % (i)] = ""
- queue_name = apt_pkg.ParseCommandLine(cnf.Cnf,Arguments,sys.argv)
+ queue_name = apt_pkg.parse_commandline(cnf.Cnf,Arguments,sys.argv)
if len(queue_name) != 1:
print "E: Specify exactly one policy queue"
queue_name = queue_name[0]
- Options = cnf.SubTree("Process-Policy::Options")
+ Options = cnf.subtree("Process-Policy::Options")
if Options["Help"]:
usage()
if not cnf.has_key("Dinstall::Options::%s" % (i)):
cnf["Dinstall::Options::%s" % (i)] = ""
- changes_files = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
- Options = cnf.SubTree("Dinstall::Options")
+ changes_files = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
+ Options = cnf.subtree("Dinstall::Options")
if Options["Help"]:
usage()
if not Cnf.has_key("Queue-Report::Options::%s" % (i)):
Cnf["Queue-Report::Options::%s" % (i)] = ""
- apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv)
+ apt_pkg.parse_commandline(Cnf, Arguments, sys.argv)
- Options = Cnf.SubTree("Queue-Report::Options")
+ Options = Cnf.subtree("Queue-Report::Options")
if Options["Help"]:
usage()
for i in Cnf["Queue-Report::Options::Directories"].split(","):
queue_names.append(i)
elif Cnf.has_key("Queue-Report::Directories"):
- queue_names = Cnf.ValueList("Queue-Report::Directories")
+ queue_names = Cnf.value_list("Queue-Report::Directories")
else:
queue_names = [ "byhand", "new" ]
if not cnf.has_key("Rm::Options::Suite"):
cnf["Rm::Options::Suite"] = "unstable"
- arguments = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
- Options = cnf.SubTree("Rm::Options")
+ arguments = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
+ Options = cnf.subtree("Rm::Options")
if Options["Help"]:
usage()
q = session.execute("SELECT l.path, f.filename, b.package, b.version, a.arch_string, b.id, b.maintainer FROM binaries b, bin_associations ba, architecture a, suite su, files f, location l, component c WHERE ba.bin = b.id AND ba.suite = su.id AND b.architecture = a.id AND b.file = f.id AND f.location = l.id AND l.component = c.id %s %s %s AND b.package = '%s'" % (con_suites, con_components, con_architectures, package))
for i in q.fetchall():
filename = "/".join(i[:2])
- control = apt_pkg.ParseSection(apt_inst.debExtractControl(utils.open_file(filename)))
- source = control.Find("Source", control.Find("Package"))
+ control = apt_pkg.TagSection(utils.deb_extract_control(utils.open_file(filename)))
+ source = control.find("Source", control.find("Package"))
source = re_strip_source_version.sub('', source)
if source_packages.has_key(source):
to_remove.append(i[2:])
versions = []
for package in removals:
versions = d[package].keys()
- versions.sort(apt_pkg.VersionCompare)
+ versions.sort(apt_pkg.version_compare)
for version in versions:
d[package][version].sort(utils.arch_compare_sw)
summary += "%10s | %10s | %s\n" % (package, version, ", ".join(d[package][version]))
if Options["Done"]:
Subst_close_rm = Subst_common
bcc = []
- if cnf.Find("Dinstall::Bcc") != "":
+ if cnf.find("Dinstall::Bcc") != "":
bcc.append(cnf["Dinstall::Bcc"])
- if cnf.Find("Rm::Bcc") != "":
+ if cnf.find("Rm::Bcc") != "":
bcc.append(cnf["Rm::Bcc"])
if bcc:
Subst_close_rm["__BCC__"] = "Bcc: " + ", ".join(bcc)
("p","link-path","Show-Deferred::LinkPath","HasArg"),
("d","deferred-queue","Show-Deferred::DeferredQueue","HasArg"),
('r',"rrd","Show-Deferred::Options::Rrd", "HasArg")]
- args = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv)
+ args = apt_pkg.parse_commandline(Cnf,Arguments,sys.argv)
for i in ["help"]:
if not Cnf.has_key("Show-Deferred::Options::%s" % (i)):
Cnf["Show-Deferred::Options::%s" % (i)] = ""
print >> sys.stderr, """Show-Deferred::%s is mandatory.
set via config file or command-line option %s"""%(i,j)
- Options = Cnf.SubTree("Show-Deferred::Options")
+ Options = Cnf.subtree("Show-Deferred::Options")
if Options["help"]:
usage()
if not cnf.has_key("Show-New::Options::%s" % (i)):
cnf["Show-New::Options::%s" % (i)] = ""
- changes_files = apt_pkg.ParseCommandLine(cnf.Cnf,Arguments,sys.argv)
+ changes_files = apt_pkg.parse_commandline(cnf.Cnf,Arguments,sys.argv)
if len(changes_files) == 0:
new_queue = get_policy_queue('new', session );
changes_files = utils.get_changes_files(new_queue.path)
- Options = cnf.SubTree("Show-New::Options")
+ Options = cnf.subtree("Show-New::Options")
if Options["help"]:
usage()
if not Cnf.has_key("Stats::Options::%s" % (i)):
Cnf["Stats::Options::%s" % (i)] = ""
- args = apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv)
+ args = apt_pkg.parse_commandline(Cnf, Arguments, sys.argv)
- Options = Cnf.SubTree("Stats::Options")
+ Options = Cnf.subtree("Stats::Options")
if Options["Help"]:
usage()
if not Cnf.has_key("Edit-Transitions::Options::%s" % (i)):
Cnf["Edit-Transitions::Options::%s" % (i)] = ""
- apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv)
+ apt_pkg.parse_commandline(Cnf, Arguments, sys.argv)
- Options = Cnf.SubTree("Edit-Transitions::Options")
+ Options = Cnf.subtree("Edit-Transitions::Options")
if Options["help"]:
usage()
print "Transition source %s not in testing, transition still ongoing." % (source)
else:
current = sourceobj.version
- compare = apt_pkg.VersionCompare(current, expected)
+ compare = apt_pkg.version_compare(current, expected)
if compare < 0:
# This is still valid, the current version in database is older than
# the new version we wait for
# No package in testing
print "Transition source %s not in testing, transition still ongoing." % (source)
else:
- compare = apt_pkg.VersionCompare(sourceobj.version, expected)
+ compare = apt_pkg.version_compare(sourceobj.version, expected)
print "Apt compare says: %s" % (compare)
if compare < 0:
# This is still valid, the current version in database is older than
################################################################################
Cnf = None
-required_database_schema = 71
+required_database_schema = 72
################################################################################
if not cnf.has_key("Update-DB::Options::%s" % (i)):
cnf["Update-DB::Options::%s" % (i)] = ""
- arguments = apt_pkg.ParseCommandLine(cnf.Cnf, arguments, sys.argv)
+ arguments = apt_pkg.parse_commandline(cnf.Cnf, arguments, sys.argv)
- options = cnf.SubTree("Update-DB::Options")
+ options = cnf.subtree("Update-DB::Options")
if options["Help"]:
self.usage()
elif arguments:
from cPickle import Unpickler, Pickler
from errno import EPERM
-from apt_inst import debExtractControl
-from apt_pkg import ParseSection
+from apt_pkg import TagSection
-from utils import open_file, fubar, poolify
+from utils import open_file, fubar, poolify, deb_extract_control
from config import *
from dbconn import *
if entry["type"] == "deb":
deb_fh = open_file(name)
- summary += ParseSection(debExtractControl(deb_fh))["Description"] + '\n'
+ summary += TagSection(deb_extract_control(deb_fh))["Description"] + '\n'
deb_fh.close()
else:
"""Sort by source name, source, version, 'have source', and
finally by filename."""
# Sort by source version
- q = apt_pkg.VersionCompare(a["version"], b["version"])
+ q = apt_pkg.version_compare(a["version"], b["version"])
if q:
return -q
def _readconf(self):
apt_pkg.init()
- self.Cnf = apt_pkg.newConfiguration()
+ self.Cnf = apt_pkg.Configuration()
- apt_pkg.ReadConfigFileISC(self.Cnf, which_conf_file())
+ apt_pkg.read_config_file_isc(self.Cnf, which_conf_file())
# Check whether our dak.conf was the real one or
# just a pointer to our main one
res = socket.gethostbyaddr(socket.gethostname())
conffile = self.Cnf.get("Config::" + res[0] + "::DakConfig")
if conffile:
- apt_pkg.ReadConfigFileISC(self.Cnf, conffile)
+ apt_pkg.read_config_file_isc(self.Cnf, conffile)
# Rebind some functions
# TODO: Clean this up
self.get = self.Cnf.get
- self.SubTree = self.Cnf.SubTree
- self.ValueList = self.Cnf.ValueList
- self.Find = self.Cnf.Find
- self.FindB = self.Cnf.FindB
+ self.subtree = self.Cnf.subtree
+ self.value_list = self.Cnf.value_list
+ self.find = self.Cnf.find
+ self.find_b = self.Cnf.find_b
def has_key(self, name):
return self.Cnf.has_key(name)
from config import Config
from textutils import fix_maintainer
from dak_exceptions import DBUpdateError, NoSourceFieldError, FileExistsError
+import utils
# suppress some deprecation warnings in squeeze related to sqlalchemy
import warnings
return None
sa_major_version = sqlalchemy.__version__[0:3]
-if sa_major_version in ["0.5", "0.6"]:
+if sa_major_version in ["0.5", "0.6", "0.7"]:
from sqlalchemy.databases import postgres
postgres.ischema_names['debversion'] = DebVersion
else:
- raise Exception("dak only ported to SQLA versions 0.5 and 0.6. See daklib/dbconn.py")
+ raise Exception("dak only ported to SQLA versions 0.5 to 0.7. See daklib/dbconn.py")
################################################################################
import apt_inst
fullpath = self.poolfile.fullpath
deb_file = open(fullpath, 'r')
- stanza = apt_inst.debExtractControl(deb_file)
+ stanza = utils.deb_extract_control(deb_file)
deb_file.close()
return stanza
mapper(Architecture, self.tbl_architecture,
properties = dict(arch_id = self.tbl_architecture.c.id,
suites = relation(Suite, secondary=self.tbl_suite_architectures,
- order_by='suite_name',
- backref=backref('architectures', order_by='arch_string'))),
+ order_by=self.tbl_suite.c.suite_name,
+ backref=backref('architectures', order_by=self.tbl_architecture.c.arch_string))),
extension = validator)
mapper(Archive, self.tbl_archive,
Cnf = Config()
# Handle suite mappings
- for m in Cnf.ValueList("SuiteMappings"):
+ for m in Cnf.value_list("SuiteMappings"):
args = m.split()
mtype = args[0]
if mtype == "map" or mtype == "silent-map":
# Extract package control information
deb_file = utils.open_file(f)
try:
- control = apt_pkg.ParseSection(apt_inst.debExtractControl(deb_file))
+ control = apt_pkg.TagSection(utils.deb_extract_control(deb_file))
except:
- self.rejects.append("%s: debExtractControl() raised %s." % (f, sys.exc_info()[0]))
+ self.rejects.append("%s: deb_extract_control() raised %s." % (f, sys.exc_info()[0]))
deb_file.close()
# Can't continue, none of the checks on control would work.
return
- # Check for mandantory "Description:"
- deb_file.seek(0)
- try:
- apt_pkg.ParseSection(apt_inst.debExtractControl(deb_file))["Description"] + '\n'
- except:
- self.rejects.append("%s: Missing Description in binary package" % (f))
- return
-
deb_file.close()
# Check for mandatory fields
- for field in [ "Package", "Architecture", "Version" ]:
- if control.Find(field) == None:
+ for field in [ "Package", "Architecture", "Version", "Description" ]:
+ if field not in control:
# Can't continue
self.rejects.append("%s: No %s field in control." % (f, field))
return
# Ensure the package name matches the one give in the .changes
- if not self.pkg.changes["binary"].has_key(control.Find("Package", "")):
- self.rejects.append("%s: control file lists name as `%s', which isn't in changes file." % (f, control.Find("Package", "")))
+ if not self.pkg.changes["binary"].has_key(control.find("Package", "")):
+ self.rejects.append("%s: control file lists name as `%s', which isn't in changes file." % (f, control.find("Package", "")))
# Validate the package field
- package = control.Find("Package")
+ package = control["Package"]
if not re_valid_pkg_name.match(package):
self.rejects.append("%s: invalid package name '%s'." % (f, package))
# Validate the version field
- version = control.Find("Version")
+ version = control["Version"]
if not re_valid_version.match(version):
self.rejects.append("%s: invalid version number '%s'." % (f, version))
# Ensure the architecture of the .deb is one we know about.
default_suite = cnf.get("Dinstall::DefaultSuite", "unstable")
- architecture = control.Find("Architecture")
+ architecture = control["Architecture"]
upload_suite = self.pkg.changes["distribution"].keys()[0]
if architecture not in [a.arch_string for a in get_suite_architectures(default_suite, session = session)] \
self.rejects.append("%s: control file lists arch as `%s', which isn't in changes file." % (f, architecture))
# Sanity-check the Depends field
- depends = control.Find("Depends")
+ depends = control.find("Depends")
if depends == '':
self.rejects.append("%s: Depends field is empty." % (f))
# Sanity-check the Provides field
- provides = control.Find("Provides")
- if provides:
+ provides = control.find("Provides")
+ if provides is not None:
provide = re_spacestrip.sub('', provides)
if provide == '':
self.rejects.append("%s: Provides field is empty." % (f))
# If there is a Built-Using field, we need to check we can find the
# exact source version
- built_using = control.Find("Built-Using")
- if built_using:
+ built_using = control.find("Built-Using")
+ if built_using is not None:
try:
entry["built-using"] = []
for dep in apt_pkg.parse_depends(built_using):
# Check the section & priority match those given in the .changes (non-fatal)
- if control.Find("Section") and entry["section"] != "" \
- and entry["section"] != control.Find("Section"):
+ if control.find("Section") and entry["section"] != "" \
+ and entry["section"] != control.find("Section"):
self.warnings.append("%s control file lists section as `%s', but changes file has `%s'." % \
- (f, control.Find("Section", ""), entry["section"]))
- if control.Find("Priority") and entry["priority"] != "" \
- and entry["priority"] != control.Find("Priority"):
+ (f, control.find("Section", ""), entry["section"]))
+ if control.find("Priority") and entry["priority"] != "" \
+ and entry["priority"] != control.find("Priority"):
self.warnings.append("%s control file lists priority as `%s', but changes file has `%s'." % \
- (f, control.Find("Priority", ""), entry["priority"]))
+ (f, control.find("Priority", ""), entry["priority"]))
entry["package"] = package
entry["architecture"] = architecture
entry["version"] = version
- entry["maintainer"] = control.Find("Maintainer", "")
+ entry["maintainer"] = control.find("Maintainer", "")
if f.endswith(".udeb"):
self.pkg.files[f]["dbtype"] = "udeb"
else:
self.rejects.append("%s is neither a .deb or a .udeb." % (f))
- entry["source"] = control.Find("Source", entry["package"])
+ entry["source"] = control.find("Source", entry["package"])
# Get the source version
source = entry["source"]
if entry["package"] != file_package:
self.rejects.append("%s: package part of filename (%s) does not match package name in the %s (%s)." % \
(f, file_package, entry["dbtype"], entry["package"]))
- epochless_version = re_no_epoch.sub('', control.Find("Version"))
+ epochless_version = re_no_epoch.sub('', control.find("Version"))
# version
file_version = m.group(2)
return
# Handle component mappings
- for m in cnf.ValueList("ComponentMappings"):
+ for m in cnf.value_list("ComponentMappings"):
(source, dest) = m.split()
if entry["component"] == source:
entry["original component"] = source
if not has_source:
self.rejects.append("no source found and Architecture line in changes mention source.")
- if (not has_binaries) and (not cnf.FindB("Dinstall::AllowSourceOnlyUploads")):
+ if (not has_binaries) and (not cnf.find_b("Dinstall::AllowSourceOnlyUploads")):
self.rejects.append("source only uploads are not supported.")
###########################################################################
if field:
# Have apt try to parse them...
try:
- apt_pkg.ParseSrcDepends(field)
+ apt_pkg.parse_src_depends(field)
except:
self.rejects.append("%s: invalid %s field (can not be parsed by apt)." % (dsc_filename, field_name.title()))
self.rejects.append("'dpkg-source -x' failed for %s. (%s)" % (dsc_filename, str(e)))
return
- if not cnf.Find("Dir::BTSVersionTrack"):
+ if not cnf.find("Dir::BTSVersionTrack"):
return
# Get the upstream version
if not self.pkg.changes.has_key("urgency"):
self.pkg.changes["urgency"] = cnf["Urgency::Default"]
self.pkg.changes["urgency"] = self.pkg.changes["urgency"].lower()
- if self.pkg.changes["urgency"] not in cnf.ValueList("Urgency::Valid"):
+ if self.pkg.changes["urgency"] not in cnf.value_list("Urgency::Valid"):
self.warnings.append("%s is not a valid urgency; it will be treated as %s by testing." % \
(self.pkg.changes["urgency"], cnf["Urgency::Default"]))
self.pkg.changes["urgency"] = cnf["Urgency::Default"]
# Will be None if nothing is in testing.
current = get_source_in_suite(source, "testing", session)
if current is not None:
- compare = apt_pkg.VersionCompare(current.version, expected)
+ compare = apt_pkg.version_compare(current.version, expected)
if current is None or compare < 0:
# This is still valid, the current version in testing is older than
del self.Subst["__ANNOUNCE_LIST_ADDRESS__"]
- if cnf.FindB("Dinstall::CloseBugs") and cnf.has_key("Dinstall::BugServer"):
+ if cnf.find_b("Dinstall::CloseBugs") and cnf.has_key("Dinstall::BugServer"):
summary = self.close_bugs(summary, action)
del self.Subst["__SHORT_SUMMARY__"]
self.announce(short_summary, 1)
## Helper stuff for DebBugs Version Tracking
- if cnf.Find("Dir::BTSVersionTrack"):
+ if cnf.find("Dir::BTSVersionTrack"):
if self.pkg.changes["architecture"].has_key("source"):
(fd, temp_filename) = utils.temp_filename(cnf["Dir::BTSVersionTrack"], prefix=".")
version_history = os.fdopen(fd, 'w')
cnf = Config()
# Abandon the check if override disparity checks have been disabled
- if not cnf.FindB("Dinstall::OverrideDisparityCheck"):
+ if not cnf.find_b("Dinstall::OverrideDisparityCheck"):
return
summary = self.pkg.check_override()
anysuite = [suite] + [ vc.reference.suite_name for vc in get_version_checks(suite, "Enhances") ]
for (s, v) in sv_list:
if s in [ x.lower() for x in anysuite ]:
- if not anyversion or apt_pkg.VersionCompare(anyversion, v) <= 0:
+ if not anyversion or apt_pkg.version_compare(anyversion, v) <= 0:
anyversion = v
return anyversion
must_be_newer_than.append(target_suite)
for (suite, existent_version) in sv_list:
- vercmp = apt_pkg.VersionCompare(new_version, existent_version)
+ vercmp = apt_pkg.version_compare(new_version, existent_version)
if suite in must_be_newer_than and sourceful and vercmp < 1:
self.rejects.append("%s: old version (%s) in %s >= new version (%s) targeted at %s." % (filename, existent_version, suite, new_version, target_suite))
# we could just stick with the "...old version..." REJECT
# for this, I think.
self.rejects.append("Won't propogate NEW packages.")
- elif apt_pkg.VersionCompare(new_version, add_version) < 0:
+ elif apt_pkg.version_compare(new_version, add_version) < 0:
# propogation would be redundant. no need to reject though.
self.warnings.append("ignoring versionconflict: %s: old version (%s) in %s <= new version (%s) targeted at %s." % (filename, existent_version, suite, new_version, target_suite))
cansave = 1
- elif apt_pkg.VersionCompare(new_version, add_version) > 0 and \
- apt_pkg.VersionCompare(add_version, target_version) >= 0:
+ elif apt_pkg.version_compare(new_version, add_version) > 0 and \
+ apt_pkg.version_compare(add_version, target_version) >= 0:
# propogate!!
self.warnings.append("Propogating upload to %s" % (addsuite))
self.pkg.changes.setdefault("propdistribution", {})
all_auto = 0
continue
- ABH = cnf.SubTree("AutomaticByHandPackages")
+ ABH = cnf.subtree("AutomaticByHandPackages")
if not ABH.has_key(pckg) or \
ABH["%s::Source" % (pckg)] != u.pkg.changes["source"]:
print "not match %s %s" % (pckg, u.pkg.changes["source"])
import tempfile
import traceback
import stat
+import apt_inst
import apt_pkg
import time
import re
res = socket.getfqdn()
# In case we allow local config files per user, try if one exists
- if Cnf.FindB("Config::" + res + "::AllowLocalConfig"):
+ if Cnf.find_b("Config::" + res + "::AllowLocalConfig"):
homedir = os.getenv("HOME")
confpath = os.path.join(homedir, "/etc/dak.conf")
if os.path.exists(confpath):
def which_apt_conf_file ():
res = socket.getfqdn()
# In case we allow local config files per user, try if one exists
- if Cnf.FindB("Config::" + res + "::AllowLocalConfig"):
+ if Cnf.find_b("Config::" + res + "::AllowLocalConfig"):
homedir = os.getenv("HOME")
confpath = os.path.join(homedir, "/etc/dak.conf")
if os.path.exists(confpath):
# Sort by source version
a_version = a_changes.get("version", "0")
b_version = b_changes.get("version", "0")
- q = apt_pkg.VersionCompare(a_version, b_version)
+ q = apt_pkg.version_compare(a_version, b_version)
if q:
return q
apt_pkg.init()
-Cnf = apt_pkg.newConfiguration()
+Cnf = apt_pkg.Configuration()
if not os.getenv("DAK_TEST"):
- apt_pkg.ReadConfigFileISC(Cnf,default_config)
+ apt_pkg.read_config_file_isc(Cnf,default_config)
if which_conf_file() != default_config:
- apt_pkg.ReadConfigFileISC(Cnf,which_conf_file())
+ apt_pkg.read_config_file_isc(Cnf,which_conf_file())
################################################################################
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")
==================================
The following packages are needed for the database:
- * postgresql-9.0 postgresql-client-9.0 postgresql-plperl-9.0 postgresql-plpython-9.0 postgresql-9.0-debversion
+ * postgresql-9.1 postgresql-client-9.1 postgresql-9.1-debversion
and the following packages for dak itself:
* python-psycopg2 python-sqlalchemy python-apt gnupg dpkg-dev lintian
binutils-multiarch python-yaml less python-ldap python-pyrss2gen python-rrdtool
For the purposes of this document, we'll be working in /srv/dak
-Set up the dak user on both the system and in postgres:
+Set up the dak user:
# sudo addgroup --system ftpmaster
# sudo adduser --system dak --ingroup ftpmaster --shell /bin/bash
-# sudo -u postgres createuser -s dak
+
+Create postgres roles and database:
+# sudo -u postgres psql
+ CREATE USER dak CREATEROLE;
+ CREATE ROLE ftpmaster;
+ CREATE ROLE ftpteam WITH ROLE ftpmaster;
+ CREATE ROLE ftptrainee WITH ROLE ftpmaster, ftpteam;
+
+ CREATE DATABASE projectb WITH OWNER dak TEMPLATE template0 ENCODING 'SQL_ASCII';
+ \c projectb
+ CREATE EXTENSION IF NOT EXISTS plpgsql;
+ CREATE EXTENSION IF NOT EXISTS debversion;
Set up the dak directory:
# sudo mkdir /etc/dak
Become the dak user:
# sudo -u dak -s -H
-Create the additional roles:
-# createuser -S -R -D ftpmaster
-# createuser -S -R -D ftpteam
-# createuser -S -R -D ftptrainee
-# psql -d projectb -c "ALTER GROUP ftpteam ADD USER ftpmaster"
-# psql -d projectb -c "ALTER GROUP ftptrainee ADD USER ftpmaster"
-# psql -d projectb -c "ALTER GROUP ftptrainee ADD USER ftpteam"
-
-Create an empty database with SQL_ASCII encoding:
-# createdb -T template0 -E SQL_ASCII -O dak projectb
-
Import the schema. We redirect STDOUT to /dev/null as otherwise it's
impossible to see if something fails.
# psql -1 -f current_schema.sql -d projectb >/dev/null
TempPath "__DAKBASE__/tmp/";
};
+Rm
+{
+ LogFile "__DAKBASE__/log/removals.txt";
+ LogFile822 "__DAKBASE__/log/removals.822";
+};
+
Urgency
{
Default "low";
ALTER SCHEMA audit OWNER TO dak;
---
--- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: dak
---
-
-CREATE OR REPLACE PROCEDURAL LANGUAGE plpgsql;
-
-
-ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO dak;
-
SET search_path = public, pg_catalog;
---
--- Name: debversion; Type: SHELL TYPE; Schema: public; Owner: postgres
---
-
-CREATE TYPE debversion;
-
-
---
--- Name: debversionin(cstring); Type: FUNCTION; Schema: public; Owner: postgres
---
-
-CREATE FUNCTION debversionin(cstring) RETURNS debversion
- LANGUAGE internal IMMUTABLE STRICT
- AS $$textin$$;
-
-
-ALTER FUNCTION public.debversionin(cstring) OWNER TO postgres;
-
---
--- Name: debversionout(debversion); Type: FUNCTION; Schema: public; Owner: postgres
---
-
-CREATE FUNCTION debversionout(debversion) RETURNS cstring
- LANGUAGE internal IMMUTABLE STRICT
- AS $$textout$$;
-
-
-ALTER FUNCTION public.debversionout(debversion) OWNER TO postgres;
-
---
--- Name: debversionrecv(internal); Type: FUNCTION; Schema: public; Owner: postgres
---
-
-CREATE FUNCTION debversionrecv(internal) RETURNS debversion
- LANGUAGE internal STABLE STRICT
- AS $$textrecv$$;
-
-
-ALTER FUNCTION public.debversionrecv(internal) OWNER TO postgres;
-
---
--- Name: debversionsend(debversion); Type: FUNCTION; Schema: public; Owner: postgres
---
-
-CREATE FUNCTION debversionsend(debversion) RETURNS bytea
- LANGUAGE internal STABLE STRICT
- AS $$textsend$$;
-
-
-ALTER FUNCTION public.debversionsend(debversion) OWNER TO postgres;
-
---
--- Name: debversion; Type: TYPE; Schema: public; Owner: postgres
---
-
-CREATE TYPE debversion (
- INTERNALLENGTH = variable,
- INPUT = debversionin,
- OUTPUT = debversionout,
- RECEIVE = debversionrecv,
- SEND = debversionsend,
- CATEGORY = 'S',
- ALIGNMENT = int4,
- STORAGE = extended
-);
-
-
-ALTER TYPE public.debversion OWNER TO postgres;
-
---
--- Name: TYPE debversion; Type: COMMENT; Schema: public; Owner: postgres
---
-
-COMMENT ON TYPE debversion IS 'Debian package version number';
-
-
--
-- Name: bin_associations_id_max(); Type: FUNCTION; Schema: public; Owner: dak
--
ALTER FUNCTION public.binaries_id_max() OWNER TO dak;
---
--- Name: debversion(character); Type: FUNCTION; Schema: public; Owner: postgres
---
-
-CREATE FUNCTION debversion(character) RETURNS debversion
- LANGUAGE internal IMMUTABLE STRICT
- AS $$rtrim1$$;
-
-
-ALTER FUNCTION public.debversion(character) OWNER TO postgres;
-
---
--- Name: debversion_cmp(debversion, debversion); Type: FUNCTION; Schema: public; Owner: postgres
---
-
-CREATE FUNCTION debversion_cmp(version1 debversion, version2 debversion) RETURNS integer
- LANGUAGE c IMMUTABLE STRICT
- AS '$libdir/debversion', 'debversion_cmp';
-
-
-ALTER FUNCTION public.debversion_cmp(version1 debversion, version2 debversion) OWNER TO postgres;
-
---
--- Name: FUNCTION debversion_cmp(version1 debversion, version2 debversion); Type: COMMENT; Schema: public; Owner: postgres
---
-
-COMMENT ON FUNCTION debversion_cmp(version1 debversion, version2 debversion) IS 'Compare Debian versions';
-
-
---
--- Name: debversion_eq(debversion, debversion); Type: FUNCTION; Schema: public; Owner: postgres
---
-
-CREATE FUNCTION debversion_eq(version1 debversion, version2 debversion) RETURNS boolean
- LANGUAGE c IMMUTABLE STRICT
- AS '$libdir/debversion', 'debversion_eq';
-
-
-ALTER FUNCTION public.debversion_eq(version1 debversion, version2 debversion) OWNER TO postgres;
-
---
--- Name: FUNCTION debversion_eq(version1 debversion, version2 debversion); Type: COMMENT; Schema: public; Owner: postgres
---
-
-COMMENT ON FUNCTION debversion_eq(version1 debversion, version2 debversion) IS 'debversion equal';
-
-
---
--- Name: debversion_ge(debversion, debversion); Type: FUNCTION; Schema: public; Owner: postgres
---
-
-CREATE FUNCTION debversion_ge(version1 debversion, version2 debversion) RETURNS boolean
- LANGUAGE c IMMUTABLE STRICT
- AS '$libdir/debversion', 'debversion_ge';
-
-
-ALTER FUNCTION public.debversion_ge(version1 debversion, version2 debversion) OWNER TO postgres;
-
---
--- Name: FUNCTION debversion_ge(version1 debversion, version2 debversion); Type: COMMENT; Schema: public; Owner: postgres
---
-
-COMMENT ON FUNCTION debversion_ge(version1 debversion, version2 debversion) IS 'debversion greater-than-or-equal';
-
-
---
--- Name: debversion_gt(debversion, debversion); Type: FUNCTION; Schema: public; Owner: postgres
---
-
-CREATE FUNCTION debversion_gt(version1 debversion, version2 debversion) RETURNS boolean
- LANGUAGE c IMMUTABLE STRICT
- AS '$libdir/debversion', 'debversion_gt';
-
-
-ALTER FUNCTION public.debversion_gt(version1 debversion, version2 debversion) OWNER TO postgres;
-
---
--- Name: FUNCTION debversion_gt(version1 debversion, version2 debversion); Type: COMMENT; Schema: public; Owner: postgres
---
-
-COMMENT ON FUNCTION debversion_gt(version1 debversion, version2 debversion) IS 'debversion greater-than';
-
-
---
--- Name: debversion_hash(debversion); Type: FUNCTION; Schema: public; Owner: postgres
---
-
-CREATE FUNCTION debversion_hash(debversion) RETURNS integer
- LANGUAGE c IMMUTABLE STRICT
- AS '$libdir/debversion', 'debversion_hash';
-
-
-ALTER FUNCTION public.debversion_hash(debversion) OWNER TO postgres;
-
---
--- Name: debversion_larger(debversion, debversion); Type: FUNCTION; Schema: public; Owner: postgres
---
-
-CREATE FUNCTION debversion_larger(version1 debversion, version2 debversion) RETURNS debversion
- LANGUAGE c IMMUTABLE STRICT
- AS '$libdir/debversion', 'debversion_larger';
-
-
-ALTER FUNCTION public.debversion_larger(version1 debversion, version2 debversion) OWNER TO postgres;
-
---
--- Name: debversion_le(debversion, debversion); Type: FUNCTION; Schema: public; Owner: postgres
---
-
-CREATE FUNCTION debversion_le(version1 debversion, version2 debversion) RETURNS boolean
- LANGUAGE c IMMUTABLE STRICT
- AS '$libdir/debversion', 'debversion_le';
-
-
-ALTER FUNCTION public.debversion_le(version1 debversion, version2 debversion) OWNER TO postgres;
-
---
--- Name: FUNCTION debversion_le(version1 debversion, version2 debversion); Type: COMMENT; Schema: public; Owner: postgres
---
-
-COMMENT ON FUNCTION debversion_le(version1 debversion, version2 debversion) IS 'debversion less-than-or-equal';
-
-
---
--- Name: debversion_lt(debversion, debversion); Type: FUNCTION; Schema: public; Owner: postgres
---
-
-CREATE FUNCTION debversion_lt(version1 debversion, version2 debversion) RETURNS boolean
- LANGUAGE c IMMUTABLE STRICT
- AS '$libdir/debversion', 'debversion_lt';
-
-
-ALTER FUNCTION public.debversion_lt(version1 debversion, version2 debversion) OWNER TO postgres;
-
---
--- Name: FUNCTION debversion_lt(version1 debversion, version2 debversion); Type: COMMENT; Schema: public; Owner: postgres
---
-
-COMMENT ON FUNCTION debversion_lt(version1 debversion, version2 debversion) IS 'debversion less-than';
-
-
---
--- Name: debversion_ne(debversion, debversion); Type: FUNCTION; Schema: public; Owner: postgres
---
-
-CREATE FUNCTION debversion_ne(version1 debversion, version2 debversion) RETURNS boolean
- LANGUAGE c IMMUTABLE STRICT
- AS '$libdir/debversion', 'debversion_ne';
-
-
-ALTER FUNCTION public.debversion_ne(version1 debversion, version2 debversion) OWNER TO postgres;
-
---
--- Name: FUNCTION debversion_ne(version1 debversion, version2 debversion); Type: COMMENT; Schema: public; Owner: postgres
---
-
-COMMENT ON FUNCTION debversion_ne(version1 debversion, version2 debversion) IS 'debversion not equal';
-
-
---
--- Name: debversion_smaller(debversion, debversion); Type: FUNCTION; Schema: public; Owner: postgres
---
-
-CREATE FUNCTION debversion_smaller(version1 debversion, version2 debversion) RETURNS debversion
- LANGUAGE c IMMUTABLE STRICT
- AS '$libdir/debversion', 'debversion_smaller';
-
-
-ALTER FUNCTION public.debversion_smaller(version1 debversion, version2 debversion) OWNER TO postgres;
-
--
-- Name: dsc_files_id_max(); Type: FUNCTION; Schema: public; Owner: dak
--
ALTER FUNCTION public.trigger_override_update() OWNER TO dak;
---
--- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
---
-
-CREATE OPERATOR > (
- PROCEDURE = debversion_gt,
- LEFTARG = debversion,
- RIGHTARG = debversion,
- COMMUTATOR = <,
- NEGATOR = >=
-);
-
-
-ALTER OPERATOR public.> (debversion, debversion) OWNER TO postgres;
-
---
--- Name: OPERATOR > (debversion, debversion); Type: COMMENT; Schema: public; Owner: postgres
---
-
-COMMENT ON OPERATOR > (debversion, debversion) IS 'debversion greater-than';
-
-
---
--- Name: max(debversion); Type: AGGREGATE; Schema: public; Owner: postgres
---
-
-CREATE AGGREGATE max(debversion) (
- SFUNC = debversion_larger,
- STYPE = debversion,
- SORTOP = >
-);
-
-
-ALTER AGGREGATE public.max(debversion) OWNER TO postgres;
-
---
--- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
---
-
-CREATE OPERATOR < (
- PROCEDURE = debversion_lt,
- LEFTARG = debversion,
- RIGHTARG = debversion,
- COMMUTATOR = >,
- NEGATOR = >=
-);
-
-
-ALTER OPERATOR public.< (debversion, debversion) OWNER TO postgres;
-
---
--- Name: OPERATOR < (debversion, debversion); Type: COMMENT; Schema: public; Owner: postgres
---
-
-COMMENT ON OPERATOR < (debversion, debversion) IS 'debversion less-than';
-
-
---
--- Name: min(debversion); Type: AGGREGATE; Schema: public; Owner: postgres
---
-
-CREATE AGGREGATE min(debversion) (
- SFUNC = debversion_smaller,
- STYPE = debversion,
- SORTOP = <
-);
-
-
-ALTER AGGREGATE public.min(debversion) OWNER TO postgres;
-
---
--- Name: space_separated_list(text); Type: AGGREGATE; Schema: public; Owner: dak
---
-
-CREATE AGGREGATE space_separated_list(text) (
- SFUNC = space_concat,
- STYPE = text,
- INITCOND = ''
-);
-
-
-ALTER AGGREGATE public.space_separated_list(text) OWNER TO dak;
-
---
--- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
---
-
-CREATE OPERATOR <= (
- PROCEDURE = debversion_le,
- LEFTARG = debversion,
- RIGHTARG = debversion,
- COMMUTATOR = >=,
- NEGATOR = >
-);
-
-
-ALTER OPERATOR public.<= (debversion, debversion) OWNER TO postgres;
-
---
--- Name: OPERATOR <= (debversion, debversion); Type: COMMENT; Schema: public; Owner: postgres
---
-
-COMMENT ON OPERATOR <= (debversion, debversion) IS 'debversion less-than-or-equal';
-
-
---
--- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
---
-
-CREATE OPERATOR <> (
- PROCEDURE = debversion_ne,
- LEFTARG = debversion,
- RIGHTARG = debversion,
- COMMUTATOR = <>,
- NEGATOR = =
-);
-
-
-ALTER OPERATOR public.<> (debversion, debversion) OWNER TO postgres;
-
---
--- Name: OPERATOR <> (debversion, debversion); Type: COMMENT; Schema: public; Owner: postgres
---
-
-COMMENT ON OPERATOR <> (debversion, debversion) IS 'debversion not equal';
-
-
---
--- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
---
-
-CREATE OPERATOR = (
- PROCEDURE = debversion_eq,
- LEFTARG = debversion,
- RIGHTARG = debversion,
- COMMUTATOR = =,
- NEGATOR = <>
-);
-
-
-ALTER OPERATOR public.= (debversion, debversion) OWNER TO postgres;
-
---
--- Name: OPERATOR = (debversion, debversion); Type: COMMENT; Schema: public; Owner: postgres
---
-
-COMMENT ON OPERATOR = (debversion, debversion) IS 'debversion equal';
-
-
---
--- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
---
-
-CREATE OPERATOR >= (
- PROCEDURE = debversion_ge,
- LEFTARG = debversion,
- RIGHTARG = debversion,
- COMMUTATOR = <=,
- NEGATOR = <
-);
-
-
-ALTER OPERATOR public.>= (debversion, debversion) OWNER TO postgres;
-
---
--- Name: OPERATOR >= (debversion, debversion); Type: COMMENT; Schema: public; Owner: postgres
---
-
-COMMENT ON OPERATOR >= (debversion, debversion) IS 'debversion greater-than-or-equal';
-
-
---
--- Name: debversion_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
---
-
-CREATE OPERATOR CLASS debversion_ops
- DEFAULT FOR TYPE debversion USING btree AS
- OPERATOR 1 <(debversion,debversion) ,
- OPERATOR 2 <=(debversion,debversion) ,
- OPERATOR 3 =(debversion,debversion) ,
- OPERATOR 4 >=(debversion,debversion) ,
- OPERATOR 5 >(debversion,debversion) ,
- FUNCTION 1 debversion_cmp(debversion,debversion);
-
-
-ALTER OPERATOR CLASS public.debversion_ops USING btree OWNER TO postgres;
-
---
--- Name: debversion_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
---
-
-CREATE OPERATOR CLASS debversion_ops
- DEFAULT FOR TYPE debversion USING hash AS
- OPERATOR 1 =(debversion,debversion) ,
- FUNCTION 1 debversion_hash(debversion);
-
-
-ALTER OPERATOR CLASS public.debversion_ops USING hash OWNER TO postgres;
-
-SET search_path = pg_catalog;
-
---
--- Name: CAST (character AS public.debversion); Type: CAST; Schema: pg_catalog; Owner:
---
-
-CREATE CAST (character AS public.debversion) WITH FUNCTION public.debversion(character);
-
-
---
--- Name: CAST (public.debversion AS character); Type: CAST; Schema: pg_catalog; Owner:
---
-
-CREATE CAST (public.debversion AS character) WITHOUT FUNCTION AS ASSIGNMENT;
-
-
---
--- Name: CAST (public.debversion AS text); Type: CAST; Schema: pg_catalog; Owner:
---
-
-CREATE CAST (public.debversion AS text) WITHOUT FUNCTION AS IMPLICIT;
-
-
---
--- Name: CAST (public.debversion AS character varying); Type: CAST; Schema: pg_catalog; Owner:
---
-
-CREATE CAST (public.debversion AS character varying) WITHOUT FUNCTION AS IMPLICIT;
-
-
---
--- Name: CAST (text AS public.debversion); Type: CAST; Schema: pg_catalog; Owner:
---
-
-CREATE CAST (text AS public.debversion) WITHOUT FUNCTION AS ASSIGNMENT;
-
-
---
--- Name: CAST (character varying AS public.debversion); Type: CAST; Schema: pg_catalog; Owner:
---
-
-CREATE CAST (character varying AS public.debversion) WITHOUT FUNCTION AS ASSIGNMENT;
-
-
SET search_path = audit, pg_catalog;
SET default_tablespace = '';