From 249988a787d26046bf7b389594ff25029229e3d9 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 21 Jul 2003 20:07:12 +0000 Subject: * 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. --- corepkgs/fetchurl/fetchurl.fix | 1 + corepkgs/fetchurl/fetchurl.sh | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'corepkgs') diff --git a/corepkgs/fetchurl/fetchurl.fix b/corepkgs/fetchurl/fetchurl.fix index f798c0becbc2..0221b612cfe3 100644 --- a/corepkgs/fetchurl/fetchurl.fix +++ b/corepkgs/fetchurl/fetchurl.fix @@ -4,6 +4,7 @@ Function(["url", "md5"], , ("url", Var("url")) , ("md5", Var("md5")) , ("name", BaseName(Var("url"))) + , ("id", Var("md5")) ] ) ) diff --git a/corepkgs/fetchurl/fetchurl.sh b/corepkgs/fetchurl/fetchurl.sh index 1479e898b936..7b6243974d3f 100644 --- a/corepkgs/fetchurl/fetchurl.sh +++ b/corepkgs/fetchurl/fetchurl.sh @@ -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 -- cgit 1.4.1