Skip Menu |
 

This queue is for tickets about the CPAN CPAN distribution.

Report information
The Basics
Id: 32841
Status: open
Priority: 0/
Queue: CPAN

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

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



Subject: Location of .cpan Inconsistent on Mac OS X
Date: Thu, 31 Jan 2008 13:21:26 -0800
To: bug-CPAN [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
Download (untitled) / with headers
text/plain 660b
I'm running Perl 5.10 with CPAN v1.9205 on Mac OS X 10.5 "Leopard". Once File::HomeDir is installed, CPAN.pm using ~/Library/Application\ Support\.cpan for CPAN::MyConfig, but everything else is still in `/.cpan. I'd prefer that everything was just left in ~/.cpan, as on other OSes, regardless of what File::HomeDir says. If ~/.cpan isn't feasible, then I'd certainly prefer that everything was in one place, at the very least. As it is, downloads and builds go into ~/.cpan and config goes into ~/Library/Application\ Support/.cpan. Very annoying. Thanks for all the recent great in improvements in CPAN.pm, though. Very nice! Best, David
CC: Michael G Schwern <schwern [...] pobox.com>
Subject: Re: [rt.cpan.org #32841] Location of .cpan Inconsistent on Mac OS X
Date: Fri, 01 Feb 2008 06:47:18 +0100
To: bug-CPAN [...] rt.cpan.org
From: andreas.koenig.7os6VVqR [...] franz.ak.mind.de (Andreas J. Koenig)
Show quoted text
>>>>> On Thu, 31 Jan 2008 16:23:07 -0500, "David Wheeler via RT" <bug-CPAN@rt.cpan.org> said:
Show quoted text
> I'm running Perl 5.10 with CPAN v1.9205 on Mac OS X 10.5 "Leopard". > Once File::HomeDir is installed, CPAN.pm using ~/Library/Application\ > Support\.cpan for CPAN::MyConfig, but everything else is still in > `/.cpan. I'd prefer that everything was just left in ~/.cpan, as on > other OSes, regardless of what File::HomeDir says. If ~/.cpan isn't > feasible, then I'd certainly prefer that everything was in one place, > at the very least. As it is, downloads and builds go into ~/.cpan and > config goes into ~/Library/Application\ Support/.cpan. Very annoying.
I'm not sure how this came about. I remember it was Schwern's idea to treat OSX a bit OSXishly. Or maybe it is a consequence of using File::HomeDir in one place and forgetting it somewhere else? I fully agree with you that there should be only one place. But offhand I don't know where the bug sits. Is it still broken in 1.92_55? -- andreas
CC: Adam Kennedy <adamk [...] cpan.org>
Subject: Re: [rt.cpan.org #32841] Location of .cpan Inconsistent on Mac OS X
Date: Thu, 31 Jan 2008 23:42:14 -0800
To: bug-CPAN [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
Download (untitled) / with headers
text/plain 1.6k
(Andreas J. Koenig) via RT wrote: Show quoted text
> Queue: CPAN > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=32841 > >
>>>>>> On Thu, 31 Jan 2008 16:23:07 -0500, "David Wheeler via RT" <bug-CPAN@rt.cpan.org> said:
>
> > I'm running Perl 5.10 with CPAN v1.9205 on Mac OS X 10.5 "Leopard". > > Once File::HomeDir is installed, CPAN.pm using ~/Library/Application\ > > Support\.cpan for CPAN::MyConfig, but everything else is still in > > `/.cpan. I'd prefer that everything was just left in ~/.cpan, as on > > other OSes, regardless of what File::HomeDir says. If ~/.cpan isn't > > feasible, then I'd certainly prefer that everything was in one place, > > at the very least. As it is, downloads and builds go into ~/.cpan and > > config goes into ~/Library/Application\ Support/.cpan. Very annoying.
> > I'm not sure how this came about. I remember it was Schwern's idea to > treat OSX a bit OSXishly. Or maybe it is a consequence of using > File::HomeDir in one place and forgetting it somewhere else?
I hereby transfer all blame to one Adam Kennedy. I enter into evidence rt.cpan.org 17759 and 22120 as exhibits A and 2. FWIW I think CPAN is doing the right thing by using the native configuration directory. Show quoted text
> I fully agree with you that there should be only one place. But > offhand I don't know where the bug sits. Is it still broken in > 1.92_55?
I'd suspect what's happening is CPAN::MyConfig says to use ~/.cpan for the build_dir and cpan_home and all that. I'd check that, David. -- 10. Not allowed to purchase anyone’s soul on government time. -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army http://skippyslist.com/list/
CC: bug-CPAN [...] rt.cpan.org, "Adam Kennedy" <adamk [...] cpan.org>
Subject: Re: [rt.cpan.org #32841] Location of .cpan Inconsistent on Mac OS X
Date: Fri, 1 Feb 2008 20:41:55 +1100
To: "Michael G Schwern" <schwern [...] pobox.com>
From: "Adam Kennedy" <adamkennedybackup [...] gmail.com>
Download (untitled) / with headers
text/plain 2.2k
Hey, I'm just supplying the CORRECT place to put the files, when asked by CPAN.pm. (And pudge made that decision anyway) If you ignore what I say and half the time go use something else, I refuse to be held accountable :) That said, it would seem slightly odd to me that you would START with the files in one place, and then not do one of a) Move the files to the new location or b) Keep using the old build location, when File::HomeDir is added. Adam K On 01/02/2008, Michael G Schwern <schwern@pobox.com> wrote: Show quoted text
> (Andreas J. Koenig) via RT wrote:
> > Queue: CPAN > > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=32841 > > >
> >>>>>> On Thu, 31 Jan 2008 16:23:07 -0500, "David Wheeler via RT" <bug-CPAN@rt.cpan.org> said:
> >
> > > I'm running Perl 5.10 with CPAN v1.9205 on Mac OS X 10.5 "Leopard". > > > Once File::HomeDir is installed, CPAN.pm using ~/Library/Application\ > > > Support\.cpan for CPAN::MyConfig, but everything else is still in > > > `/.cpan. I'd prefer that everything was just left in ~/.cpan, as on > > > other OSes, regardless of what File::HomeDir says. If ~/.cpan isn't > > > feasible, then I'd certainly prefer that everything was in one place, > > > at the very least. As it is, downloads and builds go into ~/.cpan and > > > config goes into ~/Library/Application\ Support/.cpan. Very annoying.
> > > > I'm not sure how this came about. I remember it was Schwern's idea to > > treat OSX a bit OSXishly. Or maybe it is a consequence of using > > File::HomeDir in one place and forgetting it somewhere else?
> > I hereby transfer all blame to one Adam Kennedy. I enter into evidence > rt.cpan.org 17759 and 22120 as exhibits A and 2. > > FWIW I think CPAN is doing the right thing by using the native configuration > directory. > >
> > I fully agree with you that there should be only one place. But > > offhand I don't know where the bug sits. Is it still broken in > > 1.92_55?
> > I'd suspect what's happening is CPAN::MyConfig says to use ~/.cpan for the > build_dir and cpan_home and all that. I'd check that, David. > > > -- > 10. Not allowed to purchase anyone's soul on government time. > -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army > http://skippyslist.com/list/ >
Subject: Re: [rt.cpan.org #32841] Location of .cpan Inconsistent on Mac OS X
Date: Fri, 01 Feb 2008 01:58:52 -0800
To: bug-CPAN [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
Download (untitled) / with headers
text/plain 848b
Adam Kennedy via RT wrote: Show quoted text
> That said, it would seem slightly odd to me that you would START with > the files in one place, and then not do one of a) Move the files to > the new location or b) Keep using the old build location, when > File::HomeDir is added.
I think folks aren't aware anything changed so they aren't taking any action, it's just how things are set up. I can guess something like this happens: 1) A fresh Perl is installed, no File::HomeDir. 2) The CPAN shell is loaded, without File::HomeDir it falls back to $ENV{HOME} for configuration. 3) File::HomeDir is eventually installed, now the CPAN shell is looking in ~/Library/Application Support/.cpan for it's config but everything was originally configured for ~/.cpan -- Reality is that which, when you stop believing in it, doesn't go away. -- Phillip K. Dick
Subject: Re: [rt.cpan.org #32841] Location of .cpan Inconsistent on Mac OS X
Date: Fri, 1 Feb 2008 10:03:09 -0800
To: bug-CPAN [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
Download (untitled) / with headers
text/plain 933b
On Feb 1, 2008, at 01:59, Michael G Schwern via RT wrote: Show quoted text
> I can guess something like this happens: > 1) A fresh Perl is installed, no File::HomeDir. > 2) The CPAN shell is loaded, without File::HomeDir it falls back to > $ENV{HOME} for configuration. > 3) File::HomeDir is eventually installed, now the CPAN shell is > looking in > ~/Library/Application Support/.cpan for it's config but everything was > originally configured for ~/.cpan
Yes, that's what happened to me, and the next time I ran the CPAN shell after installing File::HomeDir, it prompted me to configure things again, because it was no longer looking for ~/.cpan/CPAN/ MyConfig.pm. When I figured out what was going on, I copied the file over, but what a PITA. Anyway, it looks like CPAN::Config is using `File::HomeDir->my_data` for the location of .cpan, but why not just use `File::HomeDir- Show quoted text
>my_home` like everything else does?
Best, David
Subject: Re: [rt.cpan.org #32841] Location of .cpan Inconsistent on Mac OS X
Date: Fri, 01 Feb 2008 12:47:22 -0800
To: bug-CPAN [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
David Wheeler via RT wrote: Show quoted text
>> I can guess something like this happens: >> 1) A fresh Perl is installed, no File::HomeDir. >> 2) The CPAN shell is loaded, without File::HomeDir it falls back to >> $ENV{HOME} for configuration. >> 3) File::HomeDir is eventually installed, now the CPAN shell is >> looking in >> ~/Library/Application Support/.cpan for it's config but everything was >> originally configured for ~/.cpan
> > Yes, that's what happened to me, and the next time I ran the CPAN > shell after installing File::HomeDir, it prompted me to configure > things again, because it was no longer looking for ~/.cpan/CPAN/ > MyConfig.pm. When I figured out what was going on, I copied the file > over, but what a PITA.
This, I believe, is the actual problem. It doesn't seem to matter to you where the data lives as long as it lives in one place, right? So the question now is how do we make sure it lives in one place? There's a bootstrap problem. Show quoted text
> Anyway, it looks like CPAN::Config is using `File::HomeDir->my_data` > for the location of .cpan, but why not just use `File::HomeDir-
> >my_home` like everything else does?
Because the whole point of File::HomeDir is to abstract this all away. It would be incorrect to use my_home for this because you're not asking where the home directory is, you're asking where to put config data. On stock Unix almost all of this defaults to home because Unixes rarely define a user data directory. Everyone just dumps things into ~/.foo by tradition. Both Windows and OS X define a place to put user data, that's ~/Library/Application Support on OS X and on Windows it's ~/Local Settings/Application Data/. [1] Other systems might do the same in the future, so it's best to ask them. While one might say "but OS X is Unix"... well, yes except where it's not. [1] Actually you ask the OS where it is, something else Unix generally lacks. -- But there's no sense crying over every mistake. You just keep on trying till you run out of cake. -- Jonathan Coulton, "Still Alive"
Subject: Re: [rt.cpan.org #32841] Location of .cpan Inconsistent on Mac OS X
Date: Fri, 1 Feb 2008 16:02:20 -0500
To: bug-CPAN [...] rt.cpan.org
From: "David Golden" <dagolden [...] cpan.org>
Download (untitled) / with headers
text/plain 1.3k
On Feb 1, 2008 3:47 PM, Michael G Schwern via RT <bug-CPAN@rt.cpan.org> wrote: Show quoted text
> Because the whole point of File::HomeDir is to abstract this all away. It > would be incorrect to use my_home for this because you're not asking where > the > home directory is, you're asking where to put config data. On stock Unix > almost all of this defaults to home because Unixes rarely define a user > data > directory. Everyone just dumps things into ~/.foo by tradition. > >
My rule of thumb for this is that configuration directories/files should live in a common, easily found directory. For CPAN::Reporter on Windows, the standard place users expect to find things is "My Documents" -- not some hidden system directory buried in some hard to find place. Cache and other purely application accessed data can live in the "Application Data" type directories. For anything with a Unix background, I would expect to find dot-config type directories like "~/.cpanreporter" so that's the behavior. I don't believe in sticking things in some my_data() directory just because that exists for native GUI applications. Certainly, the *addition* of File::HomeDir shouldn't change the location of the default configuration directory -- or if it does, there should be an automatic migration from the old location to the new location if that situation is detected. David
Subject: Re: [rt.cpan.org #32841] Location of .cpan Inconsistent on Mac OS X
Date: Fri, 1 Feb 2008 18:48:19 -0800
To: bug-CPAN [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
Download (untitled) / with headers
text/plain 2.1k
On Feb 1, 2008, at 12:47, Michael G Schwern via RT wrote: Show quoted text
> This, I believe, is the actual problem. It doesn't seem to matter > to you > where the data lives as long as it lives in one place, right?
The bug is that it uses two locations, yes. My preference is for ~/.cpan, but I can live with it elsewhere, as long as there is just one directory. Show quoted text
> So the question now is how do we make sure it lives in one place? > There's a > bootstrap problem.
There is no bootstrap problem if you always use `$ENV{HOME}/.cpan`. ;-) Show quoted text
> Because the whole point of File::HomeDir is to abstract this all > away. It > would be incorrect to use my_home for this because you're not asking > where the > home directory is, you're asking where to put config data. On stock > Unix > almost all of this defaults to home because Unixes rarely define a > user data > directory. Everyone just dumps things into ~/.foo by tradition.
Yes, and it is a tradition that Unix apps that are distributed *with* Mac OS X use. If you fire up /usr/bin/emacs, what configuration file does it use? ~/.emacs, of course. Only UI apps use ~/Library/ Application\ Support. Show quoted text
> Both Windows and OS X define a place to put user data, that's > ~/Library/Application Support on OS X and on Windows it's ~/Local > Settings/Application Data/. [1] Other systems might do the same in > the > future, so it's best to ask them.
Yes, but as I said, no other Unix apps on OS X use ~/Library/ Application\ Support. You might argue that they should, or that one day they might, but I'd bet against it. I'd say: fat chance! None of them use the Cocoa API, so none of them would use that directory. Note that CPAN is only using it now because File::HomeDir uses Mac::Carbon to find it. And Carbon is mainly a GUI API. Show quoted text
> While one might say "but OS X is Unix"... well, yes except where > it's not. > > > [1] Actually you ask the OS where it is, something else Unix > generally lacks.
I think it's not the OS you're asking so much as the carbon API. Not the same thing at all. In fact, I expect that Carbon will be deprecated one day. What does the Cocoa API say? Best, David
Subject: Re: [rt.cpan.org #32841] Location of .cpan Inconsistent on Mac OS X
Date: Fri, 01 Feb 2008 21:14:53 -0800
To: bug-CPAN [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
Download (untitled) / with headers
text/plain 3.2k
David Wheeler via RT wrote: Show quoted text
>> This, I believe, is the actual problem. It doesn't seem to matter >> to you >> where the data lives as long as it lives in one place, right?
> > The bug is that it uses two locations, yes. My preference is for > ~/.cpan, but I can live with it elsewhere, as long as there is just > one directory.
Ok good. Everything from here on rapidly gets academic but this is the clear bug. Show quoted text
>> So the question now is how do we make sure it lives in one place? >> There's a bootstrap problem.
> > There is no bootstrap problem if you always use `$ENV{HOME}/.cpan`. ;-)
Sure, if $ENV{HOME} is defined and if it's appropriate to use $ENV{HOME} on that system. On Windows, for example, it's wrong even if it is. Abstracting all this away was the point of File::HomeDir, so at that level it becomes a File::HomeDir issue. Show quoted text
>> Because the whole point of File::HomeDir is to abstract this all >> away. It >> would be incorrect to use my_home for this because you're not asking >> where the >> home directory is, you're asking where to put config data. On stock >> Unix >> almost all of this defaults to home because Unixes rarely define a >> user data >> directory. Everyone just dumps things into ~/.foo by tradition.
> > Yes, and it is a tradition that Unix apps that are distributed *with* > Mac OS X use. If you fire up /usr/bin/emacs, what configuration file > does it use? ~/.emacs, of course. Only UI apps use ~/Library/ > Application\ Support.
I suspect the "choice" was more to just leave them alone to avoid adding another porting chore. It would involve digging into each and every app to change where it finds its config files. Perl, having a much richer set of libraries, is much better about abstracting this sort of thing away. Show quoted text
>> Both Windows and OS X define a place to put user data, that's >> ~/Library/Application Support on OS X and on Windows it's ~/Local >> Settings/Application Data/. [1] Other systems might do the same in >> the >> future, so it's best to ask them.
> > Yes, but as I said, no other Unix apps on OS X use ~/Library/ > Application\ Support. You might argue that they should, or that one > day they might, but I'd bet against it. I'd say: fat chance! None of > them use the Cocoa API, so none of them would use that directory. Note > that CPAN is only using it now because File::HomeDir uses Mac::Carbon > to find it. And Carbon is mainly a GUI API.
Is there any particular reason command line and GUI apps should put their configs in different places? Show quoted text
>> [1] Actually you ask the OS where it is, something else Unix >> generally lacks.
> > I think it's not the OS you're asking so much as the carbon API. Not > the same thing at all. In fact, I expect that Carbon will be > deprecated one day. What does the Cocoa API say?
Since Apple made the OS and Carbon and Cocoa, it's academic to argue that fine point of what's the OS and what's the API. The point was that OS X has a unified API to ask while, in general, Unix does not. If Ubutunu had one (and it might) it might make sense to ask it. Carbon and Cocoa will probably say the same thing. It would be silly if they didn't as the whole point of Carbon is to make OS 9 apps transition to OS X. -- Whip me, beat me, make my code compatible with VMS!
Subject: Re: [rt.cpan.org #32841] Location of .cpan Inconsistent on Mac OS X
Date: Sat, 2 Feb 2008 08:54:49 -0500
To: bug-CPAN [...] rt.cpan.org
From: "David Golden" <dagolden [...] cpan.org>
Download (untitled) / with headers
text/plain 951b
On Feb 2, 2008 12:17 AM, Michael G Schwern via RT <bug-CPAN@rt.cpan.org> wrote: Show quoted text
> Perl, having a much richer set of libraries, is much better about > abstracting > this sort of thing away. >
Actually, it's not better, which is why we're having this problem. File::HomeDir is just providing access to the OS level definitions, not abstracting OS level differences away. It sounds like what we need is File::HomeDir->my_dot_config() That should returns a consistent and sane location for ".foo" style configuration files or directories. Then we can all argue over where the heck that should be on various systems. For OSX, I think it's the user's home directory. For Windows, I think it should be in "My Documents" (which is what most users think of as something equivalent to "home") --- though in Vista I think they actually have something more like a home directory and "Document" and "Pictures" and such folders hangs off of that. David
Download (untitled) / with headers
text/plain 1.2k
On Sat Feb 02 08:59:17 2008, DAGOLDEN wrote: Show quoted text
> On Feb 2, 2008 12:17 AM, Michael G Schwern via RT <bug-CPAN@rt.cpan.org> > wrote: >
> > Perl, having a much richer set of libraries, is much better about > > abstracting > > this sort of thing away. > >
> > Actually, it's not better, which is why we're having this problem. > File::HomeDir is just providing access to the OS level definitions, not > abstracting OS level differences away. It sounds like what we need is > > File::HomeDir->my_dot_config() > > That should returns a consistent and sane location for ".foo" style > configuration files or directories. Then we can all argue over where the > heck that should be on various systems. > > For OSX, I think it's the user's home directory. For Windows, I think it > should be in "My Documents" (which is what most users think of as
something Show quoted text
> equivalent to "home") --- though in Vista I think they actually have > something more like a home directory and "Document" and "Pictures" and
such Show quoted text
> folders hangs off of that. > > David
Does the attached patch to CPAN::FirstTime help with this problem of placing the files in two separate areas? There's a section in the CPAN::FirstTime::init(_) sub that uses $ENV{HOME} to set $cpan_home; the patch changes this to use CPAN::HandleConfig::home().
Download FirstTime.diff
text/x-diff 511b
Index: FirstTime.pm =================================================================== --- FirstTime.pm (revision 2642) +++ FirstTime.pm (working copy) @@ -657,7 +657,7 @@ if (!$matcher or 'cpan_home' =~ /$matcher/) { my $cpan_home = $CPAN::Config->{cpan_home} - || File::Spec->catdir($ENV{HOME}, ".cpan"); + || File::Spec->catdir(CPAN::HandleConfig::home(), ".cpan"); if (-d $cpan_home) { $CPAN::Frontend->myprint(qq{
Subject: Re: [rt.cpan.org #32841] Location of .cpan Inconsistent on Mac OS X
Date: Sat, 02 Feb 2008 14:00:43 -0800
To: bug-CPAN [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
Download (untitled) / with headers
text/plain 625b
David Golden via RT wrote: Show quoted text
> Actually, it's not better, which is why we're having this problem. > File::HomeDir is just providing access to the OS level definitions, not > abstracting OS level differences away. It sounds like what we need is > > File::HomeDir->my_dot_config() > > That should returns a consistent and sane location for ".foo" style > configuration files or directories. Then we can all argue over where the > heck that should be on various systems.
Though I'd nit-pick particulars, that sounds like a good way to attack the problem. -- Being faith-based doesn't trump reality. -- Bruce Sterling
Subject: Re: [rt.cpan.org #32841] Location of .cpan Inconsistent on Mac OS X
Date: Sat, 2 Feb 2008 15:14:53 -0800
To: bug-CPAN [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
Download (untitled) / with headers
text/plain 440b
On Feb 2, 2008, at 14:01, Michael G Schwern via RT wrote: Show quoted text
>> File::HomeDir->my_dot_config() >> >> That should returns a consistent and sane location for ".foo" style >> configuration files or directories. Then we can all argue over >> where the >> heck that should be on various systems.
> > Though I'd nit-pick particulars, that sounds like a good way to > attack the > problem.
How about the attached for a start? Best, David
Download my_dot_config.patch
text/x-diff 974b

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #32841] Location of .cpan Inconsistent on Mac OS X
Date: Sat, 2 Feb 2008 15:18:25 -0800
To: bug-CPAN [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
Download (untitled) / with headers
text/plain 2.2k
On Feb 1, 2008, at 21:17, Michael G Schwern via RT wrote: Show quoted text
>> The bug is that it uses two locations, yes. My preference is for >> ~/.cpan, but I can live with it elsewhere, as long as there is just >> one directory.
> > Ok good. Everything from here on rapidly gets academic but this is > the clear bug.
Agreed. Show quoted text
>> There is no bootstrap problem if you always use ` >> $ENV{HOME}/.cpan`. ;-)
> > Sure, if $ENV{HOME} is defined and if it's appropriate to use > $ENV{HOME} on > that system. On Windows, for example, it's wrong even if it is.
Whatever CPAN.pm has used for the last 10 years, then. Show quoted text
> Abstracting all this away was the point of File::HomeDir, so at that > level it > becomes a File::HomeDir issue.
Yes, that works, as long as CPAN.pm uses it consistently, of course. Show quoted text
>> Yes, and it is a tradition that Unix apps that are distributed *with* >> Mac OS X use. If you fire up /usr/bin/emacs, what configuration file >> does it use? ~/.emacs, of course. Only UI apps use ~/Library/ >> Application\ Support.
> > I suspect the "choice" was more to just leave them alone to avoid > adding > another porting chore. It would involve digging into each and every > app to > change where it finds its config files.
I suspect that no one even thought about it or cared. They assume that if someone knows enough to be using a Unix command-line program with a configuration file, they'll expect it to be in ~/. Show quoted text
> Perl, having a much richer set of libraries, is much better about > abstracting > this sort of thing away.
I agree it should be abstracted away, I just don't agree that it should go somewhere other than ~/. Show quoted text
> Is there any particular reason command line and GUI apps should put > their > configs in different places?
Don't think so. Convention. Show quoted text
> Since Apple made the OS and Carbon and Cocoa, it's academic to argue > that fine > point of what's the OS and what's the API.
You're right, that was a cheap shot. Sorry. Show quoted text
> The point was that OS X has a > unified API to ask while, in general, Unix does not. If Ubutunu had > one (and > it might) it might make sense to ask it. > > Carbon and Cocoa will probably say the same thing. It would be > silly if they > didn't as the whole point of Carbon is to make OS 9 apps transition > to OS X.
Agreed. David
Subject: Re: [rt.cpan.org #32841] Location of .cpan Inconsistent on Mac OS X
Date: Sat, 2 Feb 2008 16:02:21 -0800
To: bug-CPAN [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
Download (untitled) / with headers
text/plain 910b
On Feb 2, 2008, at 12:34, RKOBES via RT wrote: Show quoted text
> Does the attached patch to CPAN::FirstTime help with this problem of > placing the files in two separate areas? There's a section in the > CPAN::FirstTime::init(_) sub that uses $ENV{HOME} to set $cpan_home; > the > patch changes this to use CPAN::HandleConfig::home(). > <FirstTime.diff>
Yes, that seems to help. I ran it and it configured everything in ~/.cpan. Then I installed File::HomeDir and ran cpan again, at which point it ran through the configuration again, but did put everything in ~/Library/Application\ Support/.cpan, not just MyConfig.pm. So it's definitely an improvement. Now if only CPAN.pm could move its configuration directory (if its location changes), rather than make me go through the entire configuration again, that would be ideal. Of course, the fact that it changes at all is pretty annoying, IMO. Best, David
CC: Adam Kennedy <cpan [...] ali.as>
Subject: Re: [rt.cpan.org #32841] Location of .cpan Inconsistent on Mac OS X
Date: Thu, 10 Apr 2008 11:10:21 -0700
To: bug-CPAN [...] rt.cpan.org
From: "David E. Wheeler" <david [...] kineticode.com>
Download (untitled) / with headers
text/plain 615b
I've committed this to File::HomeDir. Alias, look cool to you? Best, David On Feb 2, 2008, at 15:14, David E. Wheeler wrote: Show quoted text
> On Feb 2, 2008, at 14:01, Michael G Schwern via RT wrote: >
>>> File::HomeDir->my_dot_config() >>> >>> That should returns a consistent and sane location for ".foo" style >>> configuration files or directories. Then we can all argue over >>> where the >>> heck that should be on various systems.
>> >> Though I'd nit-pick particulars, that sounds like a good way to >> attack the >> problem.
> > How about the attached for a start? > > Best, > > David > <my_dot_config.patch>
Subject: Re: [rt.cpan.org #32841] Location of .cpan Inconsistent on Mac OS X
Date: Tue, 15 Jul 2008 22:35:32 -0700
To: bug-CPAN [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
Download (untitled) / with headers
text/plain 1.2k
On Feb 2, 2008, at 15:14, David E. Wheeler wrote: Show quoted text
>>> File::HomeDir->my_dot_config() >>> >>> That should returns a consistent and sane location for ".foo" style >>> configuration files or directories. Then we can all argue over >>> where the >>> heck that should be on various systems.
>> >> Though I'd nit-pick particulars, that sounds like a good way to >> attack the >> problem.
> > How about the attached for a start?
That patch made it into File::HomeDir, and into a production release on 27 June 2008. I therefore now propose this patch to CPAN::HandleConfig to address this issue (See also RT #26912): Index: lib/CPAN/HandleConfig.pm =================================================================== --- lib/CPAN/HandleConfig.pm (revision 3246) +++ lib/CPAN/HandleConfig.pm (working copy) @@ -500,7 +500,9 @@ my $old_v = $CPAN::Config->{load_module_verbosity}; $CPAN::Config->{load_module_verbosity} = q[none]; if ($CPAN::META->has_usable("File::HomeDir")) { - $home = File::HomeDir->my_data; + $home = File::HomeDir->can('my_dot_config') + ? File::HomeDir->my_dot_config + : File::HomeDir->my_data; unless (defined $home) { $home = File::HomeDir->my_home } Thanks, David
Subject: Re: [rt.cpan.org #32841] Location of .cpan Inconsistent on Mac OS X
Date: Thu, 17 Jul 2008 05:10:50 +0200
To: bug-CPAN [...] rt.cpan.org
From: andreas.koenig.7os6VVqR [...] franz.ak.mind.de (Andreas J. Koenig)
Download (untitled) / with headers
text/plain 232b
Show quoted text
>>>>> On Wed, 16 Jul 2008 01:36:52 -0400, "David Wheeler via RT" <bug-CPAN@rt.cpan.org> said:
Show quoted text
> --- lib/CPAN/HandleConfig.pm (revision 3246) > +++ lib/CPAN/HandleConfig.pm (working copy)
Thanks, applied (as 3250) -- andreas
Download (untitled) / with headers
text/plain 464b
Unfortunately, Adam yanked dot_config_dir from File::HomeDir without warning, so we need another long term solution. I'd prefer to avoid File::HomeDir entirely, since it causes config location to change with or without it. How about checking these: * $ENV{PERL_CPAN_HOME} * $^O eq 'MSWin32' ? catdir( $ENV{HOMEDIR}, $ENV{HOMEPATH} ) : $ENV{HOME} Thus, we get something "standard" to fall back on (HOME), but allow users to override as they wish. -- David
Subject: Re: [rt.cpan.org #32841] Location of .cpan Inconsistent on Mac OS X
Date: Sun, 20 Sep 2009 21:59:50 -0700
To: bug-CPAN [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
Download (untitled) / with headers
text/plain 592b
On Sep 20, 2009, at 12:22 PM, David Golden via RT wrote: Show quoted text
> Unfortunately, Adam yanked dot_config_dir from File::HomeDir without > warning, so we need another long term solution.
WTF? When did he do that? And why? Show quoted text
> I'd prefer to avoid File::HomeDir entirely, since it causes config > location to change with or without it. > > How about checking these: > > * $ENV{PERL_CPAN_HOME} > * $^O eq 'MSWin32' ? catdir( $ENV{HOMEDIR}, $ENV{HOMEPATH} ) : > $ENV{HOME} > > Thus, we get something "standard" to fall back on (HOME), but allow > users to override as they wish.
Works for me. David


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.