Add delete-rpm-sig CLI and deleteRPMSig hub call
Fixes: https://pagure.io/koji/issue/2665
This commit is contained in:
parent
8d1a94c8d4
commit
fb8cfc5678
6 changed files with 347 additions and 0 deletions
|
|
@ -1640,6 +1640,36 @@ def handle_import_sig(goptions, session, args):
|
|||
session.writeSignedRPM(rinfo['id'], sigkey)
|
||||
|
||||
|
||||
def handle_remove_sig(goptions, session, args):
|
||||
"[admin] Remove signed RPMs from db and disk"
|
||||
usage = _("usage: %prog remove-sig [options] <rpm-id/n-v-r.a/rpminfo>")
|
||||
parser = OptionParser(usage=get_usage_str(usage))
|
||||
parser.add_option("--sigkey", action="store", default=None, help=_("Specify signature key"))
|
||||
parser.add_option("--all", action="store_true",
|
||||
help=_("Remove all signed copies for specified RPM"))
|
||||
(options, args) = parser.parse_args(args)
|
||||
if len(args) < 1:
|
||||
parser.error(_("Please specify an RPM"))
|
||||
|
||||
if not options.all and not options.sigkey:
|
||||
error("Either --sigkey or --all options must be given")
|
||||
|
||||
if options.all and options.sigkey:
|
||||
error("Conflicting options specified")
|
||||
|
||||
activate_session(session, goptions)
|
||||
rpminfo = args[0]
|
||||
|
||||
rinfo = session.getRPM(rpminfo)
|
||||
if not rinfo:
|
||||
print("No such rpm in system: %s" % rpminfo)
|
||||
else:
|
||||
try:
|
||||
session.deleteRPMSig(rpminfo, sigkey=options.sigkey)
|
||||
except koji.GenericError:
|
||||
print("Signature %s for rpm %s does not existing" % (options.sigkey, rpminfo))
|
||||
|
||||
|
||||
def handle_write_signed_rpm(goptions, session, args):
|
||||
"[admin] Write signed RPMs to disk"
|
||||
usage = _("usage: %prog write-signed-rpm [options] <signature-key> <n-v-r> [<n-v-r> ...]")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue