about summary refs log tree commit diff
path: root/scripts/nix-channel.in
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-09-25T10·44+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-09-25T10·44+0000
commit68ae953d8a492061bcda7c4d7bf2f5b9432f791c (patch)
treed5e35a4fe76bf043539d8a49bb00e9e220fa364c /scripts/nix-channel.in
parent76c971009149f73453ccec66392625f2b67f8785 (diff)
* Clean up calls to system().
Diffstat (limited to 'scripts/nix-channel.in')
-rw-r--r--scripts/nix-channel.in12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/nix-channel.in b/scripts/nix-channel.in
index 63a56616b130..19b012922bca 100644
--- a/scripts/nix-channel.in
+++ b/scripts/nix-channel.in
@@ -70,8 +70,8 @@ sub update {
     readChannels;
 
     # Get rid of all the old substitutes.
-    system "@bindir@/nix-store --clear-substitutes";
-    die "cannot clear substitutes" if ($? != 0);
+    system("@bindir@/nix-store", "--clear-substitutes") == 0
+        or die "cannot clear substitutes";
 
     # Remove all the old manifests.
     for my $manifest (glob "$stateDir/manifests/*.nixmanifest") {
@@ -81,8 +81,8 @@ sub update {
     # Pull cache manifests.
     foreach my $url (@channels) {
         print "pulling cache manifest from `$url'\n";
-        system "@bindir@/nix-pull '$url'/MANIFEST";
-        die "cannot pull cache manifest from `$url'" if ($? != 0);
+        system("@bindir@/nix-pull", "$url/MANIFEST") == 0
+            or die "cannot pull cache manifest from `$url'";
     }
 
     # Create a Nix expression that fetches and unpacks the channel Nix
@@ -122,8 +122,8 @@ sub update {
     unlink "$rootFile.tmp";
 
     # Make it the default Nix expression for `nix-env'.
-    system "@bindir@/nix-env --import '$outPath'";
-    die "cannot pull set default Nix expression to `$outPath'" if ($? != 0);
+    system("@bindir@/nix-env", "--import", "$outPath") == 0
+         or die "cannot pull set default Nix expression to `$outPath'";
 }