guix-commits
[Top][All Lists]
Advanced

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

branch master updated: import: stackage: Don’t try to update packages no


From: guix-commits
Subject: branch master updated: import: stackage: Don’t try to update packages not available on Stackage.
Date: Mon, 27 Sep 2021 07:58:09 -0400

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

lbraun pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 9c5e5ca  import: stackage: Don’t try to update packages not available 
on Stackage.
9c5e5ca is described below

commit 9c5e5ca1c0de56a0d5b2b924de10548172095b58
Author: Xinglu Chen <public@yoctocell.xyz>
AuthorDate: Thu Sep 16 13:29:42 2021 +0200

    import: stackage: Don’t try to update packages not available on Stackage.
    
    Previously, the ‘hackage-package?’ predicate was used which meant that
    the updater would try to update non-Stackage packages, and lead to messages
    like these:
    
      $ guix refresh -t stackage
      warning: failed to parse 
https://hackage.haskell.org/package/hurl/hurl.cabal
      warning: failed to parse 
https://hackage.haskell.org/package/idris/idris.cabal
    
    Since ‘hurl’ and ‘idris’ aren’t available on the current Stackage LTS 
release,
    they should be filtered out before the Stackage updater even tries to update
    them.
    
    * stackage.scm (stackage-package?): New procedure.
    (%stackage-updater): Use it.
    
    Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
---
 guix/import/stackage.scm | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
index bbd903a..731e696 100644
--- a/guix/import/stackage.scm
+++ b/guix/import/stackage.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2017 Federico Beffa <beffa@fbengineering.ch>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
+;;; Copyright © 2021 Xinglu Chem <public@yoctocell.xyz>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21,10 +22,12 @@
 (define-module (guix import stackage)
   #:use-module (ice-9 match)
   #:use-module (ice-9 regex)
+  #:use-module (ice-9 control)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
   #:use-module (srfi srfi-34)
   #:use-module (srfi srfi-35)
+  #:use-module (srfi srfi-43)
   #:use-module (guix import json)
   #:use-module (guix import hackage)
   #:use-module (guix import utils)
@@ -141,11 +144,23 @@ PACKAGE or #f if the package is not included in the 
Stackage LTS release."
                 (version version)
                 (urls (list url))))))))))
 
+(define (stackage-package? package)
+  "Whether PACKAGE is available on the default Stackage LTS release."
+  (and (hackage-package? package)
+       (let ((packages (lts-info-packages
+                        (stackage-lts-info-fetch %default-lts-version)))
+             (hackage-name (guix-package->hackage-name package)))
+         (vector-any identity
+                     (vector-map
+                      (lambda (_ metadata)
+                        (string=? (cdr (list-ref metadata 2)) hackage-name))
+                      packages)))))
+
 (define %stackage-updater
   (upstream-updater
    (name 'stackage)
    (description "Updater for Stackage LTS packages")
-   (pred hackage-package?)
+   (pred stackage-package?)
    (latest latest-lts-release)))
 
 ;;; stackage.scm ends here



reply via email to

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