makepkg: avoid file|grep dependency for CRLF check

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Dave Reisner 2013-03-24 15:09:18 -04:00 committed by Allan McRae
parent fa601c41ed
commit 87acfef166
1 changed files with 1 additions and 2 deletions

View File

@ -2744,8 +2744,7 @@ if [[ ! -f $BUILDFILE ]]; then
source_safe "$BUILDFILE"
fi
else
crlftest=$(file "$BUILDFILE" | grep -F 'CRLF' || true)
if [[ -n $crlftest ]]; then
if [[ $(<"$BUILDFILE") = *$'\r'* ]]; then
error "$(gettext "%s contains %s characters and cannot be sourced.")" "$BUILDFILE" "CRLF"
exit 1
fi