X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fadmin.py;h=43e20ecfe9209b6f87c2237e8a620f650740618a;hb=3b5f198f7625cf6ddc50f2a54608c07726b4e923;hp=da8669895f345044ef5430f27dccfaa192c7bf13;hpb=6ea4004efd238a3dde60271fca8420ab778e9e7c;p=dak.git diff --git a/dak/admin.py b/dak/admin.py index da866989..43e20ecf 100755 --- a/dak/admin.py +++ b/dak/admin.py @@ -24,6 +24,7 @@ import sys import apt_pkg import daklib.archive +import daklib.gpg from daklib import utils from daklib.dbconn import * @@ -143,6 +144,8 @@ Perform administrative work on the dak database. change-component SUITE COMPONENT binary BINARY... Move source or binary packages to a different component by copying associated files and changing the overrides. + + forget-signature FILE: forget that we saw FILE """ sys.exit(exit_code) @@ -927,6 +930,26 @@ dispatch['change-component'] = change_component ################################################################################ +def forget_signature(args): + filename = args[1] + with open(filename, 'r') as fh: + data = fh.read() + + session = DBConn().session() + keyrings = [ k.keyring_name for k in session.query(Keyring).filter_by(active=True).order_by(Keyring.priority) ] + signed_file = daklib.gpg.SignedFile(data, keyrings) + history = SignatureHistory.from_signed_file(signed_file).query(session) + if history is not None: + session.delete(history) + session.commit() + else: + print "Signature was not known to dak." + session.rollback() + +dispatch['forget-signature'] = forget_signature + +################################################################################ + def main(): """Perform administrative work on the dak database""" global dryrun