1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-16 02:01:59 +02:00

* Allow the output/expression id to be forced to a certain

value; this potentially dangerous feature enables better 
  sharing for those paths for which the content is known in 
  advance (e.g., because a content hash is given).
* Fast builds: if we can expand all output paths of a derive 
  expression, we don't have to build.
This commit is contained in:
Eelco Dolstra 2003-07-21 20:07:12 +00:00
parent 49231fbe41
commit 249988a787
6 changed files with 23 additions and 17 deletions

View file

@ -4,6 +4,7 @@ Function(["url", "md5"],
, ("url", Var("url"))
, ("md5", Var("md5"))
, ("name", BaseName(Var("url")))
, ("id", Var("md5"))
]
)
)

View file

@ -4,9 +4,7 @@ echo "downloading $url into $out..."
wget "$url" -O "$out" || exit 1
actual=$(md5sum -b $out | cut -c1-32)
if ! test "$md5" == "ignore"; then
if ! test "$actual" == "$md5"; then
echo "hash is $actual, expected $md5"
exit 1
fi
if ! test "$actual" == "$md5"; then
echo "hash is $actual, expected $md5"
exit 1
fi