rpm-build/scripts/shebang.req.in
Alexey Tourbin 47bd8eff65 shebang.req: don't read the whole script
$ (echo '#!/usr/bin/perl'; cat /dev/zero) |sed -n '1s|^#![[:space:]]*/|/|p;q'
/usr/bin/perl
$
2008-04-01 15:33:19 +04:00

21 lines
348 B
Bash
Executable File

#!/bin/sh -efu
. @RPMCONFIGDIR@/functions
. @RPMCONFIGDIR@/find-package
ShebangReq()
{
local f="$1" line=; shift
line=$(sed -n '1s|^#![[:space:]]*/|/|p;q' "$f")
[ -n "$line" ] || return 0
set -- $line
case "$#,$1" in
2,/usr/bin/env)
FindPackage "$f" "$1" "$2" ;;
*)
FindPackage "$f" "$1" ;;
esac
}
ArgvFileAction ShebangReq "$@"