summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2010-12-17 16:22:33 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2010-12-17 19:36:48 +0100
commit20c3bc4eb1dc968cf40a35c4f4cd00a225c072f3 (patch)
tree6b650545ffed488cda3035b87976641fcb2e7a3f /src
parent397ffbe6a738e0f5a242ebecca6b2615d86f202e (diff)
interactive_select_packages(): show package description when hoovering over package
Diffstat (limited to 'src')
-rw-r--r--src/core/libs/lib-pacman.sh13
-rw-r--r--src/core/libs/lib-ui-interactive.sh10
2 files changed, 17 insertions, 6 deletions
diff --git a/src/core/libs/lib-pacman.sh b/src/core/libs/lib-pacman.sh
index 474f551..f087c83 100644
--- a/src/core/libs/lib-pacman.sh
+++ b/src/core/libs/lib-pacman.sh
@@ -144,5 +144,16 @@ list_packages ()
# order is the same as the input
which_group ()
{
- PACKAGE_GROUPS=`LANG=C $PACMAN_TARGET -Si $1| awk '/^Name/{ printf("%s ",$3) } /^Group/{ print $3 }'`
+ PACKAGE_GROUPS=`LANG=C $PACMAN_TARGET -Si $1 | awk '/^Name/{ printf("%s ",$3) } /^Group/{ print $3 }'`
+}
+
+# get group and packagedesc for packages
+# $1 packages separated by spaces
+# output format: multiple lines, each line like:
+# <pkgname> <group> <desc>
+# order is the same as the input
+# note that space is used as separator, but desc is the only thing that will contain spaces.
+pkginfo ()
+{
+ PACKAGE_INFO=`LANG=C $PACMAN_TARGET -Si $1 | awk '/^Name/{ printf("%s ",$3) } /^Group/{ printf("%s", $3) } /^Description/{ for(i=3;i<=NF;++i) printf(" %s",$i); printf ("\n")}'`
}
diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh
index a590d3d..00592b7 100644
--- a/src/core/libs/lib-ui-interactive.sh
+++ b/src/core/libs/lib-ui-interactive.sh
@@ -736,22 +736,22 @@ If any previous configuration you've done until now (like fancy filesystems) req
# get sorted array of available packages, with their groups. TODO: we should use $repos here
local pkgall=($(list_packages repo core | cut -d ' ' -f2))
- which_group "${pkgall[@]}"
+ pkginfo "${pkgall[@]}"
# build the list of options, sorted primarily by group, then by packagename (this is already). marking where appropriate
local pkglist=()
needed_pkgs=("${needed_pkgs_fs[@]}")
- while read pkgname pkggroup; do
+ while read pkgname pkggroup pkgdesc; do
mark=OFF
if check_is_in "$pkggroup" "${grouplist[@]}" || check_is_in $pkgname "${needed_pkgs[@]}"; then
mark=ON
fi
- pkglist+=("$pkgname" "$pkggroup" $mark)
- done < <(echo "$PACKAGE_GROUPS" | sort -f -k 2)
+ pkglist+=("$pkgname" "$pkggroup" $mark "$pkgdesc")
+ done < <(echo "$PACKAGE_INFO" | sort -f -k 2)
[ ${#pkglist[@]} -eq 0 ] && show_warning "No packages found" "Sorry. I could not find any packages. maybe your network is not setup correctly, you lost connection, no mirror setup, bad group, ..." && return 1
- ask_checklist "Select Packages To Install." "${pkglist[@]}" || return 1
+ ask_checklist "Select Packages To Install." 1 "${pkglist[@]}" || return 1
var_TARGET_PACKAGES="${ANSWER_CHECKLIST[@]}"
return 0
}