distribution TEXT NOT NULL,
urgency TEXT NOT NULL,
maintainer TEXT NOT NULL,
+ fingerprint TEXT NOT NULL,
changedby TEXT NOT NULL,
date TEXT NOT NULL,
UNIQUE (changesname)
try:
count += 1
print "Directory %s, file %7d, failures %3d. (%s)" % (dirpath[-10:], count, failure, changesfile)
- changes = parse_changes(os.path.join(dirpath, changesfile), signing_rules=-1)
- (changes["fingerprint"], _) = check_signature(os.path.join(dirpath, changesfile))
+ changes = Changes()
+ changesfile = os.path.join(dirpath, changesfile)
+ changes.changes = parse_changes(changesfile, signing_rules=-1)
+ (changes.changes["fingerprint"], _) = check_signature(changesfile))
except InvalidDscError, line:
warn("syntax error in .dsc file '%s', line %s." % (f, line))
failure += 1
warn("found invalid changes file, not properly utf-8 encoded")
failure += 1
- filetime = datetime.datetime.fromtimestamp(os.path.getctime(os.path.join(dirpath, changesfile)))
- c.execute("INSERT INTO known_changes(changesname, seen, source, binaries, architecture, version, distribution, urgency, maintainer, changedby, date) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)" , [changesfile, filetime, changes["source"], changes["binary"], changes["architecture"], changes["version"], changes["distribution"], changes["urgency"], changes["maintainer"], changes["changed-by"], changes["date"]])
+ changes.add_known_changes(directory)
+
+ c.execute("GRANT ALL ON known_changes TO ftpmaster;")
+ c.execute("GRANT SELECT ON known_changes TO public;")
c.execute("UPDATE config SET value = '20' WHERE name = 'db_revision'")
self.db.commit()
Logger.log(["BYHAND REJECT: %s" % (upload.pkg.changes_file)])
upload.do_reject(manual=1, reject_message=Options["Manual-Reject"])
os.unlink(upload.pkg.changes_file[:-8]+".dak")
+ upload.pkg.remove_known_changes()
done = 1
elif answer == 'S':
done = 1
os.chdir(u.pkg.directory)
u.do_reject(0, pi)
elif answer == 'A':
+ u.pkg.add_known_changes( "Accepted" )
u.accept(summary, short_summary)
u.check_override()
u.remove()
elif answer == queuekey:
+ u.pkg.add_known_changes( qu )
queue_info[qu]["process"](u, summary, short_summary)
u.remove()
elif answer == 'Q':
return summary
+ def remove_known_changes(self, session=None):
+ if session is None:
+ session = DBConn().session()
+ privatetrans = True
+
+ session.query(KnownChange).filter(changesfile=self.changes_file).delete()
+
+ if privatetrans:
+ session.commit()
+ session.close()
+ def add_known_changes(self, queue, session=None):
+ cnf = Config()
+
+ if session is None:
+ session = DBConn().session()
+ privatetrans = True
+
+ dirpath = cnf["Dir::Queue::%s" % (queue) ]
+ changesfile = os.path.join(dirpath, self.changes_file)
+ filetime = datetime.datetime.fromtimestamp(os.path.getctime(changesfile))
+
+ session.execute(
+ """INSERT INTO known_changes
+ (changesname, seen, source, binaries, architecture, version,
+ distribution, urgency, maintainer, fingerprint, changedby, date)
+ VALUES (:changesfile,:filetime,:source,:binary, :architecture,
+ :version,:distribution,:urgency,'maintainer,:changedby,:date)""",
+ { 'changesfile':changesfile,
+ 'filetime':filetime,
+ 'source':self.changes["source"],
+ 'binary':self.changes["binary"],
+ 'architecture':self.changes["architecture"],
+ 'version':self.changes["version"],
+ 'distribution':self.changes["distribution"],
+ 'urgency':self.changes["urgency"],
+ 'maintainer':self.changes["maintainer"],
+ 'fingerprint':self.changes["fingerprint"],
+ 'changedby':self.changes["changed-by"],
+ 'date':self.changes["date"]} )
+
+ if privatetrans:
+ session.commit()
+ session.close()
def load_dot_dak(self, changesfile):
"""