Hi all,

That wasn't exactly easy.  I have to think that if it is difficult, I'm 
not doing it right.

  # echo 'die' > badlib/Build.PL
  my $libdir = 'badlib';
  unless (-d $libdir) {
    mkdir($libdir, 0777) or die "Can't create $libdir: $!";
  }
  ok -d $libdir;
  my $filename = 'Build.PL';
  my $file = File::Spec->catfile($libdir, $filename);
  my $fh = IO::File->new($file, '>') or die "Can't create $file: $!";
  print $fh "die\n";
  $fh->close;
  ok -e $file;

Here, I was cribbing off of 't/files.t', though looking back at the 
t/test_type.t $dist->add_file seems pretty handy.

However, it is somewhat inconvenient to need to $dist->regen from the 
toplevel directory.  Is it reasonable for $dist to have a cd_in() 
cd_out() methods (allowing it to know its current state) and be able to 
regen() from anywhere?

Also, $dist->make_file($filepath, $content) as a "create this right now" 
method would be convenient.

Since I've been looking at testing Module::ScanDeps lately, I wonder if 
it wouldn't be useful to make this be Test::DistGen and install it with 
the rest of Module::Build?

--Eric
-- 
I eat your socks and you pay me.
--The business sense of a very small goat.
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------

Reply via email to