1 |
commit: ea7f00529fa689a6624f6b26b5d3b7197f4fbfd5 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Sep 28 13:18:31 2019 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Sep 28 13:18:31 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ea7f0052 |
7 |
|
8 |
qpkg: don't emit hypothetical messages when real work has been done |
9 |
|
10 |
drop the "would be" part of how many bytes were freed when we're not |
11 |
pretending |
12 |
|
13 |
Bug: https://bugs.gentoo.org/695586 |
14 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
15 |
|
16 |
applets.h | 2 +- |
17 |
man/qpkg.1 | 4 ++-- |
18 |
qpkg.c | 8 +++++--- |
19 |
3 files changed, 8 insertions(+), 6 deletions(-) |
20 |
|
21 |
diff --git a/applets.h b/applets.h |
22 |
index 520ff23..364f457 100644 |
23 |
--- a/applets.h |
24 |
+++ b/applets.h |
25 |
@@ -82,7 +82,7 @@ static const struct applet_t { |
26 |
{"qmanifest", qmanifest_main, "<misc args>", "verify or generate thick Manifest files"}, |
27 |
#endif |
28 |
{"qmerge", qmerge_main, "<pkgnames>", "fetch and merge binary package"}, |
29 |
- {"qpkg", qpkg_main, "<misc args>", "manipulate Gentoo binpkgs"}, |
30 |
+ {"qpkg", qpkg_main, "<misc args>", "create or manipulate Gentoo binpkgs"}, |
31 |
{"qsearch", qsearch_main, "<regex>", "search pkgname/desc"}, |
32 |
{"qsize", qsize_main, "<pkgname>", "calculate size usage"}, |
33 |
{"qtbz2", qtbz2_main, "<misc args>", "manipulate tbz2 packages"}, |
34 |
|
35 |
diff --git a/man/qpkg.1 b/man/qpkg.1 |
36 |
index c471ea1..161a8bb 100644 |
37 |
--- a/man/qpkg.1 |
38 |
+++ b/man/qpkg.1 |
39 |
@@ -1,7 +1,7 @@ |
40 |
.\" generated by mkman.py, please do NOT edit! |
41 |
-.TH qpkg "1" "Jul 2019" "Gentoo Foundation" "qpkg" |
42 |
+.TH qpkg "1" "Sep 2019" "Gentoo Foundation" "qpkg" |
43 |
.SH NAME |
44 |
-qpkg \- manipulate Gentoo binpkgs |
45 |
+qpkg \- create or manipulate Gentoo binpkgs |
46 |
.SH SYNOPSIS |
47 |
.B qpkg |
48 |
\fI[opts] <misc args>\fR |
49 |
|
50 |
diff --git a/qpkg.c b/qpkg.c |
51 |
index 0ac6e92..947ff84 100644 |
52 |
--- a/qpkg.c |
53 |
+++ b/qpkg.c |
54 |
@@ -171,8 +171,9 @@ qpkg_clean(char *dirp) |
55 |
disp_units = KILOBYTE; |
56 |
if ((num_all_bytes / KILOBYTE) > 1000) |
57 |
disp_units = MEGABYTE; |
58 |
- qprintf(" %s*%s Total space that would be freed in packages " |
59 |
- "directory: %s%s %ciB%s\n", GREEN, NORM, RED, |
60 |
+ qprintf(" %s*%s Total space %sfreed in packages " |
61 |
+ "directory: %s%s %ciB%s\n", GREEN, NORM, |
62 |
+ pretend ? "that would be " : "", RED, |
63 |
make_human_readable_str(num_all_bytes, 1, disp_units), |
64 |
disp_units == MEGABYTE ? 'M' : 'K', NORM); |
65 |
|
66 |
@@ -297,10 +298,11 @@ qpkg_make(depend_atom *atom) |
67 |
xpak_create(AT_FDCWD, tbz2, 1, xpak_argv, 1, verbose); |
68 |
|
69 |
stat(tbz2, &st); |
70 |
+ xpaksize = st.st_size - xpaksize; |
71 |
|
72 |
/* save tbz2 tail: OOOOSTOP */ |
73 |
fp = fopen(tbz2, "a"); |
74 |
- WRITE_BE_INT32(buf, st.st_size - xpaksize); |
75 |
+ WRITE_BE_INT32(buf, xpaksize); |
76 |
fwrite(buf, 1, 4, fp); |
77 |
fwrite("STOP", 1, 4, fp); |
78 |
fclose(fp); |