Hello,
Sorry for the low-quality patch; it seemed so obvious that laziness won
over good sense.
The amended patch implements your suggestion and checks whether the used
hash is `sha256` or anything else, adapting the output accordingly in each
case.
Thank you for your patience,
Helio.
On Sat, 17 Oct 2020 at 22:21, Ludovic Courtès <ludo@gnu.org> wrote:
Toggle quote (26 lines)
> Hi,
>
> Helio Machado <0x2b3bfa0@gmail.com> skribis:
>
> > This patch fixes the following build-time deprecation warning:
> >
> > guix/import/print.scm:77:21: warning: 'origin-sha256' is deprecated,
> > use 'origin-hash' instead
>
> Thanks for looking into it! The deprecation warning is a bit confusing
> though in this case because ‘origin-hash’ is not exactly a drop-in
> replacement for ‘origin-sha256’, as can be seen in the manual, so this
> patch wouldn’t have the desired effect.
>
> Instead, ‘print.scm’ could be changed to emit a (sha256 …) form when the
> <content-hash> object is indeed a sha256 hash, and otherwise use a (hash
> …) form.
>
> See
> <
> https://guix.gnu.org/manual/devel/en/html_node/origin-Reference.html#index-content_002dhash
> >.
>
> Thanks,
> Ludo’.
>