When running port from within the Apple Security Frameworks, I get this error: couldn't find HOME environment variable to expand path while executing "file mkdir $macports_user_dir" (procedure "dportinit" line 45) invoked from within "dportinit ui_options global_options global_variations" Error: /opt/local/bin/port: Failed to initialize ports system, couldn't find HOME environment variable to expand path How should I mark this when I report it as an error in trac to ensure proper action? Randall Wood rhwood@mac.com http://shyramblings.blogspot.com "The rules are simple: The ball is round. The game lasts 90 minutes. All the rest is just philosophy."
On May 13, 2007, at 09:54, Randall Wood wrote:
When running port from within the Apple Security Frameworks, I get this error:
couldn't find HOME environment variable to expand path while executing "file mkdir $macports_user_dir" (procedure "dportinit" line 45) invoked from within "dportinit ui_options global_options global_variations" Error: /opt/local/bin/port: Failed to initialize ports system, couldn't find HOME environment variable to expand path
How should I mark this when I report it as an error in trac to ensure proper action?
I guess I've never heard of "the Apple Security Frameworks." What is that? Do you have a HOME environment variable set to the correct value?
On 13 May 2007, at 11:34, Ryan Schmidt wrote:
On May 13, 2007, at 09:54, Randall Wood wrote:
When running port from within the Apple Security Frameworks, I get this error:
couldn't find HOME environment variable to expand path while executing "file mkdir $macports_user_dir" (procedure "dportinit" line 45) invoked from within "dportinit ui_options global_options global_variations" Error: /opt/local/bin/port: Failed to initialize ports system, couldn't find HOME environment variable to expand path
How should I mark this when I report it as an error in trac to ensure proper action?
I guess I've never heard of "the Apple Security Frameworks." What is that?
Do you have a HOME environment variable set to the correct value?
The Apple Security Frameworks are the Security Foundation Framework Security Framework Security Interface Framework and are used by Applications, Preference Panes, and Installers to authenticate users, and to request privilege escalation for a task. My $HOME environment variable is correctly set, but the Security Frameworks do not set this variable. When I 'sudo port ...' it works. BTW: port creates the ~/.macports directory with root ownership, but should create it with the same ownership as the $HOME directory. Randall Wood rhwood@mac.com http://shyramblings.blogspot.com "The rules are simple: The ball is round. The game lasts 90 minutes. All the rest is just philosophy."
Hey Randall, On May 13, 2007, at 11:34 AM, Randall Wood wrote:
My $HOME environment variable is correctly set, but the Security Frameworks do not set this variable. When I 'sudo port ...' it works.
Does this occur because you're invoking the darwinports framework directly without going through a shell which would otherwise be setting HOME? I'm not quite sure what to do about this issue. I did make a small change to the code to call file normalize instead of relying on the file name handling to do the conversion, but it looks to me like it boils down to the same thing in the end. One possibility is that (since we know we're on a mac), we could just set $HOME based on the uid, if it's not set. This seems fraught with a bit of peril. Another possibility might be to just require that HOME be set, pushing the problem back into your court. If you're invoking through the darwinports api, can you set HOME prior to init? Other ideas?
BTW: port creates the ~/.macports directory with root ownership, but should create it with the same ownership as the $HOME directory.
I guess I have two choices: (1) Always create the directory with ownership its parent directory (2) Always create the directory with ownership of the uid, rather than euid. #1 is probably better. Anybody else? James
On 13 May 2007, at 20:09, James Berry wrote:
Hey Randall,
On May 13, 2007, at 11:34 AM, Randall Wood wrote:
My $HOME environment variable is correctly set, but the Security Frameworks do not set this variable. When I 'sudo port ...' it works.
Does this occur because you're invoking the darwinports framework directly without going through a shell which would otherwise be setting HOME?
It occurs when running port from Pallet, my attempt to write a GUI for macports.
I'm not quite sure what to do about this issue. I did make a small change to the code to call file normalize instead of relying on the file name handling to do the conversion, but it looks to me like it boils down to the same thing in the end.
One possibility is that (since we know we're on a mac), we could just set $HOME based on the uid, if it's not set. This seems fraught with a bit of peril. Another possibility might be to just require that HOME be set, pushing the problem back into your court. If you're invoking through the darwinports api, can you set HOME prior to init? Other ideas?
BTW: port creates the ~/.macports directory with root ownership, but should create it with the same ownership as the $HOME directory.
I guess I have two choices:
(1) Always create the directory with ownership its parent directory
(2) Always create the directory with ownership of the uid, rather than euid.
#1 is probably better. Anybody else?
I think we should go with #1.
James
Randall Wood rhwood@mac.com http://shyramblings.blogspot.com "The rules are simple: The ball is round. The game lasts 90 minutes. All the rest is just philosophy."
On May 13, 2007, at 5:47 PM, Randall Wood wrote:
On 13 May 2007, at 20:09, James Berry wrote:
Hey Randall,
On May 13, 2007, at 11:34 AM, Randall Wood wrote:
My $HOME environment variable is correctly set, but the Security Frameworks do not set this variable. When I 'sudo port ...' it works.
Does this occur because you're invoking the darwinports framework directly without going through a shell which would otherwise be setting HOME?
It occurs when running port from Pallet, my attempt to write a GUI for macports.
But is Pallet actually calling port(1) (through the security framework)? If so, what happens if you have it call port(1) through the shell, rather than directly through tclsh? /bin/bash sets HOME on its own, apparently. James
I'm not quite sure what to do about this issue. I did make a small change to the code to call file normalize instead of relying on the file name handling to do the conversion, but it looks to me like it boils down to the same thing in the end.
One possibility is that (since we know we're on a mac), we could just set $HOME based on the uid, if it's not set. This seems fraught with a bit of peril. Another possibility might be to just require that HOME be set, pushing the problem back into your court. If you're invoking through the darwinports api, can you set HOME prior to init? Other ideas?
On May 13, 2007, at 09:54, Randall Wood wrote:
couldn't find HOME environment variable to expand path while executing "file mkdir $macports_user_dir" (procedure "dportinit" line 45) invoked from within "dportinit ui_options global_options global_variations" Error: /opt/local/bin/port: Failed to initialize ports system, couldn't find HOME environment variable to expand path
Sigh... Now I'm experiencing this error as well, when running port from a PHP script through my web server: couldn't find HOME environment variable to expand path while executing "file mkdir $macports_user_dir" (procedure "dportinit" line 45) invoked from within "dportinit ui_options global_options global_variations" If I preface the port command with something like HOME=/Library/ WebServer then I get this: can't create directory "~/.macports": permission denied while executing "file mkdir $macports_user_dir" (procedure "dportinit" line 45) invoked from within "dportinit ui_options global_options global_variations" If I manually create /Library/WebServer/.macports and set it owned by www, then MacPorts relents. But I'd rather not have to do that. I think I would prefer that if the HOME environment variable is not set, that MacPorts not complain about it, and learn to live without a ~/.macports directory. There's nothing in it anyway, and my PHP script used to work just fine in previous versions of MacPorts.
On May 14, 2007, at 11:51 PM, Ryan Schmidt wrote:
On May 13, 2007, at 09:54, Randall Wood wrote:
couldn't find HOME environment variable to expand path while executing "file mkdir $macports_user_dir" (procedure "dportinit" line 45) invoked from within "dportinit ui_options global_options global_variations" Error: /opt/local/bin/port: Failed to initialize ports system, couldn't find HOME environment variable to expand path
Sigh... Now I'm experiencing this error as well, when running port from a PHP script through my web server:
If I manually create /Library/WebServer/.macports and set it owned by www, then MacPorts relents. But I'd rather not have to do that. I think I would prefer that if the HOME environment variable is not set, that MacPorts not complain about it, and learn to live without a ~/.macports directory. There's nothing in it anyway, and my PHP script used to work just fine in previous versions of MacPorts.
Ryan and Randall, I checked in some code this morning that should only try to use or create that directory if HOME is defined. Please check it out and give feedback. r25177. James
On May 15, 2007, at 10:58, James Berry wrote:
On May 14, 2007, at 11:51 PM, Ryan Schmidt wrote:
On May 13, 2007, at 09:54, Randall Wood wrote:
couldn't find HOME environment variable to expand path while executing "file mkdir $macports_user_dir" (procedure "dportinit" line 45) invoked from within "dportinit ui_options global_options global_variations" Error: /opt/local/bin/port: Failed to initialize ports system, couldn't find HOME environment variable to expand path
Sigh... Now I'm experiencing this error as well, when running port from a PHP script through my web server:
If I manually create /Library/WebServer/.macports and set it owned by www, then MacPorts relents. But I'd rather not have to do that. I think I would prefer that if the HOME environment variable is not set, that MacPorts not complain about it, and learn to live without a ~/.macports directory. There's nothing in it anyway, and my PHP script used to work just fine in previous versions of MacPorts.
Ryan and Randall,
I checked in some code this morning that should only try to use or create that directory if HOME is defined. Please check it out and give feedback. r25177.
Just wanted to confirm with you that yes, this does work. Thanks, James!
participants (3)
-
James Berry
-
Randall Wood
-
Ryan Schmidt