summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2011-03-31 11:08:55 +1000
committerDan McGee <dan@archlinux.org>2011-04-04 19:03:40 -0500
commit37df0d4f4fb042f8fbb39525d8d338968dd912bb (patch)
tree46ee2cef7413deccb9b2849b2db3142ec3fb59e3 /scripts
parentfc334b4e77553643bf9cdec47a4469ea7c62566b (diff)
downloadpacman-37df0d4f4fb042f8fbb39525d8d338968dd912bb.tar.xz
makepkg: improve parsing for sanity checks
Trailing backslahses can lead to additional spaces at the front of extracted entries. See FS#23524. Strip these while parsing the PKGBUILD entries. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/makepkg.sh.in8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 193a1853..b55ac427 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1256,7 +1256,7 @@ check_sanity() {
local provides_list=()
eval $(awk '/^[[:space:]]*provides=/,/\)/' "$BUILDFILE" | \
- sed -e "s/provides=/provides_list+=/" -e "s/#.*//")
+ sed -e "s/provides=/provides_list+=/" -e "s/#.*//" -e 's/\\$//')
for i in ${provides_list[@]}; do
if [[ $i != ${i//</} || $i != ${i//>/} ]]; then
error "$(gettext "Provides array cannot contain comparison (< or >) operators.")"
@@ -1266,7 +1266,7 @@ check_sanity() {
local backup_list=()
eval $(awk '/^[[:space:]]*backup=/,/\)/' "$BUILDFILE" | \
- sed -e "s/backup=/backup_list+=/" -e "s/#.*//")
+ sed -e "s/backup=/backup_list+=/" -e "s/#.*//" -e 's/\\$//')
for i in "${backup_list[@]}"; do
if [[ ${i:0:1} = "/" ]]; then
error "$(gettext "Backup entry should not contain leading slash : %s")" "$i"
@@ -1276,7 +1276,7 @@ check_sanity() {
local optdepends_list=()
eval $(awk '/^[[:space:]]*optdepends=\(/,/\)[[:space:]]*(|#.*)$/' "$BUILDFILE" | \
- sed -e "s/optdepends=/optdepends_list+=/" -e "s/#.*//")
+ sed -e "s/optdepends=/optdepends_list+=/" -e "s/#.*//" -e 's/\\$//')
for i in "${optdepends_list[@]}"; do
local pkg=${i%%:*}
if [[ ! $pkg =~ ^[[:alnum:]\>\<\=\.\+\_\-]+$ ]]; then
@@ -1301,7 +1301,7 @@ check_sanity() {
local valid_options=1
local known kopt options_list
eval $(awk '/^[[:space:]]*options=/,/\)/' "$BUILDFILE" | \
- sed -e "s/options=/options_list+=/" -e "s/#.*//")
+ sed -e "s/options=/options_list+=/" -e "s/#.*//" -e 's/\\$//')
for i in ${options_list[@]}; do
known=0
# check if option matches a known option or its inverse