[Rpm-maint] [rpm-software-management/rpm] Implement rpmkeys --rebuild (PR #3474)

Panu Matilainen notifications at github.com
Thu Nov 28 15:03:26 UTC 2024


@pmatilai commented on this pull request.



> +    auto macros = rpm::macros();
+    auto [mrc, keyringpath] = macros.expand("%{_keyringpath}");
+    while ('/' == keyringpath.back())
+	keyringpath.pop_back();
+    std::string path = rpm::expand_path({rpmtxnRootDir(txn), keyringpath});
+    std::string tmppath = keyringpath + ".tmp/";
+    std::string oldpath = keyringpath + ".rpmold/";
+    std::error_code ec = {};
+    rpmRC rc = RPMRC_OK;
+
+    macros.push("_keyringpath", "", tmppath.c_str(), 0);
+
+    rpmPubkey key = NULL;
+    auto iter = rpmKeyringInitIterator(keys, 0);
+    while ((rc == RPMRC_OK) && (key = rpmKeyringIteratorNext(iter))) {
+	rc = store->import_key(txn, key, 0, 0);

... Also this suggests that there shoudn't perhaps be a separate keystore-specific rebuild operation, ie it should just be handled by the rpmts-level rebuild - if we use the rpmdb backend as a model, that doesn't have a backend-specific rebuild operation either.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3474#discussion_r1862351277
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/3474/review/2468401856 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20241128/6b9f7964/attachment.htm>


More information about the Rpm-maint mailing list