unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#50755] [PATCH] import: Generate list of importers based on available modules
@ 2021-09-23 12:24 pinoaffe
  2021-09-23 18:07 ` Sarah Morgensen
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: pinoaffe @ 2021-09-23 12:24 UTC (permalink / raw)
  To: 50755


* guix/scripts/import.scm (importers): Generate a list of all importers by
looping over available guile modules, allowing for extensibility.
---
 guix/scripts/import.scm | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm
index 40fa6759ae..44cbaf13d6 100644
--- a/guix/scripts/import.scm
+++ b/guix/scripts/import.scm
@@ -23,6 +23,7 @@
 
 (define-module (guix scripts import)
   #:use-module (guix ui)
+  #:use-module (guix discovery)
   #:use-module (guix scripts)
   #:use-module (guix utils)
   #:use-module (srfi srfi-1)
@@ -78,9 +79,11 @@ rather than \\n."
 ;;; Entry point.
 ;;;
 
-(define importers '("gnu" "pypi" "cpan" "hackage" "stackage" "egg" "elpa"
-                    "gem" "go" "cran" "crate" "texlive" "json" "opam"
-                    "minetest"))
+(define importers (map (lambda (module)
+                         (symbol->string (caddr (module-name module))))
+                       (all-modules (map (lambda (entry)
+                                           `(,entry . "guix/import"))
+                                         %load-path))))
 
 (define (resolve-importer name)
   (let ((module (resolve-interface
-- 
2.32.0





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

end of thread, other threads:[~2021-10-11 11:52 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-23 12:24 [bug#50755] [PATCH] import: Generate list of importers based on available modules pinoaffe
2021-09-23 18:07 ` Sarah Morgensen
2021-09-23 21:17   ` pinoaffe
2021-09-23 21:19 ` [bug#50755] [PATCH v2] " pinoaffe
2021-09-27 14:28   ` zimoun
2021-09-27 18:27     ` pinoaffe
2021-09-27 18:20 ` [bug#50755] [PATCH v3] " pinoaffe
2021-09-27 20:09   ` zimoun
2021-09-28  9:51     ` Maxime Devos
2021-09-28 14:39       ` pinoaffe
2021-09-29 20:59         ` Maxime Devos
2021-09-30  8:17           ` pinoaffe
2021-09-30  8:37             ` Maxime Devos
2021-10-11 11:51               ` zimoun

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