shell.req: more idiomatic regexp for reading the shebang (use ?)
Compared with a similar regexp in Emacs sources -- http://git.altlinux.org/gears/e/emacs24.git?p=emacs24.git;a=blob;f=lisp/progmodes/sh-script.el;h=4700324d376db79e27d05e5352fff2f7e841a603;hb=HEAD#l1637 : "#![ \t]?\\([^ \t\n]*/bin/env[ \t]\\)?\\([^ \t\n]+\\)" Conclusion: mostly identical meaning, with the exception of a more liberal path of env in Emacs. But ALT Sisyphus has /usr/bin/env only, so I don't see a good reason to make the regexp more general. (If a different path is written there, it won't work in ALT Sisyphus.)
This commit is contained in:
parent
06f844cd6f
commit
ef66de16d5
@ -23,7 +23,7 @@
|
||||
|
||||
print_sh_number_from_shebang()
|
||||
{
|
||||
sed -rn -e '1 s,^\#![[:space:]]*(|/usr/bin/env[[:space:]]+)[^[:space:]]*sh([0-9]+)(|[[:space:]].*)$,\2,p'
|
||||
sed -rn -e '1 s,^\#![[:space:]]*(/usr/bin/env[[:space:]]+)?[^[:space:]]*sh([0-9]+)([[:space:]].*)?$,\2,p'
|
||||
}
|
||||
|
||||
shREQ= shPROV=
|
||||
|
Loading…
Reference in New Issue
Block a user