Re: [Module::Build] Document install_base_relpaths
Status: Beta
Brought to you by:
kwilliams
From: Randy W. S. <ml...@th...> - 2006-04-07 22:52:58
|
David Wheeler wrote: > On Apr 6, 2006, at 10:53, Randy W. Sims wrote: > >> Great. besides making the methods public and documenting them, the >> bigger change was one you don't see: During install it now knows to >> install the custom type whereas before it would not install them >> unless you specified an explicit --install-path or did some trickery >> under the hood. Eg. setting install_base_relpath and giving the >> --install-base option did nothing when installing. > > So if I don't set install-path or install_base, where will it be > installed? If 'install_path' is set, elements will be installed to the set location. If 'install_base' is set, and the author provides a relpath via install_base_relpath(), elements will be installed to install_base/relpath. If 'prefix' is set, and the author provides a relpath via prefix_relpath(), elements will be installed to prefix/relpath. Otherwise it will not be installed. The changes I made allow the above to work without further tinkering with the internals by authors. > I thought that I needed to write process_[element]_files() to > set it up to do the right thing. For example, for my "www" element, I > have this method: > > sub process_www_files { > my $self = shift; > my $files = $self->find_www_files; > while (my ($file, $dest) = each %$files) { > $self->copy_if_modified( > from => $file, > to => File::Spec->catfile($self->blib, $dest) > ); > } > } > > Do I no longer need that? None of my changes affect the code above in any way. Although, as written, I think the code above is redundant. IIRC, the default processing does exactly what your process_www_files() does as long as you supply the find_www_files. But, again, that has nothing to do with any changes I've recently made. Regards, Randy. |