emacs-bug-tracker
[Top][All Lists]
Advanced

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

bug#50618: closed ([PATCH] import: stackage: Don’t try to update package


From: GNU bug Tracking System
Subject: bug#50618: closed ([PATCH] import: stackage: Don’t try to update packages not available on Stackage.)
Date: Mon, 27 Sep 2021 12:00:01 +0000

Your message dated Mon, 27 Sep 2021 13:59:02 +0200
with message-id <YVGyBrSKOPWNrkSj@noor.fritz.box>
and subject line Re: [PATCH v2] import: stackage: Don’t try to update packages 
not available on Stackage.
has caused the debbugs.gnu.org bug report #50618,
regarding [PATCH] import: stackage: Don’t try to update packages not available 
on Stackage.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
50618: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=50618
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH] import: stackage: Don’t try to update packages not available on Stackage. Date: Thu, 16 Sep 2021 13:31:51 +0200
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.
---
 guix/import/stackage.scm | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
index bbd903a2cd..5b19e2a03a 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.
 ;;;
@@ -25,6 +26,7 @@
   #:use-module (srfi srfi-26)
   #:use-module (srfi srfi-34)
   #:use-module (srfi srfi-35)
+  #:use-module (guix http-client)
   #:use-module (guix import json)
   #:use-module (guix import hackage)
   #:use-module (guix import utils)
@@ -141,11 +143,22 @@ 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)
+       (guard (c ((and (http-get-error? c)
+                       (= 404 (http-get-error-code c)))
+                  #f))
+         (let* ((name (guix-package->hackage-name package))
+                (url (string-append (%stackage-url) "/lts-"
+                                    %default-lts-version "/package/" name)))
+           (http-fetch url)))))
+
 (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

base-commit: a840caccaee8c9492f4cc8a7ba802ef54391f199
-- 
2.33.0






--- End Message ---
--- Begin Message --- Subject: Re: [PATCH v2] import: stackage: Don’t try to update packages not available on Stackage. Date: Mon, 27 Sep 2021 13:59:02 +0200
Hi,

> Sure, but I think its easier for you to just apply the attached patch.
> 
>   <https://git.yoctocell.xyz/guix/log/?h=stackage-import-predicate>
> 
applied as 9c5e5ca1c0de56a0d5b2b924de10548172095b58.

Thank you very much!
Lars



--- End Message ---

reply via email to

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