rpm-build/scripts/shell.req.files
Alexey Tourbin b4bb9944c6 shell.req.files: adjusted /bin/ash pattern
file(1) sucks here, but we should handle one more common case.

$ file - <<<'#!/bin/ash'
/dev/stdin: a /bin/ash script text executable
$ file - <<<'#!/bin/ash -efu'
/dev/stdin: a /bin/ash -efu script text executable
$ file - <<<'#!/bin/ash  -efu'
/dev/stdin: a /bin/ash  -efu script text executable
$ file - <<<'#! /bin/ash  -efu'
/dev/stdin: a /bin/ash  -efu script text executable
$ file - <<<'#!  /bin/ash  -efu'
/dev/stdin: script text executable for  /bin/ash  -efu
$
2009-06-21 00:20:31 +04:00

19 lines
357 B
Bash
Executable File

#!/bin/sh -efu
while IFS=$'\t' read -r f t; do
case "$t" in
#!/bin/sh
*'Bourne shell script text'*)
echo "$f" ;;
#!/bin/bash
*'Bourne-Again shell script text'*)
echo "$f" ;;
#!/usr/bin/env bash
*' bash script text'*)
echo "$f" ;;
#!/bin/ash
*' /bin/ash script text'* |\
*' /bin/ash '*' script text'* )
echo "$f" ;;
esac
done