1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-05-25 10:31:49 +02:00

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.
This commit is contained in:
Nikita Karetnikov
2013-04-21 17:20:00 +00:00
parent bfda2997c8
commit 6c365eca6d
4 changed files with 157 additions and 2 deletions
+35 -2
View File
@@ -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