Re: get user's home

2017-08-04 Thread db
On 4 Aug 2017, at 22:58, Joshua Root  wrote:
> Suppose a port is built on the buildbot. The user is 'buildbot' and so the 
> value of $user_home will be something like '/Users/buildbot'.

During testing I didn't thoroughly checked that env var there. I suppose, it 
could be deleted or set to nil and left to the user to set it himself. As I 
said, I wrote the port for me, and uploaded it for others to test, as I 
couldn't figure out a (better) way to set it in the startup item and didn't 
find documentation on how macports would handle this case.

Re: get user's home

2017-08-04 Thread Bradley Giesbrecht
> On Aug 4, 2017, at 1:46 PM, Umesh Singla  wrote:
> 
> On a side note, I didn't get this part:
> 
> The user installing the port is not necessarily the one that will use it.

macOS is a multi-user system. The installed ports are largely available to any 
system user.

—
Brad



Re: get user's home

2017-08-04 Thread Stephen J. Butler
For example, suppose I work in IT and someone needs ipfs on their machine.
I might SSH in, run "sudo port install ipfs", and then say "All done!" But
I'm not the one that will use that software, so it's not proper to encode
my username anywhere as a default.

On Fri, Aug 4, 2017 at 3:46 PM, Umesh Singla 
wrote:

> On a side note, I didn't get this part:
>
> The user installing the port is not necessarily the one that will use it.
>
>
>
>


Re: get user's home

2017-08-04 Thread Stephen J. Butler
If this is a system level daemon that's being started, then it seems to me
that it should be storing its data in a system level location.
/opt/local/var/ipfs or /opt/local/var/lib/ipfs or /opt/local/var/spool/ipfs
depending on various preferences.

On Fri, Aug 4, 2017 at 2:41 PM, db  wrote:

> On 4 Aug 2017, at 16:05, Joshua Root  wrote:
> > Should be in $user_home (if it could be determined, which is not
> guaranteed). But why do you need it? The user installing the port is not
> necessarily the one that will use it.
>
> That worked, thanks. I used it for an env var's default value in ipfs'
> startup item (#54566). I don't know if we could pass a different value on
> install or load, for that matter. Everything's fine as in works_for_me. How
> come schraderbräu has it and macports not?


Re: get user's home

2017-08-04 Thread db
On 4 Aug 2017, at 16:05, Joshua Root  wrote:
> Should be in $user_home (if it could be determined, which is not guaranteed). 
> But why do you need it? The user installing the port is not necessarily the 
> one that will use it.

That worked, thanks. I used it for an env var's default value in ipfs' startup 
item (#54566). I don't know if we could pass a different value on install or 
load, for that matter. Everything's fine as in works_for_me. How come 
schraderbräu has it and macports not?

Re: get user's home

2017-08-04 Thread Joshua Root

On 2017-8-4 22:19 , db wrote:

How can I get the user's home, the flesh and blood bot's?

set home$::env(HOME)

righteously returns /opt/local/var/macports/home/


Should be in $user_home (if it could be determined, which is not 
guaranteed). But why do you need it? The user installing the port is not 
necessarily the one that will use it.


- Josh


get user's home

2017-08-04 Thread db
How can I get the user's home, the flesh and blood bot's?

set home$::env(HOME)

righteously returns /opt/local/var/macports/home/