diff --git a/NEWS b/NEWS index 702f7d5c..2c796039 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,9 @@ xbps-0.48 (???): + * xbps-install(1): -n/--dry-run mode now also prints "installed_size" and + "filename-size" objects as 5th and 6th argument, respectively. + This implements #109 (https://github.com/voidlinux/xbps/issues/109). + * libxbps: fixed another issue when replacing an existing pkg with a virtual pkg, and there's an update for the original pkg in the transaction. Fixes #116 (https://github.com/voidlinux/xbps/issues/116). diff --git a/bin/xbps-install/transaction.c b/bin/xbps-install/transaction.c index 70aecdf3..2030d6ca 100644 --- a/bin/xbps-install/transaction.c +++ b/bin/xbps-install/transaction.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2014 Juan Romero Pardines. + * Copyright (c) 2009-2015 Juan Romero Pardines. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -52,8 +52,10 @@ show_actions(xbps_object_iterator_t iter) { xbps_object_t obj; const char *repoloc, *trans, *pkgver, *arch; + uint64_t isize, dsize; repoloc = trans = pkgver = arch = NULL; + isize = dsize = 0; while ((obj = xbps_object_iterator_next(iter)) != NULL) { xbps_dictionary_get_cstring_nocopy(obj, "transaction", &trans); @@ -63,6 +65,12 @@ show_actions(xbps_object_iterator_t iter) xbps_dictionary_get_cstring_nocopy(obj, "architecture", &arch); if (repoloc && arch) printf(" %s %s", arch, repoloc); + xbps_dictionary_get_uint64(obj, "installed_size", &isize); + xbps_dictionary_get_uint64(obj, "filename-size", &dsize); + if (isize) + printf(" %ju", isize); + if (dsize) + printf(" %ju", dsize); printf("\n"); } diff --git a/tests/xbps/libxbps/shell/install_test.sh b/tests/xbps/libxbps/shell/install_test.sh index 070a6708..f4e83f63 100644 --- a/tests/xbps/libxbps/shell/install_test.sh +++ b/tests/xbps/libxbps/shell/install_test.sh @@ -439,7 +439,9 @@ update_xbps_body() { xbps-rindex -d -a repo/*.xbps atf_check_equal $? 0 out=$(xbps-install -r root --repository=repo -yun) - atf_check_equal "$out" "xbps-1.1_1 update noarch $(readlink -f repo)" + set -- $out + exp="$1 $2 $3 $4" + atf_check_equal "$exp" "xbps-1.1_1 update noarch $(readlink -f repo)" } atf_test_case update_xbps_virtual @@ -476,7 +478,9 @@ update_xbps_virtual_body() { xbps-rindex -d -a repo/*.xbps atf_check_equal $? 0 out=$(xbps-install -r root --repository=repo -yun) - atf_check_equal "$out" "xbps-git-1.1_1 update noarch $(readlink -f repo)" + set -- $out + exp="$1 $2 $3 $4" + atf_check_equal "$exp" "xbps-git-1.1_1 update noarch $(readlink -f repo)" } atf_init_test_cases() { diff --git a/tests/xbps/libxbps/shell/update_hold.sh b/tests/xbps/libxbps/shell/update_hold.sh index 8521e144..02a635db 100644 --- a/tests/xbps/libxbps/shell/update_hold.sh +++ b/tests/xbps/libxbps/shell/update_hold.sh @@ -27,7 +27,9 @@ update_hold_body() { atf_check_equal $? 0 cd .. out=$(xbps-install -r root --repository=$PWD/repo -un) - atf_check_equal "$out" "A-1.1_1 hold noarch $PWD/repo" + set -- $out + exp="$1 $2 $3 $4" + atf_check_equal "$exp" "A-1.1_1 hold noarch $PWD/repo" xbps-install -r root --repository=$PWD/repo -yuvd atf_check_equal $? 0 out=$(xbps-query -r root -p pkgver A)