Skip Menu |

This queue is for tickets about the Brackup CPAN distribution.

Report information
The Basics
Id: 18307
Status: open
Priority: 0/
Queue: Brackup

People
Owner: Nobody in particular
Requestors: adamk [...] cpan.org
Cc:
AdminCc:

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



Subject: $ENV{HOME} is a big portability no no
It might be early days for the moment, but if we are to ever have any chance of getting this ported over to Win32 and so on, you probably should go take a look at the shiny new File::HomeDir, which handles most platforms (and at least centralises the problem when we encounter edge cases in one place).
For now I don't care, but Win32 support would be nice one day, if I can get PAR to work. I'll require Homedir on Win32 in the future (patches welcome!), but I won't require it for Unix. I'll have a tiny function to use $ENV{HOME} || HomeDir(...)
Subject: Re: [rt.cpan.org #18307] $ENV{HOME} is a big portability no no
Date: Wed, 05 Apr 2006 18:43:24 +1000
To: bug-Brackup [...] rt.cpan.org
From: Adam Kennedy <adam [...] phase-n.com>
Sounds fine to me. BTW, you should be aware that there's an upcoming change to HomeDir that you may need to care about too. In short, there are some situations in which not only is thee no HOME, but the current user literally does not have a home to find. So homedir is going to start returning false. The one you may care about is that root on Mac OS X does not have a home. So you might at least need logic to handle that. Adam K via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=18307 > > > For now I don't care, but Win32 support would be nice one day, if I can get PAR to work. > > I'll require Homedir on Win32 in the future (patches welcome!), but I won't require it for Unix. > I'll have a tiny function to use $ENV{HOME} || HomeDir(...)
Subject: Re: [rt.cpan.org #18307] $ENV{HOME} is a big portability no no
Date: Wed, 05 Apr 2006 18:47:21 +1000
To: bug-Brackup [...] rt.cpan.org
From: Adam Kennedy <adam [...] phase-n.com>
BTW, what this also means is that you should default TO install homedir. Then remove it for known-good cases. So on linux/bsd/etc or anything else you recognise, don't use it. So not so much if ( $^O eq 'Win32' ) but some form of sub always_has_home { return 1 if $^O eq 'linux'; return 0 if $^O eq 'Win32'; return 1 if ...; ... return 0; } unless ( always_has_home() ) { ... } Adam K adam@phase-n.com via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=18307 > > > Sounds fine to me. > > BTW, you should be aware that there's an upcoming change to HomeDir that > you may need to care about too. > > In short, there are some situations in which not only is thee no HOME, > but the current user literally does not have a home to find. > > So homedir is going to start returning false. > > The one you may care about is that root on Mac OS X does not have a home. > > So you might at least need logic to handle that. > > Adam K > > via RT wrote:
>> <URL: http://rt.cpan.org/Ticket/Display.html?id=18307 > >> >> For now I don't care, but Win32 support would be nice one day, if I can get PAR to work. >> >> I'll require Homedir on Win32 in the future (patches welcome!), but I won't require it for Unix. >> I'll have a tiny function to use $ENV{HOME} || HomeDir(...)
From: wlynch [...] sharth.ath.cx
I can only test on leopard, but root's home is /var/root there. On Wed Apr 05 04:46:05 2006, adam@phase-n.com wrote: Show quoted text
> The one you may care about is that root on Mac OS X does not have a > home.