unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kai Jellinghaus <kaij@j10-labs.com>
To: guix-devel@gnu.org
Subject: Respect channel directory for 'guix channel
Date: Thu, 8 Aug 2024 02:24:23 +0200	[thread overview]
Message-ID: <CANgSNSMmnS97d=ws_B0hUAuh5TNTH98axQ=B3adt3bsSTb=KNg@mail.gmail.com> (raw)

I'm aware it's a bit of a special use-case but I'm wondering whether
it'd be possible to respect the channel directory (from .guix-channel)
when looking for self-build.\?
I've managed to get it somewhat working (by modifying
guix/channels.scm when looking for the file, and when applying
patches).
It does cause some unnecessary loads of .guix-channel, and my guille
knowledge hasn't progressed to the point that I could figure out how
to structure it differently.
There may also be some concern that this will fail too early for an
invalid 'guix channel? Not sure.

Here's a patch (not possible to apply as-is, sorry, the hashes will be off)
---
 guix-channel/guix/channels.scm | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/guix-channel/guix/channels.scm b/guix-channel/guix/channels.scm
index 34f63eb833..de9c239872 100644
--- a/guix-channel/guix/channels.scm
+++ b/guix-channel/guix/channels.scm
@@ -455,7 +455,10 @@ (define (dot-git? file stat)
     (when (guix-channel? channel)
       ;; Apply the relevant subset of PATCHES directly in CHECKOUT.  This is
       ;; safe to do because 'switch-to-ref' eventually does a hard reset.
-      (apply-patches checkout commit patches))
+      (apply-patches
+        (string-append checkout (channel-metadata-directory
+          (read-channel-metadata-from-source checkout)))
+        commit patches))

     (let* ((name     (url+commit->name (channel-url channel) commit))
            (checkout (add-to-store store name #t "sha256" checkout
@@ -717,7 +720,9 @@ (define name
     (symbol->string
      (channel-name (channel-instance-channel instance))))
   (define source
-    (channel-instance-checkout instance))
+    (string-append
+      (channel-instance-checkout instance)
+      (channel-metadata-directory (channel-instance-metadata instance))))
   (define commit
     (channel-instance-commit instance))

-- 
2.46.0


                 reply	other threads:[~2024-08-08  0:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to='CANgSNSMmnS97d=ws_B0hUAuh5TNTH98axQ=B3adt3bsSTb=KNg@mail.gmail.com' \
    --to=kaij@j10-labs.com \
    --cc=guix-devel@gnu.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).