3
0
Fork 0
forked from mirrors/nixpkgs

Remove some artifacts of a failed attempt from replace-dependency

This commit is contained in:
Shea Levy 2013-01-11 16:09:07 -05:00
parent a210e346dc
commit 779c74f795

View file

@ -63,18 +63,17 @@ let
} | $nixStore --restore $out } | $nixStore --restore $out
''; '';
fn = { drv, rewritten-drvs }: rewritten-drvs // ( rewritten-deps = listToAttrs [ {name = discard old-dependency.outPath; value = new-dependency;} ];
fn = drv:
if depends-on-old drv if depends-on-old drv
then listToAttrs [ { then listToAttrs [ {
name = discard (toString drv); name = discard (toString drv);
value = replace-strings drv (rewritten-drvs // (fold (drv: acc: value = replace-strings drv (rewritten-deps // (fold (drv: acc:
(fn { inherit drv rewritten-drvs; }) // acc (fn drv) // acc
) {} (references-of drv))); ) {} (references-of drv)));
} ] } ]
else {} else {};
); in assert (stringLength old-dependency.name == stringLength new-dependency.name);
in assert (stringLength old-dependency.name == stringLength new-dependency.name); getAttr (discard drv.outPath) (fn { getAttr (discard drv.outPath) (fn drv)
inherit drv;
rewritten-drvs = listToAttrs [ {name = discard old-dependency.outPath; value = new-dependency;} ];
})