Gentoo Archives: gentoo-commits

From: Jory Pratt <anarchy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: sys-fs/xfsprogs/files/, sys-fs/xfsprogs/
Date: Tue, 25 Jul 2017 18:53:02
Message-Id: 1501008736.5add06bbc9793015b5139dde6dc07e6575ea9cd1.anarchy@gentoo
1 commit: 5add06bbc9793015b5139dde6dc07e6575ea9cd1
2 Author: Jory A. Pratt <anarchy <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jul 25 18:52:16 2017 +0000
4 Commit: Jory Pratt <anarchy <AT> gentoo <DOT> org>
5 CommitDate: Tue Jul 25 18:52:16 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=5add06bb
7
8 sys-fs/xfsprogs: Apply upstream patch to fix sdtout definition of
9 read-only variable
10
11 sys-fs/xfsprogs/Manifest | 3 +-
12 .../xfsprogs/files/xfsprogs-4.12.0-fix_musl.patch | 118 +++++++++++++++++++++
13 sys-fs/xfsprogs/xfsprogs-4.12.0.ebuild | 1 +
14 3 files changed, 121 insertions(+), 1 deletion(-)
15
16 diff --git a/sys-fs/xfsprogs/Manifest b/sys-fs/xfsprogs/Manifest
17 index 4efd970..d2f8665 100644
18 --- a/sys-fs/xfsprogs/Manifest
19 +++ b/sys-fs/xfsprogs/Manifest
20 @@ -1,4 +1,5 @@
21 AUX xfsprogs-4.11.0-musl.patch 1835 SHA256 1387eebcf9e61ab50fea70e11f7d6873ae47e26f3fba99b8df2d17d6a2db1619 SHA512 dcfafb16d31c50c6c16ee2a778eda6c946646e129e6c9c96efeb518f7935534dcd7063aded186c5d874ffd07b6eaa31f3ff0e06e0cdca9876565056c727a5494 WHIRLPOOL 68b03ec3ccc1258e667e883910dfeaa65945ffdc893da5c752baea1ec6d7c859be85b8287392c951cf60315aee356dd463410d287ff673a2b70dfe9684a56bb9
22 +AUX xfsprogs-4.12.0-fix_musl.patch 3134 SHA256 a76aadd93aa62c7f942c2bc5d65db771075a00961ee422e9fd1f3abf67bfab93 SHA512 90aed5c33bfae13c89ffa26f076bd4c75f6562ec7bd87607238daa0e19e108e7de5f41025880d8314677c31ba54dd9acd4646e44bef139b7256033406427f30e WHIRLPOOL 24e7ffbe1ad68688dabd4be1a1c7af60ea849a73ff78dc80b3a93e0b31bcc8a978da6f6e48bbcd7f1e8de7e37d061b87e4cec2c931c21d42eb8827d97c626df2
23 AUX xfsprogs-4.12.0-sharedlibs.patch 2361 SHA256 4f10b622e8b7c8654a5dc79356343515ef203742ba4781b97a6f02f23e99555a SHA512 bbf802c54d2c8a2a524a9d4ae0ca66a18bf6b099a00fcc248abee04f84371bd35fc07a2dcc0c1d99c297b474c1f98d92927aa5ca16df5e6caef3abe386f31eba WHIRLPOOL 72e00337e46700ee2a16597bb8188fff229c019c46a39f60598a6d802b8ba094c6e5da8377aad60fee6afd9f491c577d2c84ace3f78a00438268ccbc1832368a
24 AUX xfsprogs-4.3.0-cross-compile.patch 5112 SHA256 5654447555115bce22e443623f6fc17b767681741f043a9dc5e6887967a27db9 SHA512 2d6303b7c89b3e1ca2ba1d95a4477d0d1c2360ed68bf9c9d3630f990081be98ace9b9c164729635fa582cc5c8bd418e1824e35f613512d43cc6116fcda379582 WHIRLPOOL 1fee9f56739d13c1b04b2d0d190b193c97a846902fce8ccba0210cbce6a61bcd2cab118a2c59fb66cd89a957e32e714c3f1dc534697819165a505a8eb8f225b6
25 AUX xfsprogs-4.3.0-musl.patch 3543 SHA256 afe6ea3f95d88abc0b2c276e1c88dd8acc3bdbf10cf93cba54cae9d1de6e1e67 SHA512 7c86c402bda6630699e63b55389931d8a43c9ed6489c248bf090ca724516c56d4b2b3204dd07272a2e84e11abda8f0aa0735851c3f66330f6be258390a8dafe6 WHIRLPOOL 8fb46034afbea1b78c23e931d36920228ee401c0a72b4496eb40771b245c8a0f9800eb8794631362937ad0192fe959c1789fcee5a98d1788035c19219365cce7
26 @@ -11,6 +12,6 @@ DIST xfsprogs-4.11.0.tar.xz 1113480 SHA256 c3a6d87b564d7738243c507df82276bed9822
27 DIST xfsprogs-4.12.0.tar.xz 1128400 SHA256 b330ad8d737f4152ae511580102e2fc49212bb51dfb4b614084344abae46d0df SHA512 1dc4a0a5f40baf1d6398c8f07b4cb3ab796cf052c34b811d60b08c60a4700c2ced8d4d1adb878f8b85ba58cf3e1276db1477109de538fd427d3e359a52f59d4a WHIRLPOOL c18d3c9dfab8ccb877eb6fa9fa05be3c614a587c6cb616a9f18b52debb8ecacbd22056cb397ff9e69407c66e105d034458b41f0ba4275352f31398e64d303c02
28 DIST xfsprogs-4.5.0.tar.gz 1524382 SHA256 e49beb314984efbd0d758abb5c6137db3bb60a88e59e1e94c00defb536cf89f8 SHA512 19c95551dc91ec46916f9a7e3d7976907664d32dd5fdc26af0ca62ca74c4b3c10f9e843aac8214ea9d1c0bf140c9f4e321d059808af01a623abedd5067011314 WHIRLPOOL 54d742635df024a63181da76c3220671610068363af85be2677521f20342595a5cebb2fd169945572351901ee2c9384f79f54a381ab3620dde22d863aa66d469
29 EBUILD xfsprogs-4.11.0.ebuild 2750 SHA256 de77973986d0e862e0179e74fdd619cf99d54218d282b47324a4dd45c8e86398 SHA512 7113861301c0e1437133e813a6fb3d1653419d63385f7ba1040953cced4596ac091bc75bee991c82d17b7f4764634a5334a09100f8f9a5b6954154d357d8ee5e WHIRLPOOL e2c3ea570f178bccf6b0b2bcbb65638af7905931301d87b90ddefa0a469a6c266afec0e5bc370b0dd6a9ee318e376ce270b19fc21ae5687c5f5295101e051d48
30 -EBUILD xfsprogs-4.12.0.ebuild 2729 SHA256 9336a0592b2d2642938ba1661c962a14b5ad277b0978846584ad11f0f5a60ac4 SHA512 f910da3fed6bd41ac3a0d3500f4bc4da7e7644e9864f08a1ad3fe174d1ca79d7f738508145a866f138ef3d370c50414f90d0c2577f3357862fb5a72253b45a78 WHIRLPOOL a8c44865d9c4540541782f8188803f2f374c721e454a33eeee577c83321d84ef8d93f95c51f32faa3cfe6f565cadfb99cdc1b660afb86b4a67f613275be01ced
31 +EBUILD xfsprogs-4.12.0.ebuild 2772 SHA256 04ca2d3cd42b3dc50ec559a82780253cc87d3302deaf9c1872c4be7cf698d4d3 SHA512 ce7afb45c259c606e01de7f916b4663df2ff583635f38159b6dd9136856bc66bf4d4ccca89748665f5541bcf904f7066b5d7677c0292fdd9b54be6172845e7c4 WHIRLPOOL 5b8440386b011db2cf71fbdc76bac6faec1766b6ef3dc5c02d37f6a7549531dd7edc6cf8ea6be548ad4f5fec5592d492923ef133064ba556a02f3d36240fc5c7
32 EBUILD xfsprogs-4.5.0.ebuild 2936 SHA256 f4faccf78a63237359239504ba56946817e6c604ebf5836e2c094b0bb1255ff5 SHA512 7363f71ab6ba657735394682e38cdf4cf21db032c34167435a9d37f74db52f8e25319d172f3d007db2b64973b3bde28abd602b1d64a544122d28654cc3605054 WHIRLPOOL 17d12153e5cd04828ac71c41e2e59b32ed21e19af9e0d83f40b93619f800f85ae89f4c272496a7f59268b386e72e97b6a17bb46a370586cda957e3bcadf94616
33 MISC metadata.xml 257 SHA256 c1d4bdabe699c6d9fcdf3b7794a13b45f69e3826b814b422e4ca7e6893b99012 SHA512 9c7759d33e1bbc8be0da5b4f59fc720266e40f4116d7db0c17c5ad800a7bb638f33a1308e1554092af781f06df6f6cb55db41fc22207cd3edc2e159840e3a3b1 WHIRLPOOL 4afcbc79dd61237c778735b39060b3e294fdc07da5b0da6f7b40db92649ac71febddd7a0265502e102d8eec9664fd5af2071fff9428bfcb0a6bf06cf70c68a3d
34
35 diff --git a/sys-fs/xfsprogs/files/xfsprogs-4.12.0-fix_musl.patch b/sys-fs/xfsprogs/files/xfsprogs-4.12.0-fix_musl.patch
36 new file mode 100644
37 index 0000000..de647d9
38 --- /dev/null
39 +++ b/sys-fs/xfsprogs/files/xfsprogs-4.12.0-fix_musl.patch
40 @@ -0,0 +1,118 @@
41 +From 21253610f9ef87db8e2a75b863b7fcfbd0cdb421 Mon Sep 17 00:00:00 2001
42 +From: "Darrick J. Wong" <darrick.wong@××××××.com>
43 +Date: Tue, 25 Jul 2017 13:45:01 -0500
44 +Subject: [PATCH] In patch 4944defad4 ("xfs_db: redirect printfs when
45 + metadumping to stdout"), we solved the problem of xfs_db printfs ending up in
46 + the metadump stream by reassigning stdout for the duration of a stdout
47 + metadump. Unfortunately, musl doesn't allow stdout to be reassigned (in
48 + their view "extern FILE *stdout" means "extern FILE * const stdout"), so we
49 + abandon the old approach in favor of playing games with dup() to switch the
50 + raw file descriptors.
51 +
52 +While we're at it, fix a regression where an unconverted outf test
53 +allows progress info to end up in the metadump stream.
54 +
55 +Signed-off-by: Darrick J. Wong <darrick.wong@××××××.com>
56 +---
57 + db/metadump.c | 47 ++++++++++++++++++++++++++++++++++++-----------
58 + 1 file changed, 36 insertions(+), 11 deletions(-)
59 +
60 +diff --git a/db/metadump.c b/db/metadump.c
61 +index 96641e0..4e2f648 100644
62 +--- a/db/metadump.c
63 ++++ b/db/metadump.c
64 +@@ -78,6 +78,7 @@ static int obfuscate = 1;
65 + static int zero_stale_data = 1;
66 + static int show_warnings = 0;
67 + static int progress_since_warning = 0;
68 ++static bool stdout_metadump;
69 +
70 + void
71 + metadump_init(void)
72 +@@ -137,7 +138,7 @@ print_progress(const char *fmt, ...)
73 + va_end(ap);
74 + buf[sizeof(buf)-1] = '\0';
75 +
76 +- f = (outf == stdout) ? stderr : stdout;
77 ++ f = stdout_metadump ? stderr : stdout;
78 + fprintf(f, "\r%-59s", buf);
79 + fflush(f);
80 + progress_since_warning = 1;
81 +@@ -2750,7 +2751,8 @@ metadump_f(
82 + xfs_agnumber_t agno;
83 + int c;
84 + int start_iocur_sp;
85 +- bool stdout_metadump = false;
86 ++ int outfd = -1;
87 ++ int ret;
88 + char *p;
89 +
90 + exitcode = 1;
91 +@@ -2870,16 +2872,35 @@ metadump_f(
92 + * metadump operation so that dbprintf and other messages
93 + * are sent to the console instead of polluting the
94 + * metadump stream.
95 ++ *
96 ++ * We get to do this the hard way because musl doesn't
97 ++ * allow reassignment of stdout.
98 + */
99 +- outf = stdout;
100 +- stdout = stderr;
101 ++ fflush(stdout);
102 ++ outfd = dup(STDOUT_FILENO);
103 ++ if (outfd < 0) {
104 ++ perror("opening dump stream");
105 ++ goto out;
106 ++ }
107 ++ ret = dup2(STDERR_FILENO, STDOUT_FILENO);
108 ++ if (ret < 0) {
109 ++ perror("redirecting stdout");
110 ++ close(outfd);
111 ++ goto out;
112 ++ }
113 ++ outf = fdopen(outfd, "a");
114 ++ if (outf == NULL) {
115 ++ fprintf(stderr, "cannot create dump stream\n");
116 ++ dup2(outfd, 1);
117 ++ close(outfd);
118 ++ goto out;
119 ++ }
120 + stdout_metadump = true;
121 + } else {
122 + outf = fopen(argv[optind], "wb");
123 + if (outf == NULL) {
124 + print_warning("cannot create dump file");
125 +- free(metablock);
126 +- return 0;
127 ++ goto out;
128 + }
129 + }
130 +
131 +@@ -2907,15 +2928,19 @@ metadump_f(
132 + if (progress_since_warning)
133 + fputc('\n', stdout_metadump ? stderr : stdout);
134 +
135 +- if (stdout_metadump)
136 +- stdout = outf;
137 +- else
138 +- fclose(outf);
139 ++ if (stdout_metadump) {
140 ++ fflush(outf);
141 ++ fflush(stdout);
142 ++ ret = dup2(outfd, STDOUT_FILENO);
143 ++ if (ret < 0)
144 ++ perror("un-redirecting stdout");
145 ++ }
146 ++ fclose(outf);
147 +
148 + /* cleanup iocur stack */
149 + while (iocur_sp > start_iocur_sp)
150 + pop_cur();
151 +-
152 ++out:
153 + free(metablock);
154 +
155 + return 0;
156 +--
157 +2.13.3
158 +
159
160 diff --git a/sys-fs/xfsprogs/xfsprogs-4.12.0.ebuild b/sys-fs/xfsprogs/xfsprogs-4.12.0.ebuild
161 index 772f842..730f86c 100644
162 --- a/sys-fs/xfsprogs/xfsprogs-4.12.0.ebuild
163 +++ b/sys-fs/xfsprogs/xfsprogs-4.12.0.ebuild
164 @@ -32,6 +32,7 @@ PATCHES=(
165 "${FILESDIR}"/${PN}-4.7.0-libxcmd-link.patch
166 "${FILESDIR}"/${PN}-4.9.0-underlinking.patch
167 "${FILESDIR}"/${PN}-4.11.0-musl.patch
168 + "${FILESDIR}"/${PN}-4.12.0-fix_musl.patch
169 )
170
171 pkg_setup() {