diff options
author | TizenOpenSource <tizenopensrc@samsung.com> | 2023-12-27 18:11:19 +0900 |
---|---|---|
committer | TizenOpenSource <tizenopensrc@samsung.com> | 2023-12-27 18:11:19 +0900 |
commit | 727a4bfe21f594703093859adb151f67f0403a13 (patch) | |
tree | 90f3c63cafddcdc010091ead32a9d5e7d09e4cd2 /SignatureCheck.py | |
parent | 95b3517edeace0e940b51d8ac5609c8f9326f6f4 (diff) | |
download | rpmlint-upstream.tar.gz rpmlint-upstream.tar.bz2 rpmlint-upstream.zip |
Imported Upstream version 2.5.0upstream/2.5.0upstream
Diffstat (limited to 'SignatureCheck.py')
-rw-r--r-- | SignatureCheck.py | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/SignatureCheck.py b/SignatureCheck.py deleted file mode 100644 index 483579d..0000000 --- a/SignatureCheck.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################# -# File : SignatureCheck.py -# Package : rpmlint -# Author : Frederic Lepied -# Created on : Thu Oct 7 17:06:14 1999 -# Purpose : check the presence of a PGP signature. -############################################################################# - -import re - -import AbstractCheck -from Filter import addDetails, printError -import Pkg - - -class SignatureCheck(AbstractCheck.AbstractCheck): - pgp_regex = re.compile(r"pgp|gpg", re.IGNORECASE) - unknown_key_regex = re.compile(r"\(MISSING KEYS:(?:\([^)]+\))?\s+([^\)]+)\)") - - def __init__(self): - AbstractCheck.AbstractCheck.__init__(self, "SignatureCheck") - - def check(self, pkg): - res = pkg.checkSignature() - if not res or res[0] != 0: - if res and res[1]: - kres = SignatureCheck.unknown_key_regex.search(res[1]) - else: - kres = None - if kres: - printError(pkg, "unknown-key", kres.group(1)) - else: - Pkg.warn("Error checking signature of %s: %s" % - (pkg.filename, res[1])) - else: - if not SignatureCheck.pgp_regex.search(res[1]): - printError(pkg, "no-signature") - - -# Create an object to enable the auto registration of the test -check = SignatureCheck() - -addDetails( -'no-signature', -'''You have to include your pgp or gpg signature in your package. -For more information on signatures, please refer to www.gnupg.org.''', - -'unknown-key', -'''The package was signed, but with an unknown key. -See the rpm --import option for more information.''', -) - -# SignatureCheck.py ends here |