unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: 45910@debbugs.gnu.org
Subject: [bug#45910] [PATCH] ui: Switch precedence for extensions.
Date: Sat, 16 Jan 2021 01:57:08 +0100	[thread overview]
Message-ID: <20210116005708.22610-1-zimon.toutoune@gmail.com> (raw)

* guix/ui.scm (run-guix-command): Modify order that extensions are allowed to
override default commands.
---
 guix/ui.scm | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/guix/ui.scm b/guix/ui.scm
index bd504c68da..ad78d5cedd 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -2126,18 +2126,18 @@ found."
   (define module
     (catch 'misc-error
       (lambda ()
-        (resolve-interface `(guix scripts ,command)))
-      (lambda _
         ;; Check if there is a matching extension.
+        (match (search-path (extension-directories)
+                            (format #f "~a.scm" command))
+          (#f
+           (throw 'misc-error))
+          (file
+           (load file)
+           (resolve-interface `(guix extensions ,command)))))
+      (lambda _
         (catch 'misc-error
           (lambda ()
-            (match (search-path (extension-directories)
-                                (format #f "~a.scm" command))
-              (#f
-               (throw 'misc-error))
-              (file
-                (load file)
-                (resolve-interface `(guix extensions ,command)))))
+            (resolve-interface `(guix scripts ,command)))
           (lambda _
             (format (current-error-port)
                     (G_ "guix: ~a: command not found~%") command)

base-commit: 884f320e7ceb35cb8472510e47fc5f1944675d82
-- 
2.29.2





             reply	other threads:[~2021-01-16  0:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-16  0:57 zimoun [this message]
2021-01-28  9:20 ` [bug#45910] [PATCH] ui: Look up extensions before built-in commands Ricardo Wurmus
2021-01-28 16:26   ` zimoun
2021-01-28 17:53     ` bug#45910: " Ricardo Wurmus

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=20210116005708.22610-1-zimon.toutoune@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=45910@debbugs.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).