diff --git a/0001-Add-option-to-set-mtime-of-files-in-rpms.patch b/0001-Add-option-to-set-mtime-of-files-in-rpms.patch deleted file mode 100644 index 4214f3f..0000000 --- a/0001-Add-option-to-set-mtime-of-files-in-rpms.patch +++ /dev/null @@ -1,122 +0,0 @@ -From fc04a1bde1941d2c61a9e33e55c5c492327674ba Mon Sep 17 00:00:00 2001 -From: Jan Zerebecki -Date: Thu, 15 Feb 2024 09:57:35 +0100 -Subject: [PATCH 1/3] Add option to set mtime of files in rpms - -to SOURCE_DATE_EPOCH. - -For backwards compatibility the option clamp / limit the maximum mtime -is retained. - -Setting it ouright avoids problems with an incorrectly older clock. It -also avoids problems with build scrips that incorrectly change file -mtimes when SOURCE_DATE_EPOCH_MTIME is in use. - -mtimes are required to increase with new versions and releases -of an rpm with the same name, as rsync without --checksum and similar -tools would get confused if the content changes without newer mtime. - -If SOURCE_DATE_EPOCH_MTIME is set use it instead for file modification time -stamps. It is supposed to be newer. This can be used if we might want to -compare if the file content remains the same when a build dependency -changes while a build script embeds SOURCE_DATE_EPOCH in the file -content. - -This can be used to support automatic rebuilds. Normally automatic -rebuilds work, but together with reproducible builds an undesirable -situation may occur. If a build e.g. embeds SOURCE_DATE_EPOCH in the -output, then the output changes every time such a rebuild happens, which -can be very often. This is to be avoided as updating packages without -necessity is too expensive. ---- - build/files.c | 33 ++++++++++++++++++++++++++++----- - docs/manual/buildprocess.md | 5 +++-- - 2 files changed, 31 insertions(+), 7 deletions(-) - -diff --git a/build/files.c b/build/files.c -index c403c806e..cec7999ca 100644 ---- a/build/files.c -+++ b/build/files.c -@@ -1033,14 +1033,34 @@ static void genCpioListAndHeader(FileList fl, Package pkg, int isSrc) - rpm_loff_t totalFileSize = 0; - Header h = pkg->header; /* just a shortcut */ - int override_date = 0; -+ int set_mtime = 0; - time_t source_date_epoch = 0; - char *srcdate = getenv("SOURCE_DATE_EPOCH"); -+ char *msrcdate = getenv("SOURCE_DATE_EPOCH_MTIME"); - -- /* Limit the maximum date to SOURCE_DATE_EPOCH if defined -- * similar to the tar --clamp-mtime option -+ /* If SOURCE_DATE_EPOCH_MTIME is set use it for file modification time -+ * stamps, it is supposed to be newer. This can be used if we might want to -+ * compare if the file content remains the same when a build dependency -+ * changes while a build script embeds SOURCE_DATE_EPOCH in the file -+ * content. mtimes are required to increase with new versions and releases -+ * of an rpm with the same name, as rsync without --checksum and similar -+ * tools would get confused if the content changes without newer mtime. */ -+ if (msrcdate != NULL) { -+ srcdate = msrcdate; -+ } -+ -+ /* Set the file mtime to SOURCE_DATE_EPOCH it if requested to make the -+ * resulting rpm reproducible. - * https://reproducible-builds.org/specs/source-date-epoch/ -+ * -+ * For backwards compatibility clamp / limit the maximum mtime if requested -+ * similar the tar --clamp-mtime option. Setting it ouright avoids problems -+ * with an incorrectly older clock. It also avoids problems with build -+ * scrips that incorrectly change file mtimes when SOURCE_DATE_EPOCH_MTIME -+ * is in use. - */ -- if (srcdate && rpmExpandNumeric("%{?clamp_mtime_to_source_date_epoch}")) { -+ if (srcdate && (rpmExpandNumeric("%{?clamp_mtime_to_source_date_epoch}") -+ || rpmExpandNumeric("%{?set_mtime_to_source_date_epoch}"))) { - char *endptr; - errno = 0; - source_date_epoch = strtol(srcdate, &endptr, 10); -@@ -1049,6 +1069,9 @@ static void genCpioListAndHeader(FileList fl, Package pkg, int isSrc) - fl->processingFailed = 1; - } - override_date = 1; -+ if (rpmExpandNumeric("%{?set_mtime_to_source_date_epoch}")) { -+ set_mtime = 1; -+ } - } - - /* -@@ -1191,8 +1214,8 @@ static void genCpioListAndHeader(FileList fl, Package pkg, int isSrc) - totalFileSize += flp->fl_size; - } - } -- -- if (override_date && flp->fl_mtime > source_date_epoch) { -+ -+ if (override_date && (flp->fl_mtime > source_date_epoch || set_mtime)) { - flp->fl_mtime = source_date_epoch; - } - /* -diff --git a/docs/manual/buildprocess.md b/docs/manual/buildprocess.md -index 1ceb47a7e..64cd35626 100644 ---- a/docs/manual/buildprocess.md -+++ b/docs/manual/buildprocess.md -@@ -94,13 +94,14 @@ Macro name | Description - `%_build_pkgcheck` | Progam to run on each generated binary package - `%_build_pkcheck_set` | Program to run on the generated binary package set - --### Reproducability -+### Reproducibility - - Macro name | Description - --------------------------------------|----------- - `%source_date_epoch_from_changelog` | Set `SOURCE_DATE_EPOCH` from latest `%changelog` entry - `%use_source_date_epoch_as_buildtime` | Set package BuildTime to `SOURCE_DATE_EPOCH` --`%clamp_mtime_to_source_date_epoch` | Ensure file timestamps are not newer than `SOURCE_DATE_EPOCH` -+`%set_mtime_to_source_date_epoch` | Set file modification timestamps to `SOURCE_DATE_EPOCH_MTIME` or as fallback to `SOURCE_DATE_EPOCH` -+`%clamp_mtime_to_source_date_epoch` | You should use the above instead, it is for backwards compatibility only. Ensure file timestamps are not newer than `SOURCE_DATE_EPOCH` - - ### Vendor defaults - --- -2.30.2 - diff --git a/0002-log-build-time-if-it-is-set-from-SOURCE_DATE_EPOCH.patch b/0002-log-build-time-if-it-is-set-from-SOURCE_DATE_EPOCH.patch index 4d40865..f3c173e 100644 --- a/0002-log-build-time-if-it-is-set-from-SOURCE_DATE_EPOCH.patch +++ b/0002-log-build-time-if-it-is-set-from-SOURCE_DATE_EPOCH.patch @@ -1,17 +1,6 @@ -From e0a8b84f68993fccbe70c4fb1cd8402fa7371147 Mon Sep 17 00:00:00 2001 -From: Jan Zerebecki -Date: Thu, 15 Feb 2024 07:58:44 +0100 -Subject: [PATCH 2/3] log build time if it is set from SOURCE_DATE_EPOCH - ---- - build/build.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/build/build.c b/build/build.c -index f2cf98c8b..2693d80b3 100644 ---- a/build/build.c -+++ b/build/build.c -@@ -35,8 +35,11 @@ static rpm_time_t getBuildTime(void) +--- build/build.c.orig 2024-12-16 09:50:41.468083747 +0000 ++++ build/build.c 2024-12-16 09:50:48.428069376 +0000 +@@ -45,8 +45,11 @@ static rpm_time_t getBuildTime(void) epoch = strtol(srcdate, &endptr, 10); if (srcdate == endptr || *endptr || errno != 0) rpmlog(RPMLOG_ERR, _("unable to parse SOURCE_DATE_EPOCH\n")); @@ -23,7 +12,4 @@ index f2cf98c8b..2693d80b3 100644 + } } else buildTime = (uint32_t) time(NULL); - --- -2.30.2 - + free(btMacro); diff --git a/0003-Error-out-on-a-missing-changelog-date.patch b/0003-Error-out-on-a-missing-changelog-date.patch index 37f9273..21838e6 100644 --- a/0003-Error-out-on-a-missing-changelog-date.patch +++ b/0003-Error-out-on-a-missing-changelog-date.patch @@ -1,30 +1,14 @@ -From 973f94bafea8e641ed747d3c420ea1bc2e1cb37f Mon Sep 17 00:00:00 2001 -From: Jan Zerebecki -Date: Thu, 15 Feb 2024 08:03:05 +0100 -Subject: [PATCH 3/3] Error out on a missing changelog date - -if it is needed as the source for SOURCE_DATE_EPOCH, instead of only -logging a warning. ---- - build/build.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/build/build.c b/build/build.c -index 2693d80b3..ce7bc8b88 100644 ---- a/build/build.c -+++ b/build/build.c -@@ -344,8 +344,10 @@ static rpmRC buildSpec(rpmts ts, BTA_t buildArgs, rpmSpec spec, int what) +--- build/build.c.orig 2024-10-07 09:35:46.000000000 +0000 ++++ build/build.c 2024-12-16 09:50:14.728138966 +0000 +@@ -385,8 +385,10 @@ static int buildSpec(rpmts ts, BTA_t bui setenv("SOURCE_DATE_EPOCH", sdestr, 0); rpmtdFreeData(&td); } else { -- rpmlog(RPMLOG_WARNING, _("source_date_epoch_from_changelog set but " -+ rpmlog(RPMLOG_ERR, _("source_date_epoch_from_changelog set but " - "%%changelog is missing\n")); +- rpmlog(RPMLOG_WARNING, _("%%source_date_epoch_from_changelog is set, but " ++ rpmlog(RPMLOG_ERR, _("%%source_date_epoch_from_changelog is set, but " + "%%changelog has no entries to take a date from\n")); + rc = RPMRC_FAIL; + goto exit; } } --- -2.30.2 - diff --git a/archcheck.diff b/archcheck.diff new file mode 100644 index 0000000..912f2e1 --- /dev/null +++ b/archcheck.diff @@ -0,0 +1,28 @@ +--- build/parsePreamble.c.orig 2025-04-25 09:33:36.850778834 +0000 ++++ build/parsePreamble.c 2025-04-25 09:33:51.002755713 +0000 +@@ -1332,6 +1332,11 @@ int parsePreamble(rpmSpec spec, int init + "%{dirname:%{buildroot}}", RMIL_GLOBAL, 0); + } + ++ /* XXX Skip valid arch check if not building binary package */ ++ if (!(spec->flags & RPMSPEC_ANYARCH) && checkForValidArchitectures(spec)) { ++ goto exit; ++ } ++ + /* if we get down here nextPart has been set to non-error */ + res = nextPart; + +--- build/parseSpec.c.orig 2025-04-25 09:34:05.770731591 +0000 ++++ build/parseSpec.c 2025-04-25 09:34:20.242707943 +0000 +@@ -1355,11 +1355,6 @@ static rpmRC finalizeSpec(rpmSpec spec) + char *os = rpmExpand("%{_target_os}", NULL); + char *optflags = rpmExpand("%{optflags}", NULL); + +- /* XXX Skip valid arch check if not building binary package */ +- if (!(spec->flags & RPMSPEC_ANYARCH) && checkForValidArchitectures(spec)) { +- goto exit; +- } +- + fillOutMainPackage(spec->packages->header); + /* Define group tag to something when group is undefined in main package*/ + if (!headerIsEntry(spec->packages->header, RPMTAG_GROUP)) { diff --git a/assumeexec.diff b/assumeexec.diff index dd05d64..2853817 100644 --- a/assumeexec.diff +++ b/assumeexec.diff @@ -1,14 +1,14 @@ ---- tools/elfdeps.c.orig 2014-06-26 06:51:55.768815677 +0000 -+++ tools/elfdeps.c 2014-08-04 13:02:16.981081591 +0000 -@@ -17,6 +17,7 @@ int soname_only = 0; - int fake_soname = 1; +--- tools/elfdeps.c.orig 2024-10-07 09:35:46.000000000 +0000 ++++ tools/elfdeps.c 2024-12-16 09:25:13.479234184 +0000 +@@ -17,6 +17,7 @@ int fake_soname = 1; int filter_soname = 1; int require_interp = 0; + int multifile = 0; +int assume_exec = 0; typedef struct elfInfo_s { Elf *elf; -@@ -299,7 +300,7 @@ static int processFile(const char *fn, i +@@ -302,7 +303,7 @@ static int processFile(const char *fn, i if (ehdr->e_type == ET_DYN || ehdr->e_type == ET_EXEC) { ei->marker = mkmarker(ehdr); ei->isDSO = (ehdr->e_type == ET_DYN); @@ -17,10 +17,10 @@ processProgHeaders(ei, ehdr); processSections(ei); -@@ -364,6 +365,7 @@ int main(int argc, char *argv[]) - { "no-fake-soname", 0, POPT_ARG_VAL, &fake_soname, 0, NULL, NULL }, +@@ -372,6 +373,7 @@ int main(int argc, char *argv[]) { "no-filter-soname", 0, POPT_ARG_VAL, &filter_soname, 0, NULL, NULL }, { "require-interp", 0, POPT_ARG_VAL, &require_interp, -1, NULL, NULL }, + { "multifile", 'm', POPT_ARG_VAL, &multifile, -1, NULL, NULL }, + { "assume-exec", 0, POPT_ARG_VAL, &assume_exec, -1, NULL, NULL }, POPT_AUTOHELP POPT_TABLEEND diff --git a/auto-config-update-aarch64-ppc64le.diff b/auto-config-update-aarch64-ppc64le.diff index 6ea5f7f..1c098a2 100644 --- a/auto-config-update-aarch64-ppc64le.diff +++ b/auto-config-update-aarch64-ppc64le.diff @@ -1,36 +1,31 @@ -Index: build/parseSpec.c -=================================================================== ---- build/parseSpec.c.orig -+++ build/parseSpec.c -@@ -942,7 +942,30 @@ static rpmSpec parseSpec(const char *spe - &(spec->buildrequires)); - break; - case PART_BUILD: -- parsePart = parseSimpleScript(spec, "%build", &(spec->build)); -+ if (spec->build) { -+ rpmlog(RPMLOG_ERR, _("line %d: second %s\n"), spec->lineNum, "%build"); -+ parsePart = PART_ERROR; -+ break; -+ } -+ spec->build = newStringBuf(); -+ appendLineStringBuf(spec->build, -+ "ref=/usr/lib/rpm\n" -+ "mints=0\n" -+ "case $(uname -m) in\n" -+ " aarch64) mints=20120610;;\n" -+ " ppc64le) mints=20130610;;\n" -+ " riscv64) mints=20160911;;\n" -+ "esac\n" -+ "for s in guess sub; do\n" -+ " for c in $(find -maxdepth 8 -name \"config.$s\"); do\n" -+ " grep -q config-patches@ $c || continue\n" -+ " timestamp=$(sed -n \"/^timestamp=/{s///;s/[-'\\\"]//g;p;q;}\" $c)\n" -+ " test -n \"$timestamp\" || timestamp=0\n" -+ " test $timestamp -ge $mints || install -m 755 $ref/config.$s $c\n" -+ " done\n" -+ "done\n" -+ ); -+ parsePart = parseLines(spec, STRIP_NOTHING, NULL, &(spec->build)); - break; - case PART_INSTALL: - parsePart = parseSimpleScript(spec, "%install", &(spec->install)); +--- build/parseSimpleScript.c.orig 2024-12-16 09:59:01.199053527 +0000 ++++ build/parseSimpleScript.c 2024-12-16 10:08:22.389914963 +0000 +@@ -59,6 +59,28 @@ int parseSimpleScript(rpmSpec spec, cons + target = &buf; + } + ++ if (!mode && !*target && !strcmp(name, "build")) { ++ *target = newStringBuf(); ++ appendLineStringBuf(*target, ++ "ref=/usr/lib/rpm\n" ++ "mints=0\n" ++ "case $(uname -m) in\n" ++ " aarch64) mints=20120610;;\n" ++ " ppc64le) mints=20130610;;\n" ++ " riscv64) mints=20160911;;\n" ++ " loongarch64) mints=20201222;;\n" ++ "esac\n" ++ "for s in guess sub; do\n" ++ " for c in $(find -maxdepth 8 -name \"config.$s\"); do\n" ++ " grep -q config-patches@ $c || continue\n" ++ " timestamp=$(sed -n \"/^timestamp=/{s///;s/[-'\\\"]//g;p;q;}\" $c)\n" ++ " test -n \"$timestamp\" || timestamp=0\n" ++ " test $timestamp -ge $mints || install -m 755 $ref/config.$s $c\n" ++ " done\n" ++ "done\n" ++ ); ++ } ++ + res = parseLines(spec, STRIP_NOTHING, NULL, target); + + if (buf) { diff --git a/brp.diff b/brp.diff index 5774181..f331d4a 100644 --- a/brp.diff +++ b/brp.diff @@ -1,5 +1,5 @@ ---- scripts/brp-strip-comment-note.orig 2023-09-19 10:10:10.000000000 +0000 -+++ scripts/brp-strip-comment-note 2023-10-09 12:22:27.504732553 +0000 +--- scripts/brp-strip-comment-note.orig 2024-10-07 09:35:46.000000000 +0000 ++++ scripts/brp-strip-comment-note 2024-12-16 09:15:41.572425334 +0000 @@ -15,7 +15,7 @@ esac # Strip .comment and .note sections (the latter only if it is not allocated) @@ -9,10 +9,10 @@ note="-R .note" if $OBJDUMP -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \ grep ALLOC >/dev/null; then ---- scripts/brp-strip.orig 2023-09-19 10:10:10.000000000 +0000 -+++ scripts/brp-strip 2023-10-09 12:24:36.920521652 +0000 -@@ -35,6 +35,7 @@ strip_elf_binaries() - ! -regex "${RPM_BUILD_ROOT}/*usr/lib/debug.*" \ +--- scripts/brp-strip.orig 2024-10-07 09:35:46.000000000 +0000 ++++ scripts/brp-strip 2024-12-16 09:15:41.572425334 +0000 +@@ -37,6 +37,7 @@ strip_elf_binaries() + ! -name "*.py" ! -name "*.js" ! -name "*.rb" \ ! -name "*.go" -links "${nlinks}" -print0 | \ xargs -0 -r -P${nprocs} -n${MAX_ARGS} sh -c "file \"\$@\" | \ + grep -v ' shared object,' | grep -v '/lib/modules/ | \ diff --git a/build-aux.tar.bz2 b/build-aux.tar.bz2 index 60c0356..70ed79a 100644 --- a/build-aux.tar.bz2 +++ b/build-aux.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:69ead89491a66ae6c1a960977b7cc567e56f74d535a022fc193334d78be838f1 -size 21222 +oid sha256:85df6005b9b78efe6bbe3341b3d260915aab3b5660d33886aa7e4b2c540f68e9 +size 24182 diff --git a/buildroot-symlink.diff b/buildroot-symlink.diff new file mode 100644 index 0000000..fe6c4f1 --- /dev/null +++ b/buildroot-symlink.diff @@ -0,0 +1,10 @@ +--- scripts/check-files.orig 2024-12-17 09:47:18.016502845 +0000 ++++ scripts/check-files 2024-12-17 09:50:09.872159687 +0000 +@@ -27,6 +27,6 @@ trap "rm -f \"${FILES_DISK}\"" 0 2 3 5 1 + + # Find non-directory files in the build root and compare to the manifest. + # TODO: regex chars in last sed(1) expression should be escaped +-find "${RPM_BUILD_ROOT}" -type f -o -type l | LC_ALL=C sort > "${FILES_DISK}" ++find -H "${RPM_BUILD_ROOT}" -type f -o -type l | LC_ALL=C sort > "${FILES_DISK}" + LC_ALL=C sort | diff -d "${FILES_DISK}" - | sed -n -e 's!^\(-\|< \)'"${RPM_BUILD_ROOT}"'/usr/share/info/dir$!!' -e 's!^\(-\|< \)'"${RPM_BUILD_ROOT}"'\(.*\)$! \2!gp' + diff --git a/buildsysprep.diff b/buildsysprep.diff new file mode 100644 index 0000000..73af829 --- /dev/null +++ b/buildsysprep.diff @@ -0,0 +1,33 @@ +--- build/parseSpec.c.orig 2025-04-25 09:58:26.712300888 +0000 ++++ build/parseSpec.c 2025-04-25 09:58:54.224255916 +0000 +@@ -987,7 +987,7 @@ int checkBuildsystem(rpmSpec spec, const + } + + static rpmRC parseBuildsysSect(rpmSpec spec, const char *prefix, +- struct sectname_s *sc, FD_t fd) ++ struct sectname_s *sc, FD_t fd, int *foundp) + { + rpmRC rc = RPMRC_OK; + +@@ -1015,6 +1015,7 @@ static rpmRC parseBuildsysSect(rpmSpec s + } + free(buf); + free(args); ++ *foundp = 1; + } + free(mn); + } +@@ -1038,9 +1039,10 @@ static rpmRC parseBuildsystem(rpmSpec sp + } + + for (struct sectname_s *sc = sectList; !rc && sc->name; sc++) { +- rc = parseBuildsysSect(spec, buildsystem, sc, fd); +- if (!rc && spec->sections[sc->section] == NULL) +- rc = parseBuildsysSect(spec, "default", sc, fd); ++ int found = 0; ++ rc = parseBuildsysSect(spec, buildsystem, sc, fd, &found); ++ if (!rc && !found) ++ rc = parseBuildsysSect(spec, "default", sc, fd, &found); + } + + if (!rc) diff --git a/canongnu.diff b/canongnu.diff index cd8e81d..3e24a18 100644 --- a/canongnu.diff +++ b/canongnu.diff @@ -1,6 +1,6 @@ ---- CMakeLists.txt.orig 2024-02-07 09:57:31.944781372 +0000 -+++ CMakeLists.txt 2024-02-07 09:57:51.924739495 +0000 -@@ -138,14 +138,26 @@ function(makemacros) +--- CMakeLists.txt.orig 2024-10-07 09:35:46.000000000 +0000 ++++ CMakeLists.txt 2024-12-16 09:42:51.221054406 +0000 +@@ -153,14 +153,26 @@ function(makemacros) list(GET db_backends 0 DB_BACKEND) @@ -28,5 +28,5 @@ + set(RPMCANONGNU -gnu) + endif() - if (ENABLE_CUTF8) - set(C_LOCALE "C.UTF-8") + configure_file(platform.in platform @ONLY) + configure_file(rpmrc.in rpmrc @ONLY) diff --git a/cmake_fhardened.diff b/cmake_fhardened.diff new file mode 100644 index 0000000..9c1e1d6 --- /dev/null +++ b/cmake_fhardened.diff @@ -0,0 +1,11 @@ +--- CMakeLists.txt.orig 2025-03-26 13:46:52.439473029 +0000 ++++ CMakeLists.txt 2025-03-26 13:47:07.991447862 +0000 +@@ -436,7 +436,7 @@ foreach (flag -fno-strict-overflow -fno- + if (found) + add_compile_options(${flag}) + endif() +- unset(found) ++ unset(found CACHE) + endforeach() + + # generated sources diff --git a/cmake_python_version.diff b/cmake_python_version.diff index 70177d3..b4f9f7f 100644 --- a/cmake_python_version.diff +++ b/cmake_python_version.diff @@ -1,14 +1,14 @@ ---- CMakeLists.txt.orig 2024-02-01 13:24:18.665660569 +0000 -+++ CMakeLists.txt 2024-02-01 13:25:07.917586376 +0000 -@@ -238,7 +238,11 @@ endif() +--- CMakeLists.txt.orig 2024-12-16 09:43:16.909001370 +0000 ++++ CMakeLists.txt 2024-12-16 09:45:05.892776434 +0000 +@@ -277,7 +277,11 @@ endif() list(APPEND db_backends dummy) if (ENABLE_PYTHON) -- find_package(Python3 3.2 COMPONENTS Interpreter Development REQUIRED) +- find_package(Python3 3.7 COMPONENTS Interpreter Development REQUIRED) + if (WITH_PYTHON_VERSION) -+ find_package(Python3 ${WITH_PYTHON_VERSION} EXACT COMPONENTS Interpreter Development REQUIRED) ++ find_package(Python3 ${WITH_PYTHON_VERSION} EXACT COMPONENTS Interpreter Development REQUIRED) + else() -+ find_package(Python3 3.2 COMPONENTS Interpreter Development REQUIRED) ++ find_package(Python3 3.7 COMPONENTS Interpreter Development REQUIRED) + endif() endif() diff --git a/db_conversion.diff b/db_conversion.diff index 842ce7c..1eeab15 100644 --- a/db_conversion.diff +++ b/db_conversion.diff @@ -1,5 +1,5 @@ ---- lib/backend/bdb_ro.c.orig 2022-04-07 11:13:18.994517848 +0000 -+++ lib/backend/bdb_ro.c 2022-12-02 13:22:16.726408071 +0000 +--- lib/backend/bdb_ro.c.orig 2024-10-07 09:35:46.000000000 +0000 ++++ lib/backend/bdb_ro.c 2024-12-16 09:28:13.146864067 +0000 @@ -793,6 +793,7 @@ static unsigned int bdbro_pkgdbKey(dbiIn struct rpmdbOps_s bdbro_dbops = { .name = "bdb_ro", @@ -8,8 +8,8 @@ .open = bdbro_Open, .close = bdbro_Close, ---- lib/backend/dbi.c.orig 2022-04-07 11:13:18.994517848 +0000 -+++ lib/backend/dbi.c 2022-12-02 13:22:16.726408071 +0000 +--- lib/backend/dbi.c.orig 2024-10-07 09:35:46.000000000 +0000 ++++ lib/backend/dbi.c 2024-12-16 09:28:13.150864059 +0000 @@ -138,11 +138,20 @@ exit: } @@ -31,8 +31,8 @@ const char * dbiName(dbiIndex dbi) { return dbi->dbi_file; ---- lib/backend/dbi.h.orig 2022-04-07 11:13:18.994517848 +0000 -+++ lib/backend/dbi.h 2022-12-02 13:22:16.726408071 +0000 +--- lib/backend/dbi.h.orig 2024-10-07 09:35:46.000000000 +0000 ++++ lib/backend/dbi.h 2024-12-16 09:28:13.150864059 +0000 @@ -13,6 +13,7 @@ enum rpmdbFlags { RPMDB_FLAG_REBUILD = (1 << 1), RPMDB_FLAG_VERIFYONLY = (1 << 2), @@ -41,7 +41,7 @@ }; typedef enum dbCtrlOp_e { -@@ -53,6 +54,7 @@ struct rpmdb_s { +@@ -54,6 +55,7 @@ struct rpmdb_s { int db_buildindex; /*!< Index rebuild indicator */ const struct rpmdbOps_s * db_ops; /*!< backend ops */ @@ -49,7 +49,7 @@ /* dbenv and related parameters */ void * db_dbenv; /*!< Backend private handle */ -@@ -197,6 +199,14 @@ RPM_GNUC_INTERNAL +@@ -194,6 +196,14 @@ RPM_GNUC_INTERNAL const char * dbiName(dbiIndex dbi); /** \ingroup dbi @@ -64,7 +64,7 @@ * Open a database cursor. * @param dbi index database handle * @param flags DBC_WRITE if writing, or 0 (DBC_READ) for reading -@@ -240,6 +250,7 @@ const void * idxdbKey(dbiIndex dbi, dbiC +@@ -237,6 +247,7 @@ const void * idxdbKey(dbiIndex dbi, dbiC struct rpmdbOps_s { const char *name; /* backend name */ const char *path; /* main database name */ @@ -72,9 +72,9 @@ int (*open)(rpmdb rdb, rpmDbiTagVal rpmtag, dbiIndex * dbip, int flags); int (*close)(dbiIndex dbi, unsigned int flags); ---- lib/backend/ndb/rpmpkg.c.orig 2022-04-07 11:13:18.997517869 +0000 -+++ lib/backend/ndb/rpmpkg.c 2022-12-02 13:22:16.726408071 +0000 -@@ -1116,11 +1116,12 @@ static int rpmpkgPutInternal(rpmpkgdb pk +--- lib/backend/ndb/rpmpkg.c.orig 2024-10-07 09:35:46.000000000 +0000 ++++ lib/backend/ndb/rpmpkg.c 2024-12-16 09:28:13.150864059 +0000 +@@ -1111,11 +1111,12 @@ static int rpmpkgPutInternal(rpmpkgdb pk if (rpmpkgWriteBlob(pkgdb, pkgidx, blkoff, blkcnt, blob, blobl, pkgdb->generation)) { return RPMRC_FAIL; } @@ -90,9 +90,9 @@ if (rpmpkgWriteslot(pkgdb, slotno, pkgidx, blkoff, blkcnt)) { free(pkgdb->slots); pkgdb->slots = 0; ---- lib/rpmdb.c.orig 2022-09-20 12:08:27.197920294 +0000 -+++ lib/rpmdb.c 2022-12-02 13:24:02.830159868 +0000 -@@ -469,7 +469,12 @@ static int openDatabase(const char * pre +--- lib/rpmdb.c.orig 2024-10-07 09:35:46.000000000 +0000 ++++ lib/rpmdb.c 2024-12-16 09:29:39.686685792 +0000 +@@ -466,7 +466,12 @@ static int openDatabase(const char * pre /* Open just bare minimum when rebuilding a potentially damaged db */ int justPkgs = (db->db_flags & RPMDB_FLAG_REBUILD) && ((db->db_mode & O_ACCMODE) == O_RDONLY); @@ -106,7 +106,7 @@ if (!db->db_descr) db->db_descr = "unknown db"; -@@ -2228,6 +2233,15 @@ int rpmdbAdd(rpmdb db, Header h) +@@ -2209,6 +2214,15 @@ int rpmdbAdd(rpmdb db, Header h) if (db == NULL) return 0; @@ -119,10 +119,10 @@ + } + } + - hdrBlob = headerExport(h, &hdrLen); + hdrBlob = (uint8_t *)headerExport(h, &hdrLen); if (hdrBlob == NULL || hdrLen == 0) { ret = -1; -@@ -2423,7 +2437,22 @@ int rpmdbRebuild(const char * prefix, rp +@@ -2404,7 +2418,22 @@ int rpmdbRebuild(const char * prefix, rp } rootdbpath = rpmGetPath(prefix, dbpath, NULL); @@ -146,7 +146,7 @@ if (rstreq(newdbpath, "") || rstreq(newdbpath, dbpath)) { newdbpath = _free(newdbpath); rasprintf(&newdbpath, "%srebuilddb.%d", dbpath, (int) getpid()); -@@ -2449,7 +2478,9 @@ int rpmdbRebuild(const char * prefix, rp +@@ -2430,7 +2459,9 @@ int rpmdbRebuild(const char * prefix, rp goto exit; } if (openDatabase(prefix, newdbpath, &newdb, @@ -157,9 +157,9 @@ rc = 1; goto exit; } ---- lib/rpmdb_internal.h.orig 2022-04-07 11:13:19.014517984 +0000 -+++ lib/rpmdb_internal.h 2022-12-02 13:22:16.726408071 +0000 -@@ -25,6 +25,7 @@ extern "C" { +--- lib/rpmdb_internal.h.orig 2024-10-07 09:35:46.000000000 +0000 ++++ lib/rpmdb_internal.h 2024-12-16 09:28:13.150864059 +0000 +@@ -18,6 +18,7 @@ enum rpmdbRebuildFlags_e { RPMDB_REBUILD_FLAG_SALVAGE = (1 << 0), diff --git a/emptypw.diff b/emptypw.diff new file mode 100644 index 0000000..41b5213 --- /dev/null +++ b/emptypw.diff @@ -0,0 +1,34 @@ +--- lib/rpmug.c.orig 2025-04-25 09:48:27.153273090 +0000 ++++ lib/rpmug.c 2025-04-25 09:50:00.113122450 +0000 +@@ -1,6 +1,7 @@ + #include "system.h" + + #include ++#include + #include + #include + #include +@@ -62,12 +63,11 @@ static int lookup_field(const char *path + while ((str = fgets(buf, sizeof(buf), f)) != NULL) { + int nf = vcol > rcol ? vcol : rcol; + const char *fields[nf + 1]; +- char *tok, *save = NULL; + int col = -1; + +- while ((tok = strtok_r(str, ":", &save)) != NULL) { +- fields[++col] = tok; +- str = NULL; ++ ARGV_t tokens = argvSplitString(str, ":", ARGV_NONE); ++ for (ARGV_const_t tok = tokens; tok && *tok; tok++) { ++ fields[++col] = *tok; + if (col >= nf) + break; + } +@@ -78,6 +78,7 @@ static int lookup_field(const char *path + rc = 0; + } + } ++ argvFree(tokens); + } + + fclose(f); diff --git a/enable-postin-scripts-error.diff b/enable-postin-scripts-error.diff index 81cefd7..ee58023 100644 --- a/enable-postin-scripts-error.diff +++ b/enable-postin-scripts-error.diff @@ -1,6 +1,6 @@ ---- lib/rpmscript.c.orig 2023-09-19 10:10:10.000000000 +0000 -+++ lib/rpmscript.c 2023-10-09 13:10:38.011654503 +0000 -@@ -463,7 +463,7 @@ rpmRC rpmScriptRun(rpmScript script, int +--- lib/rpmscript.c.orig 2024-10-07 09:35:46.000000000 +0000 ++++ lib/rpmscript.c 2024-12-16 09:26:15.035107390 +0000 +@@ -462,7 +462,7 @@ rpmRC rpmScriptRun(rpmScript script, int if (script == NULL) return RPMRC_OK; ARGV_t args = NULL; @@ -9,7 +9,7 @@ RPMLOG_ERR : RPMLOG_WARNING; rpmRC rc; int script_type = RPMSCRIPTLET_FORK | RPMSCRIPTLET_EXEC; -@@ -723,5 +723,8 @@ rpmscriptTypes rpmScriptType(rpmScript s +@@ -724,5 +724,8 @@ rpmscriptTypes rpmScriptType(rpmScript s rpmscriptFlags rpmScriptFlags(rpmScript script) { @@ -19,11 +19,11 @@ + flags |= RPMSCRIPT_FLAG_CRITICAL; + return flags; } ---- macros.in.orig 2023-10-09 13:10:35.043659922 +0000 -+++ macros.in 2023-10-09 13:10:38.015654495 +0000 -@@ -1377,5 +1377,10 @@ end - end - } +--- macros.in.orig 2024-12-16 09:26:03.635130873 +0000 ++++ macros.in 2024-12-16 09:26:15.035107390 +0000 +@@ -1390,6 +1390,11 @@ end + # Global buildsystem defaults + %buildsystem_default_prep() %autosetup -C -p1 %* +# Should errors in %post scriptlet be propagated as errors? +# @@ -32,3 +32,4 @@ + # \endverbatim #*/ + diff --git a/fileattrs.diff b/fileattrs.diff index e7e9ae1..4b7ea4a 100644 --- a/fileattrs.diff +++ b/fileattrs.diff @@ -1,26 +1,9 @@ ---- fileattrs/elf.attr.orig 2023-09-19 10:10:10.000000000 +0000 -+++ fileattrs/elf.attr 2023-10-09 13:07:09.252042587 +0000 -@@ -1,4 +1,4 @@ - %__elf_provides %{_rpmconfigdir}/elfdeps --provides - %__elf_requires %{_rpmconfigdir}/elfdeps --requires +--- fileattrs/elf.attr.orig 2024-10-07 09:35:46.000000000 +0000 ++++ fileattrs/elf.attr 2024-12-16 09:23:29.831448715 +0000 +@@ -1,5 +1,5 @@ + %__elf_provides %{_rpmconfigdir}/elfdeps --provides --multifile + %__elf_requires %{_rpmconfigdir}/elfdeps --requires --multifile %__elf_magic ^(setuid,? )?(setgid,? )?(sticky )?ELF (32|64)-bit.*$ --%__elf_exclude_path ^/lib/modules/.*\.ko?(\.[[:alnum:]]*)$ -+%__elf_exclude_path (^/usr/lib/debug/)|(^/lib/modules/.*\.ko?(\.[[:alnum:]]*)$) ---- fileattrs/perl.attr.orig 2023-09-19 10:10:10.000000000 +0000 -+++ fileattrs/perl.attr 2023-10-09 12:58:36.893003334 +0000 -@@ -1,3 +1,4 @@ --%__perl_requires %{_rpmconfigdir}/perl.req -+# disabled for now -+#%__perl_requires %{_rpmconfigdir}/perl.req - %__perl_magic ^.*[Pp]erl .*$ - %__perl_flags exeonly ---- fileattrs/perllib.attr.orig 2023-09-19 10:10:10.000000000 +0000 -+++ fileattrs/perllib.attr 2023-10-09 12:58:36.893003334 +0000 -@@ -1,5 +1,6 @@ - %__perllib_provides %{_rpmconfigdir}/perl.prov --%__perllib_requires %{_rpmconfigdir}/perl.req -+#disabled for now -+#%__perllib_requires %{_rpmconfigdir}/perl.req - %__perllib_magic ^Perl[[:digit:]] module source.* - %__perllib_path \\.pm$ - %__perllib_flags magic_and_path +-%__elf_exclude_path ^/lib/modules/.*\\.ko?(\\.[[:alnum:]]*)$ ++%__elf_exclude_path (^/usr/lib/debug/)|(^/lib/modules/.*\\.ko?(\\.[[:alnum:]]*)$) + %__elf_protocol multifile diff --git a/findsupplements.diff b/findsupplements.diff index 9fac1de..7151216 100644 --- a/findsupplements.diff +++ b/findsupplements.diff @@ -1,15 +1,16 @@ ---- scripts/CMakeLists.txt.orig 2023-10-09 13:14:50.011193421 +0000 -+++ scripts/CMakeLists.txt 2023-10-09 13:15:00.395174379 +0000 -@@ -5,6 +5,7 @@ install(PROGRAMS +--- scripts/CMakeLists.txt.orig 2024-10-07 09:35:46.000000000 +0000 ++++ scripts/CMakeLists.txt 2024-12-16 09:27:43.274925606 +0000 +@@ -4,7 +4,7 @@ install(PROGRAMS + brp-strip-static-archive brp-elfperms brp-remove-la-files check-files check-prereqs check-buildroot check-rpaths check-rpaths-worker - find-lang.sh find-requires find-provides -+ find-supplements - perl.prov perl.req +- find-lang.sh find-requires find-provides ++ find-lang.sh find-requires find-provides find-supplements pkgconfigdeps.sh ocamldeps.sh ---- scripts/find-supplements.orig 2023-10-09 13:14:37.371216603 +0000 -+++ scripts/find-supplements 2023-10-09 13:14:37.371216603 +0000 + fontconfig.prov script.req +--- scripts/find-supplements.orig 2024-12-16 09:27:13.626986691 +0000 ++++ scripts/find-supplements 2024-12-16 09:27:13.626986691 +0000 @@ -0,0 +1,3 @@ +#!/bin/sh + diff --git a/localetag.diff b/localetag.diff index 1ba8935..451e06e 100644 --- a/localetag.diff +++ b/localetag.diff @@ -1,8 +1,8 @@ Convert output to the current locale. Assumes utf8 input if the decoding works, otherwise iso-8859-1. ---- lib/tagexts.c.orig 2021-06-21 12:00:44.615612184 +0000 -+++ lib/tagexts.c 2021-09-23 18:58:58.461872258 +0000 +--- lib/tagexts.c.orig 2025-02-19 15:29:33.000000000 +0000 ++++ lib/tagexts.c 2025-04-25 11:59:49.808794382 +0000 @@ -2,6 +2,7 @@ * \file lib/formats.c */ @@ -11,7 +11,7 @@ decoding works, otherwise iso-8859-1. #include "system.h" #include -@@ -197,6 +198,114 @@ typedef enum tMode_e { +@@ -192,6 +193,115 @@ typedef enum tMode_e { TRANSFILETRIGGER = 2, } tMode; @@ -94,6 +94,7 @@ decoding works, otherwise iso-8859-1. + if (wcrtomb(cc, 0x20ac, &ps) != 3 || memcmp(cc, "\342\202\254", 3)) + locisutf8 = 0; + if (locisutf8 == strisutf8) { ++ _free(cc); + wstr = _free(wstr); + return str; + } @@ -126,7 +127,7 @@ decoding works, otherwise iso-8859-1. /** * Retrieve trigger info. * @param mode type of trigger (see tMode_e) -@@ -607,10 +716,41 @@ static int i18nTag(Header h, rpmTag tag, +@@ -606,10 +716,41 @@ static int i18nTag(Header h, rpmTag tag, #endif rc = headerGet(h, tag, td, HEADERGET_ALLOC); @@ -168,7 +169,7 @@ decoding works, otherwise iso-8859-1. * Retrieve summary text. * @param h header * @param[out] td tag data container -@@ -634,6 +774,16 @@ static int descriptionTag(Header h, rpmt +@@ -633,6 +774,16 @@ static int descriptionTag(Header h, rpmt return i18nTag(h, RPMTAG_DESCRIPTION, td, hgflags); } @@ -185,7 +186,7 @@ decoding works, otherwise iso-8859-1. /** * Retrieve group text. * @param h header -@@ -971,6 +1121,8 @@ static const struct headerTagFunc_s rpmH +@@ -1022,6 +1173,8 @@ static const struct headerTagFunc_s rpmH { RPMTAG_LONGARCHIVESIZE, longarchivesizeTag }, { RPMTAG_LONGSIZE, longsizeTag }, { RPMTAG_LONGSIGSIZE, longsigsizeTag }, diff --git a/macrosin.diff b/macrosin.diff index 361faaa..7f9e638 100644 --- a/macrosin.diff +++ b/macrosin.diff @@ -1,14 +1,14 @@ ---- macros.in.orig 2023-10-09 12:34:52.359518015 +0000 -+++ macros.in 2023-10-09 12:34:56.915510497 +0000 -@@ -161,6 +161,7 @@ +--- macros.in.orig 2025-02-12 13:23:21.868124201 +0000 ++++ macros.in 2025-02-12 13:23:58.436059109 +0000 +@@ -163,6 +163,7 @@ %{?_unique_debug_names:--unique-debug-suffix "-%{VERSION}-%{RELEASE}.%{_arch}"} \\\ %{?_unique_debug_srcs:--unique-debug-src-base "%{name}-%{VERSION}-%{RELEASE}.%{_arch}"} \\\ %{?_find_debuginfo_dwz_opts} \\\ + %{lua:if posix.access(rpm.expand("%_sourcedir/baselibs.conf"), "r") then print("--dwz-single-file-mode") end} \\\ %{?_find_debuginfo_opts} \\\ %{?_debugsource_packages:-S debugsourcefiles.list} \\\ - "%{_builddir}/%{?buildsubdir}"\ -@@ -211,7 +212,8 @@ Supplements: (%{name} = %{version}-%{r + "%{builddir}/%{?buildsubdir}"\ +@@ -216,7 +217,8 @@ Supplements: (%{name} = %{version}-%{r %files langpack-%{1}\ %{nil} @@ -18,7 +18,7 @@ %_defaultlicensedir %{_datadir}/licenses # Following macros for filtering auto deps must not be used in spec files. -@@ -277,7 +279,8 @@ Supplements: (%{name} = %{version}-%{r +@@ -275,7 +277,8 @@ Supplements: (%{name} = %{version}-%{r %_tmppath %{_var}/tmp # Path to top of build area. @@ -28,7 +28,7 @@ #============================================================================== # ---- Optional rpmrc macros. -@@ -379,7 +382,7 @@ Supplements: (%{name} = %{version}-%{r +@@ -366,7 +369,7 @@ Supplements: (%{name} = %{version}-%{r # "w.ufdio" uncompressed # #%_source_payload w9.gzdio @@ -37,7 +37,7 @@ # Algorithm to use for generating file checksum digests on build. # If not specified or 0, MD5 is used. -@@ -489,6 +492,19 @@ Supplements: (%{name} = %{version}-%{r +@@ -476,6 +479,19 @@ Supplements: (%{name} = %{version}-%{r # #%_include_minidebuginfo 1 @@ -57,7 +57,7 @@ # # Include a .gdb_index section in the .debug files. # Requires _enable_debug_packages and gdb-add-index installed. -@@ -521,39 +537,39 @@ Supplements: (%{name} = %{version}-%{r +@@ -508,39 +524,39 @@ Supplements: (%{name} = %{version}-%{r # Same as for "separate" but if the __debug_package global is set then # the -debuginfo package will have a compatibility link for the main # ELF /usr/lib/debug/.build-id/xx/yyy -> /usr/lib/.build-id/xx/yyy @@ -104,7 +104,7 @@ # # Use internal dependency generator rather than external helpers? -@@ -572,6 +588,7 @@ Supplements: (%{name} = %{version}-%{r +@@ -559,6 +575,7 @@ Supplements: (%{name} = %{version}-%{r %__find_requires %{_rpmconfigdir}/find-requires #%__find_conflicts ??? #%__find_obsoletes ??? @@ -112,7 +112,7 @@ # # Path to file attribute classifications for automatic dependency -@@ -984,7 +1001,7 @@ Supplements: (%{name} = %{version}-%{r +@@ -980,7 +997,7 @@ Supplements: (%{name} = %{version}-%{r %_build_vendor %{_host_vendor} %_build_os %{_host_os} %_host @host@ @@ -121,7 +121,7 @@ %_host_cpu @host_cpu@ %_host_vendor @host_vendor@ %_host_os @host_os@ -@@ -1109,11 +1126,13 @@ Supplements: (%{name} = %{version}-%{r +@@ -1105,11 +1122,13 @@ Supplements: (%{name} = %{version}-%{r #------------------------------------------------------------------------------ # arch macro for all supported 32-bit ARM processors diff --git a/mtime_policy_set.diff b/mtime_policy_set.diff new file mode 100644 index 0000000..99386d9 --- /dev/null +++ b/mtime_policy_set.diff @@ -0,0 +1,34 @@ +--- build/files.c.orig 2025-02-12 13:27:08.131721537 +0000 ++++ build/files.c 2025-02-12 13:32:28.371151422 +0000 +@@ -1049,10 +1049,10 @@ static void genCpioListAndHeader(FileLis + } + } + +- if (!strcmp(mtime_policy_str, "clamp_to_buildtime")) { ++ if (!strcmp(mtime_policy_str, "clamp_to_buildtime") || !strcmp(mtime_policy_str, "set_to_buildtime")) { + mtime_clamp = spec->buildTime; +- override_date = 1; +- } else if (!strcmp(mtime_policy_str, "clamp_to_source_date_epoch")) { ++ override_date = mtime_policy_str[0] == 's' ? 2 : 1; ++ } else if (!strcmp(mtime_policy_str, "clamp_to_source_date_epoch") || !strcmp(mtime_policy_str, "set_to_source_date_epoch")) { + /* Limit the maximum date to SOURCE_DATE_EPOCH if defined + * similar to the tar --clamp-mtime option + * https://reproducible-builds.org/specs/source-date-epoch/ +@@ -1065,7 +1065,7 @@ static void genCpioListAndHeader(FileLis + rpmlog(RPMLOG_ERR, _("unable to parse %s=%s\n"), "SOURCE_DATE_EPOCH", srcdate); + fl->processingFailed = 1; + } +- override_date = 1; ++ override_date = mtime_policy_str[0] == 's' ? 2 : 1; + } + } else if (*mtime_policy_str) { + rpmlog(RPMLOG_WARNING, +@@ -1214,7 +1214,7 @@ static void genCpioListAndHeader(FileLis + } + } + +- if (override_date && flp->fl_mtime > mtime_clamp) { ++ if (override_date && (flp->fl_mtime > mtime_clamp || override_date == 2)) { + flp->fl_mtime = mtime_clamp; + } + /* diff --git a/noprereqdeprec.diff b/noprereqdeprec.diff index 8286ab2..fcdf1de 100644 --- a/noprereqdeprec.diff +++ b/noprereqdeprec.diff @@ -1,20 +1,20 @@ ---- build/parsePreamble.c.orig 2019-10-02 11:38:15.807736662 +0000 -+++ build/parsePreamble.c 2019-10-02 11:39:12.495617575 +0000 -@@ -1032,7 +1032,7 @@ static struct PreambleRec_s const preamb - {RPMTAG_SUGGESTNAME, 0, 0, 0, LEN_AND_STR("suggests")}, - {RPMTAG_SUPPLEMENTNAME, 0, 0, 0, LEN_AND_STR("supplements")}, - {RPMTAG_ENHANCENAME, 0, 0, 0, LEN_AND_STR("enhances")}, -- {RPMTAG_PREREQ, 2, 1, 0, LEN_AND_STR("prereq")}, -+ {RPMTAG_PREREQ, 2, 0, 0, LEN_AND_STR("prereq")}, - {RPMTAG_CONFLICTNAME, 0, 0, 0, LEN_AND_STR("conflicts")}, - {RPMTAG_OBSOLETENAME, 0, 0, 0, LEN_AND_STR("obsoletes")}, - {RPMTAG_PREFIXES, 0, 0, 1, LEN_AND_STR("prefixes")}, -@@ -1041,7 +1041,7 @@ static struct PreambleRec_s const preamb - {RPMTAG_BUILDARCHS, 0, 0, 0, LEN_AND_STR("buildarchitectures")}, - {RPMTAG_BUILDARCHS, 0, 0, 0, LEN_AND_STR("buildarch")}, - {RPMTAG_BUILDCONFLICTS, 0, 0, 0, LEN_AND_STR("buildconflicts")}, -- {RPMTAG_BUILDPREREQ, 0, 1, 0, LEN_AND_STR("buildprereq")}, -+ {RPMTAG_BUILDPREREQ, 0, 0, 0, LEN_AND_STR("buildprereq")}, - {RPMTAG_BUILDREQUIRES, 0, 0, 0, LEN_AND_STR("buildrequires")}, - {RPMTAG_AUTOREQPROV, 0, 0, 0, LEN_AND_STR("autoreqprov")}, - {RPMTAG_AUTOREQ, 0, 0, 0, LEN_AND_STR("autoreq")}, +--- build/parsePreamble.c.orig 2024-10-07 09:35:46.000000000 +0000 ++++ build/parsePreamble.c 2024-12-16 09:21:44.247668941 +0000 +@@ -1103,7 +1103,7 @@ static struct PreambleRec_s const preamb + {RPMTAG_SUGGESTNAME, 2, 0, 0, 0, LEN_AND_STR("suggests")}, + {RPMTAG_SUPPLEMENTNAME, 2, 0, 0, 0, LEN_AND_STR("supplements")}, + {RPMTAG_ENHANCENAME, 2, 0, 0, 0, LEN_AND_STR("enhances")}, +- {RPMTAG_PREREQ, 2, 1, 0, 0, LEN_AND_STR("prereq")}, ++ {RPMTAG_PREREQ, 2, 0, 0, 0, LEN_AND_STR("prereq")}, + {RPMTAG_CONFLICTNAME, 0, 0, 0, 0, LEN_AND_STR("conflicts")}, + {RPMTAG_OBSOLETENAME, 0, 0, 0, 0, LEN_AND_STR("obsoletes")}, + {RPMTAG_PREFIXES, 0, 0, 1, 0, LEN_AND_STR("prefixes")}, +@@ -1113,7 +1113,7 @@ static struct PreambleRec_s const preamb + {RPMTAG_BUILDARCHS, 0, 0, 0, 0, LEN_AND_STR("buildarch")}, + {RPMTAG_BUILDCONFLICTS, 0, 0, 0, 1, LEN_AND_STR("buildconflicts")}, + {RPMTAG_BUILDOPTION, 2, 0, 0, 1, LEN_AND_STR("buildoption")}, +- {RPMTAG_BUILDPREREQ, 0, 1, 0, 1, LEN_AND_STR("buildprereq")}, ++ {RPMTAG_BUILDPREREQ, 0, 0, 0, 1, LEN_AND_STR("buildprereq")}, + {RPMTAG_BUILDREQUIRES, 0, 0, 0, 1, LEN_AND_STR("buildrequires")}, + {RPMTAG_BUILDSYSTEM, 0, 0, 1, 1, LEN_AND_STR("buildsystem")}, + {RPMTAG_AUTOREQPROV, 0, 0, 0, 0, LEN_AND_STR("autoreqprov")}, diff --git a/pgpreleasemtime.diff b/pgpreleasemtime.diff new file mode 100644 index 0000000..88270d6 --- /dev/null +++ b/pgpreleasemtime.diff @@ -0,0 +1,38 @@ +--- include/rpm/rpmpgp.h.orig 2025-06-02 13:22:06.721991623 +0000 ++++ include/rpm/rpmpgp.h 2025-06-02 13:25:58.441706775 +0000 +@@ -467,6 +467,14 @@ int pgpDigParamsVersion(pgpDigParams dig + uint32_t pgpDigParamsCreationTime(pgpDigParams digp); + + /** \ingroup rpmpgp ++ * Retrieve the object's last modification time. ++ * ++ * param digp parameter container ++ * return seconds since the UNIX Epoch. ++ */ ++uint32_t pgpDigParamsModificationTime(pgpDigParams digp); ++ ++/** \ingroup rpmpgp + * Destroy parsed OpenPGP packet parameter(s). + * @param digp parameter container + * @return NULL always +--- lib/rpmts.c.orig 2025-06-02 13:04:10.919297800 +0000 ++++ lib/rpmts.c 2025-06-02 13:05:41.795192518 +0000 +@@ -468,7 +468,7 @@ static void initPgpData(pgpDigParams pub + if (! pd->userid) { + pd->userid = "none"; + } +- pd->time = pgpDigParamsCreationTime(pubp); ++ pd->time = pgpDigParamsModificationTime(pubp); + + rasprintf(&pd->timestr, "%x", pd->time); + rasprintf(&pd->verid, "%d:%s-%s", pgpDigParamsVersion(pubp), pd->signid, pd->timestr); +--- rpmio/rpmpgp_legacy-1.1/rpmpgp_internal.h.orig 2025-06-02 13:27:51.345567394 +0000 ++++ rpmio/rpmpgp_legacy-1.1/rpmpgp_internal.h 2025-06-02 13:28:59.425482575 +0000 +@@ -163,7 +163,4 @@ rpmpgpRC pgpMergeKeys(const uint8_t *pkt + RPM_GNUC_INTERNAL + uint32_t pgpCurrentTime(void); + +-RPM_GNUC_INTERNAL +-uint32_t pgpDigParamsModificationTime(pgpDigParams digp); +- + #endif /* _RPMPGP_INTERNAL_H */ diff --git a/posttrans.diff b/posttrans.diff index 7df213a..b8368d3 100644 --- a/posttrans.diff +++ b/posttrans.diff @@ -1,5 +1,5 @@ ---- include/rpm/rpmcli.h.orig 2023-09-19 10:10:10.000000000 +0000 -+++ include/rpm/rpmcli.h 2023-10-12 11:43:59.662617302 +0000 +--- include/rpm/rpmcli.h.orig 2025-02-19 15:29:33.000000000 +0000 ++++ include/rpm/rpmcli.h 2025-07-29 14:13:12.907099597 +0000 @@ -306,6 +306,7 @@ enum rpmInstallFlags_e { INSTALL_ALLMATCHES = (1 << 9), /*!< from --allmatches */ INSTALL_REINSTALL = (1 << 10), /*!< from --reinstall */ @@ -24,8 +24,8 @@ */ extern struct rpmInstallArguments_s rpmIArgs; ---- include/rpm/rpmts.h.orig 2023-10-12 11:43:35.870664176 +0000 -+++ include/rpm/rpmts.h 2023-10-12 11:43:59.662617302 +0000 +--- include/rpm/rpmts.h.orig 2025-07-29 14:13:01.139113390 +0000 ++++ include/rpm/rpmts.h 2025-07-29 14:13:12.907099597 +0000 @@ -253,6 +253,15 @@ int rpmtsOrder(rpmts ts); int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet); @@ -42,8 +42,8 @@ * Reference a transaction set instance. * @param ts transaction set * @return new transaction set reference ---- lib/poptI.c.orig 2023-09-19 10:10:10.000000000 +0000 -+++ lib/poptI.c 2023-10-12 11:43:59.662617302 +0000 +--- lib/poptI.c.orig 2025-02-19 15:29:33.000000000 +0000 ++++ lib/poptI.c 2025-07-29 14:13:12.907099597 +0000 @@ -283,6 +283,10 @@ struct poptOption rpmInstallPoptTable[] &rpmIArgs.installInterfaceFlags, (INSTALL_RESTORE), N_("restore package(s)"), @@ -55,9 +55,18 @@ POPT_TABLEEND }; ---- lib/psm.c.orig 2023-10-12 11:43:35.850664215 +0000 -+++ lib/psm.c 2023-10-12 11:43:59.662617302 +0000 -@@ -1001,7 +1001,7 @@ static rpmRC rpmPackageErase(rpmts ts, r +--- lib/psm.c.orig 2025-07-29 14:13:01.119113413 +0000 ++++ lib/psm.c 2025-07-29 14:13:12.907099597 +0000 +@@ -612,6 +612,8 @@ static int isUpdate(rpmts ts, rpmte te) + rpmtsi pi = rpmtsiInit(ts); + rpmte p; + int update = 0; ++ if (rpmteAddOp(te) == RPMTE_RUNPOSTTRANS_UPDATE) ++ update = 1; + while ((p = rpmtsiNext(pi, TR_REMOVED)) != NULL) { + if (rpmteDependsOn(p) == te) { + update = 1; +@@ -1009,7 +1011,7 @@ static rpmRC rpmPackageErase(rpmts ts, r } if (rc) break; @@ -66,8 +75,8 @@ /* Prepare post transaction uninstall triggers */ rpmtriggersPrepPostUnTransFileTrigs(psm->ts, psm->te); } ---- lib/rpminstall.c.orig 2023-09-19 10:10:10.000000000 +0000 -+++ lib/rpminstall.c 2023-10-12 11:43:59.662617302 +0000 +--- lib/rpminstall.c.orig 2025-02-19 15:29:33.000000000 +0000 ++++ lib/rpminstall.c 2025-07-29 14:13:56.519048463 +0000 @@ -6,6 +6,8 @@ #include @@ -77,7 +86,55 @@ #include #include #include /* rpmReadPackageFile, vercmp etc */ -@@ -830,3 +832,32 @@ int rpmInstallSource(rpmts ts, const cha +@@ -90,6 +92,24 @@ static rpmVSFlags setvsFlags(struct rpmI + return vsflags; + } + ++static const char * ++posttranstag2str(rpmTagVal stag) ++{ ++ switch (stag) { ++ case RPMTAG_POSTTRANS: ++ return "posttrans"; ++ case RPMTAG_POSTUNTRANS: ++ return "postuntrans"; ++ case RPMTAG_TRIGGERIN: ++ return "transfiletriggerin"; ++ case RPMTAG_TRIGGERUN: ++ return "transfiletriggerun"; ++ case RPMTAG_TRIGGERPOSTUN: ++ return "transfiletriggerpostun"; ++ } ++ return rpmTagGetName(stag); ++} ++ + void * rpmShowProgress(const void * arg, + const rpmCallbackType what, + const rpm_loff_t amount, +@@ -213,8 +233,22 @@ void * rpmShowProgress(const void * arg, + case RPMCALLBACK_CPIO_ERROR: + break; + case RPMCALLBACK_SCRIPT_ERROR: ++ if (flags & INSTALL_RUNPOSTTRANS) { ++ rpmTagVal stag = (rpmTagVal)amount; ++ char *s = headerGetAsString(h, RPMTAG_NEVRA); ++ fprintf(stdout, "Error from %%%s(%s)\n", posttranstag2str(stag), s); ++ (void) fflush(stdout); ++ free(s); ++ } + break; + case RPMCALLBACK_SCRIPT_START: ++ if (flags & INSTALL_RUNPOSTTRANS) { ++ rpmTagVal stag = (rpmTagVal)amount; ++ char *s = headerGetAsString(h, RPMTAG_NEVRA); ++ fprintf(stdout, "Running %%%s(%s)\n", posttranstag2str(stag), s); ++ (void) fflush(stdout); ++ free(s); ++ } + break; + case RPMCALLBACK_SCRIPT_STOP: + break; +@@ -831,3 +865,33 @@ int rpmInstallSource(rpmts ts, const cha return rc; } @@ -98,20 +155,31 @@ + goto exit; + } + while ((s = fgets(line, sizeof(line) - 1, f)) != 0) { -+ if (p = strrchr(s, '\n')) ++ if ((p = strrchr(s, '\n')) != 0) + *p = 0; + argvAdd(&manifest, s); + } + fclose(f); + rpmlog(RPMLOG_DEBUG, "running posttrans scriptlets\n"); + rpmtsClean(ts); ++ setNotifyFlag(ia, ts); + rc = rpmtsRunPostTrans(ts, manifest); +exit: + argvFree(manifest); + return rc; +} ---- lib/rpmtriggers.c.orig 2023-09-19 10:10:10.000000000 +0000 -+++ lib/rpmtriggers.c 2023-10-12 11:43:59.662617302 +0000 +--- lib/rpmte_internal.h.orig 2025-02-19 15:29:33.000000000 +0000 ++++ lib/rpmte_internal.h 2025-07-29 14:13:12.907099597 +0000 +@@ -32,6 +32,7 @@ enum addOp_e { + RPMTE_UPGRADE = 1, + RPMTE_REINSTALL = 2, + RPMTE_RESTORE = 3, ++ RPMTE_RUNPOSTTRANS_UPDATE = 4, + }; + + /** \ingroup rpmte +--- lib/rpmtriggers.c.orig 2025-02-19 15:29:33.000000000 +0000 ++++ lib/rpmtriggers.c 2025-07-29 14:13:12.907099597 +0000 @@ -1,5 +1,6 @@ #include "system.h" @@ -128,7 +196,7 @@ unsigned int tix, unsigned int priority) { if (trigs->count == trigs->alloced) { -@@ -178,6 +179,14 @@ int runPostUnTransFileTrigs(rpmts ts) +@@ -190,6 +191,14 @@ int runPostUnTransFileTrigs(rpmts ts) if (trigH == NULL) continue; @@ -143,7 +211,29 @@ /* Prepare and run script */ script = rpmScriptFromTriggerTag(trigH, triggertag(RPMSENSE_TRIGGERPOSTUN), -@@ -587,6 +596,16 @@ rpmRC runImmedFileTriggers(rpmts ts, rpm +@@ -603,6 +612,21 @@ rpmRC runFileTriggers(rpmts ts, rpmte te + return (nerrors == 0) ? RPMRC_OK : RPMRC_FAIL; + } + ++static int isUpdate(rpmts ts, rpmte te) ++{ ++ rpmtsi pi = rpmtsiInit(ts); ++ rpmte p; ++ int update = 0; ++ while ((p = rpmtsiNext(pi, TR_REMOVED)) != NULL) { ++ if (rpmteDependsOn(p) == te) { ++ update = 1; ++ break; ++ } ++ } ++ rpmtsiFree(pi); ++ return update; ++} ++ + rpmRC runImmedFileTriggers(rpmts ts, rpmte te, int arg1, rpmsenseFlags sense, + rpmscriptTriggerModes tm, int priorityClass) + { +@@ -613,6 +637,19 @@ rpmRC runImmedFileTriggers(rpmts ts, rpm rpmTagVal priorityTag; rpmtriggers triggers; @@ -151,7 +241,10 @@ + unsigned int hdrNum = headerGetInstance(trigH); + if (hdrNum) { + char *trigNEVRA = headerGetAsString(trigH, RPMTAG_NEVRA); -+ rpmlog(RPMLOG_NOTICE, "dump_posttrans: install %u %s\n", hdrNum, trigNEVRA); ++ if (isUpdate(ts, te)) ++ rpmlog(RPMLOG_NOTICE, "dump_posttrans: update %u %s\n", hdrNum, trigNEVRA); ++ else ++ rpmlog(RPMLOG_NOTICE, "dump_posttrans: install %u %s\n", hdrNum, trigNEVRA); + free(trigNEVRA); + } + headerFree(trigH); @@ -160,9 +253,9 @@ if (tm == RPMSCRIPT_FILETRIGGER) { priorityTag = RPMTAG_FILETRIGGERPRIORITIES; } else { ---- lib/rpmtriggers.h.orig 2023-09-19 10:10:10.000000000 +0000 -+++ lib/rpmtriggers.h 2023-10-12 11:43:59.662617302 +0000 -@@ -27,6 +27,10 @@ rpmtriggers rpmtriggersCreate(unsigned i +--- lib/rpmtriggers.h.orig 2025-02-19 15:29:33.000000000 +0000 ++++ lib/rpmtriggers.h 2025-07-29 14:13:12.907099597 +0000 +@@ -24,6 +24,10 @@ rpmtriggers rpmtriggersCreate(unsigned i RPM_GNUC_INTERNAL rpmtriggers rpmtriggersFree(rpmtriggers triggers); @@ -173,9 +266,9 @@ /* * Prepare post trans uninstall file triggers. After transcation uninstalled * files are not saved anywhere. So we need during uninstalation of every ---- lib/rpmts_internal.h.orig 2023-09-19 10:10:10.000000000 +0000 -+++ lib/rpmts_internal.h 2023-10-12 11:43:59.662617302 +0000 -@@ -94,6 +94,8 @@ struct rpmts_s { +--- lib/rpmts_internal.h.orig 2025-02-19 15:29:33.000000000 +0000 ++++ lib/rpmts_internal.h 2025-07-29 14:13:12.907099597 +0000 +@@ -83,6 +83,8 @@ struct rpmts_s { int min_writes; /*!< macro minimize_writes used */ time_t overrideTime; /*!< Time value used when overriding system clock. */ @@ -183,9 +276,9 @@ + int dump_posttrans; /*!< macro dump_posttrans used */ }; - #ifdef __cplusplus ---- lib/transaction.c.orig 2023-09-19 10:10:10.000000000 +0000 -+++ lib/transaction.c 2023-10-12 11:44:28.398560689 +0000 + /** \ingroup rpmts +--- lib/transaction.c.orig 2025-02-19 15:29:33.000000000 +0000 ++++ lib/transaction.c 2025-07-29 14:13:12.907099597 +0000 @@ -1475,6 +1475,8 @@ static int rpmtsSetup(rpmts ts, rpmprobF /* Get available space on mounted file systems. */ (void) rpmtsInitDSI(ts); @@ -195,44 +288,24 @@ return 0; } -@@ -1858,27 +1860,31 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rp +@@ -1858,6 +1860,16 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rp /* Actually install and remove packages */ nfailed = rpmtsProcess(ts); + if (ts->dump_posttrans) { + rpmlog(RPMLOG_NOTICE, "dump_posttrans: enabled\n"); ++ runTransScripts(ts, PKG_POSTUNTRANS); /* need to run them right away */ ++ runPostUnTransFileTrigs(ts); ++ runTransScripts(ts, PKG_TRANSFILETRIGGERIN); ++ /* Final exit code */ ++ rc = nfailed ? -1 : 0; ++ goto exit; + } + /* Run %posttrans scripts unless disabled */ -- if (!(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOSTTRANS))) { -+ if (!ts->dump_posttrans && !(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOSTTRANS))) { + if (!(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOSTTRANS))) { rpmlog(RPMLOG_DEBUG, "running %%posttrans scripts\n"); - runTransScripts(ts, PKG_POSTTRANS); - } - /* Run %postuntrans scripts unless disabled */ -- if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_NOPOSTUNTRANS)) { -+ if (!ts->dump_posttrans && !(rpmtsFlags(ts) & RPMTRANS_FLAG_NOPOSTUNTRANS)) { - rpmlog(RPMLOG_DEBUG, "running %%postuntrans scripts\n"); - runTransScripts(ts, PKG_POSTUNTRANS); - } - - /* Run %transfiletriggerpostun scripts unless disabled */ -- if (!(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOSTTRANS|RPMTRANS_FLAG_NOTRIGGERIN))) { -+ if (!ts->dump_posttrans && !(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOSTTRANS|RPMTRANS_FLAG_NOTRIGGERIN))) { - runFileTriggers(ts, NULL, RPMSENSE_TRIGGERIN, RPMSCRIPT_TRANSFILETRIGGER, 0); - } -- if (!(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOSTTRANS|RPMTRANS_FLAG_NOTRIGGERPOSTUN))) { -+ if (ts->dump_posttrans || !(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOSTTRANS|RPMTRANS_FLAG_NOTRIGGERPOSTUN))) { - runPostUnTransFileTrigs(ts); - } - - /* Run %transfiletriggerin scripts unless disabled */ -- if (!(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOSTTRANS|RPMTRANS_FLAG_NOTRIGGERIN))) { -+ if (ts->dump_posttrans || !(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOSTTRANS|RPMTRANS_FLAG_NOTRIGGERIN))) { - runTransScripts(ts, PKG_TRANSFILETRIGGERIN); - } - /* Final exit code */ -@@ -1901,3 +1907,117 @@ exit: +@@ -1901,3 +1913,120 @@ exit: sigaction(SIGPIPE, &oact, NULL); return rc; } @@ -295,12 +368,15 @@ + goto exit; + char *line; + while ((line = *manifest++) != 0) { -+ if (!strncmp(line, "dump_posttrans: install ", 24)) { -+ const char *lp = line + 24; ++ if (strncmp(line, "dump_posttrans: ", 16) != 0) ++ continue; ++ line += 16; ++ if (!strncmp(line, "install ", 8) || !strncmp(line, "update ", 7)) { ++ const char *lp = line + (*line == 'i' ? 8 : 7); + Header h = runPostTransFindPkg(ts, lp); + if (!h) + continue; -+ rpmte p = rpmteNew(ts, h, TR_ADDED, line + 45, NULL, RPMTE_INSTALL); ++ rpmte p = rpmteNew(ts, h, TR_ADDED, NULL, NULL, (*line == 'i' ? RPMTE_INSTALL: RPMTE_RUNPOSTTRANS_UPDATE)); + if (tsmem->orderCount >= tsmem->orderAlloced) { + tsmem->orderAlloced += (tsmem->orderCount - tsmem->orderAlloced) + tsmem->delta; + tsmem->order = xrealloc(tsmem->order, tsmem->orderAlloced * sizeof(*tsmem->order)); @@ -311,8 +387,8 @@ + tsmem->addedPackages = rpmalCreate(ts, 5); + rpmalAdd(tsmem->addedPackages, p); + packageHashAddEntry(tsmem->installedPackages, headerGetInstance(h), p); -+ } else if (!strncmp(line, "dump_posttrans: transfiletriggerpostun ", 39)) { -+ const char *lp = line + 39; ++ } else if (!strncmp(line, "transfiletriggerpostun ", 23)) { ++ const char *lp = line + 23; + unsigned int tix = runPostTransFindPkgNum(&lp); + Header h = runPostTransFindPkg(ts, lp); + struct rpmtd_s priorities; @@ -336,7 +412,7 @@ + runTransScripts(ts, PKG_POSTTRANS); + runTransScripts(ts, PKG_POSTUNTRANS); + /* run %transfiletriggerin scripts */ -+ runFileTriggers(ts, NULL, RPMSENSE_TRIGGERIN, RPMSCRIPT_TRANSFILETRIGGER, 0); ++ runFileTriggers(ts, NULL, -1, RPMSENSE_TRIGGERIN, RPMSCRIPT_TRANSFILETRIGGER, 0); + /* run %transfiletriggerpostun scrips */ + runPostUnTransFileTrigs(ts); + /* Run immed %transfiletriggerin scripts */ @@ -350,8 +426,8 @@ + rpmtsEmpty(ts); + return rc; +} ---- tools/rpm.c.orig 2023-09-19 10:10:10.000000000 +0000 -+++ tools/rpm.c 2023-10-12 11:43:59.662617302 +0000 +--- tools/rpm.c.orig 2025-02-19 15:29:33.000000000 +0000 ++++ tools/rpm.c 2025-07-29 14:13:12.907099597 +0000 @@ -21,6 +21,7 @@ enum modes { MODE_ERASE = (1 << 2), MODE_RESTORE = (1 << 4), diff --git a/python-rpm.changes b/python-rpm.changes index cee2dd7..bc9e5fc 100644 --- a/python-rpm.changes +++ b/python-rpm.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Fri Mar 7 14:14:55 CET 2025 - mls@suse.de + +- update to rpm-4.20.1 + +------------------------------------------------------------------- +Mon Dec 16 11:55:23 CET 2024 - mls@suse.de + +- update to rpm-4.20.0 + ------------------------------------------------------------------- Fri Feb 9 11:34:31 CET 2024 - mls@suse.de @@ -36,7 +46,7 @@ Fri Dec 2 15:09:55 CET 2022 - mls@suse.de - update to rpm-4.18.0 ------------------------------------------------------------------- +------------------------------------------------------------------- Thu Jul 21 16:11:22 CEST 2022 - mls@suse.de - update to rpm-4.17.1 diff --git a/python-rpm.spec b/python-rpm.spec index 5651fc8..562deb5 100644 --- a/python-rpm.spec +++ b/python-rpm.spec @@ -1,7 +1,7 @@ # # spec file for package python-rpm # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # Copyright (c) 2017 Neal Gompa . # # All modifications and additions to the file contributed by third parties @@ -20,7 +20,7 @@ # Enable Python build sourced from rpm spec %global with_python 1 Name: python-rpm -Version: 4.19.1.1 +Version: 4.20.1 Release: 0 Summary: Python Bindings for Manipulating RPM Packages License: GPL-2.0-or-later @@ -32,6 +32,7 @@ BuildRequires: cmake BuildRequires: fdupes BuildRequires: file-devel BuildRequires: libacl-devel +BuildRequires: libarchive-devel BuildRequires: libbz2-devel BuildRequires: libcap-devel BuildRequires: libdw-devel diff --git a/rpm-4.19.1.1.tar.bz2 b/rpm-4.19.1.1.tar.bz2 deleted file mode 100644 index 44cfb57..0000000 --- a/rpm-4.19.1.1.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:874091b80efe66f9de8e3242ae2337162e2d7131e3aa4ac99ac22155e9c521e5 -size 5849649 diff --git a/rpm-4.20.1.tar.bz2 b/rpm-4.20.1.tar.bz2 new file mode 100644 index 0000000..d107472 --- /dev/null +++ b/rpm-4.20.1.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:52647e12638364533ab671cbc8e485c96f9f08889d93fe0ed104a6632661124f +size 4534720 diff --git a/rpm.changes b/rpm.changes index 7368ee1..60857a7 100644 --- a/rpm.changes +++ b/rpm.changes @@ -1,3 +1,164 @@ +------------------------------------------------------------------- +Tue Jul 29 16:15:58 CEST 2025 - mls@suse.de + +- flush scriptlet notification messages in --runposttrans + * needed to fix leaking tmp files [bsc#1218459] + * updated patch: posttrans.diff + * added "rpm_flushes_runposttrans" provides for libzypp + +------------------------------------------------------------------- +Mon Jun 2 15:07:06 CEST 2025 - mls@suse.de + +- use the pubkey modification time instead of the creation time + as the release number, as it was with older rpm versions + * new patch: pgpreleasemtime.diff + +------------------------------------------------------------------- +Wed May 21 15:40:57 CEST 2025 - mls@suse.de + +- fix posttrans scriptlet argument in the update case [bsc#1243279] + * updated patch: posttrans.diff +- fix postuntrans scriptlets not being run if dump_posttrans is set + +------------------------------------------------------------------- +Fri Apr 25 11:29:35 CEST 2025 - mls@suse.de + +- print scriptlet messages in --runposttrans + * needed to fix leaking tmp files [bsc#1218459] + * updated patch: posttrans.diff +- backport architecture check fix from upstream + * new patch: archcheck.diff +- backport empty password fix from upstream + * new patch: emptypw.diff +- backport buildsys specific prep fix from upstream + * new patch: buildsysprep.diff +- fix memory leak in str2locale [bsc#1241052] + * updated patch: localetag.diff + +------------------------------------------------------------------- +Wed Mar 26 14:48:09 CET 2025 - mls@suse.de + +- Backport check_c_compiler_flag cmake tests fix from upstream + The old code would pick up -fhardened by accident + * new patch: cmake_fhardened.diff + +------------------------------------------------------------------- +Fri Mar 7 14:14:55 CET 2025 - mls@suse.de + +- update to rpm-4.20.1 + * add support for fully locked user accounts in sysusers.d + * fix unmodified %config files being removed in case of an + unpack failure + * fix lua deprecation warnings being shown packages built with + old rpm versions + * ignore all files in macro directories that do not end with an + alphanumeric character +- refreshed patches: + * rpmqpack.diff + * unshare.diff + * rpm2archive.diff +- dropped patches: + * debugpackage.diff + * nextfiles.diff + * buildsys.diff + +------------------------------------------------------------------- +Wed Feb 12 13:36:45 CET 2025 - mls@suse.de + +- make the rpm package not depend on libarchive + * move the rpmuncompress tool to rpm-build + * rewrite rpm2archive to not use libarchive for cpio/tar writing + * new patch: rpm2archive.diff +- revert buildroot macro setting that did more harm than good +- add set_to_buildtime and set_to_source_date_epoch mtime policy + support + * new patch: mtime_policy_set.diff +- drop unused 0001-Add-option-to-set-mtime-of-files-in-rpms.patch + patch +- do not output debug messages in rpmspec -q if a buildsystem is + used + * new patch: buildsys.diff + +------------------------------------------------------------------- +Mon Feb 3 13:13:27 CET 2025 - mls@suse.de + +- allow to have the primary binding signature in the unhashed area + * updated rpmpgp_legacy-1.0.tar.gz to rpmpgp_legacy-1.1.tar.gz + +------------------------------------------------------------------- +Thu Jan 30 12:17:34 CET 2025 - mls@suse.de + +- Split unshare plugin configuration into a new "rpm-plugin-unshare" + subpackage. This disables the plugin unless the new package + is installed. + +------------------------------------------------------------------- +Thu Jan 30 12:03:40 CET 2025 - Adrian Schröter + +- enable config.guess/sub update also for loongarch64 architecture +- update config.guess/sub files to current state from autoconf-2.72 + +------------------------------------------------------------------- +Tue Jan 7 10:58:17 CET 2025 - mls@suse.de + +- make misuses of %global with %buildroot work again + * new patch: undefbuildroot.diff + +------------------------------------------------------------------- +Thu Dec 19 14:29:49 CET 2024 - mls@suse.de + +- backport debug_package regression fix from upstream + * new patch: debugpackage.diff +- fix segfault in rpmtsNextFiles + * new patch: nextfiles.diff + +------------------------------------------------------------------- +Tue Dec 17 10:59:26 CET 2024 - mls@suse.de + +- allow the buildroot to be a symbolic link in check-files + (needed for pesign-obs-integration) + * new patch: buildroot-symlink.diff + +------------------------------------------------------------------- +Mon Dec 16 11:55:23 CET 2024 - mls@suse.de + +- update to rpm-4.20.0 + * new BuildSystem directive + * support for build scriptley augmenting + * per-package build directory available as %builddir + * --build-in-place automatically sets --noprep + * new -C option for autosetup + * better support for reproducible builds + * support for group membership lines + * new rpm.spawn() lua function + * support indentation in spec tags + * new rpmdump tool +- switch to rpmpgp-legacy-1.0 +- disable buildroot check in rpmlintrc for now +- refreshed patches: + * brp.diff macrosin.diff rpmqpack.diff specfilemacro.diff + * noprereqdeprec.diff fileattrs.diff assumeexec.diff + * enable-postin-scripts-error.diff findsupplements.diff + * db_conversion.diff canongnu.diff cmake_python_version.diff + * zstdpool.diff posttrans.diff + * auto-config-update-aarch64-ppc64le.diff + * 0002-log-build-time-if-it-is-set-from-SOURCE_DATE_EPOCH.patch + * 0003-Error-out-on-a-missing-changelog-date.patch +- add compatibility %buildroot definition +- backport unshare fix from upstream and extend it a bit + * new patch: unshare.diff + +------------------------------------------------------------------- +Mon Nov 11 08:43:56 UTC 2024 - Michal Suchanek + +- Bump debugedit version (bsc#1233156) + +------------------------------------------------------------------- +Wed Sep 4 09:27:50 UTC 2024 - Dirk Stoecker + +- move perl packaging to own package + adapt fileattrs.diff + ------------------------------------------------------------------- Fri Mar 1 12:55:27 UTC 2024 - Marcus Meissner @@ -4813,4 +4974,3 @@ Thu Jun 26 19:10:48 MEST 1997 - ma@suse.de - introducing rpm, version 2.4.1 - documentation (ascii,html) in usr/doc/packages/rpm - diff --git a/rpm.spec b/rpm.spec index 43ab7f9..588dc20 100644 --- a/rpm.spec +++ b/rpm.spec @@ -1,7 +1,7 @@ # # spec file for package rpm # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -32,6 +32,7 @@ BuildRequires: gettext-devel BuildRequires: glibc-devel BuildRequires: gzip BuildRequires: libacl-devel +BuildRequires: libarchive-devel BuildRequires: libbz2-devel BuildRequires: libcap-devel BuildRequires: libdw-devel @@ -51,17 +52,20 @@ BuildRequires: xz-devel BuildRequires: pkgconfig(libzstd) BuildRequires: pkgconfig(zlib) #!BuildIgnore: rpmlint-Factory +Provides: rpm_flushes_runposttrans Provides: rpminst Requires(post): %fillup_prereq Requires: rpm-config-SUSE Summary: The RPM Package Manager License: GPL-2.0-or-later Group: System/Packages -Version: 4.19.1.1 +Version: 4.20.1 Release: 0 URL: https://rpm.org/ #Git-Clone: https://github.com/rpm-software-management/rpm -Source: https://ftp.osuosl.org/pub/rpm/releases/rpm-4.19.x/rpm-%{version}.tar.bz2 +Source: https://ftp.osuosl.org/pub/rpm/releases/rpm-4.20.x/rpm-%{version}.tar.bz2 +#Git-Clone: https://github.com/rpm-software-management/rpmpgp_legacy +Source1: rpmpgp_legacy-1.1.tar.gz Source5: rpmsort Source8: rpmconfigcheck Source9: sysconfig.services-rpm @@ -113,9 +117,18 @@ Patch135: selinux_transactional_update.patch Patch136: rpmsort_reverse.diff Patch138: canongnu.diff Patch139: cmake_python_version.diff -Patch140: 0001-Add-option-to-set-mtime-of-files-in-rpms.patch Patch141: 0002-log-build-time-if-it-is-set-from-SOURCE_DATE_EPOCH.patch Patch142: 0003-Error-out-on-a-missing-changelog-date.patch +Patch150: unshare.diff +Patch151: buildroot-symlink.diff +Patch154: undefbuildroot.diff +Patch155: rpm2archive.diff +Patch156: mtime_policy_set.diff +Patch157: cmake_fhardened.diff +Patch158: archcheck.diff +Patch159: emptypw.diff +Patch160: buildsysprep.diff +Patch161: pgpreleasemtime.diff Patch6464: auto-config-update-aarch64-ppc64le.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build # @@ -187,7 +200,7 @@ Requires: util-linux Requires: which Requires: xz # needed for debuginfo generation -Requires: debugedit = 5.0 +Requires: debugedit >= 5.0 # drop candidates Requires: cpio Requires: file @@ -201,19 +214,22 @@ Conflicts: rpm < 4.15.0 If you want to build a rpm, you need this package. It provides rpmbuild and requires some packages that are usually required. -%package build-perl -Summary: RPM dependency generator for Perl -Group: Development/Languages/Perl -Requires: perl-base +%package plugin-unshare +Summary: Rpm plugin for Linux namespace isolation functionality +Requires: rpm = %{version} -%description build-perl -Provides and requires generator for .pl files and modules. +%description plugin-unshare +Rpm plugin for Linux namespace isolation functionality. %prep %setup -q -n rpm-%{version} -%ifarch aarch64 ppc64le riscv64 +%ifarch aarch64 ppc64le riscv64 loongarch64 tar xf %{SOURCE14} %endif +pushd rpmio +tar xf %{SOURCE1} +ln -s rpmpgp_legacy-* rpmpgp_legacy +popd rm -rf sqlite %patch -P 5 -P 12 -P 13 -P 18 @@ -230,9 +246,11 @@ rm -rf sqlite %patch -P 122 -P 123 %patch -P 131 -P 133 -P 134 -P 135 -P 136 -P 138 %patch -P 139 -%patch -P 140 -P 141 -P 142 -p1 +%patch -P 141 -P 142 +%patch -P 150 -P 151 -P 154 -P 155 -P 156 -P 157 -P 158 -P 159 +%patch -P 160 -P 161 -%ifarch aarch64 ppc64le riscv64 +%ifarch aarch64 ppc64le riscv64 loongarch64 %patch -P 6464 %endif @@ -270,10 +288,11 @@ cmake .. \ -DCMAKE_INSTALL_FULL_SHAREDSTATEDIR:PATH=/var/lib \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DRPM_VENDOR=suse \ - -DWITH_ARCHIVE=OFF \ + -DWITH_ARCHIVE=ON \ -DWITH_READLINE=OFF \ -DWITH_SELINUX=ON \ - -DWITH_INTERNAL_OPENPGP=ON \ + -DWITH_SEQUOIA=OFF \ + -DWITH_LEGACY_OPENPGP=ON \ -DENABLE_NDB=ON \ -DENABLE_BDB_RO=ON \ -DENABLE_SQLITE=OFF \ @@ -345,7 +364,7 @@ for i in /usr/share/automake-*/*; do fi done popd -%ifarch aarch64 ppc64le riscv64 +%ifarch aarch64 ppc64le riscv64 loongarch64 install -m 755 build-aux/config.guess %{buildroot}/usr/lib/rpm install -m 755 build-aux/config.sub %{buildroot}/usr/lib/rpm %endif @@ -404,12 +423,15 @@ fi %license COPYING %doc %{_datadir}/doc/packages/rpm %exclude %{_datadir}/doc/packages/rpm/API +%exclude /usr/lib/rpm/macros.d/macros.transaction_unshare +%exclude %{_mandir}/man8/rpm-plugin-unshare* /etc/rpm %if 0%{?suse_version} < 1550 /bin/rpm %endif %{_bindir}/gendiff %{_bindir}/rpm + %{_bindir}/rpm2archive %{_bindir}/rpm2cpio %{_bindir}/rpmdb %{_bindir}/rpmgraph @@ -431,7 +453,7 @@ fi /usr/lib/rpm/rpmpopt-* /usr/lib/rpm/rpmrc /usr/lib/rpm/rpmsort - /usr/lib/rpm/rpmuncompress + /usr/lib/rpm/rpmdump /usr/lib/rpm/suse /usr/lib/rpm/tgpg %{_libdir}/rpm-plugins @@ -463,27 +485,19 @@ fi /usr/lib/rpm/rpm_macros_provides.sh /usr/lib/rpm/elfdeps /usr/lib/rpm/rpmdeps +/usr/lib/rpm/rpmuncompress /usr/bin/rpmspec /usr/lib/rpm/brp-* /usr/lib/rpm/check-* /usr/lib/rpm/*find* /usr/lib/rpm/fileattrs/ -%exclude /usr/lib/rpm/fileattrs/perl*.attr /usr/lib/rpm/*.prov -%exclude /usr/lib/rpm/perl.prov /usr/lib/rpm/*.req -%exclude /usr/lib/rpm/perl.req -%ifarch aarch64 ppc64le riscv64 +%ifarch aarch64 ppc64le riscv64 loongarch64 /usr/lib/rpm/config.guess /usr/lib/rpm/config.sub %endif -%files build-perl -%defattr(-,root,root) -/usr/lib/rpm/fileattrs/perl*.attr -/usr/lib/rpm/perl.prov -/usr/lib/rpm/perl.req - %files devel %defattr(644,root,root,755) /usr/include/rpm @@ -495,4 +509,9 @@ fi %{_libdir}/cmake/rpm %doc %{_datadir}/doc/packages/rpm/API +%files plugin-unshare +%defattr(-,root,root) +/usr/lib/rpm/macros.d/macros.transaction_unshare +%doc %{_mandir}/man8/rpm-plugin-unshare* + %changelog diff --git a/rpm2archive.diff b/rpm2archive.diff new file mode 100644 index 0000000..5ea34d0 --- /dev/null +++ b/rpm2archive.diff @@ -0,0 +1,589 @@ +--- tools/CMakeLists.txt.orig 2025-03-07 13:25:15.637092178 +0000 ++++ tools/CMakeLists.txt 2025-03-07 13:26:53.764950409 +0000 +@@ -41,7 +41,6 @@ if (READLINE_FOUND) + endif() + + add_executable(rpm2archive rpm2archive.c) +-target_link_libraries(rpm2archive PRIVATE PkgConfig::LIBARCHIVE) + install(TARGETS rpm2archive) + + # Everything links to these +--- tools/rpm2archive.c.orig 2025-02-19 15:29:33.000000000 +0000 ++++ tools/rpm2archive.c 2025-03-07 13:25:19.881086047 +0000 +@@ -2,6 +2,14 @@ + + #include "system.h" + ++#if defined(MAJOR_IN_MKDEV) ++#include ++#elif defined(MAJOR_IN_SYSMACROS) ++#include ++#else ++#include /* already included from system.h */ ++#endif ++ + #include /* rpmReadPackageFile .. */ + #include + #include +@@ -12,8 +20,11 @@ + + #include + ++#if 0 + #include + #include ++#endif ++ + #include + #include + #include +@@ -36,6 +47,8 @@ static struct poptOption optionsTable[] + POPT_TABLEEND + }; + ++#if 0 ++ + static void fill_archive_entry(struct archive_entry * entry, rpmfi fi, + char **hardlink) + { +@@ -282,6 +295,540 @@ static int process_package(rpmts ts, con + return rc; + } + ++#else ++ ++static int do_fwrite(FD_t fdo, const void *p, size_t l) ++{ ++ if (Fwrite(p, l, 1, fdo) != l) { ++ fprintf(stderr, "Error writing archive: %s\n", Fstrerror(fdo)); ++ return RPMRC_FAIL; ++ } ++ return RPMRC_OK; ++} ++ ++static int do_fwrite_content(FD_t fdo, char * buf, rpmfi fi) ++{ ++ rpm_loff_t left = rpmfiFSize(fi); ++ size_t len, read; ++ ++ while (left) { ++ len = (left > BUFSIZE ? BUFSIZE : left); ++ read = rpmfiArchiveRead(fi, buf, len); ++ if (read != len) { ++ fprintf(stderr, "Error reading file from rpm payload\n"); ++ break; ++ } ++ if (do_fwrite(fdo, buf, len)) { ++ fprintf(stderr, "Error writing archive: %s\n", Fstrerror(fdo)); ++ break; ++ } ++ left -= len; ++ } ++ return (left > 0); ++} ++ ++/* cpio support */ ++ ++static inline void write_cpio_entry_num(unsigned char *p, unsigned long val) ++{ ++ char space[64]; ++ sprintf(space, "%8.8lx", val); ++ memcpy(p, space, 8); ++} ++ ++static int write_cpio_entry(FD_t fdo, rpmfi fi, const char *filename, struct stat *st, const char *flink, const char *hlink, char *buf) ++{ ++ unsigned char cpioh[110]; ++ memcpy(cpioh, "070701", 6); ++ if (!fi) { ++ memset(cpioh + 6, '0', sizeof(cpioh) - 6); ++ write_cpio_entry_num(cpioh + 38, 1); ++ write_cpio_entry_num(cpioh + 94, 11); ++ if (do_fwrite(fdo, cpioh, sizeof(cpioh))) ++ return RPMRC_FAIL; ++ if (do_fwrite(fdo, "TRAILER!!!\0\0\0", 11 + 3)) ++ return RPMRC_FAIL; ++ return RPMRC_OK; ++ } ++ if (st->st_size > UINT32_MAX) { ++ fprintf(stderr, "Warning: file too large for format, skipping: %s\n", filename); ++ return RPMRC_OK; ++ } ++ size_t fnl = strlen(filename); ++ write_cpio_entry_num(cpioh + 6, st->st_ino); ++ write_cpio_entry_num(cpioh + 14, st->st_mode); ++ write_cpio_entry_num(cpioh + 22, st->st_uid); ++ write_cpio_entry_num(cpioh + 30, st->st_gid); ++ write_cpio_entry_num(cpioh + 38, st->st_nlink); ++ write_cpio_entry_num(cpioh + 46, st->st_mtime); ++ write_cpio_entry_num(cpioh + 54, st->st_size); ++ write_cpio_entry_num(cpioh + 62, major(st->st_dev)); ++ write_cpio_entry_num(cpioh + 70, minor(st->st_dev)); ++ write_cpio_entry_num(cpioh + 78, major(st->st_rdev)); ++ write_cpio_entry_num(cpioh + 86, minor(st->st_rdev)); ++ write_cpio_entry_num(cpioh + 94, fnl + 1); ++ write_cpio_entry_num(cpioh + 102, 0); ++ if (do_fwrite(fdo, cpioh, sizeof(cpioh))) ++ return RPMRC_FAIL; ++ if (do_fwrite(fdo, filename, fnl + 1)) ++ return RPMRC_FAIL; ++ fnl = (110 + fnl + 1) & 3; ++ if (fnl && do_fwrite(fdo, "\0\0\0", 4 - fnl)) ++ return RPMRC_FAIL; ++ if (S_ISLNK(st->st_mode)) { ++ if (st->st_size != strlen(flink)) ++ return RPMRC_FAIL; ++ if (do_fwrite(fdo, flink, st->st_size)) ++ return RPMRC_FAIL; ++ } else if (S_ISREG(st->st_mode)) { ++ if (st->st_size && do_fwrite_content(fdo, buf, fi)) ++ return RPMRC_FAIL; ++ } else { ++ return RPMRC_OK; ++ } ++ fnl = (st->st_size) & 3; ++ if (fnl && do_fwrite(fdo, "\0\0\0", 4 - fnl)) ++ return RPMRC_FAIL; ++ return RPMRC_OK; ++} ++ ++/* pax support */ ++ ++static void add_pax_attrib(char **paxbuf, const char *pax, const char *val) ++{ ++ size_t ten, len = 1 + strlen(pax) + 1 + strlen(val) + 1; ++ for (ten = 1; ten <= len; ten *= 10) ++ len++; ++ if (*paxbuf) ++ *paxbuf = realloc(*paxbuf, strlen(*paxbuf) + len + 1); ++ else { ++ *paxbuf = xmalloc(len + 1); ++ **paxbuf = 0; ++ } ++ sprintf(*paxbuf + strlen(*paxbuf), "%llu %s=%s\n", (unsigned long long)len, pax, val); ++} ++ ++static void set_pax_entry_num_base256(unsigned char *p, unsigned long long val, int size) ++{ ++ /* use base-256 encoding */ ++ unsigned char *pe = p + size; ++ for (; pe > p; val >>= 8) ++ *pe-- = (unsigned char)(val & 255); ++ *p |= 0x80; ++} ++ ++static inline void set_pax_entry_num(unsigned char *p, unsigned long long val, int size, char *pax, char **paxbuf) ++{ ++ char space[64]; ++ int sz = size == 12 ? size - 1 : size - 2; ++ if (paxbuf && val >= (unsigned long long)1 << (sz * 3)) { ++ /* add pax header */ ++ sprintf(space, "%llu", val); ++ add_pax_attrib(paxbuf, pax, space); ++ } ++ if (val >= (unsigned long long)1 << (size * 3)) { ++ set_pax_entry_num_base256(p, val, size); ++ return; ++ } ++ sprintf(space, "%0*llo ", sz, val); ++ memcpy(p, space, size); ++} ++ ++static int pax_is_ascii(const char *val) ++{ ++ for (; *val; val++) ++ if (*(const unsigned char *)val >= 0x80) ++ return 0; ++ return 1; ++} ++ ++static inline void set_pax_entry_str(unsigned char *p, const char *val, int size, char *pax, char **paxbuf) ++{ ++ size_t l = strlen(val); ++ if (paxbuf && (l > size || !pax_is_ascii(val))) ++ add_pax_attrib(paxbuf, pax, val); ++ memcpy(p, val, l < size ? l : size); ++} ++ ++static void set_pax_path_mangle(unsigned char *paxh, const char *filename, const char *insert) ++{ ++ size_t l = strlen(filename); ++ size_t ilen = insert ? strlen(insert) + 1 : 0; ++ const char *p, *p2, *bn; ++ int isdir = 0; ++ /* strip trailing '/' and '/.' components */ ++ while (l && (filename[l - 1] == '/' || (filename[l - 1] == '.' && l > 1 && filename[l - 2] == '/'))) { ++ l--; ++ isdir = 1; ++ } ++ if (ilen) { ++ isdir = 0; /* no trailing slash for a PaxHeader */ ++ if (l == 0) { ++ filename = "/rootdir"; ++ l = 8; ++ } else if (l == 1 && filename[0] == '.') { ++ filename = "currentdir"; ++ l = 10; ++ } else if (l == 2 && filename[0] == '.' && filename[1] == '.') { ++ filename = "parrentdir"; ++ l = 10; ++ } ++ } ++ /* find the basename */ ++ bn = filename + l; ++ while (bn > filename && bn[-1] != '/') ++ bn--; ++ /* truncate basename (we use 99 like libarchive so we can add a '/' if the prefix is empty) */ ++ l -= bn - filename; ++ if (l > 99 - (ilen + isdir)) ++ l = 99 - (ilen + isdir); ++ /* calculate prefix */ ++ if (bn - filename <= 100 - (l + ilen + isdir)) { ++ p = filename; /* no need for a prefix */ ++ } else { ++ p = bn - filename > 155 ? filename + 155 : bn; ++ while (p > filename && *p != '/') ++ p--; ++ /* move as much of the prefix into name as possible */ ++ if (p > filename && bn - p < 99 - (l + ilen + isdir)) { ++ p2 = strchr(bn - (99 - (l + ilen + isdir)), '/'); ++ if (p2 && p2 < p) ++ p = p2; ++ } ++ } ++ /* copy the prefix */ ++ if (p != filename) { ++ memcpy(paxh + 345, filename, p - filename); ++ p++; /* skip the '/' */ ++ } ++ /* copy rest of the dir */ ++ p2 = p + (99 - (l + ilen + isdir)) > bn ? bn : p + (99 - (l + ilen + isdir)); ++ while (p2 > p && *p2 != '/') ++ p2--; ++ if (p2 < bn && *p2 == '/') ++ p2++; /* always fits as we used 99 as size limit above */ ++ memcpy(paxh, p, p2 - p); ++ /* copy the insert */ ++ if (ilen) { ++ memcpy(paxh + (p2 - p), insert, ilen); ++ paxh[p2 - p + ilen - 1] = '/'; ++ } ++ /* copy the basename */ ++ memcpy(paxh + (p2 - p) + ilen, bn, l); ++ if (isdir) ++ paxh[p2 - p + ilen + l] = '/'; ++} ++ ++static int set_pax_path(unsigned char *paxh, const char *filename) ++{ ++ size_t l = strlen(filename); ++ if (l <= 100) { ++ memcpy(paxh, filename, l); ++ return 0; ++ } ++ const char *p = strchr(filename + l - 100 - 1, '/'); ++ if (p == filename) ++ p = strchr(filename + 1, '/'); ++ if (p && p[1] && p - filename <= 155) { ++ memcpy(paxh, p + 1, l - (p + 1 - filename)); ++ memcpy(paxh + 345, filename, p - filename); ++ return 0; ++ } ++ set_pax_path_mangle(paxh, filename, NULL); ++ return 1; ++} ++ ++static int write_pax_entry_pax(FD_t fdo, rpmfi fi, const char *filename, struct stat *st, char *paxbuf); ++ ++static int write_pax_entry(FD_t fdo, rpmfi fi, const char *filename, struct stat *st, const char *flink, const char *hlink, char *buf) ++{ ++ unsigned char paxh[512]; ++ int tartype = -1; ++ rpm_loff_t size = 0; ++ ++ memset(paxh, 0, sizeof(paxh)); ++ if (!fi) { ++ if (do_fwrite(fdo, paxh, sizeof(paxh))) ++ return RPMRC_FAIL; ++ if (do_fwrite(fdo, paxh, sizeof(paxh))) ++ return RPMRC_FAIL; ++ return RPMRC_OK; ++ } ++ if (filename == NULL && flink) ++ tartype = 'x'; ++ else if (S_ISREG(st->st_mode)) ++ tartype = st->st_nlink > 1 && !rpmfiArchiveHasContent(fi) ? '1' : '0'; ++ else if (S_ISLNK(st->st_mode)) ++ tartype = '2'; ++ else if (S_ISCHR(st->st_mode)) ++ tartype = '3'; ++ else if (S_ISBLK(st->st_mode)) ++ tartype = '4'; ++ else if (S_ISDIR(st->st_mode)) ++ tartype = '5'; ++ else if (S_ISFIFO(st->st_mode)) ++ tartype = '6'; ++ if (tartype == -1) { ++ fprintf(stderr, "Warning: unsupported file type, skipping: %s\n", filename); ++ return RPMRC_OK; ++ } ++ if (tartype == '5') { ++ size_t l = strlen(filename); ++ if (!l || filename[l - 1] != '/') { ++ char *dirfilename = rstrscat(NULL, filename, "/", NULL); ++ int r = write_pax_entry(fdo, fi, dirfilename, st, flink, hlink, buf); ++ _free(dirfilename); ++ return r; ++ } ++ } ++ if (tartype == '0' || tartype == '1') ++ size = rpmfiFSize(fi); ++ else if (tartype == 'x') ++ size = (rpm_loff_t)strlen(buf); ++ ++ /* fill entry header */ ++ char *paxbuf = NULL; ++ char **paxbufp = tartype == 'x' ? NULL : &paxbuf; ++ if (tartype == 'x') { ++ set_pax_path_mangle(paxh, flink, "PaxHeader"); ++ } else { ++ if (set_pax_path(paxh, filename) || !pax_is_ascii(filename)) ++ add_pax_attrib(paxbufp, "path", filename); ++ } ++ set_pax_entry_num(paxh + 100, st->st_mode & 07777, 8, NULL, NULL); ++ set_pax_entry_num(paxh + 108, st->st_uid, 8, "uid", paxbufp); ++ set_pax_entry_num(paxh + 116, st->st_gid, 8, "gid", paxbufp); ++ set_pax_entry_num(paxh + 124, size, 12, "size", paxbufp); ++ set_pax_entry_num(paxh + 136, st->st_mtime, 12, "mtime", paxbufp); ++ memset(paxh + 148, ' ', 8); ++ paxh[156] = tartype; ++ if (tartype == '1' || tartype == '2') ++ set_pax_entry_str(paxh + 157, tartype == '1' ? hlink : flink, 100, "linkpath", paxbufp); ++ memcpy(paxh + 257, "ustar\00000", 8); ++ set_pax_entry_str(paxh + 265, rpmfiFUser(fi), 32, "user", paxbufp); ++ set_pax_entry_str(paxh + 297, rpmfiFGroup(fi), 32, "group", paxbufp); ++ set_pax_entry_num(paxh + 329, major(st->st_rdev), 8, "SCHILY.devmajor", paxbufp); ++ set_pax_entry_num(paxh + 337, minor(st->st_rdev), 8, "SCHILY.devminor", paxbufp); ++ int i, checksum = 0; ++ for (i = 0; i < 512; i++) ++ checksum += paxh[i]; ++ set_pax_entry_num(paxh + 148, checksum, 8, NULL, NULL); ++ paxh[148 + 6] = 0; ++ paxh[148 + 7] = ' '; ++ /* write pax header if we need it */ ++ if (paxbuf) { ++ int r = write_pax_entry_pax(fdo, fi, filename, st, paxbuf); ++ free(paxbuf); ++ if (r) ++ return RPMRC_FAIL; ++ } ++ /* write entry header */ ++ if (do_fwrite(fdo, paxh, 512)) ++ return RPMRC_FAIL; ++ if (tartype != '0' && tartype != 'x') ++ return RPMRC_OK; /* no content for those types */ ++ /* write content */ ++ if (tartype == '0' && size && do_fwrite_content(fdo, buf, fi)) ++ return RPMRC_FAIL; ++ if (tartype == 'x' && size && do_fwrite(fdo, buf, size)) ++ return RPMRC_FAIL; ++ /* write padding */ ++ size &= 511; ++ if (size) { ++ memset(paxh, 0, sizeof(paxh)); ++ if (do_fwrite(fdo, paxh, 512 - size)) ++ return RPMRC_FAIL; ++ } ++ return RPMRC_OK; ++} ++ ++static int write_pax_entry_pax(FD_t fdo, rpmfi fi, const char *filename, struct stat *st, char *paxbuf) ++{ ++ /* tweak stat data and filename */ ++ struct stat paxst = *st; ++ paxst.st_size = strlen(paxbuf); ++ paxst.st_mode = paxst.st_mode & 0777; ++ if (paxst.st_uid >= (1 << 18)) ++ paxst.st_uid = (1 << 18) - 1; ++ if (paxst.st_gid >= (1 << 18)) ++ paxst.st_gid = (1 << 18) - 1; ++ if (paxst.st_mtime < 0) ++ paxst.st_mtime = 0; ++ if ((unsigned long long)paxst.st_mtime >= 1ULL << 33) ++ paxst.st_mtime = (time_t)((1ULL << 33) - 1); ++ return write_pax_entry(fdo, fi, NULL, &paxst, filename, NULL, paxbuf); ++} ++ ++static int process_package(rpmts ts, const char * filename) ++{ ++ FD_t fdi; ++ FD_t gzdi; ++ FD_t fdo; ++ Header h; ++ int rc = 0; ++ char * rpmio_flags = NULL; ++ int iscpio = 0; ++ ++ if (!strcmp(filename, "-")) { ++ if(isatty(STDIN_FILENO)) { ++ fprintf(stderr, "Error: missing input RPM package\n"); ++ exit(EXIT_FAILURE); ++ } ++ fdi = fdDup(STDIN_FILENO); ++ } else { ++ fdi = Fopen(filename, "r.ufdio"); ++ } ++ ++ if (Ferror(fdi)) { ++ fprintf(stderr, "rpm2archive: %s: %s\n", ++ filename, Fstrerror(fdi)); ++ exit(EXIT_FAILURE); ++ } ++ ++ rc = rpmReadPackageFile(ts, fdi, "rpm2cpio", &h); ++ ++ switch (rc) { ++ case RPMRC_OK: ++ case RPMRC_NOKEY: ++ case RPMRC_NOTTRUSTED: ++ break; ++ case RPMRC_NOTFOUND: ++ fprintf(stderr, _("argument is not an RPM package\n")); ++ exit(EXIT_FAILURE); ++ break; ++ case RPMRC_FAIL: ++ default: ++ fprintf(stderr, _("error reading header from package\n")); ++ exit(EXIT_FAILURE); ++ break; ++ } ++ ++ ++ /* Retrieve payload size and compression type. */ ++ { const char *compr = headerGetString(h, RPMTAG_PAYLOADCOMPRESSOR); ++ rpmio_flags = rstrscat(NULL, "r.", compr ? compr : "gzip", NULL); ++ } ++ ++ gzdi = Fdopen(fdi, rpmio_flags); /* XXX gzdi == fdi */ ++ free(rpmio_flags); ++ ++ if (gzdi == NULL) { ++ fprintf(stderr, _("cannot re-open payload: %s\n"), Fstrerror(gzdi)); ++ exit(EXIT_FAILURE); ++ } ++ ++ if (rstreq(format, "pax")) { ++ iscpio = 0; ++ } else if (rstreq(format, "cpio")) { ++ iscpio = 1; ++ } else { ++ fprintf(stderr, "Error: Format %s is not supported\n", format); ++ exit(EXIT_FAILURE); ++ } ++ ++ if (!isatty(STDOUT_FILENO)) { ++ fdo = fdDup(STDOUT_FILENO); ++ } else { ++ if (!strcmp(filename, "-")) { ++ fprintf(stderr, "Error: refusing to output archive data to a terminal.\n"); ++ exit(EXIT_FAILURE); ++ } ++ char * outname; ++ if (urlIsURL(filename)) { ++ const char * fname = strrchr(filename, '/'); ++ if (fname != NULL) { ++ fname++; ++ } else { ++ fname = filename; ++ } ++ outname = rstrscat(NULL, fname, NULL); ++ } else { ++ outname = rstrscat(NULL, filename, NULL); ++ } ++ if (compress) { ++ outname = rstrscat(&outname, ".tgz", NULL); ++ } else { ++ outname = rstrscat(&outname, ".tar", NULL); ++ } ++ fdo = Fopen(outname, "w.ufdio"); ++ if (!fdo) { ++ fprintf(stderr, "Error: Can't open output file: %s\n", outname); ++ exit(EXIT_FAILURE); ++ } ++ _free(outname); ++ } ++ if (compress && fdo) ++ fdo = Fdopen(fdo, "w.gzdio"); ++ if (!fdo) { ++ fprintf(stderr, "Error: Can't setup output file\n"); ++ exit(EXIT_FAILURE); ++ } ++ ++ char * buf = (char *)xmalloc(BUFSIZE); ++ char * hardlink = NULL; ++ ++ rpmfiles files = rpmfilesNew(NULL, h, 0, RPMFI_KEEPHEADER); ++ rpmfi fi = rpmfiNewArchiveReader(gzdi, files, iscpio ? RPMFI_ITER_READ_ARCHIVE : RPMFI_ITER_READ_ARCHIVE_CONTENT_FIRST); ++ ++ while ((rc = rpmfiNext(fi)) >= 0) { ++ struct stat st; ++ const char *dn, *flink; ++ char *filename; ++ if (rpmfiStat(fi, 0, &st)) { ++ break; ++ } ++ dn = rpmfiDN(fi); ++ if (!strcmp(dn, "")) dn = "/"; ++ filename = rstrscat(NULL, ".", dn, rpmfiBN(fi), NULL); ++ flink = S_ISLNK(st.st_mode) ? rpmfiFLink(fi) : NULL; ++ if (st.st_nlink > 1 && !iscpio) { ++ if (rpmfiArchiveHasContent(fi)) { ++ /* hardlink sizes are special, see rpmfiStat() */ ++ _free(hardlink); ++ hardlink = xstrdup(filename); ++ } ++ } ++ if (iscpio) ++ rc = write_cpio_entry(fdo, fi, filename, &st, flink, st.st_nlink > 1 ? hardlink : NULL, buf); ++ else ++ rc = write_pax_entry(fdo, fi, filename, &st, flink, st.st_nlink > 1 ? hardlink : NULL, buf); ++ _free(filename); ++ if (rc == RPMRC_FAIL) ++ break; ++ } ++ /* End of iteration is not an error, everything else is */ ++ if (rc == RPMERR_ITER_END) { ++ rc = 0; ++ } else { ++ rc = 1; ++ } ++ ++ /* write trailer */ ++ if (!rc) { ++ if (iscpio) ++ rc = write_cpio_entry(fdo, NULL, NULL, NULL, NULL, NULL, buf); ++ else ++ rc = write_pax_entry(fdo, NULL, NULL, NULL, NULL, NULL, buf); ++ rc = rc == RPMRC_FAIL ? 1 : 0; ++ } ++ ++ if (Fclose(fdo) && !rc) { ++ fprintf(stderr, "Error writing archive\n"); ++ rc = 1; ++ } ++ ++ _free(hardlink); ++ ++ Fclose(gzdi); /* XXX gzdi == fdi */ ++ buf = _free(buf); ++ rpmfilesFree(files); ++ rpmfiFree(fi); ++ headerFree(h); ++ return rc; ++} ++#endif ++ ++ + int main(int argc, char *argv[]) + { + int rc = 0; diff --git a/rpmpgp_legacy-1.1.tar.gz b/rpmpgp_legacy-1.1.tar.gz new file mode 100644 index 0000000..e24b237 --- /dev/null +++ b/rpmpgp_legacy-1.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e123301a48b8d64e97f1c168097e023baa68f5f352adb3e8c954d4ac7efd0cf +size 33987 diff --git a/rpmqpack.diff b/rpmqpack.diff index faee0f1..6180198 100644 --- a/rpmqpack.diff +++ b/rpmqpack.diff @@ -1,15 +1,15 @@ ---- docs/man/CMakeLists.txt.orig 2024-02-07 13:36:51.000000000 +0000 -+++ docs/man/CMakeLists.txt 2024-02-09 10:36:43.300952115 +0000 +--- docs/man/CMakeLists.txt.orig 2025-02-19 15:29:33.000000000 +0000 ++++ docs/man/CMakeLists.txt 2025-03-07 13:16:59.913873002 +0000 @@ -2,6 +2,7 @@ set(core - gendiff.1 rpm2cpio.8 + gendiff.1 rpm2cpio.8 rpm2archive.8 rpm.8 rpmbuild.8 rpmdb.8 rpmkeys.8 rpmsign.8 rpmspec.8 rpmdeps.8 rpmgraph.8 rpmlua.8 rpm-misc.8 rpmsort.8 + rpmqpack.8 ) set(extra - rpm2archive.8 rpm-plugins.8 rpm-plugin-prioreset.8 rpm-plugin-syslog.8 ---- docs/man/rpmqpack.8.orig 2024-02-09 10:36:43.300952115 +0000 -+++ docs/man/rpmqpack.8 2024-02-09 10:36:43.300952115 +0000 + rpm-plugins.8 rpm-plugin-prioreset.8 rpm-plugin-syslog.8 +--- docs/man/rpmqpack.8.orig 2025-03-07 13:16:59.913873002 +0000 ++++ docs/man/rpmqpack.8 2025-03-07 13:16:59.913873002 +0000 @@ -0,0 +1,25 @@ +.TH RPMQPACK 8 "Mar 2002" +.SH NAME @@ -36,9 +36,9 @@ + +.SH AUTHOR +Michael Schroeder ---- tools/CMakeLists.txt.orig 2024-02-07 13:36:51.000000000 +0000 -+++ tools/CMakeLists.txt 2024-02-09 10:37:32.932875459 +0000 -@@ -7,6 +7,7 @@ add_executable(rpm2cpio rpm2cpio.c cliut +--- tools/CMakeLists.txt.orig 2025-02-19 15:29:33.000000000 +0000 ++++ tools/CMakeLists.txt 2025-03-07 13:16:59.913873002 +0000 +@@ -6,6 +6,7 @@ add_executable(rpmkeys rpmkeys.c cliutil add_executable(rpmsign rpmsign.c cliutils) add_executable(rpmbuild rpmbuild.c cliutils) add_executable(rpmspec rpmspec.c cliutils) @@ -46,17 +46,17 @@ add_executable(rpmdeps rpmdeps.c) add_executable(rpmgraph rpmgraph.c) -@@ -60,7 +61,7 @@ foreach(cmd rpmverify rpmquery) - endforeach() +@@ -73,7 +74,7 @@ endif() + install(TARGETS - rpm rpmdb rpmkeys rpm2cpio rpmsign rpmbuild rpmspec + rpm rpmdb rpmkeys rpmsign rpmbuild rpmspec - rpmlua rpmgraph + rpmlua rpmgraph rpmqpack ) - install(TARGETS rpmdeps rpmuncompress DESTINATION ${RPM_CONFIGDIR}) + install(TARGETS rpmdeps rpmdump rpmuncompress DESTINATION ${RPM_CONFIGDIR}) ---- tools/rpmqpack.c.orig 2024-02-09 10:36:43.300952115 +0000 -+++ tools/rpmqpack.c 2024-02-09 10:36:43.300952115 +0000 +--- tools/rpmqpack.c.orig 2025-03-07 13:16:59.913873002 +0000 ++++ tools/rpmqpack.c 2025-03-07 13:16:59.913873002 +0000 @@ -0,0 +1,60 @@ +#include +#include diff --git a/specfilemacro.diff b/specfilemacro.diff index 1e1ee6d..ee27c38 100644 --- a/specfilemacro.diff +++ b/specfilemacro.diff @@ -1,10 +1,10 @@ ---- build/parseSpec.c.orig 2013-06-10 15:55:10.000000000 +0000 -+++ build/parseSpec.c 2013-07-12 12:04:11.000000000 +0000 -@@ -561,6 +561,7 @@ static rpmSpec parseSpec(const char *spe +--- build/parseSpec.c.orig 2024-10-07 09:35:46.000000000 +0000 ++++ build/parseSpec.c 2024-12-16 09:19:43.511920745 +0000 +@@ -1309,6 +1309,7 @@ static rpmSpec parseSpec(const char *spe spec = newSpec(); spec->specFile = rpmGetPath(specFile, NULL); + addMacro(spec->macros, "_specfile", NULL, spec->specFile, RMIL_SPEC); pushOFI(spec, spec->specFile); - /* If buildRoot not specified, use default %{buildroot} */ - if (buildRoot) { + /* If explicit --buildroot was passed, grab hold of it */ + if (buildRoot) diff --git a/undefbuildroot.diff b/undefbuildroot.diff new file mode 100644 index 0000000..64dbff0 --- /dev/null +++ b/undefbuildroot.diff @@ -0,0 +1,15 @@ +--- build/parseSpec.c.orig 2025-01-07 09:55:58.006136886 +0000 ++++ build/parseSpec.c 2025-01-07 09:56:23.618086661 +0000 +@@ -1321,9 +1321,11 @@ static rpmSpec parseSpec(const char *spe + rpmPushMacroFlags(spec->macros, "_top_builddir", NULL, + top_builddir, RMIL_GLOBAL, RPMMACRO_LITERAL); + +- /* Undefine (!!) %_builddir so %global misuses fall through */ ++ /* Undefine (!!) %_builddir and %buildroot so %global misuses fall through */ + while (rpmMacroIsDefined(spec->macros, "_builddir")) + rpmPopMacro(spec->macros, "_builddir"); ++ while (rpmMacroIsDefined(spec->macros, "buildroot")) ++ rpmPopMacro(spec->macros, "buildroot"); + free(top_builddir); + } + diff --git a/unshare.diff b/unshare.diff new file mode 100644 index 0000000..a20d8f2 --- /dev/null +++ b/unshare.diff @@ -0,0 +1,28 @@ +--- plugins/unshare.c.orig 2025-02-19 15:29:33.000000000 +0000 ++++ plugins/unshare.c 2025-03-07 13:21:21.145450130 +0000 +@@ -15,6 +15,16 @@ + static ARGV_t private_mounts = NULL; + static int unshare_flags = 0; + ++static int in_chroot() ++{ ++ struct stat sta, stb; ++ if (stat("/", &sta)) ++ return 0; ++ if (stat("/proc/1/root", &stb)) ++ return 1; /* proc not mounted, assume chroot */ ++ return sta.st_dev == stb.st_dev && sta.st_ino == stb.st_ino ? 0 : 1; ++} ++ + static rpmRC unshare_init(rpmPlugin plugin, rpmts ts) + { + char *paths = rpmExpand("%{?__transaction_unshare_paths}", NULL); +@@ -24,7 +34,7 @@ static rpmRC unshare_init(rpmPlugin plug + * Changing mount propagation from inside a chroot fails if the root + * is not also a mount point, disable for now. + */ +- if (strcmp(rpmtsRootDir(ts), "/")) { ++ if (strcmp(rpmtsRootDir(ts), "/") || in_chroot()) { + rpmlog(RPMLOG_WARNING, + "private mounts in chroot not implemented\n"); + } else { diff --git a/zstdpool.diff b/zstdpool.diff index 23b4e62..314f0c6 100644 --- a/zstdpool.diff +++ b/zstdpool.diff @@ -1,5 +1,5 @@ ---- rpmio/rpmio.c.orig 2023-09-19 10:10:10.000000000 +0000 -+++ rpmio/rpmio.c 2023-10-10 12:09:28.171040124 +0000 +--- rpmio/rpmio.c.orig 2024-10-07 09:35:46.000000000 +0000 ++++ rpmio/rpmio.c 2024-12-16 09:42:02.197155600 +0000 @@ -8,6 +8,7 @@ #include #include @@ -8,7 +8,7 @@ #include #include -@@ -997,6 +998,7 @@ static const FDIO_t lzdio = &lzdio_s; +@@ -996,6 +997,7 @@ const FDIO_t lzdio = &lzdio_s; /* Support for ZSTD library. */ #ifdef HAVE_ZSTD @@ -16,7 +16,7 @@ #include typedef struct rpmzstd_s { -@@ -1011,6 +1013,29 @@ typedef struct rpmzstd_s { +@@ -1013,6 +1015,29 @@ typedef struct rpmzstd_s { ZSTD_outBuffer zob; /*!< ZSTD_outBuffer */ } * rpmzstd; @@ -45,21 +45,21 @@ + static rpmzstd rpmzstdNew(int fdno, const char *fmode) { - int flags = 0; -@@ -1116,8 +1141,18 @@ static rpmzstd rpmzstdNew(int fdno, cons + rpmzstd zstd = NULL; +@@ -1119,8 +1144,18 @@ static rpmzstd rpmzstdNew(int fdno, cons } if (threads > 0) { -- if (ZSTD_isError (ZSTD_CCtx_setParameter(_stream, ZSTD_c_nbWorkers, threads))) -+ if (ZSTD_isError (ZSTD_CCtx_setParameter(_stream, ZSTD_c_nbWorkers, threads))) { +- if (ZSTD_isError (ZSTD_CCtx_setParameter(zstd->stream.c, ZSTD_c_nbWorkers, threads))) ++ if (ZSTD_isError (ZSTD_CCtx_setParameter(zstd->stream.c, ZSTD_c_nbWorkers, threads))) { rpmlog(RPMLOG_DEBUG, "zstd library does not support multi-threading\n"); + } else { +#if ZSTD_VERSION_NUMBER >= 10407 + pthread_once(&zstdThreadPoolCreated, zstdCreateThreadPool); + if (zstdThreadPool) { + if (threads > zstdThreadPoolThreads) -+ ZSTD_CCtx_setParameter(_stream, ZSTD_c_nbWorkers, zstdThreadPoolThreads); -+ ZSTD_CCtx_refThreadPool(_stream, zstdThreadPool); ++ ZSTD_CCtx_setParameter(zstd->stream.c, ZSTD_c_nbWorkers, zstdThreadPoolThreads); ++ ZSTD_CCtx_refThreadPool(zstd->stream.c, zstdThreadPool); + } +#endif + }