Skip to content

Commit

Permalink
Fix flack8 lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
CAMOBAP committed Oct 11, 2021
1 parent 11e8b53 commit 6dad132
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions snap/plugins/cpanm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'))
shutil.copytree('/usr/local',
os.path.join(self.installdir, 'usr', 'local'))

0 comments on commit 6dad132

Please sign in to comment.