Suivant: Invoquer guix import, Précédent: Invoquer guix download, Monter: Utilitaires [Table des matières][Index]
guix hash
La commande guix hash
calcule le hash d’un fichier. C’est surtout
un outil pour simplifier la vie des contributeur·rice·s à la distribution :
elle calcule le hash cryptographique d’un ou plusieurs fichiers, qui peut
être utilisé dans la définition d’ un paquet (voir Définition des paquets).
La syntaxe générale est :
guix hash option file ...
Lorsque fichier est -
(un tiret), guix hash
calcul le
hash des données lues depuis l’entrée standard. guix hash
a les
options suivantes :
--hash=algorithme
-H algorithme
Calcule un hash en utilisant l’ algorithme spécifié, sha256
par
défaut.
algorithm must be the name of a cryptographic hash algorithm supported
by Libgcrypt via Guile-Gcrypt—e.g., sha512
or sha3-256
(voir Hash Functions dans Guile-Gcrypt Reference Manual).
--format=fmt
-f fmt
Écrit le hash dans le format spécifié par fmt.
Formats supportés : base64
, nix-base32
, base32
,
base16
(hex
et hexadecimal
peuvent être utilisés).
Si l’option --format n’est pas spécifiée, guix hash
affichera le hash en nix-base32
. Cette représentation est utilisée
dans les définitions des paquets.
--recursive
-r
The --recursive option is deprecated in favor of --serializer=nar (see below); -r remains accepted as a convenient shorthand.
--serializer=type
-S type
Compute the hash on file using type serialization.
type may be one of the following:
none
This is the default: it computes the hash of a file’s contents.
nar
Compute the hash of a “normalized archive” (or “nar”) containing file, including its children if it is a directory. Some of the metadata of file is part of the archive; for instance, when file is a regular file, the hash is different depending on whether file is executable or not. Metadata such as time stamps have no impact on the hash (voir Invoquer guix archive, for more info on the nar format).
git
Compute the hash of the file or directory as a Git “tree”, following the same method as the Git version control system.
--exclude-vcs
-x
Conjointement avec --recursive, exclut les répertoires de système de contrôle de version (.bzr, .git, .hg, etc.).
Par exemple, voici comment calculer le hash d’un dépôt Git, ce qui est utile
avec la méthode git-fetch
(voir référence de origin) :
$ git clone http://example.org/foo.git $ cd foo $ guix hash -x --serializer=nar .
Suivant: Invoquer guix import, Précédent: Invoquer guix download, Monter: Utilitaires [Table des matières][Index]