Jump to content


using p4 as root

linux p4

  • Please log in to reply
No replies to this topic

#1 nathanalderson

nathanalderson

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 29 April 2013 - 06:20 PM

Hello,

I'm using a vim plugin which currently uses 'p4 set' to get the value of some perforce environment variables. If I edit a file as root with, for example, 'sudo vim somefile', then the plugin gripes at me and doesn't work because the output of 'p4 set' is empty.  However, the actual environment variables that I assume 'p4 set' is using are available from 'sudo' context.  I can demonstrate this with the following sequence:

~ » echo $P4USER
nalderso
~ » sudo echo $P4USER
nalderso
~ » p4 set
P4CLIENT=[redacted]
P4PORT=[redacted]
P4USER=nalderso
~ » sudo p4 set

Is this expected?  Is there an easy way to get 'sudo p4 set' to return the same values as 'p4 set'?  I'm thinking of modifying the plugin to just use the environment variables directly, but then I'll have to modify my windows client to use environment variables instead of the registry.

Any thoughts?

--Nathan





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users