[p4] Need help to debug this simple trigger

Michael Delaney mdelaney at upromise.com
Fri Nov 21 10:38:42 PST 2008


You could try to print out the command to a log file, or stdout, and see 
what command is actually being ran ... that might help you debug it

$command = "$P4 describe -s $change_num"
print "running command ... $command"
@change_info=`$command`;

print "@change_info";
exit 1;

G2345C wrote:
> Hell all,
> I dont understand what did i do wrong in this trigger?. I just want to print the output of "p4 describe -s $change_num" when i submit something, but it keeps showing me nothing. but if i change that line to "p4 info" it show the output. Please help me please
> Server version: P4D/LINUX26X86_64/2006.1/114363 (2007/01/10)
>
>
> Here is the trigger:
>
> test-trigger change-submit //depot/test/... "/usr/local/bin/perl /tmp/scripts/testtrigger.pl %changelist% %serverport% %client%"
>
>
> And Here is the perl script
>
>
> #!/usr/local/bin/perl
>
> my $change_num, $server_port, $client_name;
> my $p4;
> my @change_info, @change_info_long;
>
> $P4PORT='perforce:1666';
> $P4USER='g2345c';
> $P4PASSWD='password';
> $ENV{P4USER}='g2345c';
> $ENV{P4PASSWD}='password';
>
> $P4="/tools/bin/p4 -p $P4PORT -u $P4USER -P $P4PASSWD";
>
> #login to perforce
> system ("export P4USER=hbnguyen");
> `echo $P4PASSWD | $P4 login`;
>
> $change_num = $ARGV[0];
> $server_port = $ARGV[1];
> $client_name = $ARGV[2];
>
> @change_info=`$P4 describe -s $change_num`;
>
> #If i replace the line above with this line, i got the output 
> #@change_info=`$P4 info`;
>
> print "@change_info";
> exit 1;
>
>
>
>       
> _______________________________________________
> perforce-user mailing list  -  perforce-user at perforce.com
> http://maillist.perforce.com/mailman/listinfo/perforce-user
>   



More information about the perforce-user mailing list