提交 b96fec59 编写于 作者: M Mark Hymers

Merge commit 'djpig/process-upload'

......@@ -98,7 +98,7 @@ def do_update(self):
ON DELETE CASCADE""")
c.execute("""ALTER TABLE suite DROP CONSTRAINT suite_policy_queue_fkey""")
c.execute("""ALTER TABLE suite DROP CONSTRAINT suite_policy_queue_id_fkey""")
c.execute("""UPDATE suite
SET policy_queue_id = (SELECT policy_queue.id FROM policy_queue
......
......@@ -196,7 +196,7 @@ def usage (exit_code=0):
###############################################################################
def action(u, dbc):
def action(u):
cnf = Config()
holding = Holding()
session = DBConn().session()
......@@ -257,12 +257,12 @@ def action(u, dbc):
# so, we skip the policy queue, otherwise we go there.
divert = package_to_suite(u, suite.suite_name, session=session)
if divert:
print "%s for %s\n%s%s" % ( su.policy_queue.queue_name.upper(),
print "%s for %s\n%s%s" % ( suite.policy_queue.queue_name.upper(),
", ".join(u.pkg.changes["distribution"].keys()),
pi, summary)
queuekey = "P"
prompt = "[P]olicy, Skip, Quit ?"
policyqueue = su.policy_queue
policyqueue = suite.policy_queue
if Options["Automatic"]:
answer = 'P'
break
......
......@@ -205,7 +205,7 @@ class Changes(object):
multivalues[key] = self.changes[key].keys()
session.execute(
"""INSERT INTO known_changes
"""INSERT INTO changes
(changesname, seen, source, binaries, architecture, version,
distribution, urgency, maintainer, fingerprint, changedby, date)
VALUES (:changesfile,:filetime,:source,:binary, :architecture,
......
......@@ -2088,7 +2088,7 @@ def add_deb_to_db(u, filename, session=None):
filename = entry["pool name"] + filename
fullpath = os.path.join(cnf["Dir::Pool"], filename)
if not entry.get("location id", None):
entry["location id"] = get_location(cnf["Dir::Pool"], entry["component"], utils.where_am_i(), session).location_id
entry["location id"] = get_location(cnf["Dir::Pool"], entry["component"], session=session).location_id
if not entry.get("files id", None):
poolfile = add_poolfile(filename, entry, entry["location id"], session)
......
......@@ -720,7 +720,6 @@ class Upload(object):
def per_suite_file_checks(self, f, suite, session):
cnf = Config()
entry = self.pkg.files[f]
archive = utils.where_am_i()
# Skip byhand
if entry.has_key("byhand"):
......@@ -764,9 +763,9 @@ class Upload(object):
# Determine the location
location = cnf["Dir::Pool"]
l = get_location(location, entry["component"], archive, session)
l = get_location(location, entry["component"], session=session)
if l is None:
self.rejects.append("[INTERNAL ERROR] couldn't determine location (Component: %s, Archive: %s)" % (entry["component"], archive))
self.rejects.append("[INTERNAL ERROR] couldn't determine location (Component: %)" % entry["component"])
entry["location id"] = -1
else:
entry["location id"] = l.location_id
......@@ -817,7 +816,10 @@ class Upload(object):
try:
dbc = session.query(DBChange).filter_by(changesname=base_filename).one()
if dbc.in_queue is not None and dbc.in_queue.queue_name != 'unchecked':
# if in the pool or in a queue other than unchecked, reject
if (dbc.in_queue is None) \
or (dbc.in_queue is not None
and dbc.in_queue.queue_name != 'unchecked'):
self.rejects.append("%s file already known to dak" % base_filename)
except NoResultFound, e:
# not known, good
......
......@@ -34,14 +34,14 @@ from daklib.config import Config
################################################################################
def package_to_suite(u, suite_name, session):
if not u.pkg.changes["distribution"].has_key(suite):
if not u.pkg.changes["distribution"].has_key(suite_name):
return False
ret = True
if not u.pkg.changes["architecture"].has_key("source"):
q = session.query(SrcAssociation.sa_id)
q = q.join(Suite).filter_by(suite_name=suite)
q = q.join(Suite).filter_by(suite_name=suite_name)
q = q.join(DBSource).filter_by(source=u.pkg.changes['source'])
q = q.filter_by(version=u.pkg.changes['version']).limit(1)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册