Skip to content

Instantly share code, notes, and snippets.

@chantra
Created March 29, 2022 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chantra/fdcf38f8e12f29bab539a5d0dde97ea7 to your computer and use it in GitHub Desktop.
Save chantra/fdcf38f8e12f29bab539a5d0dde97ea7 to your computer and use it in GitHub Desktop.
diff -wbBdu -ruN a/0001-RPM-with-Copy-on-Write.patch b/0001-RPM-with-Copy-on-Write.patch
--- a/0001-RPM-with-Copy-on-Write.patch 2022-03-29 09:37:26.890154992 -0700
+++ b/0001-RPM-with-Copy-on-Write.patch 2022-03-29 10:13:47.452509220 -0700
@@ -146,7 +146,7 @@
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -8,6 +8,7 @@
- #include <inttypes.h>
+
#include <utime.h>
#include <errno.h>
+#include <stdbool.h>
diff -wbBdu -ruN a/0002-Remove-use-of-bool-type-for-consistency.patch b/0002-Remove-use-of-bool-type-for-consistency.patch
--- a/0002-Remove-use-of-bool-type-for-consistency.patch 2022-03-29 09:37:26.890154992 -0700
+++ b/0002-Remove-use-of-bool-type-for-consistency.patch 2022-03-29 10:13:47.453509219 -0700
@@ -12,7 +12,7 @@
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -8,7 +8,6 @@
- #include <inttypes.h>
+
#include <utime.h>
#include <errno.h>
-#include <stdbool.h>
diff -wbBdu -ruN a/0005-tests-rpm2extents-Add-basic-tests-for-rpm2extents.patch b/0005-tests-rpm2extents-Add-basic-tests-for-rpm2extents.patch
--- a/0005-tests-rpm2extents-Add-basic-tests-for-rpm2extents.patch 2022-03-29 09:37:26.890154992 -0700
+++ b/0005-tests-rpm2extents-Add-basic-tests-for-rpm2extents.patch 2022-03-29 10:13:47.453509219 -0700
@@ -15,9 +15,9 @@
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -36,6 +36,7 @@ TESTSUITE_AT += rpmio.at
+ TESTSUITE_AT += rpmio.at
TESTSUITE_AT += rpmorder.at
TESTSUITE_AT += rpmvfylevel.at
- TESTSUITE_AT += rpmpgp.at
+TESTSUITE_AT += rpm2extents.at
EXTRA_DIST += $(TESTSUITE_AT)
@@ -64,9 +64,9 @@
--- a/tests/rpmtests.at
+++ b/tests/rpmtests.at
@@ -21,3 +21,4 @@ m4_include([rpmreplace.at])
- m4_include([rpmconfig.at])
- m4_include([rpmconfig2.at])
- m4_include([rpmconfig3.at])
+ m4_include([rpmmacro.at])
+ m4_include([rpmpython.at])
+ m4_include([rpmdepmatch.at])
+m4_include([rpm2extents.at])
--
2.35.1
diff -wbBdu -ruN a/0010-rpm2extents-Make-rpmkeys-support-reading-metadata-fr.patch b/0010-rpm2extents-Make-rpmkeys-support-reading-metadata-fr.patch
--- a/0010-rpm2extents-Make-rpmkeys-support-reading-metadata-fr.patch 2022-03-29 09:37:26.891154990 -0700
+++ b/0010-rpm2extents-Make-rpmkeys-support-reading-metadata-fr.patch 2022-03-29 10:13:47.453509219 -0700
@@ -23,9 +23,9 @@
+ */
+#define MAGIC 3472329499408095051
+
+ int _print_pkts = 0;
+
static int doImport(rpmts ts, const char *fn, char *buf, ssize_t blen)
- {
- char const * const pgpmark = "-----BEGIN PGP ";
@@ -220,6 +225,107 @@ exit:
return rc;
}
diff -wbBdu -ruN a/0012-rpmextents-Create-an-internal-library-to-make-rpmext.patch b/0012-rpmextents-Create-an-internal-library-to-make-rpmext.patch
--- a/0012-rpmextents-Create-an-internal-library-to-make-rpmext.patch 2022-03-29 09:37:26.891154990 -0700
+++ b/0012-rpmextents-Create-an-internal-library-to-make-rpmext.patch 2022-03-29 10:13:47.453509219 -0700
@@ -47,9 +47,9 @@
- */
-#define MAGIC 3472329499408095051
-
+ int _print_pkts = 0;
+
static int doImport(rpmts ts, const char *fn, char *buf, ssize_t blen)
- {
- char const * const pgpmark = "-----BEGIN PGP ";
@@ -225,42 +221,6 @@ exit:
return rc;
}
diff -wbBdu -ruN a/0016-test-new-runroot_plugins-function-to-run-command-in-.patch b/0016-test-new-runroot_plugins-function-to-run-command-in-.patch
--- a/0016-test-new-runroot_plugins-function-to-run-command-in-.patch 2022-03-29 09:37:26.891154990 -0700
+++ b/0016-test-new-runroot_plugins-function-to-run-command-in-.patch 2022-03-29 10:13:47.454509217 -0700
@@ -12,13 +12,12 @@
index c3189d327..c18637362 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
-@@ -82,6 +82,15 @@ function runroot()
+@@ -82,6 +82,14 @@ function runroot()
)
}
+function runroot_plugins()
+{
-+ setup_env
+ (unset RPM_CONFIGDIR RPM_POPTEXEC_PATH; cd ${RPMTEST} && \
+ MAGIC="/magic/magic" FAKECHROOT_BASE="${RPMTEST}" fakechroot "$@" --define "_buildhost testhost" --define "_topdir /build" --nouserns
+ )
@@ -27,7 +26,7 @@
+
function runroot_other()
{
- setup_env
+ (unset RPM_CONFIGDIR RPM_POPTEXEC_PATH; cd ${RPMTEST} && \
--
2.35.1
diff -wbBdu -ruN a/0017-test-Add-test-installing-an-RPM-with-reflink-plugin.patch b/0017-test-Add-test-installing-an-RPM-with-reflink-plugin.patch
--- a/0017-test-Add-test-installing-an-RPM-with-reflink-plugin.patch 2022-03-29 09:37:26.891154990 -0700
+++ b/0017-test-Add-test-installing-an-RPM-with-reflink-plugin.patch 2022-03-29 10:13:47.454509217 -0700
@@ -16,8 +16,8 @@
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -50,6 +50,19 @@ else
- CAP_DISABLED=true;
- fi
+
+ RPM_XFAIL=${RPM_XFAIL-1}
+FSTYPE=$(stat -f -c %T /)
+REFLINKABLE_FS=("xfs" "brtfs")
@@ -32,9 +32,9 @@
+ fi
+done
+
- function setup_env()
+ function run()
{
- if [ -d testing ]; then
+ "$@" --define "_tmppath ${RPMTEST}/tmp" --define "_topdir ${TOPDIR}" --dbpath="${RPMTEST}/var/lib/rpm/"
diff --git a/tests/rpm2extents.at b/tests/rpm2extents.at
index 18accfc75..44e46a68e 100644
--- a/tests/rpm2extents.at
diff -wbBdu -ruN a/0030-rpmcow-Make-rpm-i-install-package-without-the-need-o.patch b/0030-rpmcow-Make-rpm-i-install-package-without-the-need-o.patch
--- a/0030-rpmcow-Make-rpm-i-install-package-without-the-need-o.patch 2022-03-29 09:37:26.892154988 -0700
+++ b/0030-rpmcow-Make-rpm-i-install-package-without-the-need-o.patch 2022-03-29 10:13:47.455509215 -0700
@@ -25,43 +25,36 @@
#include "lib/rpmvs.h"
#include "rpmio/rpmhook.h"
#include "lib/rpmtriggers.h"
-@@ -1286,19 +1287,25 @@ static int verifyPackageFiles(rpmts ts, rpm_loff_t total)
+@@ -1255,10 +1256,16 @@ static int verifyPackageFiles(rpmts ts, rpm_loff_t total)
+ .signature = RPMRC_NOTFOUND,
+ .vfylevel = vfylevel,
+ };
++ int verified = 0;
+ rpmRC prc = RPMRC_FAIL;
rpmtsNotify(ts, p, RPMCALLBACK_VERIFY_PROGRESS, oc++, total);
FD_t fd = rpmtsNotify(ts, p, RPMCALLBACK_INST_OPEN_FILE, 0, 0);
-- if (fd != NULL) {
-- prc = rpmpkgRead(vs, fd, NULL, NULL, &vd.msg);
-- rpmtsNotify(ts, p, RPMCALLBACK_INST_CLOSE_FILE, 0, 0);
+ if(fd != NULL && isTranscodedRpm(fd) == RPMRC_OK) {
+ /* Transcoded RPMs are validated at transcoding time */
+ prc = RPMRC_OK;
+ verified = 1;
+ } else {
-+ if (fd != NULL) {
-+ prc = rpmpkgRead(vs, fd, NULL, NULL, &vd.msg);
-+ rpmtsNotify(ts, p, RPMCALLBACK_INST_CLOSE_FILE, 0, 0);
+ if (fd != NULL) {
+ prc = rpmpkgRead(vs, fd, NULL, NULL, &vd.msg);
+ rpmtsNotify(ts, p, RPMCALLBACK_INST_CLOSE_FILE, 0, 0);
+@@ -1267,8 +1274,11 @@ static int verifyPackageFiles(rpmts ts, rpm_loff_t total)
+ if (prc == RPMRC_OK)
+ prc = rpmvsVerify(vs, RPMSIG_VERIFIABLE_TYPE, vfyCb, &vd);
+
++ verified = vd.signature == RPMRC_OK;
+ }
-+ if (prc == RPMRC_OK)
-+ prc = rpmvsVerify(vs, RPMSIG_VERIFIABLE_TYPE, vfyCb, &vd);
+
-+ /* Record verify result */
-+ if (vd.type[RPMSIG_SIGNATURE_TYPE] == RPMRC_OK)
-+ verified |= RPMSIG_SIGNATURE_TYPE;
-+ if (vd.type[RPMSIG_DIGEST_TYPE] == RPMRC_OK)
-+ verified |= RPMSIG_DIGEST_TYPE;
- }
-
-- if (prc == RPMRC_OK)
-- prc = rpmvsVerify(vs, RPMSIG_VERIFIABLE_TYPE, vfyCb, &vd);
--
-- /* Record verify result */
-- if (vd.type[RPMSIG_SIGNATURE_TYPE] == RPMRC_OK)
-- verified |= RPMSIG_SIGNATURE_TYPE;
-- if (vd.type[RPMSIG_DIGEST_TYPE] == RPMRC_OK)
-- verified |= RPMSIG_DIGEST_TYPE;
- rpmteSetVerified(p, verified);
+ /* Record verify result, signatures only for now */
+- rpmteSetVerified(p, vd.signature == RPMRC_OK);
++ rpmteSetVerified(p, verified);
if (prc)
+ rpmteAddProblem(p, RPMPROB_VERIFY, NULL, vd.msg, 0);
diff --git a/tests/rpm2extents.at b/tests/rpm2extents.at
index 5c66de7f6..5135c9cf8 100644
--- a/tests/rpm2extents.at
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment