summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-12-07 06:32:34 +0100
committerDan McGee <dan@archlinux.org>2008-12-08 05:11:37 +0100
commit818fae320f22ea758765a55b3a3a98e2f0a66a45 (patch)
tree144fb99ea3ad5fc6b1e45402654b80360d5db254 /scripts
parent69be73f68cc770ddcbe388af96e32f8bba7886f7 (diff)
downloadpacman-818fae320f22ea758765a55b3a3a98e2f0a66a45.tar.gz
pacman-818fae320f22ea758765a55b3a3a98e2f0a66a45.tar.xz
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>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/makepkg.sh.in6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index b8896258..179746d2 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -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"