summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-10-24 19:20:06 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-10-24 19:20:06 +0200
commitf1cb10360b3c092b160cc75c56ef8228eff165df (patch)
tree983459254532b62b086af2b41a57408d6d6efcaa
parent53aaf16641587b5f8ceb10575ff90e483c5a6f4b (diff)
pkg update: Added 'package state' information
-rwxr-xr-xbin/pkg11
1 files changed, 10 insertions, 1 deletions
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