diff options
author | Nathan Jones <nathanj@insightbb.com> | 2007-06-01 11:00:39 -0400 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-06-01 11:00:39 -0400 |
commit | 80237630af0b2241a8a756d7ed7d2be3f80cfec5 (patch) | |
tree | 739f3039f84de677b33f6b7b5f241edb2472ee3d /src/pacman/query.c | |
parent | cb9f046945b0365d7d29ee590a31a08bece1879c (diff) | |
download | pacman-80237630af0b2241a8a756d7ed7d2be3f80cfec5.tar.xz |
Change -z|--showsize flag to ShowSize pacman.conf option
Also cleaned up some duplicate printf lines related to the ShowSize option.
Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/query.c')
-rw-r--r-- | src/pacman/query.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/pacman/query.c b/src/pacman/query.c index a4a42075..fde093a4 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -132,16 +132,14 @@ int pacman_query(alpm_list_t *targets) alpm_list_t *grp; pmpkg_t *pkg = alpm_list_getdata(i); - /* print the package size with the output if -z option passed */ - if(config->showsize) { + printf("local/%s %s", alpm_pkg_get_name(pkg), alpm_pkg_get_version(pkg)); + + /* print the package size with the output if ShowSize option set */ + if(alpm_option_get_showsize()) { /* Convert byte size to MB */ double mbsize = alpm_pkg_get_size(pkg) / (1024.0 * 1024.0); - printf("local/%s %s [%.2f MB]", alpm_pkg_get_name(pkg), - alpm_pkg_get_version(pkg), mbsize); - } else { - printf("local/%s %s", alpm_pkg_get_name(pkg), - alpm_pkg_get_version(pkg)); + printf(" [%.2f MB]", mbsize); } if((grp = alpm_pkg_get_groups(pkg)) != NULL) { |