about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-11-04T20·20+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-11-04T20·20+0000
commitfeb3ceaee034cf5783264eb9dc6bd2dd62298341 (patch)
tree86b6cb0a4a85f28fc7379ae8647a78d1ea7ec808 /scripts
parentcb7ccb528bbaeb30d09fbb41e57ab75d3121e1bc (diff)
* Better error messages.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/nix-channel.in8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/nix-channel.in b/scripts/nix-channel.in
index d05751512d62..1733afceb384 100755
--- a/scripts/nix-channel.in
+++ b/scripts/nix-channel.in
@@ -17,7 +17,7 @@ my @channels;
 # Reads the list of channels from the file $channelsList;
 sub readChannels {
     return if (!-f $channelsList);
-    open CHANNELS, "<$channelsList" or die "cannot open `$channelsList'";
+    open CHANNELS, "<$channelsList" or die "cannot open `$channelsList': $!";
     while (<CHANNELS>) {
         chomp;
         push @channels, $_;
@@ -28,7 +28,7 @@ sub readChannels {
 
 # Writes the list of channels to the file $channelsList;
 sub writeChannels {
-    open CHANNELS, ">$channelsList" or die "cannot open `$channelsList'";
+    open CHANNELS, ">$channelsList" or die "cannot open `$channelsList': $!";
     foreach my $url (@channels) {
         print CHANNELS "$url\n";
     }
@@ -94,7 +94,7 @@ sub update {
     my $rootFile = "$rootsDir/$userName.gcroot";
     my $tmpRootFile = "$rootsDir/$userName-tmp.gcroot";
     
-    open ROOT, ">$tmpRootFile" or die "cannot create `$tmpRootFile'";
+    open ROOT, ">$tmpRootFile" or die "cannot create `$tmpRootFile': $!";
     print ROOT "$storeExpr";
     close ROOT;
 
@@ -107,7 +107,7 @@ sub update {
     system "@bindir@/nix-env --import '$outPath'";
     die "cannot pull set default Nix expression to `$outPath'" if ($? != 0);
 
-    rename $tmpRootFile, $rootFile or die "cannot rename `$tmpRootFile' to `$rootFile'";
+    rename $tmpRootFile, $rootFile or die "cannot rename `$tmpRootFile' to `$rootFile': $!";
 }