[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug/Issue with CPAN defaults in Debian Wheezy



Hi All,

I believe I've uncovered a small bug relating to the default installation parameters when using CPAN.  On my first try using CPAN on the latest Debian testing version (Wheezy), I found that it was installing all the modules I requested into /root/perl instead of in the proper directories.

This issue was very kindly verified by Tomas who, thanks to his more in-depth knowledge of Perl/CPAN than mine has discovered that this issue relates to a little piece of code in CPAN/FirstTime.pm which checks for the existence of certain directories.  Please see Tomas's investigation copied below.

I did however manage to get around the issue by manually configuring CPAN and specifying that CPAN should use 'sudo' to install modules and accepted all other defaults; and now when I install modules it works exactly as expected.

I'm not quite sure if I'm raising this issue in the correct area but I do believe that this should be rectified for the 'stable' version of Wheezy so that others like me who use CPAN at its defaults won't get stuck here as well.

Cheers.
Steve.


Steve Noorderbroek
C.T.O.
Telsat Broadband Limited
www.telsatbb.vu


-----Original Message-----
From: tomas@tuxteam.de [mailto:tomas@tuxteam.de] 
Sent: Wednesday, 26 September 2012 1:01 AM
To: Steve (Telsat Broadband)
Cc: tomas@tuxteam.de
Subject: Re: Issue with installing modules in Debian Wheezy

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, Sep 25, 2012 at 07:16:40PM +1100, Steve (Telsat Broadband) wrote:
> Hi Tomas,
> 
> Again, thanks for the replies.
> 
> I did find it very strange indeed, /usr/lib/perl5 is owned and writeable by root on my box as well but still CPAN couldn't write to it.  I went through the manual config of CPAN and configured it to use 'sudo' for it's make and 'hey presto' it works as expected now.

Funny. I gave it a try (as you did, as root) and can confirm that it behaves as you describe:

| root@rasputin:~# cpan
| 
| CPAN.pm requires configuration, but most of it can be done 
| automatically.
| If you answer 'no' below, you will enter an interactive dialog for 
| each configuration option instead.
| 
| Would you like to configure as much as possible automatically? [yes] 
| no
| 
|  <install_help>
| 
| Warning: You do not have write permission for Perl library directories.
[...]

To me, it looks like a buglet. I'm still digging -- the interesting tidbit seems to be in CPAN::FirstTime (that is, in
/usr/share/perl/5.14.2/CPAN/FirstTime.pm) -- found it by grepping for the error message in the CPAN modules. Especially this function seems suspicious to me:

| sub _can_write_to_libdirs {
|     return -w $Config{installprivlib}
|         && -w $Config{installarchlib}
|         && -w $Config{installsitelib}
|         && -w $Config{installsitearch} }

(somewhere around line 2006). This would fail for root if one of the dirs is missing? And lo and behold:

| tomas@rasputin:~$ perl -e
|     'use Config; \
|      foreach my $d (qw(installprivlib installarchlib \
|                        installsitelib installsitearch)) { \
|        print("$d is $Config{$d} exists=", -d $Config{$d}, "\n"); \
|      }'

yields

| installprivlib is /usr/share/perl/5.14 exists=1 
| installarchlib is /usr/lib/perl/5.14 exists=1 
| installsitelib is /usr/local/share/perl/5.14.2 exists= 
| installsitearch is /usr/local/lib/perl/5.14.2 exists=

So it seems installsitelib and installsitearch are just missing (not on your system anymore, since you managed an install with sudo).

Is that an issue in CPAN? Is that an issue in the base install? I don't know. Maybe it's time to bring it up again in the mailing list.

Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFQYbkkBcgs9XrR2kYRAr9IAJ4tHb22rqx7ajp6NuxahnZw7uX2agCfYnJL
4Tn7O5FC/JMZHiqHyOlznfA=
=LYKh
-----END PGP SIGNATURE-----



Reply to: