Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CPAN-Mini CPAN distribution.

Report information
The Basics
Id: 9475
Status: resolved
Worked: 15 min
Priority: 0/
Queue: CPAN-Mini

People
Owner: rjbs [...] cpan.org
Requestors: rrwo [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.32
Fixed in: (no value)



Subject: minicpan does not identify home directory properly in Windows etc.
Line 57 of minicpan says %config = config_read( $ENV{HOME} . '/.minicpanrc' ); but on Windows (and maybe other OS's) HOME is undefined. So it gives a warning about contatenating undefined value. You may want to consider using File::HomeDir to identify the home directory. (Alas, the current version is buggy in Windows, but I've submitted some information to the author, so it should be fine for the next version.) In the meantime, you could look at CPANPLUS's method of determining the home directory, which checks various variables. Something like the following (based on CPANPLUS v0.49): use File::Spec; use Cwd; sub _home_dir { return defined $ENV{HOME} ? $ENV{HOME} : defined $ENV{HOMEPATH} ? File::Spec->catfile($ENV{HOMEDRIVE},$ENV{HOMEPATH}) : defined $ENV{USERPROFILE} ? $ENV{USERPROFILE} : defined $ENV{WINDIR} ? $ENV{WINDIR} : defined $ENV{windir} ? $ENV{windir} : getcwd(); }
From: adam [...] cpan.org
Yeah, this should definitely switch to File::HomeDir. Even if it has bugs, at least the problem is centralised, and whatever bugs there are will be fixed in due course in the appropriate place.
[ADAMK - Fri Sep 2 04:22:39 2005]: Show quoted text
> Yeah, this should definitely switch to File::HomeDir. > > Even if it has bugs, at least the problem is centralised, and whatever > bugs there are will be fixed in due course in the appropriate place.
You can also look at File::HomeDir::Win32 as a means to overcome Win32-specific issues.