From f9c50c9510c48d013ec98a6c139810f129eae84b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=8Cestm=C3=ADr=20Kalina?= Date: Tue, 28 May 2024 13:22:02 +0200 Subject: [PATCH] Update release to 1.12.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves: https://issues.redhat.com/browse/RHEL-35791 Signed-off-by: Čestmír Kalina --- .gitignore | 1 + 0001-manpage.patch | 93 ++++++++++++++++++++++++++++++++++++ 0002-c9s-notifications.patch | 57 ++++++++++++++++++++++ ksc.spec | 16 +++++-- sources | 2 +- 5 files changed, 164 insertions(+), 5 deletions(-) create mode 100644 0001-manpage.patch create mode 100644 0002-c9s-notifications.patch diff --git a/.gitignore b/.gitignore index 924b922..cc739aa 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /ksc-5955c6b.tar.gz +/ksc-869a25c.tar.gz diff --git a/0001-manpage.patch b/0001-manpage.patch new file mode 100644 index 0000000..0b45966 --- /dev/null +++ b/0001-manpage.patch @@ -0,0 +1,93 @@ +diff --git a/data/ksc.conf b/data/ksc.conf +index 8ee4551..c4c53fc 100644 +--- a/data/ksc.conf ++++ b/data/ksc.conf +@@ -1,6 +1,12 @@ ++[global] ++user=user@example.com ++partner=none ++partnergroup=none + [bugzilla] +-user=user@redhat.com +-partner=partner-name +-partnergroup=partner-group ++enable=1 + server=https://bugzilla.redhat.com/xmlrpc.cgi +-api_key=api_key ++api_key=API_KEY ++[mailing_list] ++enable=0 ++smtp=smtp.example.com ++to=kabi-requests@redhat.com +diff --git a/ksc.1 b/ksc.1 +index 078dd83..3c3ce86 100644 +--- a/ksc.1 ++++ b/ksc.1 +@@ -139,12 +139,18 @@ partnergroup=none + .br + [bugzilla] + .br ++enable=1 ++.br + server=https://bugzilla.redhat.com/xmlrpc.cgi + .br + api_key=API_KEY + .br + [mailing_list] + .br ++enable=1 ++.br ++smtp=smtp.example.com ++.br + to=kabi-requests@redhat.com + + Please replace the values above by your credentials. +@@ -153,7 +159,10 @@ Mandatory fields for any submission method: user, partner, partnergroup. + .br + Mandatory fields for Bugzilla submission method: server, api_key. + .br +-Mandatory fields for mailing list submission method: to. ++Mandatory fields for mailing list submission method: to, smtp. ++ ++By default, Bugzilla (mailing list) submission method is auto-enabled ++(auto-disabled) and must be opted out (in). + + Note that server must be a valid XML RPC Bugzilla link, user and to fields + must be valid e-mail addresses. +diff --git a/utils.py b/utils.py +index ce1a613..8038076 100644 +--- a/utils.py ++++ b/utils.py +@@ -220,6 +220,7 @@ def getconfig(path='/etc/ksc.conf', mock=False, require_partner=False, verbose=T + + # To be deprecated in the future: + result['bugzilla_enable'] = True ++ result['mailing_list_enable'] = False + + cat = None + for line in lines: +@@ -305,10 +306,10 @@ def getconfig(path='/etc/ksc.conf', mock=False, require_partner=False, verbose=T + raise ConfigDeprecatedValueException(path, key, result[key]) + + if not (result['method'] & SubmissionMethod.BUGZILLA.value): +- conf["bugzilla_enable"] = False ++ result["bugzilla_enable"] = False + + if not (result['method'] & SubmissionMethod.MAILING_LIST.value): +- conf["mailing_list_enable"] = False ++ result["mailing_list_enable"] = False + + return result + +@@ -365,6 +366,11 @@ def sendmail(filename, arch, mock, conf, releasename, module, subcomponent, + Email ksc report. + """ + ++ for field in [ "smtp", "user", "to" ]: ++ if field not in conf: ++ print(f"Could not send an email, '{field}' config field is missing.") ++ return ++ + major, centos = get_major_release(releasename) + if not major: + print("Invalid releasename: Mail not sent.") diff --git a/0002-c9s-notifications.patch b/0002-c9s-notifications.patch new file mode 100644 index 0000000..8a56be0 --- /dev/null +++ b/0002-c9s-notifications.patch @@ -0,0 +1,57 @@ +diff --git a/ksc.py b/ksc.py +index 4652dde..a6dc9f3 100755 +--- a/ksc.py ++++ b/ksc.py +@@ -631,12 +631,16 @@ class Ksc(object): + + # Ignore undefined options in parser instead of throwing error + class IOptParse(OptionParser): +- def error(self, msg): +- pass ++ def _process_args(self, largs, rargs, values): ++ while rargs: ++ try: ++ OptionParser._process_args(self,largs,rargs,values) ++ except: ++ pass + + parser = IOptParse() +- parser.add_option("-k", "--ko") +- opts, _ = parser.parse_args(commands[0:]) ++ parser.add_option("-k", "--ko", action="append", dest="ko") ++ opts, _ = parser.parse_args(commands) + return opts.ko + except Exception: + return None +diff --git a/utils.py b/utils.py +index 8038076..b75e770 100644 +--- a/utils.py ++++ b/utils.py +@@ -377,8 +377,12 @@ def sendmail(filename, arch, mock, conf, releasename, module, subcomponent, + return + + body = f"Product: Red Hat Enterprise Linux {major}\n" +- body += f"Release: Centos Stream\n" +- body += f"Platform: {arch}\n" ++ if releasename and len(releasename): ++ body += f"Release: {releasename[0]}\n" ++ if centos: ++ body += "CentOS Stream: True\n" ++ if arch: ++ body += f"Platform: {arch}\n" + + if 'group' in conf and conf['group'] != 'partner-group': + body += f"Partner Group: {conf['group']}\n" +@@ -387,7 +391,11 @@ def sendmail(filename, arch, mock, conf, releasename, module, subcomponent, + body += f"Partner: {conf['partner']}\n" + + body += "\n" +- body += str(module) + "\n" ++ if module: ++ if type(module) is list: ++ body += ", ".join(module) + "\n" ++ else: ++ body += str(module) + "\n" + body += "\n" + body += "---\n" + body += "\n" diff --git a/ksc.spec b/ksc.spec index 678d87b..3775bbf 100644 --- a/ksc.spec +++ b/ksc.spec @@ -1,14 +1,14 @@ %global forgeurl https://github.com/RedHatOfficial/ksc -%global commitdate 20210216 -%global commit 5955c6b2288353c5b093677221cc91a83a2c800c +%global commitdate 20230109 +%global commit 869a25c7de8ed880a72f66ae4f3e8407f1aa4114 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %{?python_enable_dependency_generator} %forgemeta -i Name: ksc -Version: 1.7 -Release: 10%{?dist} +Version: 1.12 +Release: 4%{?dist} Summary: Kernel source code checker Group: Development/Tools AutoReqProv: no @@ -22,6 +22,8 @@ Requires: python3-requests BuildRequires: python3-devel BuildRequires: python3-setuptools Source0: https://github.com/RedHatOfficial/ksc/archive/%{commit}/%{name}-%{shortcommit}.tar.gz +Patch0: 0001-manpage.patch +Patch1: 0002-c9s-notifications.patch %description A kernel module source code checker to find usage of select symbols @@ -31,6 +33,8 @@ A kernel module source code checker to find usage of select symbols # Fix build with setuptools 62.1 # https://github.com/RedHatOfficial/ksc/issues/3 sed -i "15i packages=[]," setup.py +%patch0 -p1 +%patch1 -p1 %build %py3_build @@ -49,6 +53,10 @@ install -D ksc.1 %{buildroot}%{_mandir}/man1/ksc.1 %{python3_sitelib}/ksc-%{version}*.egg-info %changelog +* Mon Mar 06 2023 Čestmír Kalina - 1.12-4 +- Resolves: JIRA: https://issues.redhat.com/browse/RHEL-35791 +- Update to the latest ksc + * Thu Jan 25 2024 Fedora Release Engineering - Packaging variables read or set by %forgemeta - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild diff --git a/sources b/sources index b205985..4f189e7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ksc-5955c6b.tar.gz) = 61556ee8422e28124d6639cbded95a3fd8b3cdcd2db11e1f2b4f5f033c7d15b42f93b49f7d99a352d697a6fc1d8667fc205ebe3ea7067052dad3d8bbc0c50c0c +SHA512 (ksc-869a25c.tar.gz) = 85c287b19d914e44ded15c11a45b49c8574a2b42dfbccc8a3f8e110fd1e51ef9cc1a21e25610620e62a8c2c51f2548693f61d912c8f93e3e88b0debcd56a70bb