mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
makepkg: proper quoting in [[ expression ]]
Always quote the righthand side of expression when the == or != operator is used, unless intended as a pattern. Quoting bash(1): When the == and != operators are used, the string to the right of the operator is considered a pattern. Any part of the pattern may be quoted to force it to be matched as a string. Signed-off-by: lolilolicon <lolilolicon@gmail.com>
This commit is contained in:
parent
d1af9b70c8
commit
497501d1c7
@ -414,7 +414,7 @@ download_file() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# rename the temporary download file to the final destination
|
# rename the temporary download file to the final destination
|
||||||
if [[ $dlfile != $file ]]; then
|
if [[ $dlfile != "$file" ]]; then
|
||||||
mv -f "$SRCDEST/$dlfile" "$SRCDEST/$file"
|
mv -f "$SRCDEST/$dlfile" "$SRCDEST/$file"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -1509,7 +1509,7 @@ check_sanity() {
|
|||||||
eval $(awk '/^[[:space:]]*provides=/,/\)/' "$BUILDFILE" | \
|
eval $(awk '/^[[:space:]]*provides=/,/\)/' "$BUILDFILE" | \
|
||||||
sed -e "s/provides=/provides_list+=/" -e "s/#.*//" -e 's/\\$//')
|
sed -e "s/provides=/provides_list+=/" -e "s/#.*//" -e 's/\\$//')
|
||||||
for i in ${provides_list[@]}; do
|
for i in ${provides_list[@]}; do
|
||||||
if [[ $i != ${i//</} || $i != ${i//>/} ]]; then
|
if [[ $i == *['<>']* ]]; then
|
||||||
error "$(gettext "%s array cannot contain comparison (< or >) operators.")" "provides"
|
error "$(gettext "%s array cannot contain comparison (< or >) operators.")" "provides"
|
||||||
ret=1
|
ret=1
|
||||||
fi
|
fi
|
||||||
@ -1767,7 +1767,7 @@ devel_update() {
|
|||||||
# _foo=pkgver
|
# _foo=pkgver
|
||||||
#
|
#
|
||||||
if [[ -n $newpkgver ]]; then
|
if [[ -n $newpkgver ]]; then
|
||||||
if [[ $newpkgver != $pkgver ]]; then
|
if [[ $newpkgver != "$pkgver" ]]; then
|
||||||
if [[ -f $BUILDFILE && -w $BUILDFILE ]]; then
|
if [[ -f $BUILDFILE && -w $BUILDFILE ]]; then
|
||||||
@SEDINPLACE@ "s/^pkgver=[^ ]*/pkgver=$newpkgver/" "$BUILDFILE"
|
@SEDINPLACE@ "s/^pkgver=[^ ]*/pkgver=$newpkgver/" "$BUILDFILE"
|
||||||
@SEDINPLACE@ "s/^pkgrel=[^ ]*/pkgrel=1/" "$BUILDFILE"
|
@SEDINPLACE@ "s/^pkgrel=[^ ]*/pkgrel=1/" "$BUILDFILE"
|
||||||
|
Loading…
Reference in New Issue
Block a user