ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Weintraub <qazw...@gmail.com>
Subject Re: Is there a login "wait for password" target/task?
Date Tue, 24 Feb 2009 15:26:23 GMT
Ah! You have Perforce security set to level 3, so you can't pass the
password via the command line or via the P4PASSWD environment
variable.

However, you can pass the Perforce ticket via the command line, so you
could still use getoptions.

See <http://perforce.com/perforce/doc.082/manuals/p4sag/03_superuser.html#1081537>
for more details.

Basically, you need to get the ticket which you can get via "p4 login
-p", then use that as your password.

Things are a bit trickier, but you can use <exec> to get the ticket,
and then the globalopts to pass the ticket. Something like this. (Not
100% sure, you'll have to experiment):

<exec executable "p4"
     outputproperty="p4ticket"
     errorproperty="p4error">
     <arg value="login"/>
     <arg value="-p">
</exec>

<fail if="p4error"
    message="No Perforce Ticket. Please log into Perforce: ${p4error}"/>

<p4 ...
   globalopts=.../>

You can also set your groups to use a very large timeout value. When I
used Perforce, a timeout value of "0" meant that the ticket never
expired. The problem is that if the user was in more than one group,
Perforce used the biggest value. So, if one group had a value of
'3600" and another group had a value of "0", the user's ticket would
expire in one hour and not never. We solved this by using 9,999,999
which set the ticket timeout for 1/2 a year. It is possible that
Perforce has solved this problem.

Anyway, if you have a user who is an automatic build process, you can
create a group for that user for an non-expiring ticket. Then you log
in once as that user, and that user should never have to log in again.

That's the way I use to handle all of my scripts. It isn't just an Ant issue.

Hope this helps.

On Mon, Feb 23, 2009 at 4:40 PM, Scott Stark <sstark@us.ibm.com> wrote:
>
>>Ant has optional Perforce tasks, and these tasks use the globalopts
>>setting, so you can pass a password though that.
>
> Hi David, yes I saw that but couldn't find anything that does what I want.
> Our Perforce install does not allow you to pass a password as a command
> line parameter -- it stops and prompts for human input. I was wondering if
> there was a way for Ant to wait for a text string such as "pass:" and send
> the password.
>
> thanks,
> Scott
>



-- 
--
David Weintraub
qazwart@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message