summaryrefslogtreecommitdiff
path: root/darcs-all
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2008-08-25 14:59:08 +0000
committerIan Lynagh <igloo@earth.li>2008-08-25 14:59:08 +0000
commit29e0999a73665a37c0c3fd311ac961f81c50bb92 (patch)
tree91490ce7d9060604393ae5e4afb8a5c8be1ce83a /darcs-all
parentb4e88b1999b29c14668df90564fc0d3c89d94120 (diff)
downloadhaskell-29e0999a73665a37c0c3fd311ac961f81c50bb92.tar.gz
Read the packages file in strictly in darcs-all and push-all
This fixes a problem where darcs tries to update it while perl has it open. On Windows this fails. Spotted by Claus Reinke.
Diffstat (limited to 'darcs-all')
-rw-r--r--darcs-all14
1 files changed, 10 insertions, 4 deletions
diff --git a/darcs-all b/darcs-all
index 6c8b406cf3..483cd9df8f 100644
--- a/darcs-all
+++ b/darcs-all
@@ -55,9 +55,13 @@ sub darcsall {
my $localpath;
my $path;
my $tag;
+ my @repos;
open IN, "< packages" or die "Can't open packages file";
- while (<IN>) {
+ @repos = <IN>;
+ close IN;
+
+ foreach (@repos) {
chomp;
if (/^([^# ]+) +(?:([^ ]+) +)?([^ ]+) +([^ ]+)$/) {
$localpath = $1;
@@ -77,7 +81,6 @@ sub darcsall {
die "Bad line: $_";
}
}
- close IN;
}
sub darcsget {
@@ -86,6 +89,7 @@ sub darcsget {
my $remotepath;
my $path;
my $tag;
+ my @repos;
if (! grep /(?:--complete|--partial)/, @_) {
warning("adding --partial, to override use --complete");
@@ -96,7 +100,10 @@ sub darcsget {
}
open IN, "< packages" or die "Can't open packages file";
- while (<IN>) {
+ @repos = <IN>;
+ close IN;
+
+ foreach (@repos) {
chomp;
if (/^([^ ]+) +(?:([^ ]+) +)?([^ ]+) +([^ ]+)$/) {
$localpath = $1;
@@ -123,7 +130,6 @@ sub darcsget {
die "Bad line: $_";
}
}
- close IN;
}
sub main {