1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00

* `nix-instantiate ... --arg NAME VALUE': allow arguments to be passed

to functions from the command line.
* nix-build: started removing backticks.
This commit is contained in:
Eelco Dolstra 2006-07-28 16:03:28 +00:00
parent c11839d7b2
commit 4661282fde
8 changed files with 58 additions and 32 deletions

View file

@ -77,6 +77,12 @@ EOF
push @instArgs, ("--attr", $ARGV[$n]);
}
elsif ($arg eq "--arg") {
die "$0: `--arg' requires two arguments\n" unless $n + 2 < scalar @ARGV;
push @instArgs, ("--arg", $ARGV[$n + 1], $ARGV[$n + 2]);
$n += 2;
}
elsif (substr($arg, 0, 1) eq "-") {
push @buildArgs, $arg;
}
@ -103,8 +109,10 @@ if (!defined $outLink) {
foreach my $expr (@exprs) {
# Instantiate.
my $drvPaths = `@bindir@/nix-instantiate --add-root "$drvLink" --indirect @instArgs "$expr"`;
my @drvPaths = split ' ', $drvPaths;
my @drvPaths;
open DRVPATHS, "-|", "@bindir@/nix-instantiate", "--add-root", $drvLink, "--indirect", @instArgs, $expr;
while (<DRVPATHS>) {chomp; push @drvPaths, $_;}
close DRVPATHS;
foreach my $drvPath (@drvPaths) {
my $target = readlink $drvPath;