summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakob Gruber <jakob.gruber@gmail.com>2011-02-21 14:21:40 +0100
committerDan McGee <dan@archlinux.org>2011-02-28 10:54:33 -0600
commitdcd234ea278357f2ab71f20326ba37d89a5335c1 (patch)
treeb8c087c72bd32a91cdb67af44ad8f0f7cbf19a3f /src
parent1a524fa8b80c147c0ad2c26797e75f76c0f1d2fe (diff)
--print-format displays size in bytes
Printing the exact size seems to make more sense for scripting contexts. Signed-off-by: Jakob Gruber <jakob.gruber@gmail.com> [Dan: adjust for master before VerbosePkgLists patches, fix type] Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 9d50afb2..2d4ccf37 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
+#include <stdint.h> /* intmax_t */
#include <string.h>
#include <errno.h>
#include <fcntl.h>
@@ -642,8 +643,7 @@ void print_packages(const alpm_list_t *packages)
/* %s : size */
if(strstr(temp,"%s")) {
char *size;
- double mbsize = (double)pkg_get_size(pkg) / (1024.0 * 1024.0);
- pm_asprintf(&size, "%.2f", mbsize);
+ pm_asprintf(&size, "%jd", (intmax_t)pkg_get_size(pkg));
string = strreplace(temp, "%s", size);
free(size);
free(temp);