From 6c365eca6dafca37f0ac34d55221bcf197df49a3 Mon Sep 17 00:00:00 2001 From: Nikita Karetnikov Date: Sun, 21 Apr 2013 17:20:00 +0000 Subject: Add 'guix hash'. * guix/scripts/hash.scm: New file. * Makefile.am (MODULES): Add it. * po/POTFILES.in: Add it. * doc/guix.texi (Invoking guix hash): New node. (Defining Packages): Add a cross-reference to the 'Invoking guix hash' node. --- doc/guix.texi | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index f149eee6dd..e23eab0f81 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -814,8 +814,9 @@ the GNU mirrors defined in @code{(guix download)}. The @code{sha256} field specifies the expected SHA256 hash of the file being downloaded. It is mandatory, and allows Guix to check the integrity of the file. The @code{(base32 @dots{})} form introduces the -base32 representation of the hash. A convenient way to obtain this -information is with the @code{guix download} tool. +base32 representation of the hash. You can obtain this information with +the @code{guix hash} (@pxref{Invoking guix hash}) and @code{guix +download} tools. @item @cindex GNU Build System @@ -1094,6 +1095,7 @@ space. @menu * Invoking guix build:: Building packages from the command line. +* Invoking guix hash:: Computing the cryptographic hash of a file. @end menu @node Invoking guix build @@ -1189,6 +1191,37 @@ the @code{package-derivation} procedure of the @code{(guix packages)} module, and to the @code{build-derivations} procedure of the @code{(guix store)} module. +@node Invoking guix hash +@section Invoking @command{guix hash} + +The @command{guix hash} command allows to check the integrity of a file. +It is primarily a convenience tool for anyone contributing to the +distribution: it computes the cryptographic hash of a file, which can be +used in the definition of a package (@pxref{Defining Packages}). + +The general syntax is: + +@example +guix hash @var{option} @var{file} +@end example + +@command{guix hash} has the following option: + +@table @code + +@item --format=@var{fmt} +@itemx -f @var{fmt} +Write the hash in the given format. + +Supported formats: @code{nix-base32}, @code{base32}, @code{base16} +(@code{hex} and @code{hexadecimal} can be used as well). + +If the @option{--format} option is not specified, @command{guix hash} +will output the hash in @code{nix-base32}. This representation is used +in the definitions of packages. + +@end table + @c ********************************************************************* @node GNU Distribution @chapter GNU Distribution -- cgit v1.2.3