[pacman-dev] [PATCH 1/3] makepkg: proper quoting in [[ expression ]]
Dan McGee
dpmcgee at gmail.com
Wed Sep 28 14:07:17 EDT 2011
On Wed, Sep 28, 2011 at 11:58 AM, lolilolicon <lolilolicon at gmail.com> wrote:
> 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 at gmail.com>
> ---
Thanks! I applied this, but I'm not going to take the time in the
future to fix formatting issues in the patch. You cannot paste stuff
into gmail and expect it to work and not linewrap incorrectly. Please
use git send-email next time.
$ git am -3 < /tmp/makepkg-1.patch
Applying: makepkg: proper quoting in [[ expression ]]
fatal: corrupt patch at line 25
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 makepkg: proper quoting in [[ expression ]]
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
> scripts/makepkg.sh.in | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index 86e74a6..cc06baa 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -414,7 +414,7 @@ download_file() {
> fi
>
> # rename the temporary download file to the final destination
> - if [[ $dlfile != $file ]]; then
> + if [[ $dlfile != "$file" ]]; then
> mv -f "$SRCDEST/$dlfile" "$SRCDEST/$file"
> fi
> }
> @@ -1509,7 +1509,7 @@ check_sanity() {
> eval $(awk '/^[[:space:]]*provides=/,/\)/' "$BUILDFILE" | \
> sed -e "s/provides=/provides_list+=/" -e "s/#.*//" -e 's/\\$//')
> 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"
> ret=1
> fi
> @@ -1767,7 +1767,7 @@ devel_update() {
> # _foo=pkgver
> #
> if [[ -n $newpkgver ]]; then
> - if [[ $newpkgver != $pkgver ]]; then
> + if [[ $newpkgver != "$pkgver" ]]; then
> if [[ -f $BUILDFILE && -w $BUILDFILE ]]; then
> @SEDINPLACE@ "s/^pkgver=[^ ]*/pkgver=$newpkgver/" "$BUILDFILE"
> @SEDINPLACE@ "s/^pkgrel=[^ ]*/pkgrel=1/" "$BUILDFILE"
> --
> 1.7.6.4
>
>
More information about the pacman-dev
mailing list