Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] common/xbps-src/shutils/chroot.sh: support importing other keys
@ 2023-11-18  4:22 classabbyamp
  2023-11-25 20:27 ` [PR PATCH] [Merged]: " classabbyamp
  0 siblings, 1 reply; 2+ messages in thread
From: classabbyamp @ 2023-11-18  4:22 UTC (permalink / raw)
  To: ml

[-- 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PR PATCH] [Merged]: common/xbps-src/shutils/chroot.sh: support importing other keys
  2023-11-18  4:22 [PR PATCH] common/xbps-src/shutils/chroot.sh: support importing other keys classabbyamp
@ 2023-11-25 20:27 ` classabbyamp
  0 siblings, 0 replies; 2+ messages in thread
From: classabbyamp @ 2023-11-25 20:27 UTC (permalink / raw)
  To: ml

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

There's a merged pull request on the void-packages repository

common/xbps-src/shutils/chroot.sh: support importing other keys
https://github.com/void-linux/void-packages/pull/47291

Description:
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**


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-25 20:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-18  4:22 [PR PATCH] common/xbps-src/shutils/chroot.sh: support importing other keys classabbyamp
2023-11-25 20:27 ` [PR PATCH] [Merged]: " classabbyamp

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).