From: "Diego Petteno (flameeyes)" <flameeyes@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-projects commit in portage-utils: qsize.c
Date: Sun, 4 Jul 2010 20:04:06 +0000 (UTC) [thread overview]
Message-ID: <20100704200406.626002C621@corvid.gentoo.org> (raw)
flameeyes 10/07/04 20:04:06
Modified: qsize.c
Log:
When calculating the size of files, take ROOT into consideration.
Without this change, qsize will not work properly when using ROOT= as
the size taken into consideration is that of the files installed with ROOT=/.
Revision Changes Path
1.35 portage-utils/qsize.c
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/qsize.c?rev=1.35&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/qsize.c?rev=1.35&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/qsize.c?r1=1.34&r2=1.35
Index: qsize.c
===================================================================
RCS file: /var/cvsroot/gentoo-projects/portage-utils/qsize.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- qsize.c 7 Apr 2010 05:58:16 -0000 1.34
+++ qsize.c 4 Jul 2010 20:04:06 -0000 1.35
@@ -1,7 +1,7 @@
/*
* Copyright 2005-2010 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qsize.c,v 1.34 2010/04/07 05:58:16 solar Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qsize.c,v 1.35 2010/07/04 20:04:06 flameeyes Exp $
*
* Copyright 2005-2010 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2010 Mike Frysinger - <vapier@gentoo.org>
@@ -32,7 +32,7 @@
"Ignore regexp string",
COMMON_OPTS_HELP
};
-static const char qsize_rcsid[] = "$Id: qsize.c,v 1.34 2010/04/07 05:58:16 solar Exp $";
+static const char qsize_rcsid[] = "$Id: qsize.c,v 1.35 2010/07/04 20:04:06 flameeyes Exp $";
#define qsize_usage(ret) usage(ret, QSIZE_FLAGS, qsize_long_opts, qsize_opts_help, lookup_applet_idx("qsize"))
int qsize_main(int argc, char **argv)
@@ -49,6 +49,7 @@
size_t disp_units = 0;
const char *str_disp_units = NULL;
char buf[_Q_PATH_MAX];
+ char filename[_Q_PATH_MAX], *filename_root;
queue *ignore_regexp = NULL;
DBG("argc=%d argv[0]=%s argv[1]=%s",
@@ -77,6 +78,9 @@
num_all_bytes = num_all_files = num_all_nonfiles = num_all_ignored = 0;
+ strcpy(filename, portroot);
+ filename_root = filename + strlen(filename);
+
/* open /var/db/pkg */
while ((dentry = q_vdb_get_next_dir(dir))) {
@@ -130,8 +134,9 @@
continue;
if (e->type == CONTENTS_OBJ || e->type == CONTENTS_SYM) {
+ strcpy(filename_root, e->name);
++num_files;
- if (!lstat(e->name, &st))
+ if (!lstat(filename, &st))
num_bytes += (fs_size ? st.st_blocks * S_BLKSIZE : st.st_size);
} else
++num_nonfiles;
next reply other threads:[~2010-07-04 20:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-04 20:04 Diego Petteno (flameeyes) [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-09-08 17:21 [gentoo-commits] gentoo-projects commit in portage-utils: qsize.c Fabian Groffen (grobian)
2009-03-24 18:54 Fabian Groffen (grobian)
2007-11-04 9:03 Ned Ludd (solar)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100704200406.626002C621@corvid.gentoo.org \
--to=flameeyes@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox