diff --git a/doc/guix.texi b/doc/guix.texi index 9147f43..17f7e14 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -1214,36 +1214,7 @@ 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 +@include hash.texi @node Invoking guix refresh @section Invoking @command{guix refresh} diff --git a/doc/hash-texi.scm b/doc/hash-texi.scm new file mode 100644 index 0000000..801f92f --- /dev/null +++ b/doc/hash-texi.scm @@ -0,0 +1,29 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2013 Nikita Karetnikov +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(use-modules (texinfo serialize) + (ice-9 session)) + +;; 'string->stexi' and 'module-commentary' are used instead of +;; 'module-stexi-documentation' because we do not want to mention 'guix-hash' +;; and the names of sections. +(call-with-output-file "doc/hash.texi" + (lambda (out) + (format out "~a~%" + (stexi->texi ((@@ (texinfo reflection) string->stexi) + (module-commentary '(guix scripts hash))))))) \ No newline at end of file diff --git a/doc/hash.texi b/doc/hash.texi new file mode 100644 index 0000000..a6469da --- /dev/null +++ b/doc/hash.texi @@ -0,0 +1,35 @@ + +@c %start of fragment + +@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 %end of fragment + diff --git a/guix/scripts/hash.scm b/guix/scripts/hash.scm index deded63..41346ac 100644 --- a/guix/scripts/hash.scm +++ b/guix/scripts/hash.scm @@ -30,6 +30,41 @@ #:export (guix-hash)) +;;; Commentary: +;; +;; @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 +;; +;;; Code: + ;;; ;;; Command-line options. ;;;