mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-22 15:58:50 -05:00
makepkg: ensure PKGBUILD does not contain CRLF characters
Do a simple check before sourcing the file to ensure we are a valid bash script. Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
69be73f68c
commit
818fae320f
@ -1354,6 +1354,12 @@ if [ ! -f "$BUILDSCRIPT" ]; then
|
||||
# PKGBUILD passed through a pipe
|
||||
BUILDSCRIPT=/dev/stdin
|
||||
fi
|
||||
else
|
||||
crlftest=$(file $BUILDSCRIPT | grep -F 'CRLF' || true)
|
||||
if [ "$crlftest" != "" ]; then
|
||||
error "$(gettext "%s contains CRLF characters and cannot be sourced.")" "$BUILDSCRIPT"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
source "$BUILDSCRIPT"
|
||||
|
Loading…
Reference in New Issue
Block a user