Author: eelco
Date: Sat Sep 10 13:26:19 2011
New Revision: 29156
URL: https://ssl.nixos.org/websvn/nix/?rev=29156&sc=1

Log:
* In overrideDerivation, handle derivations with a passthru
  attribute properly.

Modified:
   nixpkgs/branches/syscall-tracing/pkgs/lib/customisation.nix
   nixpkgs/branches/syscall-tracing/pkgs/stdenv/generic/default.nix

Modified: nixpkgs/branches/syscall-tracing/pkgs/lib/customisation.nix
==============================================================================
--- nixpkgs/branches/syscall-tracing/pkgs/lib/customisation.nix Sat Sep 10 
13:25:44 2011        (r29155)
+++ nixpkgs/branches/syscall-tracing/pkgs/lib/customisation.nix Sat Sep 10 
13:26:19 2011        (r29156)
@@ -36,13 +36,13 @@
       # Filter out special attributes.
       drop = ["meta" "passthru" "outPath" "drvPath" "hostDrv" "buildDrv" 
"type" "override" "deepOverride" "origArgs"]
               # also drop functions such as .merge .override etc
-             ++ lib.filter (n: isFunction (getAttr n drv)) (attrNames drv);
+             ++ lib.filter (n: isFunction (getAttr n drv)) (attrNames drv)
+             ++ lib.optionals (drv ? passthru) (attrNames drv.passthru);
       attrs = removeAttrs drv drop;
       newDrv = derivation (attrs // (f drv));
-    in newDrv //
-      { meta = if drv ? meta then drv.meta else {};
-        passthru = if drv ? passthru then drv.passthru else {};
-      };
+    in newDrv
+      // { meta = if drv ? meta then drv.meta else {}; }
+      // (if drv ? passthru then drv.passthru // { passthru = drv.passthru; } 
else {});
 
 
   # usage: (you can use override multiple times)

Modified: nixpkgs/branches/syscall-tracing/pkgs/stdenv/generic/default.nix
==============================================================================
--- nixpkgs/branches/syscall-tracing/pkgs/stdenv/generic/default.nix    Sat Sep 
10 13:25:44 2011        (r29155)
+++ nixpkgs/branches/syscall-tracing/pkgs/stdenv/generic/default.nix    Sat Sep 
10 13:26:19 2011        (r29156)
@@ -87,7 +87,8 @@
           # should be made available to Nix expressions using the
           # derivation (e.g., in assertions).
           //
-          (if attrs ? passthru then attrs.passthru else {});
+          lib.optionalAttrs (attrs ? passthru)
+            (attrs.passthru // { passthru = attrs.passthru; });
 
         # Utility flags to test the type of platform.
         isDarwin = result.system == "i686-darwin"
_______________________________________________
nix-commits mailing list
nix-comm...@cs.uu.nl
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to