diff options
Diffstat (limited to 'meta/recipes-devtools/rpm/files/0004-build-pack.c-remove-static-local-variables-from-buil.patch')
-rw-r--r-- | meta/recipes-devtools/rpm/files/0004-build-pack.c-remove-static-local-variables-from-buil.patch | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/meta/recipes-devtools/rpm/files/0004-build-pack.c-remove-static-local-variables-from-buil.patch b/meta/recipes-devtools/rpm/files/0004-build-pack.c-remove-static-local-variables-from-buil.patch index 64a5651f7e..8989dcebd1 100644 --- a/meta/recipes-devtools/rpm/files/0004-build-pack.c-remove-static-local-variables-from-buil.patch +++ b/meta/recipes-devtools/rpm/files/0004-build-pack.c-remove-static-local-variables-from-buil.patch | |||
@@ -1,7 +1,7 @@ | |||
1 | From ec305795a302d226343e69031ff2024dfcde69c0 Mon Sep 17 00:00:00 2001 | 1 | From 8ce9fbab2990609bdace457e146160334e931c89 Mon Sep 17 00:00:00 2001 |
2 | From: Alexander Kanavin <alex.kanavin@gmail.com> | 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> |
3 | Date: Thu, 8 Jun 2017 17:08:09 +0300 | 3 | Date: Thu, 8 Jun 2017 17:08:09 +0300 |
4 | Subject: [PATCH 3/3] build/pack.c: remove static local variables from | 4 | Subject: [PATCH 14/15] build/pack.c: remove static local variables from |
5 | buildHost() and getBuildTime() | 5 | buildHost() and getBuildTime() |
6 | 6 | ||
7 | Their use is causing difficult to diagnoze data races when building multiple | 7 | Their use is causing difficult to diagnoze data races when building multiple |
@@ -11,8 +11,8 @@ difficult to reason about code. | |||
11 | Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/226] | 11 | Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/226] |
12 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> | 12 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> |
13 | 13 | ||
14 | |||
15 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> | 14 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> |
15 | |||
16 | --- | 16 | --- |
17 | build/build.c | 54 ++++++++++++++++++++++++++++-- | 17 | build/build.c | 54 ++++++++++++++++++++++++++++-- |
18 | build/pack.c | 84 +++++++++-------------------------------------- | 18 | build/pack.c | 84 +++++++++-------------------------------------- |
@@ -20,7 +20,7 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> | |||
20 | 3 files changed, 74 insertions(+), 72 deletions(-) | 20 | 3 files changed, 74 insertions(+), 72 deletions(-) |
21 | 21 | ||
22 | diff --git a/build/build.c b/build/build.c | 22 | diff --git a/build/build.c b/build/build.c |
23 | index 5f99c8db7..09a1311c5 100644 | 23 | index 81152e53e..6001f9e52 100644 |
24 | --- a/build/build.c | 24 | --- a/build/build.c |
25 | +++ b/build/build.c | 25 | +++ b/build/build.c |
26 | @@ -6,6 +6,8 @@ | 26 | @@ -6,6 +6,8 @@ |
@@ -83,7 +83,7 @@ index 5f99c8db7..09a1311c5 100644 | |||
83 | /** | 83 | /** |
84 | */ | 84 | */ |
85 | static rpmRC doRmSource(rpmSpec spec) | 85 | static rpmRC doRmSource(rpmSpec spec) |
86 | @@ -203,6 +249,9 @@ static rpmRC buildSpec(BTA_t buildArgs, rpmSpec spec, int what) | 86 | @@ -201,6 +247,9 @@ static rpmRC buildSpec(BTA_t buildArgs, rpmSpec spec, int what) |
87 | rpmRC rc = RPMRC_OK; | 87 | rpmRC rc = RPMRC_OK; |
88 | int test = (what & RPMBUILD_NOBUILD); | 88 | int test = (what & RPMBUILD_NOBUILD); |
89 | char *cookie = buildArgs->cookie ? xstrdup(buildArgs->cookie) : NULL; | 89 | char *cookie = buildArgs->cookie ? xstrdup(buildArgs->cookie) : NULL; |
@@ -93,7 +93,7 @@ index 5f99c8db7..09a1311c5 100644 | |||
93 | 93 | ||
94 | if (rpmExpandNumeric("%{?source_date_epoch_from_changelog}") && | 94 | if (rpmExpandNumeric("%{?source_date_epoch_from_changelog}") && |
95 | getenv("SOURCE_DATE_EPOCH") == NULL) { | 95 | getenv("SOURCE_DATE_EPOCH") == NULL) { |
96 | @@ -271,11 +320,11 @@ static rpmRC buildSpec(BTA_t buildArgs, rpmSpec spec, int what) | 96 | @@ -269,11 +318,11 @@ static rpmRC buildSpec(BTA_t buildArgs, rpmSpec spec, int what) |
97 | goto exit; | 97 | goto exit; |
98 | 98 | ||
99 | if (((what & RPMBUILD_PACKAGESOURCE) && !test) && | 99 | if (((what & RPMBUILD_PACKAGESOURCE) && !test) && |
@@ -107,7 +107,7 @@ index 5f99c8db7..09a1311c5 100644 | |||
107 | goto exit; | 107 | goto exit; |
108 | 108 | ||
109 | if ((what & RPMBUILD_CLEAN) && | 109 | if ((what & RPMBUILD_CLEAN) && |
110 | @@ -295,6 +344,7 @@ static rpmRC buildSpec(BTA_t buildArgs, rpmSpec spec, int what) | 110 | @@ -293,6 +342,7 @@ static rpmRC buildSpec(BTA_t buildArgs, rpmSpec spec, int what) |
111 | (void) unlink(spec->specFile); | 111 | (void) unlink(spec->specFile); |
112 | 112 | ||
113 | exit: | 113 | exit: |
@@ -116,7 +116,7 @@ index 5f99c8db7..09a1311c5 100644 | |||
116 | spec->rootDir = NULL; | 116 | spec->rootDir = NULL; |
117 | if (rc != RPMRC_OK && rpmlogGetNrecs() > 0) { | 117 | if (rc != RPMRC_OK && rpmlogGetNrecs() > 0) { |
118 | diff --git a/build/pack.c b/build/pack.c | 118 | diff --git a/build/pack.c b/build/pack.c |
119 | index ed5b9ab4e..62427065a 100644 | 119 | index df15876ff..17a4b0905 100644 |
120 | --- a/build/pack.c | 120 | --- a/build/pack.c |
121 | +++ b/build/pack.c | 121 | +++ b/build/pack.c |
122 | @@ -6,8 +6,6 @@ | 122 | @@ -6,8 +6,6 @@ |
@@ -128,7 +128,7 @@ index ed5b9ab4e..62427065a 100644 | |||
128 | #include <sys/wait.h> | 128 | #include <sys/wait.h> |
129 | 129 | ||
130 | #include <rpm/rpmlib.h> /* RPMSIGTAG*, rpmReadPackageFile */ | 130 | #include <rpm/rpmlib.h> /* RPMSIGTAG*, rpmReadPackageFile */ |
131 | @@ -151,57 +149,6 @@ exit: | 131 | @@ -152,57 +150,6 @@ exit: |
132 | return rc; | 132 | return rc; |
133 | } | 133 | } |
134 | 134 | ||
@@ -186,9 +186,9 @@ index ed5b9ab4e..62427065a 100644 | |||
186 | static rpmRC processScriptFiles(rpmSpec spec, Package pkg) | 186 | static rpmRC processScriptFiles(rpmSpec spec, Package pkg) |
187 | { | 187 | { |
188 | struct TriggerFileEntry *p; | 188 | struct TriggerFileEntry *p; |
189 | @@ -308,7 +255,8 @@ static int haveRichDep(Package pkg) | 189 | @@ -476,7 +423,8 @@ exit: |
190 | } | 190 | * order to how the RPM format is laid on disk. |
191 | 191 | */ | |
192 | static rpmRC writeRPM(Package pkg, unsigned char ** pkgidp, | 192 | static rpmRC writeRPM(Package pkg, unsigned char ** pkgidp, |
193 | - const char *fileName, char **cookie) | 193 | - const char *fileName, char **cookie) |
194 | + const char *fileName, char **cookie, | 194 | + const char *fileName, char **cookie, |
@@ -196,7 +196,7 @@ index ed5b9ab4e..62427065a 100644 | |||
196 | { | 196 | { |
197 | FD_t fd = NULL; | 197 | FD_t fd = NULL; |
198 | char * rpmio_flags = NULL; | 198 | char * rpmio_flags = NULL; |
199 | @@ -397,7 +345,7 @@ static rpmRC writeRPM(Package pkg, unsigned char ** pkgidp, | 199 | @@ -500,7 +448,7 @@ static rpmRC writeRPM(Package pkg, unsigned char ** pkgidp, |
200 | 200 | ||
201 | /* Create and add the cookie */ | 201 | /* Create and add the cookie */ |
202 | if (cookie) { | 202 | if (cookie) { |
@@ -204,8 +204,8 @@ index ed5b9ab4e..62427065a 100644 | |||
204 | + rasprintf(cookie, "%s %d", buildHost, buildTime); | 204 | + rasprintf(cookie, "%s %d", buildHost, buildTime); |
205 | headerPutString(pkg->header, RPMTAG_COOKIE, *cookie); | 205 | headerPutString(pkg->header, RPMTAG_COOKIE, *cookie); |
206 | } | 206 | } |
207 | 207 | ||
208 | @@ -546,7 +494,7 @@ static rpmRC checkPackages(char *pkgcheck) | 208 | @@ -641,7 +589,7 @@ static rpmRC checkPackages(char *pkgcheck) |
209 | return RPMRC_OK; | 209 | return RPMRC_OK; |
210 | } | 210 | } |
211 | 211 | ||
@@ -214,7 +214,7 @@ index ed5b9ab4e..62427065a 100644 | |||
214 | { | 214 | { |
215 | const char *errorString; | 215 | const char *errorString; |
216 | rpmRC rc = RPMRC_OK; | 216 | rpmRC rc = RPMRC_OK; |
217 | @@ -565,8 +513,8 @@ static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int ch | 217 | @@ -660,8 +608,8 @@ static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int ch |
218 | headerCopyTags(spec->packages->header, pkg->header, copyTags); | 218 | headerCopyTags(spec->packages->header, pkg->header, copyTags); |
219 | 219 | ||
220 | headerPutString(pkg->header, RPMTAG_RPMVERSION, VERSION); | 220 | headerPutString(pkg->header, RPMTAG_RPMVERSION, VERSION); |
@@ -225,7 +225,7 @@ index ed5b9ab4e..62427065a 100644 | |||
225 | 225 | ||
226 | if (spec->sourcePkgId != NULL) { | 226 | if (spec->sourcePkgId != NULL) { |
227 | headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16); | 227 | headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16); |
228 | @@ -604,7 +552,7 @@ static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int ch | 228 | @@ -699,7 +647,7 @@ static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int ch |
229 | free(binRpm); | 229 | free(binRpm); |
230 | } | 230 | } |
231 | 231 | ||
@@ -234,7 +234,7 @@ index ed5b9ab4e..62427065a 100644 | |||
234 | if (rc == RPMRC_OK) { | 234 | if (rc == RPMRC_OK) { |
235 | /* Do check each written package if enabled */ | 235 | /* Do check each written package if enabled */ |
236 | char *pkgcheck = rpmExpand("%{?_build_pkgcheck} ", *filename, NULL); | 236 | char *pkgcheck = rpmExpand("%{?_build_pkgcheck} ", *filename, NULL); |
237 | @@ -624,7 +572,7 @@ struct binaryPackageTaskData | 237 | @@ -719,7 +667,7 @@ struct binaryPackageTaskData |
238 | struct binaryPackageTaskData *next; | 238 | struct binaryPackageTaskData *next; |
239 | }; | 239 | }; |
240 | 240 | ||
@@ -243,7 +243,7 @@ index ed5b9ab4e..62427065a 100644 | |||
243 | { | 243 | { |
244 | struct binaryPackageTaskData *tasks = NULL; | 244 | struct binaryPackageTaskData *tasks = NULL; |
245 | struct binaryPackageTaskData *task = NULL; | 245 | struct binaryPackageTaskData *task = NULL; |
246 | @@ -636,7 +584,7 @@ static struct binaryPackageTaskData* runBinaryPackageTasks(rpmSpec spec, const c | 246 | @@ -731,7 +679,7 @@ static struct binaryPackageTaskData* runBinaryPackageTasks(rpmSpec spec, const c |
247 | if (pkg == spec->packages) { | 247 | if (pkg == spec->packages) { |
248 | // the first package needs to be processed ahead of others, as they copy | 248 | // the first package needs to be processed ahead of others, as they copy |
249 | // changelog data from it, and so otherwise data races would happen | 249 | // changelog data from it, and so otherwise data races would happen |
@@ -252,7 +252,7 @@ index ed5b9ab4e..62427065a 100644 | |||
252 | rpmlog(RPMLOG_NOTICE, _("Finished binary package job, result %d, filename %s\n"), task->result, task->filename); | 252 | rpmlog(RPMLOG_NOTICE, _("Finished binary package job, result %d, filename %s\n"), task->result, task->filename); |
253 | tasks = task; | 253 | tasks = task; |
254 | } | 254 | } |
255 | @@ -653,7 +601,7 @@ static struct binaryPackageTaskData* runBinaryPackageTasks(rpmSpec spec, const c | 255 | @@ -748,7 +696,7 @@ static struct binaryPackageTaskData* runBinaryPackageTasks(rpmSpec spec, const c |
256 | if (task != tasks) | 256 | if (task != tasks) |
257 | #pragma omp task | 257 | #pragma omp task |
258 | { | 258 | { |
@@ -261,7 +261,7 @@ index ed5b9ab4e..62427065a 100644 | |||
261 | rpmlog(RPMLOG_NOTICE, _("Finished binary package job, result %d, filename %s\n"), task->result, task->filename); | 261 | rpmlog(RPMLOG_NOTICE, _("Finished binary package job, result %d, filename %s\n"), task->result, task->filename); |
262 | } | 262 | } |
263 | } | 263 | } |
264 | @@ -671,11 +619,11 @@ static void freeBinaryPackageTasks(struct binaryPackageTaskData* tasks) | 264 | @@ -766,11 +714,11 @@ static void freeBinaryPackageTasks(struct binaryPackageTaskData* tasks) |
265 | } | 265 | } |
266 | } | 266 | } |
267 | 267 | ||
@@ -275,7 +275,7 @@ index ed5b9ab4e..62427065a 100644 | |||
275 | 275 | ||
276 | for (struct binaryPackageTaskData *task = tasks; task != NULL; task = task->next) { | 276 | for (struct binaryPackageTaskData *task = tasks; task != NULL; task = task->next) { |
277 | if (task->result == RPMRC_OK) { | 277 | if (task->result == RPMRC_OK) { |
278 | @@ -702,22 +650,22 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating) | 278 | @@ -797,7 +745,7 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating) |
279 | return RPMRC_OK; | 279 | return RPMRC_OK; |
280 | } | 280 | } |
281 | 281 | ||
@@ -284,6 +284,7 @@ index ed5b9ab4e..62427065a 100644 | |||
284 | { | 284 | { |
285 | Package sourcePkg = spec->sourcePackage; | 285 | Package sourcePkg = spec->sourcePackage; |
286 | rpmRC rc; | 286 | rpmRC rc; |
287 | @@ -805,8 +753,8 @@ rpmRC packageSources(rpmSpec spec, char **cookie) | ||
287 | 288 | ||
288 | /* Add some cruft */ | 289 | /* Add some cruft */ |
289 | headerPutString(sourcePkg->header, RPMTAG_RPMVERSION, VERSION); | 290 | headerPutString(sourcePkg->header, RPMTAG_RPMVERSION, VERSION); |
@@ -291,9 +292,10 @@ index ed5b9ab4e..62427065a 100644 | |||
291 | - headerPutUint32(sourcePkg->header, RPMTAG_BUILDTIME, getBuildTime(), 1); | 292 | - headerPutUint32(sourcePkg->header, RPMTAG_BUILDTIME, getBuildTime(), 1); |
292 | + headerPutString(sourcePkg->header, RPMTAG_BUILDHOST, buildHost); | 293 | + headerPutString(sourcePkg->header, RPMTAG_BUILDHOST, buildHost); |
293 | + headerPutUint32(sourcePkg->header, RPMTAG_BUILDTIME, &buildTime, 1); | 294 | + headerPutUint32(sourcePkg->header, RPMTAG_BUILDTIME, &buildTime, 1); |
295 | headerPutUint32(sourcePkg->header, RPMTAG_SOURCEPACKAGE, &one, 1); | ||
294 | 296 | ||
295 | /* XXX this should be %_srpmdir */ | 297 | /* XXX this should be %_srpmdir */ |
296 | { char *fn = rpmGetPath("%{_srcrpmdir}/", spec->sourceRpmName,NULL); | 298 | @@ -814,7 +762,7 @@ rpmRC packageSources(rpmSpec spec, char **cookie) |
297 | char *pkgcheck = rpmExpand("%{?_build_pkgcheck_srpm} ", fn, NULL); | 299 | char *pkgcheck = rpmExpand("%{?_build_pkgcheck_srpm} ", fn, NULL); |
298 | 300 | ||
299 | spec->sourcePkgId = NULL; | 301 | spec->sourcePkgId = NULL; |
@@ -303,10 +305,10 @@ index ed5b9ab4e..62427065a 100644 | |||
303 | /* Do check SRPM package if enabled */ | 305 | /* Do check SRPM package if enabled */ |
304 | if (rc == RPMRC_OK && pkgcheck[0] != ' ') { | 306 | if (rc == RPMRC_OK && pkgcheck[0] != ' ') { |
305 | diff --git a/build/rpmbuild_internal.h b/build/rpmbuild_internal.h | 307 | diff --git a/build/rpmbuild_internal.h b/build/rpmbuild_internal.h |
306 | index 8351a6a34..797337ca7 100644 | 308 | index 439b7d3b5..07e8338ad 100644 |
307 | --- a/build/rpmbuild_internal.h | 309 | --- a/build/rpmbuild_internal.h |
308 | +++ b/build/rpmbuild_internal.h | 310 | +++ b/build/rpmbuild_internal.h |
309 | @@ -408,19 +408,23 @@ rpmRC processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags); | 311 | @@ -427,19 +427,23 @@ rpmRC processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags); |
310 | * @param spec spec file control structure | 312 | * @param spec spec file control structure |
311 | * @param cookie build identifier "cookie" or NULL | 313 | * @param cookie build identifier "cookie" or NULL |
312 | * @param cheating was build shortcircuited? | 314 | * @param cheating was build shortcircuited? |
@@ -333,5 +335,5 @@ index 8351a6a34..797337ca7 100644 | |||
333 | RPM_GNUC_INTERNAL | 335 | RPM_GNUC_INTERNAL |
334 | int addLangTag(rpmSpec spec, Header h, rpmTagVal tag, | 336 | int addLangTag(rpmSpec spec, Header h, rpmTagVal tag, |
335 | -- | 337 | -- |
336 | 2.11.0 | 338 | 2.14.2 |
337 | 339 | ||