diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-06-01 17:51:35 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-06-01 17:51:35 +0200 |
commit | 08b8086180bb9bf27b257e62e2ec583296bf317a (patch) | |
tree | 77ebfedf0c0c5e7fe6b2ad968f5e8a2a694a78d3 /bin/pkg | |
parent | 636120d5b3dd25e83826f4c79d559c02f96c82af (diff) |
bin/pkg: pkg_info: Only show items if they have a value
Diffstat (limited to 'bin/pkg')
-rwxr-xr-x | bin/pkg | 34 |
1 files changed, 15 insertions, 19 deletions
@@ -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 () { |