[pacman-dev] [PATCH] makepkg: Use LC_COLLATE=C for comm command

Allan McRae allan at archlinux.org
Tue Nov 22 01:29:38 EST 2011


Commit 3e4d2c3a reverted the use of strcoll in sorting package names,
which results in potentially different package orders from pacman -Qq
and that expected by comm.  Use LC_COLLATE=C for the comm commands in
makepkg.

Fixes FS#27221.

Signed-off-by: Allan McRae <allan at archlinux.org>
---
 scripts/makepkg.sh.in |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index f39e9d1..4089e30 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -506,13 +506,13 @@ remove_deps() {
 
 	# check for packages removed during dependency install (e.g. due to conflicts)
 	# removing all installed packages is risky in this case
-	if [[ -n  $(comm -23 <(printf "%s\n" "${original_pkglist[@]}") \
+	if [[ -n  $(LC_COLLATE=C comm -23 <(printf "%s\n" "${original_pkglist[@]}") \
 			<(printf "%s\n" "${current_pkglist[@]}")) ]]; then
 	  warning "$(gettext "Failed to remove installed dependencies.")"
 	  return 0
 	fi
 
-	local deplist=($(comm -13  <(printf "%s\n" "${original_pkglist[@]}") \
+	local deplist=($(LC_COLLATE=C comm -13  <(printf "%s\n" "${original_pkglist[@]}") \
 			<(printf "%s\n" "${current_pkglist[@]}")))
 	(( ${#deplist[@]} == 0 )) && return
 
-- 
1.7.7.4



More information about the pacman-dev mailing list