From f1cb10360b3c092b160cc75c56ef8228eff165df Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 24 Oct 2008 19:20:06 +0200 Subject: pkg update: Added 'package state' information --- bin/pkg | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/pkg b/bin/pkg index 57e840f..e58d0f4 100755 --- a/bin/pkg +++ b/bin/pkg @@ -592,6 +592,14 @@ function pkg_info { if [[ -r description ]] { DESCRIPTION=$(cat description) } + state='installed' + if list_incoming $1; then + state+=', needs update' + else + state+=', up-to-date' + fi + } else { + state='not installed' } function show_info { @@ -601,7 +609,8 @@ function pkg_info { } show_info "Package" $NAME - show_info "Priority" "$PRIORITY ($PRIORITY_NAME)" + show_info 'State' $state + [[ -n $PRIORITY ]] && show_info "Priority" "$PRIORITY ($PRIORITY_NAME)" show_info "Local Version" $LOCAL_VERSION show_info "Remote Version" $REMOTE_VERSION show_info "Repository Type" $REPO_TYPE -- cgit v1.2.3