aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-08-06 09:35:05 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-08-06 09:35:05 +0000
commitd551062ec4cf33b73df4e0d38671cbe6ca03abc5 (patch)
treea0e2db4d6f42379eb7929fd1ad8eaf827afc0ac4
parent236eb59293194071ac518c12d0cc6fe0a3f0ac5f (diff)
* Scan for wget and use the full path in fetchurl.sh.
* Use nix-hash (not md5sum) in fetchurl.sh.
-rw-r--r--configure.ac2
-rw-r--r--corepkgs/fetchurl/fetchurl.sh.in (renamed from corepkgs/fetchurl/fetchurl.sh)4
-rw-r--r--substitute.mk1
3 files changed, 5 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 57861063d..4dea89c95 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11,6 +11,8 @@ AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB
+AC_PATH_PROG(wget, wget)
+
AC_CHECK_LIB(pthread, pthread_mutex_init)
AM_CONFIG_HEADER([config.h])
diff --git a/corepkgs/fetchurl/fetchurl.sh b/corepkgs/fetchurl/fetchurl.sh.in
index 7b6243974..dc92c7ee5 100644
--- a/corepkgs/fetchurl/fetchurl.sh
+++ b/corepkgs/fetchurl/fetchurl.sh.in
@@ -1,9 +1,9 @@
#! /bin/sh
echo "downloading $url into $out..."
-wget "$url" -O "$out" || exit 1
+@wget@ "$url" -O "$out" || exit 1
-actual=$(md5sum -b $out | cut -c1-32)
+actual=$(@bindir@/nix-hash --flat $out)
if ! test "$actual" == "$md5"; then
echo "hash is $actual, expected $md5"
exit 1
diff --git a/substitute.mk b/substitute.mk
index af3549253..8527cf6fd 100644
--- a/substitute.mk
+++ b/substitute.mk
@@ -4,5 +4,6 @@
-e s^@bindir\@^$(bindir)^g \
-e s^@sysconfdir\@^$(sysconfdir)^g \
-e s^@localstatedir\@^$(localstatedir)^g \
+ -e s^@wget\@^$(wget)^g \
< $< > $@ || rm $@
chmod +x $@