#!/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
# Retrieve current section/priority...
oldsection, oldsourcesection, oldpriority = None, None, None
- for type in ['source', 'binary']:
+ for packagetype in ['source', 'binary']:
eqdsc = '!='
- if type == 'source':
+ if packagetype == 'source':
eqdsc = '='
q = projectB.query("""
SELECT priority.priority AS prio, section.section AS sect, override_type.type AS type
utils.fubar("%s is ambiguous. Matches %d packages" % (package,q.ntuples()))
r = q.getresult()
- if type == 'binary':
+ if packagetype == 'binary':
oldsection = r[0][1]
oldpriority = r[0][0]
else:
oldsourcesection = r[0][1]
+ oldpriority = 'source'
if not oldpriority and not oldsourcesection:
utils.fubar("Unable to find package %s" % (package))
oldsection = oldsourcesection
if not arguments:
- if oldpriority:
- print "%s is in section '%s' at priority '%s'" % (
- package,oldsection,oldpriority)
- elif oldsourcesection:
- # no use printing this line if also binary
- print "%s is in section '%s'" % (
- package,oldsourcesection)
+ print "%s is in section '%s' at priority '%s'" % (
+ package,oldsection,oldpriority)
sys.exit(0)
# At this point, we have a new section and priority... check they're valid...
print "I: Doing nothing"
sys.exit(0)
- if newpriority and not oldpriority:
- utils.fubar("Trying to set priority of a source-only package")
+ if oldpriority == 'source' and newpriority != 'source':
+ utils.fubar("Trying to change priority of a source-only package")
# If we're in no-action mode
if Options["No-Action"]:
Subst["__BCC__"] = "Bcc: " + ", ".join(bcc)
else:
Subst["__BCC__"] = "X-Filler: 42"
- Subst["__CC__"] = "X-DAK: dak override\nX-Katie: alicia $Revision: 1.6$"
+ Subst["__CC__"] = "X-DAK: dak override\nX-Katie: alicia"
Subst["__ADMIN_ADDRESS__"] = Cnf["Dinstall::MyAdminAddress"]
Subst["__DISTRO__"] = Cnf["Dinstall::MyDistribution"]
Subst["__WHOAMI__"] = utils.whoami()
+ Subst["__SOURCE__"] = package
summary = "Concerning package %s...\n" % (package)
summary += "Operating on the %s suite\n" % (suite)