- With "#!/usr/bin/env <interpreter>" shebang directives, rpm previously
only added a dependency for /usr/bin/env, completely missing the
actual interpreter. If the interpreter happens to be an absolute path, we
can just add it as is.
- Patch originally from Ville Skyttä
#!/bin/sh
-# TODO: handle #!/usr/bin/env somehow
+# TODO: handle "#!/usr/bin/env foo" somehow
while read filename; do
+ # common cases
sed -n -e '1s:^#![[:space:]]*\(/[^[:space:]]\{1,\}\).*:\1:p' "$filename"
+ #!/usr/bin/env /foo/bar
+ sed -n -e '1s:^#![[:space:]]*[^[:space:]]*/bin/env[[:space:]]\{1,\}\(/[^[:space:]]\{1,\}\):\1:p' "$filename"
done