[pacman-dev] [PATCH] pkgdelta: proper quoting in [[ expression ]]

lolilolicon lolilolicon at gmail.com
Wed Sep 28 15:05:03 EDT 2011


Always quote the right-hand side of expression when the == or != operator
is used, unless intended as a pattern.

Signed-off-by: lolilolicon <lolilolicon at gmail.com>
---
 scripts/pkgdelta.sh.in |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/pkgdelta.sh.in b/scripts/pkgdelta.sh.in
index a0e3cee..ef34c5b 100644
--- a/scripts/pkgdelta.sh.in
+++ b/scripts/pkgdelta.sh.in
@@ -93,17 +93,17 @@ create_xdelta()
 	newver="$pkgver"
 	newarch="$arch"
 
-	if [[ $oldname != $newname ]]; then
+	if [[ $oldname != "$newname" ]]; then
 		error "$(gettext "The package names don't match : '%s' and '%s'")" "$oldname" "$newname"
 		return 1
 	fi
 
-	if [[ $oldarch != $newarch ]]; then
+	if [[ $oldarch != "$newarch" ]]; then
 		error "$(gettext "The package architectures don't match : '%s' and '%s'")" "$oldarch" "$newarch"
 		return 1
 	fi
 
-	if [[ $oldver == $newver ]]; then
+	if [[ $oldver == "$newver" ]]; then
 		error "$(gettext "Both packages have the same version : '%s'")" "$newver"
 		return 1
 	fi
-- 
1.7.6.4



More information about the pacman-dev mailing list