Log "/srv/backports-master.debian.org/log/";
Lock "/srv/backports-master.debian.org/lock";
Morgue "/srv/backports-master.debian.org/morgue/";
- MorgueReject "reject";
Override "/srv/backports-master.debian.org/scripts/override/";
QueueBuild "/srv/backports-master.debian.org/buildd/";
UrgencyLog "/srv/backports-master.debian.org/testing/urgencies/";
};
};
-Component
-{
- main
- {
- Description "Main";
- MeetsDFSG "true";
- };
-
- contrib
- {
- Description "Contrib";
- MeetsDFSG "true";
- };
-
- non-free
- {
- Description "Software that fails to meet the DFSG";
- MeetsDFSG "false";
- };
-
-};
-
Section
{
admin;
source 0; // i.e. unused
};
-OverrideType
-{
- deb;
- udeb;
- dsc;
-};
-
-Location
-{
- // Pool locations on backports.debian.org
- /srv/backports-master.debian.org/ftp/pool/
- {
- Archive "backports";
- Type "pool";
- };
-
-};
-
Urgency
{
Default "low";
Lists "/srv/security-master.debian.org/dak-database/dists/";
Log "/srv/security-master.debian.org/dak-log/";
Morgue "/srv/security-master.debian.org/morgue/";
- MorgueReject "reject";
Override "/srv/security-master.debian.org/scripts/override/";
QueueBuild "/srv/security-master.debian.org/buildd/";
Upload "/srv/queued/ftpmaster/";
};
-Component
-{
-
- updates/main
- {
- Description "Main (updates)";
- MeetsDFSG "true";
- };
-
- updates/contrib
- {
- Description "Contrib (updates)";
- MeetsDFSG "true";
- };
-
- updates/non-free
- {
- Description "Software that fails to meet the DFSG";
- MeetsDFSG "false";
- };
-
-};
-
ComponentMappings
{
"main updates/main";
source 0; // i.e. unused
};
-OverrideType
-{
- deb;
- udeb;
- dsc;
-};
-
-Location
-{
- /srv/security-master.debian.org/ftp/pool/
- {
- Archive "security";
- Suites
- {
- OldStable;
- Stable;
- Testing;
- };
- Type "pool";
- };
-};
-
Urgency
{
Default "low";
Log "/srv/ftp-master.debian.org/log/";
Lock "/srv/ftp-master.debian.org/lock";
Morgue "/srv/ftp-master.debian.org/morgue/";
- MorgueReject "reject";
Override "/srv/ftp-master.debian.org/scripts/override/";
UrgencyLog "/srv/release.debian.org/britney/input/urgencies/";
TempPath "/srv/ftp-master.debian.org/tmp/";
};
};
-Component
-{
- main
- {
- Description "Main";
- MeetsDFSG "true";
- };
-
- contrib
- {
- Description "Contrib";
- MeetsDFSG "true";
- };
-
- non-free
- {
- Description "Software that fails to meet the DFSG";
- MeetsDFSG "false";
- };
-};
-
-OverrideType
-{
- deb;
- udeb;
- dsc;
-};
-
Urgency
{
Default "low";
from daklib.dbconn import *
from daklib import utils
from daklib.config import Config
+from daklib.dak_exceptions import InvalidDscError, ChangesUnicodeError, CantOpenError
################################################################################
Parse every .dsc file in the archive and check for it's validity.
"""
- cnf = Config()
-
count = 0
- suite = 'unstable'
-
- for component in cnf.SubTree("Component").List():
- component = component.lower()
- list_filename = '%s%s_%s_source.list' % (cnf["Dir::Lists"], suite, component)
- list_file = utils.open_file(list_filename)
-
- for line in list_file.readlines():
- f = line[:-1]
- try:
- utils.parse_changes(f, signing_rules=1, dsc_file=1)
- except InvalidDscError, line:
- utils.warn("syntax error in .dsc file '%s', line %s." % (f, line))
- count += 1
- except ChangesUnicodeError:
- utils.warn("found invalid changes file, not properly utf-8 encoded")
- count += 1
+
+ for src in DBConn().session().query(DBSource).order_by(DBSource.source, DBSource.version):
+ f = src.poolfile.fullpath
+ try:
+ utils.parse_changes(f, signing_rules=1, dsc_file=1)
+ except InvalidDscError:
+ utils.warn("syntax error in .dsc file %s" % f)
+ count += 1
+ except ChangesUnicodeError:
+ utils.warn("found invalid dsc file (%s), not properly utf-8 encoded" % f)
+ count += 1
+ except CantOpenError:
+ utils.warn("missing dsc file (%s)" % f)
+ count += 1
+ except Exception, e:
+ utils.warn("miscellaneous error parsing dsc file (%s): %s" % (f, str(e)))
+ count += 1
if count:
utils.warn("Found %s invalid .dsc files." % (count))
for component in cnf.SubTree("Component").List():
# It is crucial for the dsc override creation based on binary
# overrides that 'dsc' goes first
- otypes = cnf.ValueList("OverrideType")
- otypes.remove("dsc")
- otypes = ["dsc"] + otypes
+ otypes = ['dsc']
+ for ot in session.query(OverrideType):
+ if ot.overridetype == 'dsc':
+ continue
+ otypes.append(ot.overridetype)
+
for otype in otypes:
print "Processing %s [%s - %s]" \
% (osuite, component, otype)
sys.stderr.write("Processing %s...\n" % (suite.suite_name))
override_suite = suite.overridecodename
- for component_name in cnf.SubTree("Component").List():
- component = get_component(component_name, session)
- if not component:
- utils.fubar('Component %s not found' % component_name)
-
- for otype_name in cnf.ValueList("OverrideType"):
- otype = get_override_type(otype_name, session)
- if not otype:
- utils.fubar('OverrideType %s not found' % otype_name)
+ for component in session.query(Component).all():
+ for otype in session.query(OverrideType).all():
+ otype_name = otype.overridetype
+ cname = component.component_name
+ # TODO: Stick suffix info in database (or get rid of it)
if otype_name == "deb":
suffix = ""
elif otype_name == "udeb":
- if component == "contrib":
+ if cname == "contrib":
continue # Ick2
suffix = ".debian-installer"
elif otype_name == "dsc":
suffix = ".src"
+ else:
+ utils.fubar("Don't understand OverrideType %s" % otype.overridetype)
- cname = component.component_name.replace('/', '_')
+ cname = cname.replace('/', '_')
filename = os.path.join(cnf["Dir::Override"], "override.%s.%s%s" % (override_suite, cname, suffix))
output_file = utils.open_file(filename, 'w')
cnf = Config()
summarystats = SummaryStats()
- log_urgency = False
DBConn()
utils.fubar("Couldn't obtain lock; assuming another 'dak process-upload' is already running.")
else:
raise
- if cnf.get("Dir::UrgencyLog"):
- # Initialise UrgencyLog()
- log_urgency = True
- UrgencyLog()
+
+ # Initialise UrgencyLog() - it will deal with the case where we don't
+ # want to log urgencies
+ urgencylog = UrgencyLog()
Logger = daklog.Logger("process-upload", Options["No-Action"])
byebye()
if not Options["No-Action"]:
- if log_urgency:
- UrgencyLog().close()
+ urgencylog.close()
Logger.close()
utils.move(self.pkg.changes_file,
os.path.join(donedir, os.path.basename(self.pkg.changes_file)))
- if self.pkg.changes["architecture"].has_key("source") and cnf.get("Dir::UrgencyLog"):
+ if self.pkg.changes["architecture"].has_key("source"):
UrgencyLog().log(self.pkg.dsc["source"], self.pkg.dsc["version"], self.pkg.changes["urgency"])
self.update_subst()
self.timestamp = time.strftime("%Y%m%d%H%M%S")
- # Create the log directory if it doesn't exist
- self.log_dir = Config()["Dir::UrgencyLog"]
+ cnf = Config()
+ if cnf.has_key("Dir::UrgencyLog"):
+ # Create the log directory if it doesn't exist
+ self.log_dir = cnf["Dir::UrgencyLog"]
- if not os.path.exists(self.log_dir) or not os.access(self.log_dir, os.W_OK):
- warn("UrgencyLog directory %s does not exist or is not writeable, using /srv/ftp.debian.org/tmp/ instead" % (self.log_dir))
- self.log_dir = '/srv/ftp.debian.org/tmp/'
+ if not os.path.exists(self.log_dir) or not os.access(self.log_dir, os.W_OK):
+ warn("UrgencyLog directory %s does not exist or is not writeable, using /srv/ftp.debian.org/tmp/ instead" % (self.log_dir))
+ self.log_dir = '/srv/ftp.debian.org/tmp/'
+
+ # Open the logfile
+ self.log_filename = "%s/.install-urgencies-%s.new" % (self.log_dir, self.timestamp)
+ self.log_file = open_file(self.log_filename, 'w')
+
+ else:
+ self.log_dir = None
+ self.log_filename = None
+ self.log_file = None
- # Open the logfile
- self.log_filename = "%s/.install-urgencies-%s.new" % (self.log_dir, self.timestamp)
- self.log_file = open_file(self.log_filename, 'w')
self.writes = 0
def log(self, source, version, urgency):
"Log an event"
+
+ # Don't try and log if Dir::UrgencyLog is not configured
+ if self.log_file is None:
+ return
+
self.log_file.write(" ".join([source, version, urgency])+'\n')
self.log_file.flush()
self.writes += 1
def close(self):
"Close a Logger object"
+ # Don't try and log if Dir::UrgencyLog is not configured
+ if self.log_file is None:
+ return
+
self.log_file.flush()
self.log_file.close()
# Expand default component
if component == "":
- if Cnf.has_key("Component::%s" % section):
- component = section
- else:
+ comp = get_component(section)
+ if comp is None:
component = "main"
+ else:
+ component = comp.componant_name
return (section, component)
| Lists "/org/ftp.debian.org/database/dists/";
| Log "/org/ftp.debian.org/log/";
| Morgue "/org/ftp.debian.org/morgue/";
-| MorgueReject "reject";
| QueueBuild "/org/incoming.debian.org/buildd/";
| UrgencyLog "/org/ftp.debian.org/testing/urgencies/";
| Queue
sub-directories, including (optionally) those defined by
Clean-Queues::MorgueSubDir and Clean-Suites::MorgueSubDir.
-MorgueReject (required): if dak cannot move a rejected package to
-Dir::Queue::Reject, it will try to move it to the Dir::MorgueReject
-directory located under Dir::Morgue.
-
-QueueBuild (optional): This variable is only relevant if any suites
-are to be auto built, i.e. if Dinstall::QueueBuildSuites has any
-values.
-
UrgencyLog (optional): If this directory is specified, 'dak
process-accepted' will store the urgency value of each upload. This
is mainly used for britney (the testing script).
| FutureTimeTravelGrace 28800; // 8 hours
| PastCutoffYear "1984";
| BXANotify "false";
-| QueueBuildSuites
-| {
-| unstable;
-| };
| };
GPGKeyring (required): filenames of the PGP and GnuPG
CloseBugs (optional): a boolean (default: no); if true the automated bug
closing feature of dinstall is activated.
-QueueBuildSuites (optional): a list of suites which should be auto
-build.
-
QueueBuild is a boolean; if true it activates support
for auto-building from accepted.
================================================================================
-Component
----------
-
-Mandatory. List of all components, e.g.
-
-| Component
-| {
-| main
-| {
-| Description "Main";
-| MeetsDFSG "true";
-| };
-| };
-
-All three values go into the SQL database's 'component' table.
-MeetsDFSG is currently unused.
-
-================================================================================
-
Section
-------
================================================================================
-OverrideType
-------------
-
-Mandatory. List of al valid override types, e.g.
-
-| OverrideType
-| {
-| deb;
-| dsc;
-| udeb;
-| };
-
-The type goes into the 'override_type' table in the SQL database.
-
-================================================================================
-
Location
--------