[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#44038: [PATCH] Fix deprecation warning for origin-sha256
From: |
Ludovic Courtès |
Subject: |
bug#44038: [PATCH] Fix deprecation warning for origin-sha256 |
Date: |
Mon, 19 Oct 2020 10:57:21 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Hi,
Helio Machado <0x2b3bfa0@gmail.com> skribis:
> From 31c8a3ee7e6819ca01c875cfefd2818f727bc32e Mon Sep 17 00:00:00 2001
> From: Helio Machado <0x2b3bfa0+git@googlemail.com>
> Date: Mon, 19 Oct 2020 00:15:00 +0200
> Subject: [PATCH] guix/import: Fix deprecation warning for origin-sha256
>
> * guix/import/print.scm (source->code source version): Replace
> origin-sha256 by origin-hash
The non-SHA256 case would let the raw <content-hash> record through, so
I amended it as follows (also removing an unnecessary ‘format’ call).
Thanks!
Ludo’.
diff --git a/guix/import/print.scm b/guix/import/print.scm
index e79f831c76..d21ce57aeb 100644
--- a/guix/import/print.scm
+++ b/guix/import/print.scm
@@ -83,9 +83,11 @@ when evaluated."
((? string? uri) (list uri))
(factorized factorized))))
,(if (equal? (content-hash-algorithm hash) 'sha256)
- `(sha256 (base32 ,(format #f "~a" (bytevector->nix-base32-string
- (content-hash-value hash)))))
- `(hash ,hash))
+ `(sha256 (base32 ,(bytevector->nix-base32-string
+ (content-hash-value hash))))
+ `(hash (content-hash ,(bytevector->nix-base32-string
+ (content-hash-value hash))
+ ,(content-hash-algorithm hash))))
;; FIXME: in order to be able to throw away the directory prefix,
;; we just assume that the patch files can be found with
;; "search-patches".