about summary refs log tree commit diff
path: root/scripts/nix-build.in
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2008-08-04T13·46+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2008-08-04T13·46+0000
commit7592f48c83b2f333fa7c5e85fd2fb64445b1c6ca (patch)
treee8b7999903f00467cfc74b2f7860641bdf74e287 /scripts/nix-build.in
parenta1d310b6b5c710215265c1cd0d5893248ed50f92 (diff)
* nix-build: `--dry-run' flag.
Diffstat (limited to 'scripts/nix-build.in')
-rw-r--r--scripts/nix-build.in9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/nix-build.in b/scripts/nix-build.in
index 1d2584bfb2b2..a674a00415ea 100644
--- a/scripts/nix-build.in
+++ b/scripts/nix-build.in
@@ -9,6 +9,8 @@ my $addOutLink = 1;
 my $outLink;
 my $drvLink;
 
+my $dryRun = 0;
+
 my @instArgs = ();
 my @buildArgs = ();
 my @exprs = ();
@@ -89,6 +91,11 @@ EOF
         push @buildArgs, ($arg, $ARGV[$n]);
     }
 
+    elsif ($arg eq "--dry-run") {
+        push @buildArgs, "--dry-run";
+        $dryRun = 1;
+    }
+    
     elsif (substr($arg, 0, 1) eq "-") {
         push @buildArgs, $arg;
     }
@@ -133,6 +140,8 @@ foreach my $expr (@exprs) {
     while (<OUTPATHS>) {chomp; push @outPaths, $_;}
     close OUTPATHS or exit 1;
 
+    next if $dryRun;
+
     foreach my $outPath (@outPaths) {
         my $target = readlink $outPath or die "cannot read symlink `$outPath'";
         print "$target\n";