From 6dad1321c3a05ab28220058d0a4847449452dc60 Mon Sep 17 00:00:00 2001 From: Alexande B Date: Mon, 11 Oct 2021 08:25:11 +0200 Subject: [PATCH] Fix flack8 lint issues --- snap/plugins/cpanm.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/snap/plugins/cpanm.py b/snap/plugins/cpanm.py index cac8fa3..bc00051 100644 --- a/snap/plugins/cpanm.py +++ b/snap/plugins/cpanm.py @@ -2,13 +2,12 @@ import logging import os -import glob import shutil -import subprocess import urllib.request logger = logging.getLogger(__name__) + class CpanmPlugin(snapcraft.BasePlugin): @classmethod @@ -65,9 +64,14 @@ def build(self): if inc_path != ".": perl_snap_inc.append('$SNAP' + inc_path) - with open(os.path.join(self.installdir, 'usr', 'bin', 'perl5lib.sh'), "w") as text_file: - text_file.write("env PERL5LIB={} env PATH=$SNAP/usr/local/bin:$PATH $@".format(':'.join(perl_snap_inc))) + perl5lib_sh = os.path.join(self.installdir, + 'usr', 'bin', 'perl5lib.sh') + with open(perl5lib_sh, "w") as text_file: + text_file.write( + "env PERL5LIB={} env PATH=$SNAP/usr/local/bin:$PATH $@" + .format(':'.join(perl_snap_inc))) # cpanm install modules to `/usr/local` by default # unfortunatelly no best solution was found - shutil.copytree('/usr/local', os.path.join(self.installdir, 'usr', 'local')) \ No newline at end of file + shutil.copytree('/usr/local', + os.path.join(self.installdir, 'usr', 'local'))