logo       

Re: [p4] Trigger / Script NoJobs Attached issue: msg#00219

Subject: Re: [p4] Trigger / Script NoJobs Attached issue
Good catch, although -
I copied the script and then updated manually since I wanted to try if EQU
V/S LEQ and GEQ makes any difference. It didn't make any difference.

I had tried with /B option on Exit and that didn't make any difference
too...

What actually fixes it is adding port and user as follows.

p4 -u %2 -p %3 describe -s %1|findstr "Jobs"

When I ran script on Command Line outside perforce, it took default user
and port but when I run it through Trigger, it requires user and port.

I hope that Perforce changes their documentation to mention this as must...
I spent good bit of time on this silly script.

Thanks

Regards,
Neeta Roy



                                                                                
                                                                     
                      "Bruce McPeek"                                            
                                                                     
                      <brucem@vidiator.        To:       "Neeta ROY" 
<Neeta.ROY@xxxxxxxxxxxxxxxxx>, <perforce-user@xxxxxxxxxxxx>                     
                      com>                     cc:                              
                                                                     
                                               bcc:                             
                                                                     
                      12/29/2005 02:01         Subject:  RE: [p4] Trigger / 
Script NoJobs Attached issue                                             
                      PM                                                        
                                                                     
                                                                                
                                                                     
                                                                                
                                                                     




Neeta,

I suspect that you may want to add the /B flag to your EXIT commands.

D:\>exit /?
Quits the CMD.EXE program (command interpreter) or the current batch
script.

= = = =
EXIT [/B] [exitCode]

  /B          specifies to exit the current batch script instead of
              CMD.EXE.  If executed from outside a batch script, it
              will quit CMD.EXE

  exitCode    specifies a numeric number.  if /B is specified, sets
              ERRORLEVEL that number.  If quitting CMD.EXE, sets the
process
              exit code with that number.
= = = =

I'm not sure if you did a copy and paste of your script, but as shown
here, there is a syntax error.

The line
  if %ERRORLEVEL% GQU 1 goto nojobfound

Should probably be
  if %ERRORLEVEL% GEQ 1 goto nojobfound

If you are trying for "greater than or equal"...

Style-wise, "I" would put some logic at the end of your :doit section to
catch cases of falling through the ERRORLEVEL checking. I would also put
some logic after your change number test so that the script does not
continue. Your style may vary.


I hope this helps,

Bruce


-----Original Message-----
From: perforce-user-bounces@xxxxxxxxxxxx
[mailto:perforce-user-bounces@xxxxxxxxxxxx] On Behalf Of Neeta ROY
Sent: Thursday, December 29, 2005 9:23 AM
To: perforce-user@xxxxxxxxxxxx
Subject: [p4] Trigger / Script NoJobs Attached issue


This is my Script Batch file that I run from trigger table.

Either Job is attached or not Submit fails. %ERRORLEVEL% is always 1.
If I run this Batch file from command line, I get correct result.

Any ideas what am I doing wrong?

NoJob.Bat file contains:

@echo off
if not x%1==x goto doit
echo Usage is %0[change#]

:doit
p4 describe -s %1|findstr "Jobs"
if %ERRORLEVEL% GQU 1 goto nojobfound
if %ERRORLEVEL% LEQ 0 goto jobfound

:nojobfound
echo No jobs FOUND for changelist %1
EXIT 1

:jobfound
echo JOB FOUND
EXIT 0

The trigger table has this entry.
Sample Submit //v2c/... "C:/NoJob.bat %changelist%"

Regards,
Neeta Roy



_______________________________________________
perforce-user mailing list  -  perforce-user@xxxxxxxxxxxx
http://maillist.perforce.com/mailman/listinfo/perforce-user





_______________________________________________
perforce-user mailing list  -  perforce-user@xxxxxxxxxxxx
http://maillist.perforce.com/mailman/listinfo/perforce-user



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
linux.arklinux....    user-groups.lin...    kde.usability/2...    ietf.ipp/2002-0...    mail.spam.spamc...    os.netbsd.devel...    audio.cd-record...    text.unicode.de...    php.documentati...    games.fps.halfl...    window-managers...    suse.oracle.gen...    bug-tracking.gn...    video.dvdrip.us...    xfree86.cvs/200...    java.netbeans.m...    network.argus/2...    culture.sf.kill...    debian.ports.al...    freebsd.questio...    qplus.devel/200...    handhelds.palm....   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe