s-a rm SUITE ARCH remove ARCH from suite (will only work if
no packages remain for the arch in the suite)
+ archive:
+ archive list list all archives
+ archive add NAME ROOT DESCRIPTION [primary-mirror=MIRROR] [tainted=1]
+ add archive NAME with path ROOT,
+ primary mirror MIRROR.
+ archive rm NAME remove archive NAME (will only work if there are
+ no files and no suites in the archive)
+ archive rename OLD NEW rename archive OLD to NEW
+
version-check / v-c:
v-c list show version checks for all suites
v-c list-suite SUITE show version checks for suite SUITE
################################################################################
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):
signingkey = get_field('signingkey')
if signingkey is not None:
suite.signingkeys = [signingkey.upper()]
+ archive_name = get_field('archive')
+ if archive_name is not None:
+ suite.archive = get_archive(archive_name, s)
+ else:
+ suite.archive = s.query(Archive).filter(~Archive.archive_name.in_(['build-queues', 'new', 'policy'])).one()
suite.srcformats = s.query(SrcFormat).all()
s.add(suite)
s.flush()
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 archive_list():
+ session = DBConn().session()
+ for archive in session.query(Archive).order_by(Archive.archive_name):
+ print "{0} path={1} description={2} tainted={3}".format(archive.archive_name, archive.path, archive.description, archive.tainted)
+
+def archive_add(args):
+ (name, path, description) = args[0:3]
+
+ attributes = dict(
+ archive_name=name,
+ path=path,
+ description=description,
+ )
+
+ for option in args[3:]:
+ (key, value) = option.split('=')
+ attributes[key] = value
+
+ session = DBConn().session()
+
+ archive = Archive()
+ for key, value in attributes.iteritems():
+ setattr(archive, key, value)
+
+ session.add(archive)
+ session.flush()
+
+ if dryrun:
+ session.rollback()
+ else:
+ session.commit()
+
+def archive_rm(name):
+ session = DBConn().session()
+ archive = session.query(Archive).filter_by(archive_name=name).one()
+ session.delete(archive)
+ session.flush()
+
+ if dryrun:
+ session.rollback()
+ else:
+ session.commit()
+
+def archive_rename(oldname, newname):
+ session = DBConn().session()
+ archive = get_archive(oldname, session)
+ archive.archive_name = newname
+ session.flush()
+
+ if dryrun:
+ session.rollback()
+ else:
+ session.commit()
+
+def archive(command):
+ mode = command[1]
+ if mode == 'list':
+ archive_list()
+ elif mode == 'rename':
+ archive_rename(command[2], command[3])
+ elif mode == 'add':
+ archive_add(command[2:])
+ elif mode == 'rm':
+ archive_rm(command[2])
+ else:
+ die("E: archive command unknown")
+
+dispatch['archive'] = archive
+
+################################################################################
+
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):
print "PGPORT=%s" % cnf["DB::Port"]
e.append('PGPORT')
print "export " + " ".join(e)
+ elif mode == 'get':
+ print cnf.get(args[2])
else:
session = DBConn().session()
try:
if mode == 'list-all':
pass
elif mode == 'list-binary':
- q = q.filter(Keyring.default_source_acl_id == None)
+ q = q.join(Keyring.acl).filter(ACL.allow_source == False)
elif mode == 'list-source':
- q = q.filter(Keyring.default_source_acl_id != None)
+ q = q.join(Keyring.acl).filter(ACL.allow_source == True)
else:
die("E: keyring command unknown")
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"]: