FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 02-21-2011, 06:02 PM
Jakob Gruber
 
Default --print-format displays size in bytes

Printing the exact size seems to make more sense for scripting contexts
and allows us to get rid of the direct call to
size_to_human_string_format.

Signed-off-by: Jakob Gruber <jakob.gruber@gmail.com>
---
src/pacman/util.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/pacman/util.c b/src/pacman/util.c
index b651478..8903d61 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -703,7 +703,7 @@ void print_packages(const alpm_list_t *packages)
/* %s : size */
if(strstr(temp,"%s")) {
char *size;
- size = size_to_human_string_format(pkg_get_size(pkg), "%.2f", "M", 0);
+ pm_asprintf(&size, "%u", pkg_get_size(pkg));
string = strreplace(temp, "%s", size);
free(size);
free(temp);
--
1.7.4.1
 
Old 02-25-2011, 01:52 PM
Dan McGee
 
Default --print-format displays size in bytes

On Mon, Feb 21, 2011 at 1:02 PM, Jakob Gruber <jakob.gruber@gmail.com> wrote:
> Printing the exact size seems to make more sense for scripting contexts
> and allows us to get rid of the direct call to
> size_to_human_string_format.
Agreed.

Signed-off-by: Dan McGee <dan@archlinux.org>

> Signed-off-by: Jakob Gruber <jakob.gruber@gmail.com>
> ---
> *src/pacman/util.c | * *2 +-
> *1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/pacman/util.c b/src/pacman/util.c
> index b651478..8903d61 100644
> --- a/src/pacman/util.c
> +++ b/src/pacman/util.c
> @@ -703,7 +703,7 @@ void print_packages(const alpm_list_t *packages)
> * * * * * * * */* %s : size */
> * * * * * * * *if(strstr(temp,"%s")) {
> * * * * * * * * * * * *char *size;
> - * * * * * * * * * * * size = size_to_human_string_format(pkg_get_size(pkg), "%.2f", "M", 0);
> + * * * * * * * * * * * pm_asprintf(&size, "%u", pkg_get_size(pkg));
> * * * * * * * * * * * *string = strreplace(temp, "%s", size);
> * * * * * * * * * * * *free(size);
> * * * * * * * * * * * *free(temp);
> --
> 1.7.4.1
>
>
>
 
Old 02-28-2011, 03:39 PM
Jakob Gruber
 
Default --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>
---
src/pacman/util.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/pacman/util.c b/src/pacman/util.c
index ba93963..23b95c9 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -676,7 +676,7 @@ void print_packages(const alpm_list_t *packages)
/* %s : size */
if(strstr(temp,"%s")) {
char *size;
- pm_asprintf(&size, "%.2f", humanize_size(pkg_get_size(pkg), 'M', 0, NULL));
+ pm_asprintf(&size, "%u", pkg_get_size(pkg));
string = strreplace(temp, "%s", size);
free(size);
free(temp);
--
1.7.4.1
 

Thread Tools




All times are GMT. The time now is 04:29 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org