Skip to content

Commit

Permalink
sbopkg: show version information about found packages when searching …
Browse files Browse the repository at this point in the history
…with '-g' option from command-line
  • Loading branch information
yars068 committed May 20, 2018
1 parent afddeb5 commit f070eb9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/usr/sbin/sbopkg
Original file line number Diff line number Diff line change
Expand Up @@ -2523,9 +2523,10 @@ gen_search_package() {
local ITEM_SELECTION=$SBOPKGTMP/sbopkg_item_selection
local SEARCH_CHOICE=$SBOPKGTMP/sbopkg_search_choice
local SEARCH_RESULTS=$SBOPKGTMP/sbopkg_search_results
local RESULTS_VERSIONS=$SBOPKGTMP/sbopkg_search_results_versions
local RESULTS=$(find -mindepth 2 -maxdepth 2 -type d \
-iwholename "./$CATEGORY/*$PKG*" -printf "%P\n" | sort)
local NAME DESC CHOICE
local NAME DESC CHOICE RESULT_VERSION
local SRCHPICK SRCHCAT SRCHPKG

if [[ $RESULTS ]]; then
Expand Down Expand Up @@ -2581,9 +2582,12 @@ gen_search_package() {
done
else
echo "Found the following matches for $PKG:"
echo -e "NAME\tVERSION" >> $RESULTS_VERSIONS
for i in $RESULTS; do
echo $i
RESULT_VERSION=$(grep ^VERSION $(find $i -name *.info) | cut -d= -f2 | tr -d \")
echo -e "$i\t$RESULT_VERSION" >> $RESULTS_VERSIONS
done
column -t $RESULTS_VERSIONS
fi
else
if [[ $DIAG ]]; then
Expand Down

0 comments on commit f070eb9

Please sign in to comment.