mirror of
https://github.com/NixOS/nix
synced 2025-07-02 17:41:48 +02:00
* Clean up calls to system().
This commit is contained in:
parent
76c9710091
commit
68ae953d8a
8 changed files with 26 additions and 26 deletions
|
@ -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'";
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue