diff options
author | Nikita Karetnikov <nikita@karetnikov.org> | 2013-04-21 17:20:00 +0000 |
---|---|---|
committer | Nikita Karetnikov <nikita@karetnikov.org> | 2013-04-21 19:22:14 +0000 |
commit | 6c365eca6dafca37f0ac34d55221bcf197df49a3 (patch) | |
tree | a2c6135df2868c16f90f733130149ad5fe277854 /doc | |
parent | bfda2997c8d4f0ac14f1bd54f87cd320039cfd3d (diff) | |
download | patches-6c365eca6dafca37f0ac34d55221bcf197df49a3.tar patches-6c365eca6dafca37f0ac34d55221bcf197df49a3.tar.gz |
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.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/guix.texi | 37 |
1 files changed, 35 insertions, 2 deletions
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 |