Skip to content

Remove shebang options - Improve apply_regex_substitution log output#2906

Merged
boegel merged 6 commits intoeasybuilders:developfrom
vanzod:fix_shebang_regex
Jun 4, 2019
Merged

Remove shebang options - Improve apply_regex_substitution log output#2906
boegel merged 6 commits intoeasybuilders:developfrom
vanzod:fix_shebang_regex

Conversation

@vanzod
Copy link
Copy Markdown
Member

@vanzod vanzod commented Jun 3, 2019

The problem with the changes in #2905 is that with coreutils < 0.30 everything that follows the first word in the shebang is treated as a single argument. Hence something like #!/usr/bin/env perl -w fails with:

/usr/bin/env: 'perl -w': No such file or directory

This fix removes any flag from the shebang.

Changes to filetools.py are also proposed to provide a complete log of the strings replaced by apply_regex_substitutions. The log output will be:

INFO Fixing 'perl' shebang to '#!/usr/bin/env perl' for files that match 'bin/SVDetect': ['/opt/easybuild/software/Compiler/GCC/6.4.0-2.28/SVDetect/0.8b-Perl-5.26.0/bin/SVDetect']
INFO Applying following regex substitutions to /opt/easybuild/software/Compiler/GCC/6.4.0-2.28/SVDetect/0.8b-Perl-5.26.0/bin/SVDetect: [('^#!.*/perl[0-9.]*\\s+.*', '#!/usr/bin/env perl')]
INFO Replacing line 1 in /opt/easybuild/software/Compiler/GCC/6.4.0-2.28/SVDetect/0.8b-Perl-5.26.0/scripts/BAM_preprocessingPairs.pl: '#!/usr/bin/perl -w' -> '#!/usr/bin/env perl'

vanzod added 2 commits June 3, 2019 12:15
With coreutils < 0.30 everything that follows the first word in the shebang is treated as a single argument
@vanzod vanzod added this to the 3.x milestone Jun 3, 2019
@vanzod vanzod requested a review from boegel June 3, 2019 17:21
@vanzod vanzod changed the title Fix shebang regex Remove shebang options - Improve apply_regex_substitution log output Jun 3, 2019
@boegel boegel modified the milestones: 3.x, next release (3.9.2) Jun 3, 2019
Comment thread easybuild/tools/filetools.py Outdated
@easybuilders easybuilders deleted a comment from boegelbot Jun 3, 2019
boegel
boegel previously approved these changes Jun 3, 2019
Copy link
Copy Markdown
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@easybuilders easybuilders deleted a comment from boegelbot Jun 4, 2019
@boegel boegel merged commit 0af131d into easybuilders:develop Jun 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants