Commit 235c3bca authored by Jérome Perrin's avatar Jérome Perrin

fixup! component/perl: Infrastructure for CPAN packages in inpendent parts

This usage of textwrap.dedent *sometimes* does not work and sometimes
create files with indentation, so we don't have "#!/bin/sh" as first
line but "    #!/bin/sh"

Use a "safer" version that should work in all cases.
parent 8227e655
......@@ -83,7 +83,7 @@ make-binary=
PERL5LIB="${:inc}:${:install-inc}" make
# this post-make-hook is same for all users of the macro.
post-make-hook = ${:_profile_base_location_}/../../component/perl/perl-CPAN-package-create-wrapper.py#f9314defc3b144d9f36f8cab2a013af9:post_make_hook
post-make-hook = ${:_profile_base_location_}/../../component/perl/perl-CPAN-package-create-wrapper.py#d012f7ba3300b14b2c6b173351d410be:post_make_hook
perl_location = ${perl:location}
......
......@@ -13,11 +13,10 @@ def post_make_hook(options, buildout, environmet):
# install a ./bin/perl wrapper with @INC set
perl_wrapper_path = os.path.join(bin_folder, 'perl')
with open(perl_wrapper_path, 'w') as wrapper:
wrapper.write(textwrap.dedent('''\
#!/bin/sh
export PERL5LIB="{site_perl}:$PERL5LIB"
exec {perl_location}/bin/perl "$@"
'''.format(**locals())))
wrapper.write('''#!/bin/sh
export PERL5LIB="{site_perl}:$PERL5LIB"
exec {perl_location}/bin/perl "$@"
'''.format(**locals()))
os.chmod(perl_wrapper_path, 0755)
# create a wrapper for each scripts installed in perl-bin
......@@ -25,9 +24,8 @@ def post_make_hook(options, buildout, environmet):
script_name = os.path.basename(script_path)
wrapper_path = os.path.join(prefix, 'bin', script_name)
with open(wrapper_path, 'w') as wrapper:
wrapper.write(textwrap.dedent('''\
#!/bin/sh
export PERL5LIB="{site_perl}:$PERL5LIB"
exec {perl_location}/bin/perl {script_path} "$@"
'''.format(**locals())))
wrapper.write('''#!/bin/sh
export PERL5LIB="{site_perl}:$PERL5LIB"
exec {perl_location}/bin/perl {script_path} "$@"
'''.format(**locals()))
os.chmod(wrapper_path, 0755)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment