From 35512061faec1901266b79b52a3bfd79593f26ff Mon Sep 17 00:00:00 2001 From: Ken Dreyer Date: Fri, 11 Nov 2022 14:48:34 -0500 Subject: [PATCH] koijkamid: remove clamav scanner The ClamAV virus scanner in Cygwin is buggy and unmaintained. It takes significant time to run the scanner during each build, and Windows has better malware scanners now. Remove the ClamAV virus scanning from kojikamid. --- vm/kojikamid.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/vm/kojikamid.py b/vm/kojikamid.py index b8ef0077..4f08b946 100755 --- a/vm/kojikamid.py +++ b/vm/kojikamid.py @@ -155,15 +155,9 @@ class WindowsBuild(object): raise BuildError('error validating build environment: %s' % # noqa: F821 ', '.join(errors)) - def updateClam(self): - """update ClamAV virus definitions""" - ret, output = run(['/bin/freshclam', '--quiet']) - if ret: - raise BuildError('could not update ClamAV database: %s' % output) # noqa: F821 - def checkEnv(self): """make the environment is fit for building in""" - for tool in ['/bin/freshclam', '/bin/clamscan', '/bin/patch']: + for tool in ['/bin/patch']: if not os.path.isfile(tool): raise BuildError('%s is missing from the build environment' % tool) # noqa: F821 @@ -199,7 +193,6 @@ class WindowsBuild(object): ensuredir(os.path.join(self.workdir, 'patches'))) # noqa: F821 self.zipDir(self.patches_dir, os.path.join(self.workdir, 'patches.zip')) self.applyPatches(self.source_dir, self.patches_dir) - self.virusCheck(self.workdir) def applyPatches(self, sourcedir, patchdir): """Apply patches in patchdir to files in sourcedir)""" @@ -398,7 +391,6 @@ class WindowsBuild(object): else: files.append(fileinfo) self.server.updateBuildrootFiles(self.buildroot_id, files, rpms) - self.virusCheck(self.buildreq_dir) def build(self): if self.shell in ('cmd', 'cmd.exe'): @@ -520,17 +512,10 @@ class WindowsBuild(object): break else: errors.append('file %s does not exist' % entry) - self.virusCheck(self.workdir) if errors: raise BuildError('error validating build output: %s' % # noqa: F821 ', '.join(errors)) - def virusCheck(self, path): - """ensure a path is virus free with ClamAV. path should be absolute""" - if not path.startswith('/'): - raise BuildError('Invalid path to scan for viruses: ' + path) # noqa: F821 - run(['/bin/clamscan', '--quiet', '--recursive', path], fatal=True) - def gatherResults(self): """Gather information about the output from the build, return it""" return {'name': self.name, 'version': self.version, 'release': self.release, @@ -543,7 +528,6 @@ class WindowsBuild(object): def run(self): """Run the entire build process""" self.checkEnv() - self.updateClam() self.checkout() self.loadConfig() self.initBuildroot()