Uploads that were 'skipped' should not be recorded in
signature_history as they will be repeocessed later.
with daklib.archive.ArchiveUpload(directory, changes, keyrings) as upload:
processed = action(directory, upload)
if processed and not Options['No-Action']:
+ session = DBConn().session()
+ history = SignatureHistory.from_signed_file(upload.changes)
+ if history.query(session) is None:
+ session.add(history)
+ session.commit()
+ session.close()
+
unlink_if_exists(os.path.join(directory, changes.filename))
for fn in changes.files:
unlink_if_exists(os.path.join(directory, fn))
def check_replay(self, upload):
# Use private session as we want to remember having seen the .changes
# in all cases.
- session = DBConn().session()
+ session = upload.session
history = SignatureHistory.from_signed_file(upload.changes)
r = history.query(session)
if r is not None:
raise Reject('Signature for changes file was already seen at {0}.\nPlease refresh the signature of the changes file if you want to upload it again.'.format(r.seen))
- session.add(history)
- session.commit()
return True
"""Check signature of changes and dsc file (if included in upload)