Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perforce - getting stream name in a trigger script

I want to create a trigger for preventing check-out on files if they belong to a specific stream.

I am using the pre-user-edit trigger.

The trigger executes a Perl script.

When I execute in the Perl script a p4 command, then I get this error:

Perforce password (P4PASSWD) invalid or unset.

What I did is getting the stream name out of the client name (which is passed to the Perl script):

 $ stream = `p4 client -o $ client | grep ^Stream: | awk '{print \$ 2}'`;
 chomp $ stream;

This does not work.

Also, trying to assign $p4 with new P4, fails.

Anyone has a clue how to solve this?

At least, give me a way to extract the stream name out the client name?

Thanks,

like image 772
AJ Gottes Avatar asked Oct 24 '25 13:10

AJ Gottes


1 Answers

As an alternative,
$ stream = p4 -F "%Stream%" -ztag client -o;

This would just give you the stream name(no trimming is required)

like image 69
Venkat Avatar answered Oct 27 '25 20:10

Venkat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!