Here's a fix for the

No root path(s) specified at /usr/share/perl/5.8/ExtUtils/Command.pm line
95

issue with the perl tests.  It seems to be a bug in the rm_rf which is
defined in Shell::Command, which gives that warning if none of the files
are found (or alternatively, you could view the bug as being in the rmtree
which is in File::Path).  I've implemented a workaround called "cleanup",
which just checks if the files or directories exist before calling rm_rf.
It's crude, and it's stupid, but there aren't any more warnings now.

David

P.S. The fix depended on my "too many open files" test, so I'm resending
that.  I think that's a good test to have anyways (although its behavior is
system-dependent).

Sat Aug 27 15:22:15 EDT 2005  David Roundy <[EMAIL PROTECTED]>
  * add test that triggers "too many open files" bug.
  We just need to pull over 1024 patches at once to trigger this bug on my
  linux system.

Tue Aug 30 08:16:03 EDT 2005  David Roundy <[EMAIL PROTECTED]>
  * fix "No root path(s) specified at ..." testsuite problem.

New patches:

[add test that triggers "too many open files" bug.
David Roundy <[EMAIL PROTECTED]>**20050827192215
 We just need to pull over 1024 patches at once to trigger this bug on my
 linux system.
] 
<
> {
addfile ./tests/pull_many_files.pl
hunk ./tests/pull_many_files.pl 1
+#!/usr/bin/env perl
+
+# Some tests for 'darcs unpull'
+
+use lib qw(lib/perl);
+
+use Test::More qw/no_plan/;
+use Test::Darcs;
+use Shell::Command;
+use strict;
+
+rm_rf  'temp1';
+mkpath 'temp1';
+chdir  'temp1';
+darcs 'init';
+writefile("ALL --ignore-times", "_darcs/prefs/defaults");
+
+touch 'foo';
+darcs 'add foo';
+darcs "record -A x -a -m 'adding foo' foo";
+
+{ # Record lots of patches...
+  my $how_many = 1100;
+  my $n;
+  for ($n=0;$n<$how_many;$n++) {
+    writefile("$n\n", "foo");
+    darcs "record -A x -a -m 'change $n' foo";
+  }
+}
+
+chdir '..';
+rm_rf 'temp2';
+mkpath 'temp2';
+chdir 'temp2';
+darcs 'initialize';
+like( darcs('pull -a ../temp1'),
+      qr/Finished pulling/,
+      "pull works on many patches at a time" );
+
+####
+
+chdir '../';
+rm_rf 'temp1';
+rm_rf 'temp2';
+
+
+sub writefile {
+  my ($contents, $filename) = @_;
+  my $f;
+  open($f, ">$filename") || die "Couldn't open $filename";
+  print $f "$contents\n";
+  close($f);
+}
}
[fix "No root path(s) specified at ..." testsuite problem.
David Roundy <[EMAIL PROTECTED]>**20050830121603] 
<
> {
hunk ./tests/add.pl 14
 
 use strict;
 
-rm_rf  'temp1';
+cleanup  'temp1';
 mkpath 'temp1';
 chdir  'temp1';
 darcs 'init';
hunk ./tests/add.pl 86
 
 
 chdir '../';
-rm_rf 'temp1';
+cleanup 'temp1';
 ok((!-d 'temp1'), 'temp1 directory was deleted');
hunk ./tests/add_in_subdir.pl 11
 use Shell::Command;
 use File::Compare;
 
-rm_rf  qw(temp1 temp2);
+cleanup qw(temp1 temp2);
 mkpath qw(temp1 temp2);
hunk ./tests/add_in_subdir.pl 13
-END { rm_rf qw(temp1 temp2); }
+END { cleanup qw(temp1 temp2); }
 chdir 'temp1';
 darcs 'init';
 mkpath 'dir';
hunk ./tests/dist.pl 11
 use Test::Darcs;
 use Shell::Command;
 
-rm_rf  'temp1';
+cleanup 'temp1';
 mkpath 'temp1';
 chdir 'temp1';
 
hunk ./tests/dist.pl 28
 
 
 chdir '../';
-rm_rf 'temp1';
+cleanup 'temp1';
 
 
 
hunk ./tests/lib/perl/Test/Darcs.pm 4
 package Test::Darcs;
 
 use Exporter;
+use Shell::Command;
 @ISA = qw(Exporter);
 @EXPORT = qw(
     &darcs
hunk ./tests/lib/perl/Test/Darcs.pm 9
     &echo_to_darcs
+    &cleanup
     $DARCS
 );
 
hunk ./tests/lib/perl/Test/Darcs.pm 104
     return $output;
 }
 
+# The following is a workaround for a bug in Shell::Command which emits an
+# error message when given a file that doesn't exist.
 
hunk ./tests/lib/perl/Test/Darcs.pm 107
+sub cleanup {
+  my $f;
+  foreach $f (@_) {
+    rm_rf $f if (-e $f);
+  }
+}
 
 =head1 ENVIRONMENT
 
hunk ./tests/missed_resolution.pl 12
 use Shell::Command;
 
 for my $dir (qw/tmp1 tmp2/) {
-    rm_rf($dir);
+    cleanup($dir);
     mkpath("$dir/") || die "couldn't mkpath: $!";
     chdir $dir || die;
     darcs 'init';
hunk ./tests/missed_resolution.pl 61
 chdir '../';
 for my $dir (qw/tmp1 tmp2/) {
     ok(-d $dir, "$dir exists here");
-    rm_rf($dir);
+    cleanup($dir);
     ok((!-d $dir), "$dir directory was deleted");
 }
 
hunk ./tests/mv.pl 13
 use strict;
 use Carp;
 
-rm_rf 'temp1';
+cleanup 'temp1';
 mkdir 'temp1';
 chdir 'temp1';
 darcs 'init';
hunk ./tests/mv.pl 54
 ###
 
 chdir '../../../';
-rm_rf 'temp1';
+cleanup 'temp1';
 ok((!-d 'temp1'), 'temp1 directory was deleted');
 
 
hunk ./tests/optimize.pl 11
 use Test::Darcs;
 use Shell::Command;
 
-rm_rf  'temp1';
+cleanup  'temp1';
 mkpath 'temp1';
 chdir 'temp1';
 
hunk ./tests/optimize.pl 28
     "optimize --reorder-patches works for trivial case." );
 
 chdir '../';
-rm_rf 'temp1';
+cleanup 'temp1';
 
 
 
hunk ./tests/pending_has_conflicts.pl 15
 die 'darcs not found' unless $ENV{DARCS} || (-x "$ENV{PWD}/../darcs");
 $DARCS = $ENV{DARCS} || "$ENV{PWD}/../darcs";
 
-rm_rf  'temp1';
+cleanup  'temp1';
 mkpath 'temp1';
 chdir 'temp1';
 darcs 'init';
hunk ./tests/pending_has_conflicts.pl 43
 like( darcs('repair'), qr/The repo is already consistent, no changes made/i, 'darcs repair finds no problem');
 
 chdir '../';
-rm_rf 'temp1';
+cleanup 'temp1';
 ok((!-d 'temp1'), 'temp1 directory was deleted');
 
 
hunk ./tests/printer.pl 23
 
 use strict;
 
-rm_rf  'temp1';
+cleanup  'temp1';
 mkpath 'temp1';
 chdir  'temp1';
 darcs 'init';
hunk ./tests/printer.pl 143
 
 
 chdir '../';
-rm_rf 'temp1';
+cleanup 'temp1';
 ok((!-d 'temp1'), 'temp1 directory was deleted');
hunk ./tests/pull_many_files.pl 12
 use Shell::Command;
 use strict;
 
-rm_rf  'temp1';
+cleanup  'temp1';
 mkpath 'temp1';
 chdir  'temp1';
 darcs 'init';
hunk ./tests/pull_many_files.pl 32
 }
 
 chdir '..';
-rm_rf 'temp2';
+cleanup 'temp2';
 mkpath 'temp2';
 chdir 'temp2';
 darcs 'initialize';
hunk ./tests/pull_many_files.pl 43
 ####
 
 chdir '../';
-rm_rf 'temp1';
-rm_rf 'temp2';
+cleanup 'temp1';
+cleanup 'temp2';
 
 
 sub writefile {
hunk ./tests/push.pl 11
 use Shell::Command;
 use strict;
 
-rm_rf  'temp1';
-rm_rf  'temp2';
+cleanup  'temp1';
+cleanup  'temp2';
 mkpath 'temp1';
 mkpath 'temp2/one/two';
 chdir 'temp1';
hunk ./tests/push.pl 67
 }
 
 ok(-d 'temp1', "temp1 exists here");
-rm_rf 'temp1';
+cleanup 'temp1';
 ok((!-d 'temp1'), 'temp1 directory was deleted');
 
 ok(-d 'temp2', "temp2 exists here");
hunk ./tests/push.pl 71
-rm_rf 'temp2';
+cleanup 'temp2';
 ok((!-d 'temp2'), 'temp2 directory was deleted');
 
 
hunk ./tests/put.pl 12
 use Cwd;
 use strict;
 
-rm_rf  qw/temp1 temp2/;
+cleanup  qw/temp1 temp2/;
 mkpath 'temp1';
 chdir 'temp1';
 darcs 'init';
hunk ./tests/put.pl 68
 
 
 ok(-d 'temp1', "temp1 exists here");
-rm_rf 'temp1';
+cleanup 'temp1';
 ok((!-d 'temp1'), 'temp1 directory was deleted');
 
 ok(-d 'temp2', "temp2 exists here");
hunk ./tests/put.pl 72
-rm_rf 'temp2';
+cleanup 'temp2';
 ok((!-d 'temp2'), 'temp2 directory was deleted');
 
 
hunk ./tests/record.pl 12
 use Shell::Command;
 use Cwd;
 
-rm_rf  'temp1';
+cleanup  'temp1';
 mkpath 'temp1';
 chdir  'temp1';
 darcs  'init';
hunk ./tests/record.pl 49
     darcs(qw/add no_perms.txt no_perms2.txt/); 
     chmod(0000,"no_perms.txt","no_perms2.txt");
     like(darcs("record -A x -a -m foo"), qr/perms.*perms2/,$test_name);
-    rm_rf "no_perms.txt", "no_perms2.txt";
+    cleanup "no_perms.txt", "no_perms2.txt";
 
 }
 
hunk ./tests/record.pl 72
 ###
 
 chdir '../';
-rm_rf 'temp1';
+cleanup 'temp1';
 ok((!-d 'temp1'), 'temp1 directory was deleted');
 
 
hunk ./tests/resolve.pl 11
 use Test::Darcs;
 use Shell::Command;
 
-rm_rf  'temp1';
+cleanup  'temp1';
 mkpath 'temp1';
 chdir 'temp1';
 
hunk ./tests/resolve.pl 80
 
 
 chdir '../';
-rm_rf 'temp1', 'temp2';
+cleanup 'temp1', 'temp2';
 
 
 
hunk ./tests/unpull.pl 12
 use Shell::Command;
 use strict;
 
-rm_rf  'temp1';
+cleanup  'temp1';
 mkpath 'temp1';
 chdir  'temp1';
 darcs 'init';
hunk ./tests/unpull.pl 63
 ####
 
 chdir '../';
-rm_rf 'temp1';
+cleanup 'temp1';
 ok((!-d 'temp1'), 'temp1 directory was deleted');
hunk ./tests/unrecord.pl 14
 
 use strict;
 
-rm_rf  'temp1';
+cleanup  'temp1';
 mkpath 'temp1';
 chdir  'temp1';
 darcs 'init';
hunk ./tests/unrecord.pl 34
 ####
 
 chdir '../';
-rm_rf 'temp1';
+cleanup 'temp1';
 ok((!-d 'temp1'), 'temp1 directory was deleted');
hunk ./tests/whatsnew.pl 12
 use Shell::Command;
 use strict;
 
-rm_rf 'temp1';
+cleanup 'temp1';
 mkpath 'temp1';
 chdir 'temp1';
 darcs 'init';
hunk ./tests/whatsnew.pl 40
 }
 
 chdir '../';
-rm_rf('temp1');
+cleanup('temp1');
 ok((!-d 'temp1'), 'temp1 directory was deleted');
 
 
}

Context:

[New implementation of comparePS, based on memcmp. 1/5 space usage, 96% faster
[EMAIL PROTECTED] 
[Use substrPS-less versions of initPS and tailPS
[EMAIL PROTECTED] 
[remove hideous malloc hack.
David Roundy <[EMAIL PROTECTED]>**20050818161411] 
[change my AUTHORS email to [EMAIL PROTECTED]
David Roundy <[EMAIL PROTECTED]>**20050808124703] 
[fix mkstemp implementation for win32
Peter Strand <[EMAIL PROTECTED]>**20050810211303] 
[Implement parts of System.Posix.(IO|Files) for win32
[EMAIL PROTECTED] 
[implement RawMode with library functions instead of ffi
[EMAIL PROTECTED] 
[call hsc2hs without output filename argument
[EMAIL PROTECTED] 
[Rename compat.c to c_compat.c to avoid object filename conflict with Compat.hs
[EMAIL PROTECTED] 
[Move atomic_create/sloppy_atomic_create to Compat
Ian Lynagh <[EMAIL PROTECTED]>**20050730141703] 
[Split the raw mode stuff out into its own .hsc file. Windows needs some TLC
Ian Lynagh <[EMAIL PROTECTED]>**20050730134030] 
[Move maybe_relink out of compat.c
Ian Lynagh <[EMAIL PROTECTED]>**20050730131205] 
[Remove is_symlink
Ian Lynagh <[EMAIL PROTECTED]>**20050730122255] 
[Move mkstemp to Compat.hs
Ian Lynagh <[EMAIL PROTECTED]>**20050730020918] 
[Remove unused function
Ian Lynagh <[EMAIL PROTECTED]>**20050730010118] 
[Start Compat.hs, and move stdout_is_a_pipe from compat.c
Ian Lynagh <[EMAIL PROTECTED]>**20050730004829] 
[fix compilation errors with ghc-6.2.2 on win32
Peter Strand <[EMAIL PROTECTED]>**20050809192759] 
[Retain both Git's author and committer.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050810000820] 
[Move slurping into syncPristine.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050809232101
 Avoids creating a useless pristine tree when there is none.  Thanks to
 Ian for pointing this out.
] 
[Split --relink into --relink and --relink-pristine.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050809230951
 Relinking the pristine tree breaks handling of timestamps, which causes
 Darcs to compare file contents.  It should not be used unless you know
 what you are doing.
] 
[fix for bug Ian found in apply.
David Roundy <[EMAIL PROTECTED]>**20050811162558
 This is the bug manifested in the cabal repository.
] 
[Cleanup --verbose handling in repair command
Matt Lavin <[EMAIL PROTECTED]>**20050805020630] 
[clean up Printer.wrap_text.
David Roundy <[EMAIL PROTECTED]>**20050808114844] 
[add several changelog entries.
David Roundy <[EMAIL PROTECTED]>**20050808114800] 
[improve EOD message a tad.
David Roundy <[EMAIL PROTECTED]>**20050807112644
 This change also introduces a "wrapped_text" function in Printer, so we
 won't have to worry so often about manually wrapping lines.
] 
[changed ***DARCS*** to ***END OF DESCRIPTION***
Jason Dagit <[EMAIL PROTECTED]>**20050729032543] 
[remove unused opts argument from apply_patches and apply_patches_with_feedback
Matt Lavin <[EMAIL PROTECTED]>**20050807031038] 
[add code to read patch bundles with added CRs.
David Roundy <[EMAIL PROTECTED]>**20050806222631
 I think this'll address bug #291.
] 
[accept command-line flags in any order.
David Roundy <[EMAIL PROTECTED]>**20050806211828
 In particular, we no longer require that --flags precede filename and
 repository arguments.
] 
[add obliterate command as alias for unpull.
David Roundy <[EMAIL PROTECTED]>**20050804104929] 
[Do not ask confirmation for revert -a
[EMAIL PROTECTED]
 Giving -a as a parameter means the user expects all changes to be reverted.
 Just like for unrevert and record go ahead with it do not ask for confirmation.
] 
[clarify help text for 'd' in SelectPatches.
David Roundy <[EMAIL PROTECTED]>**20050806231117] 
[Add --with-static-libs configure flag for linking static versions of libraries.
[EMAIL PROTECTED] 
[add changelog entry for bug #477.
David Roundy <[EMAIL PROTECTED]>**20050806212148] 
[add description of how to add changelog entries to ChangeLog.README.
David Roundy <[EMAIL PROTECTED]>**20050806225901] 
[Explain the missing ChangeLog
Mark Stosberg <[EMAIL PROTECTED]>**20050526135421
 
 It should be easy for casual users and contributors to view and update the
 ChangeLog.
 
 Providing a README file in the place where people are most likely to look
 provides a very useful clue.
 
 However, it's still not clear to me exactly how the system works, so I have
 left a stub to complete that documentation.
 
     Mark
 
] 
[make repair work on partial repositories.
David Roundy <[EMAIL PROTECTED]>**20050805113001] 
[Use apply_patch_with_feedback from check and repair commands
Matt Lavin <[EMAIL PROTECTED]>**20050805020830] 
[show patch numbers instead of dots on get
Matt Lavin <[EMAIL PROTECTED]>**20050804013649] 
[fix obsolete error explanation in get_extra bug.
David Roundy <[EMAIL PROTECTED]>**20050804130610] 
[simplify fix for bug 463; reuse /// from FilePathUtils
Matt Lavin <[EMAIL PROTECTED]>**20050804021130] 
[Make curl exit with error on failed downloads
[EMAIL PROTECTED] 
[Bump up AC_PREREQ version to 2.59.
[EMAIL PROTECTED] 
[fix for bug 463 (with new test)
Matt Lavin <[EMAIL PROTECTED]>**20050802002116] 
[bump version number, since I just made a release.
David Roundy <[EMAIL PROTECTED]>**20050731190756] 
[Use simpler curl_version() function to get version string.
Kannan Goundan <[EMAIL PROTECTED]>**20050322221027] 
[fix documentation on --reorder-patches.
David Roundy <[EMAIL PROTECTED]>**20050731185406] 
[add changelog entry for bug #224.
David Roundy <[EMAIL PROTECTED]>**20050731133942] 
[fix bug when editing long comment leaves empty file.
David Roundy <[EMAIL PROTECTED]>**20050731133612] 
[changelog entry for bug #189.
David Roundy <[EMAIL PROTECTED]>**20050731132624] 
[TAG 1.0.4pre2
David Roundy <[EMAIL PROTECTED]>**20050731121029] 
Patch bundle hash:
dfa561adf530acc6a44dff9d200ea1af86f3deb5
_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel

Reply via email to