aboutsummaryrefslogtreecommitdiff
path: root/qpkg.c
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2019-09-28 15:18:31 +0200
committerFabian Groffen <grobian@gentoo.org>2019-09-28 15:18:31 +0200
commitea7f00529fa689a6624f6b26b5d3b7197f4fbfd5 (patch)
treed5461804e0191774c2cc1b12a1be0acab8ea7467 /qpkg.c
parentqpkg: fix tbz2 xpak generation (diff)
downloadportage-utils-ea7f00529fa689a6624f6b26b5d3b7197f4fbfd5.tar.gz
portage-utils-ea7f00529fa689a6624f6b26b5d3b7197f4fbfd5.tar.bz2
portage-utils-ea7f00529fa689a6624f6b26b5d3b7197f4fbfd5.zip
qpkg: don't emit hypothetical messages when real work has been done
drop the "would be" part of how many bytes were freed when we're not pretending Bug: https://bugs.gentoo.org/695586 Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'qpkg.c')
-rw-r--r--qpkg.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/qpkg.c b/qpkg.c
index 0ac6e92..947ff84 100644
--- a/qpkg.c
+++ b/qpkg.c
@@ -171,8 +171,9 @@ qpkg_clean(char *dirp)
disp_units = KILOBYTE;
if ((num_all_bytes / KILOBYTE) > 1000)
disp_units = MEGABYTE;
- qprintf(" %s*%s Total space that would be freed in packages "
- "directory: %s%s %ciB%s\n", GREEN, NORM, RED,
+ qprintf(" %s*%s Total space %sfreed in packages "
+ "directory: %s%s %ciB%s\n", GREEN, NORM,
+ pretend ? "that would be " : "", RED,
make_human_readable_str(num_all_bytes, 1, disp_units),
disp_units == MEGABYTE ? 'M' : 'K', NORM);
@@ -297,10 +298,11 @@ qpkg_make(depend_atom *atom)
xpak_create(AT_FDCWD, tbz2, 1, xpak_argv, 1, verbose);
stat(tbz2, &st);
+ xpaksize = st.st_size - xpaksize;
/* save tbz2 tail: OOOOSTOP */
fp = fopen(tbz2, "a");
- WRITE_BE_INT32(buf, st.st_size - xpaksize);
+ WRITE_BE_INT32(buf, xpaksize);
fwrite(buf, 1, 4, fp);
fwrite("STOP", 1, 4, fp);
fclose(fp);