Github messages for voidlinux
 help / color / mirror / Atom feed
From: classabbyamp <classabbyamp@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] common/xbps-src/shutils/chroot.sh: support importing other keys
Date: Sat, 18 Nov 2023 05:22:30 +0100	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-47291@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 742 bytes --]

There is a new pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages etc-repo-keys
https://github.com/void-linux/void-packages/pull/47291

common/xbps-src/shutils/chroot.sh: support importing other keys
When packages in `hostdir/binpkgs` are signed, it causes `xbps-src` to annoyingly request to import the associated key (every time, in the case of automation tools like `xxbuild` or `ymir`). This allows the user to add their personal public key `.plist` to `etc/repo-keys/` so this prompting does not happen.

#### Testing the changes
- I tested the changes in this PR: **YES**


A patch file from https://github.com/void-linux/void-packages/pull/47291.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-etc-repo-keys-47291.patch --]
[-- Type: text/x-diff, Size: 2176 bytes --]

From b9f5b0e725d11f785c54a6cf81327637e112e58d Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 17 Nov 2023 23:19:16 -0500
Subject: [PATCH] common/xbps-src/shutils/chroot.sh: support importing other
 keys

When packages in `hostdir/binpkgs` are signed, it causes `xbps-src` to
annoyingly request to import the associated key (every time, in the case
of automation tools like `xxbuild` or `ymir`). This allows the user to
add their personal public key `.plist` to `etc/repo-keys/` so this
prompting does not happen.
---
 .gitignore                        | 1 +
 README.md                         | 3 +++
 common/xbps-src/shutils/chroot.sh | 3 +++
 3 files changed, 7 insertions(+)

diff --git a/.gitignore b/.gitignore
index ae75426d89b57..0a1b2da0284e7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,3 +21,4 @@ etc/conf
 etc/conf.*
 etc/virtual
 etc/xbps.d/custom
+etc/repo-keys
diff --git a/README.md b/README.md
index a63ee5e8082d4..b52198c98dd3c 100644
--- a/README.md
+++ b/README.md
@@ -340,6 +340,9 @@ Each time a binary package is created, a package signature must be created with
 
 > It is not possible to sign a repository with multiple RSA keys.
 
+If packages in `hostdir/binpkgs` are signed, the key in `.plist` format (as imported by xbps) can be placed
+in `etc/repo-keys/` to prevent xbps-src from prompting to import that key.
+
 <a name="rebuilding"></a>
 ### Rebuilding and overwriting existing local packages
 
diff --git a/common/xbps-src/shutils/chroot.sh b/common/xbps-src/shutils/chroot.sh
index d65d8d7e30741..69ca6b78f5838 100644
--- a/common/xbps-src/shutils/chroot.sh
+++ b/common/xbps-src/shutils/chroot.sh
@@ -309,6 +309,9 @@ chroot_sync_repodata() {
     # Copy xbps repository keys to the masterdir.
     mkdir -p $XBPS_MASTERDIR/var/db/xbps/keys
     cp -f $XBPS_COMMONDIR/repo-keys/*.plist $XBPS_MASTERDIR/var/db/xbps/keys
+    if [ -n "$(shopt -s nullglob; echo "$XBPS_DISTDIR"/etc/repo-keys/*.plist)" ]; then
+        cp -f "$XBPS_DISTDIR"/etc/repo-keys/*.plist "$XBPS_MASTERDIR"/var/db/xbps/keys
+    fi
 
     # Make sure to sync index for remote repositories.
     if [ -z "$XBPS_SKIP_REMOTEREPOS" ]; then

             reply	other threads:[~2023-11-18  4:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-18  4:22 classabbyamp [this message]
2023-11-25 20:27 ` [PR PATCH] [Merged]: " classabbyamp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-47291@inbox.vuxu.org \
    --to=classabbyamp@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).