mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-24 00:45:52 +00:00
Improve ruby-shebang-patch routine. Add a #! line when the script
doesn't have one.
This commit is contained in:
parent
9e79a545dc
commit
11b68518a9
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=39597
@ -182,7 +182,14 @@ post-patch: ruby-shebang-patch
|
||||
ruby-shebang-patch:
|
||||
@for f in ${RUBY_SHEBANG_FILES}; do \
|
||||
${ECHO_MSG} "===> Fixing the #! line of $$f"; \
|
||||
${RUBY} -i -pe '$$. == 1 and sub /^#!\s*\S*(\benv\s+)?\bruby/, "#!${RUBY}"' $$f; \
|
||||
${RUBY} -i -p -e 'if $$. == 1; ' \
|
||||
-e ' if /^#!/; ' \
|
||||
-e ' sub /^#!\s*\S*(\benv\s+)?\bruby/, "#!${RUBY}";' \
|
||||
-e ' else;' \
|
||||
-e ' $$_ = "#!${RUBY}\n" + $$_;' \
|
||||
-e ' end;' \
|
||||
-e 'end' \
|
||||
$$f; \
|
||||
done
|
||||
.endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user