From cee9051b7c3d5c503430ff2bf3a721d271d51022 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 27 Aug 2008 15:22:33 +0000 Subject: [PATCH] * Get rid of $findUnpacker, it's pointless anyway. * Pass the source file to $unpackCmd via $curSrc. svn path=/nixpkgs/trunk/; revision=12748 --- pkgs/stdenv/generic/setup-new.sh | 25 +++++++++++-------------- pkgs/tools/system/cron/default.nix | 2 +- pkgs/top-level/all-packages.nix | 3 ++- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/pkgs/stdenv/generic/setup-new.sh b/pkgs/stdenv/generic/setup-new.sh index 2561399695c4..b646c3ed7f12 100644 --- a/pkgs/stdenv/generic/setup-new.sh +++ b/pkgs/stdenv/generic/setup-new.sh @@ -442,34 +442,31 @@ stripHash() { unpackFile() { - local file="$1" + curSrc="$1" local cmd - header "unpacking source archive $file" 3 + header "unpacking source archive $curSrc" 3 - case "$file" in + case "$curSrc" in *.tar) - tar xvf $file + tar xvf $curSrc ;; *.tar.gz | *.tgz | *.tar.Z) - gzip -d < $file | tar xvf - + gzip -d < $curSrc | tar xvf - ;; *.tar.bz2 | *.tbz2) - bzip2 -d < $file | tar xvf - + bzip2 -d < $curSrc | tar xvf - ;; *.zip) - unzip $file + unzip $curSrc ;; *) - if test -d "$file"; then - stripHash $file - cp -prvd $file $strippedName + if test -d "$curSrc"; then + stripHash $curSrc + cp -prvd $curSrc $strippedName else - if test -n "$findUnpacker"; then - $findUnpacker $1; - fi if test -z "$unpackCmd"; then - echo "source archive $file has unknown type" + echo "source archive $curSrc has unknown type" exit 1 fi eval "$unpackCmd" diff --git a/pkgs/tools/system/cron/default.nix b/pkgs/tools/system/cron/default.nix index 4d7dcb93db2b..2f7bffcbe31d 100644 --- a/pkgs/tools/system/cron/default.nix +++ b/pkgs/tools/system/cron/default.nix @@ -7,7 +7,7 @@ stdenv.mkDerivation { md5 = "5e1be9dbde66295821ac7899f2e1f561"; }; - unpackCmd = "(mkdir cron && cd cron && sh $src)"; + unpackCmd = "(mkdir cron && cd cron && sh $curSrc)"; preBuild = " substituteInPlace Makefile --replace ' -o root' ' ' --replace 111 755 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2d3c80d2a576..ff35b9b80507 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -584,7 +584,8 @@ let }; cron = import ../tools/system/cron { - inherit fetchurl stdenv; + inherit fetchurl; + stdenv = stdenvNew; }; curl = import ../tools/networking/curl {