summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-06-01 17:51:35 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-06-01 17:51:35 +0200
commit08b8086180bb9bf27b257e62e2ec583296bf317a (patch)
tree77ebfedf0c0c5e7fe6b2ad968f5e8a2a694a78d3
parent636120d5b3dd25e83826f4c79d559c02f96c82af (diff)
bin/pkg: pkg_info: Only show items if they have a value
-rwxr-xr-xbin/pkg34
1 files changed, 15 insertions, 19 deletions
diff --git a/bin/pkg b/bin/pkg
index e700939..e345823 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -232,25 +232,21 @@ pkg_info () {
DESCRIPTION=$(cat description)
}
- # Show 'em
- info "Package: "
- echo "$NAME"
- info "Priority: "
- echo "$PRIORITY ($PRIORITY_NAME)"
- info "Version: "
- echo "$VERSION"
- info "Date: "
- echo "$DATE"
- info "Dependencies: "
- echo "$DEPENDENCIES"
- info "Tags: "
- echo "$TAGS"
- info "Hooks: "
- echo "$HOOKS"
- info "Repository Size: "
- echo "$SIZE"
- info "Description:\n"
- echo "$DESCRIPTION"
+ show_info () {
+ [ -z "$2" ] && return
+ info "$1: "
+ echo "$2"
+ }
+
+ show_info "Package" "$NAME"
+ show_info "Priority" "$PRIORITY ($PRIORITY_NAME)"
+ show_info "Version" "$VERSION"
+ show_info "Date" "$DATE"
+ show_info "Dependencies" "$DEPENDENCIES"
+ show_info "Tags" "$TAGS"
+ show_info "Hooks" "$HOOKS"
+ show_info "Repostiry Size" "$SIZE"
+ show_info "Description" "$DESCRIPTION"
}
pkg_log () {