commit: ea7f00529fa689a6624f6b26b5d3b7197f4fbfd5 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> AuthorDate: Sat Sep 28 13:18:31 2019 +0000 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> CommitDate: Sat Sep 28 13:18:31 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ea7f0052
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 <AT> gentoo.org> applets.h | 2 +- man/qpkg.1 | 4 ++-- qpkg.c | 8 +++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/applets.h b/applets.h index 520ff23..364f457 100644 --- a/applets.h +++ b/applets.h @@ -82,7 +82,7 @@ static const struct applet_t { {"qmanifest", qmanifest_main, "<misc args>", "verify or generate thick Manifest files"}, #endif {"qmerge", qmerge_main, "<pkgnames>", "fetch and merge binary package"}, - {"qpkg", qpkg_main, "<misc args>", "manipulate Gentoo binpkgs"}, + {"qpkg", qpkg_main, "<misc args>", "create or manipulate Gentoo binpkgs"}, {"qsearch", qsearch_main, "<regex>", "search pkgname/desc"}, {"qsize", qsize_main, "<pkgname>", "calculate size usage"}, {"qtbz2", qtbz2_main, "<misc args>", "manipulate tbz2 packages"}, diff --git a/man/qpkg.1 b/man/qpkg.1 index c471ea1..161a8bb 100644 --- a/man/qpkg.1 +++ b/man/qpkg.1 @@ -1,7 +1,7 @@ .\" generated by mkman.py, please do NOT edit! -.TH qpkg "1" "Jul 2019" "Gentoo Foundation" "qpkg" +.TH qpkg "1" "Sep 2019" "Gentoo Foundation" "qpkg" .SH NAME -qpkg \- manipulate Gentoo binpkgs +qpkg \- create or manipulate Gentoo binpkgs .SH SYNOPSIS .B qpkg \fI[opts] <misc args>\fR 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);
