From e7f73133cbb35ed0f21938996018654391b0a7d7 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 18 Feb 2010 15:23:02 +0200 Subject: [PATCH] =?utf8?q?Extract=20#!/usr/bin/env=20interpreter=20depende?= =?utf8?q?ncies,=20part=201=20(ticket=20#136)=20-=20With=20"#!/usr/bin/env?= =?utf8?q?=20"=20shebang=20directives,=20rpm=20previously=20?= =?utf8?q?=20=20only=20added=20a=20dependency=20for=20/usr/bin/env,=20comp?= =?utf8?q?letely=20missing=20the=20=20=20actual=20interpreter.=20If=20the?= =?utf8?q?=20interpreter=20happens=20to=20be=20an=20absolute=20path,=20we?= =?utf8?q?=20=20=20can=20just=20add=20it=20as=20is.=20-=20Patch=20original?= =?utf8?q?ly=20from=20Ville=20Skytt=C3=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- scripts/script.req | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.7.4