* Nix-instantiate now accepts sets of derivations (just like nix-env).
This commit is contained in:
		
							parent
							
								
									292d6468ec
								
							
						
					
					
						commit
						638ce339a5
					
				
					 1 changed files with 9 additions and 0 deletions
				
			
		| 
						 | 
					@ -30,6 +30,8 @@ static void printNixExpr(EvalState & state, Expr e)
 | 
				
			||||||
    ATMatcher m;
 | 
					    ATMatcher m;
 | 
				
			||||||
    ATermList es;
 | 
					    ATermList es;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* !!! duplication w.r.t. parseDerivations in nix-env */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (atMatch(m, e) >> "Attrs" >> es) {
 | 
					    if (atMatch(m, e) >> "Attrs" >> es) {
 | 
				
			||||||
        Expr a = queryAttr(e, "type");
 | 
					        Expr a = queryAttr(e, "type");
 | 
				
			||||||
        if (a && evalString(state, a) == "derivation") {
 | 
					        if (a && evalString(state, a) == "derivation") {
 | 
				
			||||||
| 
						 | 
					@ -38,6 +40,13 @@ static void printNixExpr(EvalState & state, Expr e)
 | 
				
			||||||
                cout << format("%1%\n") % evalPath(state, a);
 | 
					                cout << format("%1%\n") % evalPath(state, a);
 | 
				
			||||||
                return;
 | 
					                return;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            throw Error("bad derivation");
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            ATermMap drvMap;
 | 
				
			||||||
 | 
					            queryAllAttrs(e, drvMap);
 | 
				
			||||||
 | 
					            for (ATermIterator i(drvMap.keys()); i; ++i)
 | 
				
			||||||
 | 
					                printNixExpr(state, evalExpr(state, drvMap.get(*i)));
 | 
				
			||||||
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue