Thread: [Module::Build] .modulebuildrc documentation out of sync with code
Status: Beta
Brought to you by:
kwilliams
From: David G. <da...@hy...> - 2006-04-06 11:24:44
|
I posted this to RT, but I'll copy here as well: Documentation for the location of .modulebuildrc says .modulebuildrc should be placed in $ENV{HOME}, but the code actually searches the following environment variables: APPDATA HOME USERPROFILE WINDIR SYS$LOGIN. This is particularly confusing because HOME isn't listed first, so a .modulebuildrc file place in $ENV{HOME} just mysteriously fails to work on Win32 where $ENV{APPDATA} exists. |
From: Randy W. S. <ml...@th...> - 2006-04-06 18:23:12
|
David Golden wrote: > I posted this to RT, but I'll copy here as well: > > Documentation for the location of .modulebuildrc says .modulebuildrc > should be placed in $ENV{HOME}, but the code actually searches the > following environment variables: APPDATA HOME USERPROFILE WINDIR SYS$LOGIN. > > This is particularly confusing because HOME isn't listed first, so a > .modulebuildrc file place in $ENV{HOME} just mysteriously fails to work > on Win32 where $ENV{APPDATA} exists. Instead of search for the first valid "HOME" directory, we should probably be looking for the first one that contains the file we need since all of the directories usually exist. I'm not sure about the order of the search. I would put "HOME" first because if it is explicitly set (esp on Windows), then it is probably intended to be the "primary" home dir. Having trouble finding the original report though that led to the above search being added, so I'm not sure of the exact problem it was intended to solve. I don't want to break anything. Randy. |
From: Ken W. <ke...@ma...> - 2006-04-06 18:34:37
|
On Apr 6, 2006, at 1:21 PM, Randy W. Sims wrote: > David Golden wrote: >> I posted this to RT, but I'll copy here as well: >> Documentation for the location of .modulebuildrc >> says .modulebuildrc should be placed in $ENV{HOME}, but the code >> actually searches the following environment variables: APPDATA >> HOME USERPROFILE WINDIR SYS$LOGIN. >> This is particularly confusing because HOME isn't listed first, so a >> .modulebuildrc file place in $ENV{HOME} just mysteriously fails to >> work >> on Win32 where $ENV{APPDATA} exists. > > Instead of search for the first valid "HOME" directory, we should > probably be looking for the first one that contains the file we > need since all of the directories usually exist. Agreed. > I'm not sure about the order of the search. I would put "HOME" > first because if it is explicitly set (esp on Windows), then it is > probably intended to be the "primary" home dir. Sounds reasonable. I think it's generally unlikely that people will have more than one .modulebuildrc so I'm not too worried about getting The Perfect Order. -Ken |
From: Randy W. S. <ml...@th...> - 2006-04-12 01:51:51
Attachments:
homedir.diff
|
Ken Williams wrote: > > On Apr 6, 2006, at 1:21 PM, Randy W. Sims wrote: > >> David Golden wrote: >>> I posted this to RT, but I'll copy here as well: >>> Documentation for the location of .modulebuildrc says .modulebuildrc >>> should be placed in $ENV{HOME}, but the code actually searches the >>> following environment variables: APPDATA HOME USERPROFILE WINDIR >>> SYS$LOGIN. >>> This is particularly confusing because HOME isn't listed first, so a >>> .modulebuildrc file place in $ENV{HOME} just mysteriously fails to work >>> on Win32 where $ENV{APPDATA} exists. >> >> Instead of search for the first valid "HOME" directory, we should >> probably be looking for the first one that contains the file we need >> since all of the directories usually exist. > > Agreed. Does the attached patch resolve this issue? Randy. |
From: David G. <da...@hy...> - 2006-04-12 02:27:30
|
Randy W. Sims wrote: >>> Instead of search for the first valid "HOME" directory, we should >>> probably be looking for the first one that contains the file we need >>> since all of the directories usually exist. >> >> Agreed. > > Does the attached patch resolve this issue? From visual inspection, that looks workable. Regards, David Golden |
From: David G. <da...@hy...> - 2006-04-06 19:06:51
|
Randy W. Sims wrote: > Instead of search for the first valid "HOME" directory, we should > probably be looking for the first one that contains the file we need > since all of the directories usually exist. Agreed > I'm not sure about the order of the search. I would put "HOME" first > because if it is explicitly set (esp on Windows), then it is probably > intended to be the "primary" home dir. I'd put HOME first because it's more consistent and as long as there's automatic fall back, it won't really matter for people on Windows. David |