From 908c67b7eea5a433c2124df21a03e6dcab2b01d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Sun, 1 Aug 2010 21:25:37 +0000 Subject: [PATCH] Fixing a bit the busybox expression and its new flexible config svn path=/nixpkgs/branches/stdenv-updates/; revision=22852 --- pkgs/misc/busybox/default.nix | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pkgs/misc/busybox/default.nix b/pkgs/misc/busybox/default.nix index c3afdb4b71f1..1ae51d64e30b 100644 --- a/pkgs/misc/busybox/default.nix +++ b/pkgs/misc/busybox/default.nix @@ -1,24 +1,27 @@ -{stdenv, fetchurl, enableStatic ? false, extraConfig ? ""}: +{stdenv, fetchurl, enableStatic ? false, extraConfig ? null}: let configParser = '' function parseconfig { set -x while read LINE; do - NAME=`cut -d \ -f 1 $LINE` - OPTION=`cut -d \ -f 2 $LINE` + NAME=`echo "$LINE" | cut -d \ -f 1` + OPTION=`echo "$LINE" | cut -d \ -f 2` if test -z "$NAME"; then continue fi if test "$NAME" == "CLEAR"; then + echo "parseconfig: CLEAR" echo > .config fi + echo "parseconfig: removing $NAME" sed -i /^$NAME=/d .config if test "$OPTION" != n; then + echo "parseconfig: setting $NAME=$OPTION" echo "$NAME=$OPTION" >> .config fi done @@ -32,7 +35,7 @@ let ''; staticConfig = (if enableStatic then '' - sed -i 's,.*CONFIG_STATIC.*,CONFIG_STATIC=y,' .config + CONFIG_STATIC y '' else ""); in @@ -46,20 +49,20 @@ stdenv.mkDerivation { }; configurePhase = '' - set -x make defconfig ${configParser} cat << EOF | parseconfig + ${staticConfig} ${extraConfig} ${nixConfig} $extraCrossConfig EOF - set +x + make oldconfig ''; crossAttrs = { extraCrossConfig = '' - CONFIG_CROSS_COMPILER_PREFIX "$crossConfig-" + CONFIG_CROSS_COMPILER_PREFIX "${stdenv.cross.config}-" '' + (if (stdenv.cross.platform.kernelMajor == "2.4") then '' CONFIG_IONICE n