diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2005-03-15T12·03+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2005-03-15T12·03+0000 |
commit | bacd3a6cfa3af1879ef01e693178c74839d66f70 (patch) | |
tree | adbe45ebcc229c82bd60c54500734f9700825716 | |
parent | e52ae1c0ffed6af893438cb456c5c38a272c8b21 (diff) |
* Purify all corepkgs builders.
-rw-r--r-- | configure.ac | 7 | ||||
-rw-r--r-- | corepkgs/channels/unpack.sh.in | 12 | ||||
-rw-r--r-- | corepkgs/fetchurl/builder.sh.in | 4 | ||||
-rw-r--r-- | corepkgs/nar/nar.sh.in | 7 | ||||
-rw-r--r-- | substitute.mk | 2 |
5 files changed, 17 insertions, 15 deletions
diff --git a/configure.ac b/configure.ac index 103e3e37ae38..77f76e122c26 100644 --- a/configure.ac +++ b/configure.ac @@ -81,6 +81,13 @@ AC_PATH_PROG(xsltproc, xsltproc, false) AC_PATH_PROG(flex, flex, false) AC_PATH_PROG(bison, bison, false) NEED_PROG(perl, perl) +NEED_PROG(tar, tar) + +AC_PATH_PROG(mkdir, mkdir, false) +AC_ARG_WITH(coreutils-bin, AC_HELP_STRING([--with-coreutils-bin=PATH], + [path of mkdir, etc.]), + coreutils=$withval, coreutils=$(dirname $mkdir)) +AC_SUBST(coreutils) AC_ARG_WITH(docbook-catalog, AC_HELP_STRING([--with-docbook-catalog=PATH], [path of the DocBook XML DTD]), diff --git a/corepkgs/channels/unpack.sh.in b/corepkgs/channels/unpack.sh.in index f349f3da3862..332877b9eca5 100644 --- a/corepkgs/channels/unpack.sh.in +++ b/corepkgs/channels/unpack.sh.in @@ -1,9 +1,7 @@ #! @shell@ -e -export PATH=/bin:/usr/bin # !!! impure - -mkdir $out -mkdir $out/tmp +@coreutils@/mkdir $out +@coreutils@/mkdir $out/tmp cd $out/tmp expr=$out/default.nix @@ -12,8 +10,8 @@ echo '[' > $expr nr=0 for i in $inputs; do echo "unpacking $i" - @bunzip2@ < $i | tar xvf - - mv * ../$nr # !!! hacky + @bunzip2@ < $i | @tar@ xvf - + @coreutils@/mv * ../$nr # !!! hacky echo "(import ./$nr)" >> $expr nr=$(($nr + 1)) done @@ -21,4 +19,4 @@ done echo ']' >> $expr cd .. -rmdir tmp \ No newline at end of file +@coreutils@/rmdir tmp diff --git a/corepkgs/fetchurl/builder.sh.in b/corepkgs/fetchurl/builder.sh.in index aaba65d6d26c..92b87465261d 100644 --- a/corepkgs/fetchurl/builder.sh.in +++ b/corepkgs/fetchurl/builder.sh.in @@ -1,13 +1,11 @@ #! @shell@ -e -export PATH=/bin:/usr/bin - echo "downloading $url into $out" prefetch=@storedir@/nix-prefetch-url-$outputHash if test -f "$prefetch"; then echo "using prefetched $prefetch"; - mv $prefetch $out + @coreutils@/mv $prefetch $out else @curl@ --fail --location --max-redirs 20 "$url" > "$out" fi diff --git a/corepkgs/nar/nar.sh.in b/corepkgs/nar/nar.sh.in index 1a7c33ab26dd..caa960877b4b 100644 --- a/corepkgs/nar/nar.sh.in +++ b/corepkgs/nar/nar.sh.in @@ -1,10 +1,7 @@ #! @shell@ -e -# !!! impure; fix this -export PATH=/bin:/usr/bin - echo "packing $path into $out..." -mkdir $out +@coreutils@/mkdir $out dst=$out/tmp.nar.bz2 @bindir@/nix-store --dump "$path" > tmp @@ -14,4 +11,4 @@ dst=$out/tmp.nar.bz2 @bindir@/nix-hash --flat --type $hashAlgo --base32 $dst > $out/narbz2-hash -mv $out/tmp.nar.bz2 $out/$(cat $out/narbz2-hash).nar.bz2 +@coreutils@/mv $out/tmp.nar.bz2 $out/$(@coreutils@/cat $out/narbz2-hash).nar.bz2 diff --git a/substitute.mk b/substitute.mk index 7d3f6d863c95..5f9204929b75 100644 --- a/substitute.mk +++ b/substitute.mk @@ -14,6 +14,8 @@ -e "s^@bzip2\@^$(bzip2)^g" \ -e "s^@bunzip2\@^$(bunzip2)^g" \ -e "s^@perl\@^$(perl)^g" \ + -e "s^@coreutils\@^$(coreutils)^g" \ + -e "s^@tar\@^$(tar)^g" \ -e "s^@version\@^$(VERSION)^g" \ < $< > $@ || rm $@ if test -x $<; then chmod +x $@; fi |