diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-02-10T16·14+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-02-10T16·14+0000 |
commit | 92e832348db13637875c4f529ed0aa83d3d34493 (patch) | |
tree | c00a500e1be79bf061f8ebd17e694eb4f7ee8d55 /doc/manual/nix-prefetch-url.xml | |
parent | 6551b36790d47477087fc3a7f7bb779f28e42d8e (diff) |
* Lots of manual stuff. Reference pages for most Nix commands.
* nix-pull now requires the full url to the manifest, i.e., `/MANIFEST/' is no longer automatically appended. * nix-prefetch-url works again.
Diffstat (limited to 'doc/manual/nix-prefetch-url.xml')
-rw-r--r-- | doc/manual/nix-prefetch-url.xml | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/doc/manual/nix-prefetch-url.xml b/doc/manual/nix-prefetch-url.xml new file mode 100644 index 000000000000..a6b3711e3373 --- /dev/null +++ b/doc/manual/nix-prefetch-url.xml @@ -0,0 +1,54 @@ +<refentry> + <refnamediv> + <refname>nix-prefetch-url</refname> + <refpurpose>copy a file from a URL into the store and print its MD5 hash</refpurpose> + </refnamediv> + + <refsynopsisdiv> + <cmdsynopsis> + <command>nix-prefetch-url</command> + <arg choice='plain'><replaceable>url</replaceable></arg> + </cmdsynopsis> + </refsynopsisdiv> + + <refsection> + <title>Description</title> + + <para> + The command <command>nix-prefetch-url</command> downloads the + file referenced by the URL <replaceable>url</replaceable>, + prints its MD5 cryptographic hash code, and copies it into the + Nix store. The file name in the store is + <filename><replaceable>hash</replaceable>-<replaceable>basename</replaceable></filename>, + where <replaceable>basename</replaceable> is everything + following the final slash in <replaceable>url</replaceable>. + </para> + + <para> + This command is just a convenience to Nix expression writers. + Often a Nix expressions fetch some source distribution from the + network using the <literal>fetchurl</literal> expression + contained in <literal>nixpkgs</literal>. However, + <literal>fetchurl</literal> requires an MD5 hash. If you don't + know the hash, you would have to download the file first, and + then <literal>fetchurl</literal> would download it again when + you build your Nix expression. Since + <literal>fetchurl</literal> uses the same name for the + downloaded file as <command>nix-prefetch-url</command>, the + redundant download can be avoided. + </para> + + </refsection> + + <refsection> + <title>Examples</title> + + <screen> +$ nix-prefetch-url ftp://ftp.nluug.nl/pub/gnu/make/make-3.80.tar.bz2 +... +file has hash 0bbd1df101bc0294d440471e50feca71 +...</screen> + + </refsection> + +</refentry> |