From: Panu Matilainen Date: Thu, 18 Feb 2010 13:23:02 +0000 (+0200) Subject: Extract #!/usr/bin/env interpreter dependencies, part 1 (ticket #136) X-Git-Tag: tznext/4.11.0.1.tizen20130304~2295 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e7f73133cbb35ed0f21938996018654391b0a7d7;p=tools%2Flibrpm-tizen.git Extract #!/usr/bin/env interpreter dependencies, part 1 (ticket #136) - With "#!/usr/bin/env " 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ä --- diff --git a/scripts/script.req b/scripts/script.req index 215bd50..950dc4a 100755 --- a/scripts/script.req +++ b/scripts/script.req @@ -1,6 +1,9 @@ #!/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