diff mbox series

[bug#61829,11/11] guix: packages: Remove 'origin-sha256' procedure.

Message ID b385682f37115c576fe85de408fe6f450f261d14.1677456515.git.mirai@makinata.eu
State New
Headers show
Series Purge pre-1.3.0 deprecated procedures & variables. | expand

Commit Message

Bruno Victal Feb. 27, 2023, 12:11 a.m. UTC
* guix/packages.scm (origin-sha256): Remove procedure.
* tests/import-utils.scm (test-import-utils)
[alist->package with explicit source]: Use content-hash-value.
---
 guix/packages.scm      | 9 ---------
 tests/import-utils.scm | 2 +-
 2 files changed, 1 insertion(+), 10 deletions(-)

Comments

Simon Tournier Feb. 28, 2023, 12:57 p.m. UTC | #1
Hi,

On lun., 27 févr. 2023 at 00:11, Bruno Victal <mirai@makinata.eu> wrote:

> -            origin-sha256                         ;deprecated

[...]

> -(define-deprecated (origin-sha256 origin)
> -  origin-hash
> -  (let ((hash (origin-hash origin)))
> -    (unless (eq? (content-hash-algorithm hash) 'sha256)
> -      (raise (condition (&message
> -                         (message (G_ "no SHA256 hash for origin"))))))
> -    (content-hash-value hash)))

Similarly as previously, I would not remove this without more
advertisement.


> diff --git a/tests/import-utils.scm b/tests/import-utils.scm
> index 44dff14597..1565dd610a 100644
> --- a/tests/import-utils.scm
> +++ b/tests/import-utils.scm
> @@ -141,7 +141,7 @@ (define-module (test-import-utils)
>           (license:license? (package-license pkg))
>           (build-system? (package-build-system pkg))
>           (origin? (package-source pkg))
> -         (equal? (origin-sha256 (package-source pkg))
> +         (equal? (content-hash-value (origin-hash (package-source pkg)))

This LGTM although this test was for testing origin-sha256 specifically,
I guess. :-)

Cheers,
simon
diff mbox series

Patch

diff --git a/guix/packages.scm b/guix/packages.scm
index 041a872f9d..bded89b1e0 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -73,7 +73,6 @@  (define-module (guix packages)
             origin-uri
             origin-method
             origin-hash
-            origin-sha256                         ;deprecated
             origin-file-name
             origin-actual-file-name
             origin-patches
@@ -345,14 +344,6 @@  (define-syntax-rule (origin fields ...)
 specifications to 'hash'."
   (origin-compatibility-helper (fields ...) ()))
 
-(define-deprecated (origin-sha256 origin)
-  origin-hash
-  (let ((hash (origin-hash origin)))
-    (unless (eq? (content-hash-algorithm hash) 'sha256)
-      (raise (condition (&message
-                         (message (G_ "no SHA256 hash for origin"))))))
-    (content-hash-value hash)))
-
 (define (print-origin origin port)
   "Write a concise representation of ORIGIN to PORT."
   (match origin
diff --git a/tests/import-utils.scm b/tests/import-utils.scm
index 44dff14597..1565dd610a 100644
--- a/tests/import-utils.scm
+++ b/tests/import-utils.scm
@@ -141,7 +141,7 @@  (define-module (test-import-utils)
          (license:license? (package-license pkg))
          (build-system? (package-build-system pkg))
          (origin? (package-source pkg))
-         (equal? (origin-sha256 (package-source pkg))
+         (equal? (content-hash-value (origin-hash (package-source pkg)))
                  (base32 "0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i")))))
 
 (test-equal "alist->package with false license"  ;<https://bugs.gnu.org/30470>