Corrected a flaw that made automated package silently accept any extra arguments

svn path=/nixpkgs/trunk/; revision=9101
This commit is contained in:
Michael Raskin
2007-08-11 11:14:36 +00:00
parent efbabdb598
commit 118e9d6ebf
3 changed files with 25 additions and 22 deletions
+8 -12
View File
@@ -2,7 +2,6 @@ args:
let
defList = [];
#stdenv and fetchurl are added automatically
notForBuildInputs = [];
getVal = (args.lib.getValue args defList);
check = args.lib.checkFlag args;
reqsList = [
@@ -11,14 +10,13 @@ let
["x11Support" "libX11"]
["hugeFeatures"]
["true" "ncurses"]
["false" "libSM"]
];
buildInputsNames = args.lib.filter (x: (null!=getVal x)&&
(! args.lib.isInList (notForBuildInputs ++
["stdenv" "fetchurl" "lib"] ++
(map builtins.head reqsList)) x))
/*["libX11" "glib" "gtk" "pkgconfig" "libXpm" "libXext"
"libXau" "libXt" "libXaw" "ncurses"];*/
(builtins.attrNames args);
buildInputsNames = args.lib.filter (x: (null!=getVal x))
(args.lib.uniqList {inputList =
(args.lib.concatLists (map
(x:(if (x==[]) then [] else builtins.tail x))
reqsList));});
in
assert args.lib.checkReqs args defList reqsList;
args.stdenv.mkDerivation {
@@ -36,10 +34,8 @@ args.stdenv.mkDerivation {
inherit (args) ncurses;
debug = builtins.attrNames args;
buildInputs = args.lib.filter (x: x!=null) (map getVal buildInputsNames);
preConfigure = "echo \$debug";
buildInputs = args.lib.filter (x: (x!=null)) (map getVal buildInputsNames);
postInstall = "ln -s $out/bin/vim $out/bin/vi";
preBuild="touch src/auto/link.sed";
configureFlags=" --enable-gui=auto --disable-xim "+