Re: Upgrading Core Modules Using CPAN - Best Practice?
by JavaFan (Canon) on Oct 02, 2008 at 21:23 UTC
|
I'm a bit surprised by this. Whenever I update a core module (which, admittingly, I don't do very often), it always install itself in lib/VERSION, not in site_lib.
If it didn't, you wouldn't be able to "seamlessly" upgrade CPAN (the CPAN shell always checks to see if there's a newer version available).
So, I don't have an answer. I always assumed it would just work (and it always has for me). | [reply] |
Re: Upgrading Core Modules Using CPAN - Best Practice?
by almut (Canon) on Oct 02, 2008 at 22:51 UTC
|
This means that putting Makefile.PL args in CPAN::Config may work
for some modules but not for others.
Could you point out an example module that doesn't allow to
configure its install destination? I mean, if this is true, how
would CPAN.pm then achieve to install the module in the 'site' subtree,
as you're saying? (just wondering)
| [reply] |
|
In the cpan shell,
type the following command with the specific path where you need to update the core modules
cpan> o conf makepl_arg PREFIX='<dir path>'
cpan> o conf commit
Default lib path will be changed after this command..
Lemme know if it works
| [reply] |
|
/usr/local/perl5.8.6/lib/5.8.6/sun4-solaris/Errno.pm (core)
/usr/local/perl5.8.6/lib/site_perl/5.8.6/Errno.pm (cpan)
| [reply] [d/l] [select] |
|
First off, thanks for all the feedback so far. 'Errno' is an example of one such module. This modules was installed as a core module to:
/usr/local/perl5.8.6/lib/5.8.6/sun4-solaris/Errno.pm
When I use CPAN to install this module, it defaults to installing in:
/usr/local/perl5.8.6/lib/site_perl/5.8.6/Errno.pm
I tried to specify the following arguments that would be passed to Makefile.PL to adjust the install path:
'makepl_arg' => qq[INSTALLDIRS=perl}
With this makepl_arg set, the module still installs into the same directory.
I did run across a post that suggested specifying the INSTALLPRIVLIB to the value of $Config{archlibexp} (while 'use'-ing Config), which does seem to tell the module to install into the correct location.
So, if specifying the INSTALLPRIVLIB makepl_arg is a possible solution, the questions that remain are:
- Do all core modules specify INSTALLDIRS=perl as their default location? If not, we would have to add this to CPAN::Config which may cause issues for non-core modules.
- If I specify INSTALLPRIVLIB=$Config{archlibexp} in CPAN::Config, could this cause problems for some modules?
Lastly, getting back to the original question, regardless of how it is done, is clobbering the old (core) version with the new (cpan) version of the module the recommended solution? Or would anyone suggest the @INC overlays?
| [reply] [d/l] [select] |
Re: Upgrading Core Modules Using CPAN - Best Practice?
by mattk (Pilgrim) on Oct 03, 2008 at 08:19 UTC
|
You can configure the CPAN shell to uninstall outdated modules like so:
cpan> o conf mbuild_install_arg UNINST=1
cpan> o conf make_install_arg '--uninst 1'
Or follow the prompts:
cpan> o conf init
| [reply] |
|
cpan> o conf mbuild_install_arg '--uninst 1'
cpan> o conf make_install_arg UNINST=1
Similar settings in CPANPLUS are:
CPAN Terminal> s conf buildflags uninst=1
CPAN Terminal> s conf makeflags UNINST=1
CPAN Terminal> s save
| [reply] [d/l] [select] |
|
1)
I installed a new version of module X but CPAN keeps saying, I hav
+e the old version installed
Most probably you do have the old version installed. This can happ
+en if a module installs itself into a different directory in the @INC
+ path than it was previously installed. This is not really a CPAN.pm
+problem, you would have the same problem when installing the module m
+anually. The easiest way to prevent this behaviour is to add the argu
+ment UNINST=1 to the make install call, and that is why many people a
+dd this argument permanently by configuring
o conf make_install_arg UNINST=1
2)
So why is UNINST=1 not the default?
Because there are people who have their precise expectations about
+ who may install where in the @INC path and who uses which @INC array
+. In fine tuned environments UNINST=1 can cause damage.
| [reply] [d/l] |
Re: Upgrading Core Modules Using CPAN - Best Practice?
by Anonymous Monk on Oct 03, 2008 at 06:12 UTC
|
http://search.cpan.org/dist/ExtUtils-MakeMaker/
http://search.cpan.org/src/MSCHWERN/ExtUtils-MakeMaker-6.46/Makefile.PL
INSTALLDIRS => 'perl',
make install
make alone puts all relevant files into directories that are named by
the macros INST_LIB, INST_ARCHLIB, INST_SCRIPT, INST_MAN1DIR and
INST_MAN3DIR. All these default to something below ./blib if you are
not building below the perl source directory. If you are
building below the perl source, INST_LIB and INST_ARCHLIB default to
../../lib, and INST_SCRIPT is not defined.
The install target of the generated Makefile copies the files found
below each of the INST_* directories to their INSTALL*
counterparts. Which counterparts are chosen depends on the setting of
INSTALLDIRS according to the following table:
INSTALLDIRS set to
perl site vendor
PERLPREFIX SITEPREFIX VENDORPREFIX
INST_ARCHLIB INSTALLARCHLIB INSTALLSITEARCH INSTALLVENDORARCH
INST_LIB INSTALLPRIVLIB INSTALLSITELIB INSTALLVENDORLIB
INST_BIN INSTALLBIN INSTALLSITEBIN INSTALLVENDORBIN
INST_SCRIPT INSTALLSCRIPT INSTALLSITESCRIPT INSTALLVENDORSCRIPT
INST_MAN1DIR INSTALLMAN1DIR INSTALLSITEMAN1DIR INSTALLVENDORMAN1DI
+R
INST_MAN3DIR INSTALLMAN3DIR INSTALLSITEMAN3DIR INSTALLVENDORMAN3DI
+R
INSTALLDIRS
Determines which of the sets of installation directories to choose: perl, site or vendor. Defaults to site.
| [reply] [d/l] [select] |
|
| [reply] |
|
| [reply] |
|
Re: Upgrading Core Modules Using CPAN - Best Practice?
by Anonymous Monk on Oct 03, 2008 at 06:15 UTC
|
Does anyone know of any best practices in regards to this?
You really needn't worry, all CORE modules available as separate downloads on CPAN already know how to get installed in lib instead of site/lib :) | [reply] |
|
/usr/local/perl5.8.6/lib/5.8.6/sun4-solaris/Errno.pm (core: 1.09_00)
/usr/local/perl5.8.6/lib/site_perl/5.8.6/Errno.pm (cpan: 1.10)
| [reply] [d/l] |
|
Congratulations, you've found a bug, report it to whomever put Errno on cpan :)
| [reply] |