Subject: | Unpreventable checks for existing installed package |
Date: | Thu, 6 Sep 2007 01:21:55 -0400 |
To: | bug-module-build [...] rt.cpan.org |
From: | Daniel Macks <dmacks [...] netspace.org> |
When I "perl Build.PL --destdir=/FOO", I'm asserting that I am going
to install to a temporary place, often to create an archive or
distribution package rather than for actual installation now on the
local system. In this situation, it seems like checking for an
existing older version of the package is not appropriate
behavior. Nonetheless, using Module::Build 0.2611, I get for example:
## Differing version of DateTime/TimeZoneCatalog.pm found. You might like to
rm /sw/lib/perl5/5.8.1/DateTime/TimeZoneCatalog.pm
## Running 'make install UNINST=1' will unlink all those files for you.
where that path is the location on the local system. Admitedly this is
a slightly out-dated Module::Build, but the meat of the action appears
to be in Module::Build::Base, which does not appear to be relevantly
different vs the latest CPAN version. The solution is probably in
M::B::B::ACTION_install(), where the last parameter to
ExtUtils::Install::install() should completely inhibit the
existing-local-module test if destdir was passed.
This may actually point to a problem with the EU::I::install()
interface and its documentation: it's explained (in its POD as shipped
with perl5.8.6) to be a simple boolean, but it's implemented as a
tri-state (undefined means don't even check, whereas defined means
check and act based on the defined logical value). However,
M::B::B::ACTION_install() is only calling it based on its documented
values, so it always performs the check:
ExtUtils::Install::install($self->install_map, 1, 0, $self->{args}{uninst}||0);
That means (from brief actual and mental tests) there's no way even
using command-line parameters to Build to inhibit the test, because
that last parameter will always be defined. Presuming this to be a bug
in Install() with ACTION_install() thinking it would do what it's
documented to do, should that line instead be:
ExtUtils::Install::install($self->install_map, 1, 0, $self->{args}{uninst});
(undef not "defined but false" by default) to get sane behavior now
and also for the future if install() is changed to match its docs?
Even if checking for existing modules is desired by default (i.e.,
ACTION_install() is written for now install() works, not how it's
documented), I still think it should pass undef if a destdir was
specified.
dan
--
Daniel Macks
dmacks@netspace.org
http://www.netspace.org/~dmacks