guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: import/cran: Ensure current package is not among


From: guix-commits
Subject: branch master updated: import/cran: Ensure current package is not among inputs.
Date: Mon, 05 Jun 2023 12:55:34 -0400

This is an automated email from the git hooks/post-receive script.

rekado pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new a025d8fee6 import/cran: Ensure current package is not among inputs.
a025d8fee6 is described below

commit a025d8fee6c8df1db750058d41f984103eb77978
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Mon Jun 5 18:40:10 2023 +0200

    import/cran: Ensure current package is not among inputs.
    
    * guix/import/cran.scm (cran-package-inputs): Remove the current package 
from
    the result.
---
 guix/import/cran.scm | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index d21acda22b..59ed65d929 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -601,6 +601,7 @@ META."
   "Return the list of <upstream-input> corresponding to all the dependencies
 of META, a package in REPOSITORY."
   (let* ((url    (cran-package-source-url meta repository))
+         (name   (assoc-ref meta "Package"))
          (source (download-source url
                                   #:method
                                   (cond ((assoc-ref meta 'git) 'git)
@@ -608,17 +609,21 @@ of META, a package in REPOSITORY."
                                         (else #f))))
          (tarball? (not (or (assoc-ref meta 'git)
                             (assoc-ref meta 'hg)))))
-    (sort (append (source->dependencies source tarball?)
-                  (filter-map (lambda (name)
-                                (and (not (member name invalid-packages))
-                                     (upstream-input
-                                      (name name)
-                                      (downstream-name
-                                       (transform-sysname name)))))
-                              (map string-downcase
-                                   (listify meta "SystemRequirements")))
-                  (cran-package-propagated-inputs meta)
-                  (vignette-builders meta))
+    (sort (filter
+           ;; Prevent tight cycles.
+           (lambda (input)
+             ((negate string=?) name (upstream-input-name input)))
+           (append (source->dependencies source tarball?)
+                   (filter-map (lambda (name)
+                                 (and (not (member name invalid-packages))
+                                      (upstream-input
+                                       (name name)
+                                       (downstream-name
+                                        (transform-sysname name)))))
+                               (map string-downcase
+                                    (listify meta "SystemRequirements")))
+                   (cran-package-propagated-inputs meta)
+                   (vignette-builders meta)))
           (lambda (input1 input2)
             (string<? (upstream-input-downstream-name input1)
                       (upstream-input-downstream-name input2))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]