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:
parent
c11839d7b2
commit
4661282fde
8 changed files with 58 additions and 32 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue