Fix sort order for cros_workon info.

cros_workon info currently reports warnings about the sort order being
wrong. This is because we're sorting the results in a different order
from what join expects. We should fix that.

BUG=chromium-os:23909
TEST=Verify warnings are gone.

Change-Id: I021a6ac97f3ebd9d0ce0c6350b8c080e4a42977b
Reviewed-on: https://gerrit.chromium.org/gerrit/12596
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
Commit-Ready: David James <davidjames@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
This commit is contained in:
David James 2011-12-07 15:15:37 -08:00 committed by David James
parent 835542154c
commit e7293bb80c

View File

@ -142,15 +142,16 @@ show_workon_ebuilds() {
show_workon_info() { show_workon_info() {
local atoms="$1" local atoms="$1"
local keyword="$2" local keyword="$2"
local sort="sort -u -k1b,1"
# Column 1: Package name # Column 1: Package name
# Column 2: Repo name # Column 2: Repo name
# Column 3: Source directory (if present locally) # Column 3: Source directory (if present locally)
join \ join \
<(echo "$atoms" | sed -e 's/ /\n/g' | sort -u) \ <(echo "${atoms}" | sed -e 's/ /\n/g' | ${sort}) \
<(join -a 1 -e - -o 1.2,1.1,2.2 \ <(join -a 1 -e - -o 1.2,1.1,2.2 \
<(show_project_ebuild_map "${keyword}" | sort -u) \ <(show_project_ebuild_map "${keyword}" | ${sort}) \
<(show_project_path_map | sort -u) \ <(show_project_path_map | ${sort}) \
| sort -u) | ${sort})
} }
# Canonicalize package name to category/package. # Canonicalize package name to category/package.