From 82285fa5c12d36080d4d7bb625ccdfa88012d9e2 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Jun 11 2019 11:45:21 +0000 Subject: Copy changelog in one thread at a time Signed-off-by: Igor Gnatenko --- diff --git a/rpm.spec b/rpm.spec index bb7a4a5..8a6c0c2 100644 --- a/rpm.spec +++ b/rpm.spec @@ -52,6 +52,7 @@ Patch6: 0001-find-debuginfo.sh-decompress-DWARF-compressed-ELF-se.patch # https://github.com/rpm-software-management/rpm/issues/742 #Patch7: 0001-Revert-Run-binary-package-generation-in-parallel-thr.patch Patch7: 0001-Only-permit-one-thread-at-a-time-in-addFileToTag.patch +Patch8: test.diff # Patches already upstream: diff --git a/test.diff b/test.diff index 48746df..137546e 100644 --- a/test.diff +++ b/test.diff @@ -1,47 +1,12 @@ diff --git a/build/pack.c b/build/pack.c -index 447e3ec94..21f22d5ca 100644 +index ab72750be..e6cec1816 100644 --- a/build/pack.c +++ b/build/pack.c -@@ -742,25 +742,28 @@ static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int ch - rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating) - { - rpmRC rc = RPMRC_OK; -- Package pkg; - - /* Run binary creation in parallel */ - #pragma omp parallel -- #pragma omp single -- for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { -- #pragma omp task -+ { -+ #pragma omp single - { -- pkg->rc = packageBinary(spec, pkg, cookie, cheating, &pkg->filename); -- rpmlog(RPMLOG_DEBUG, -- _("Finished binary package job, result %d, filename %s\n"), -- pkg->rc, pkg->filename); -- if (pkg->rc) { -- #pragma omp critical -- rc = pkg->rc; -+ for (Package pkg = spec->packages; pkg != NULL; pkg = pkg->next) { -+ #pragma omp task -+ { -+ pkg->rc = packageBinary(spec, pkg, cookie, cheating, &pkg->filename); -+ rpmlog(RPMLOG_DEBUG, -+ _("Finished binary package job, result %d, filename %s\n"), -+ pkg->rc, pkg->filename); -+ if (pkg->rc) { -+ #pragma omp critical -+ rc = pkg->rc; -+ } -+ } /* omp task */ -+ if (rc) -+ break; -+ } - } -- } /* omp task */ -- if (rc) -- break; +@@ -713,6 +713,7 @@ static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int ch } - /* Now check the package set if enabled */ + /* Copy changelog from src rpm */ ++ #pragma omp critical + headerCopyTags(spec->sourcePackage->header, pkg->header, copyTags); + + headerPutString(pkg->header, RPMTAG_RPMVERSION, VERSION);