Hi Bulgrien
On 2010/07/27 4:15 PM, "Bulgrien, Kevin" <[email protected]> wrote: >> -----Original Message----- >> From: [email protected] >> [mailto:[email protected] >> g] On Behalf Of Traiano Welcome >> Sent: Tuesday, July 27, 2010 4:51 AM >> To: Yaron Yogev; [email protected] >> Subject: Re: Problems with Trigger Scripts and CVS Pre-Commit Hooks >> >> >> No luck, from the debug below, I see "%{s}" being interpreted >> literally: >> >> --- >> >> [traia...@box ~/cvswork/ZONES]$ cvs commit DB.evasive.org.za >> >> + echo %{s} >> + cut -d . -f 2,3,4,5,6 >> + ZONE=%{s} >> + ZONE_FILE=DB.%{s} >> + named-checkzone %{s} DB.%{s} >> >> zone %{s}/IN: loading from master file DB.%{s} failed: file not found >> >> cvs commit: Pre-commit check failed >> cvs [commit aborted]: correct above errors first! >> >> ---- > > I am pretty sure he meant for you to try %{s} in the commitinfo > file itself, and not in the hook script. Yes, what you're seeing is the debug output from callng "sh" in the script with the "-x" option, i.e you see what the script interpreted the variable "%{s}" as ... " named.data/ZONES/* /usr/local/bin/checkzone %{s}" is exactly what I have in the commitinfo file, but the debug output from running the commit shows: >> + echo %{s} >> + cut -d . -f 2,3,4,5,6 >> + ZONE=%{s} >> + ZONE_FILE=DB.%{s} >> + named-checkzone %{s} DB.%{s} I.e "%{s}" is not exanded to the name of the file, but processed by the script as a literal "%{s}" :-( > > ie. > named.data/ZONES/* /usr/local/bin/checkzone %{s} > > I have a postcommit script that says the following in its header > comment: > > # $Id: postcommit.sh,v 1.9 2006/08/17 17:12:00 cvsadm Exp $ > # > # CVSROOT loginfo should contain: > # ALL /home/eden/cvs/scripts/postcommit.sh %{sVv} > # > # This creates the following script parameter format: > # module file1,oldversion,newversion file2,oldversion,newversion ... > # > # The script runs as the user doing the commit. > > Your commitinfo says %s, not %{s}, but of course it is a precommit I've looked at 2 different versions of the CVS manual, and it seems like %{s} and %s are interpreted the same ... I've tested both and (when they're interpreted), they both work ... > rather than a postcommit, and perhaps there is a difference, and > maybe it is optional. (I do not remember the details on the syntax > since it has been 4 years since I wrote the script.) I'd at least > try the curly braces in the commitinfo and not in the shell script. > > --- > Kevin R. Bulgrien > >> On 2010/07/27 10:42 AM, "Yaron Yogev" <[email protected]> wrote: >> >>> Hi, >>> >>> change %s --> %{s} >>> >>> Yaron >>> >>> On Jul 27, 10:24 am, Traiano Welcome >>> <[email protected]> wrote: >>>> Hi Yaron >>>> >>>> The specific line is as follows: >>>> >>>> --- >>>> named.data/ZONES/* /usr/local/bin/checkzone %s >>>> --- > > This message and/or attachments may include information subject to GD > Corporate Policy 07-105 and is intended to be accessed only by authorized > personnel of General Dynamics and approved service providers. Use, storage > and transmission are governed by General Dynamics and its policies. > Contractual restrictions apply to third parties. Recipients should refer to > the policies or contract to determine proper handling. Unauthorized review, > use, disclosure or distribution is prohibited. If you are not an intended > recipient, please contact the sender and destroy all copies of the original > message. > NOTE: This e-mail message and all attachments thereto contain confidential information intended for a specific addressee and purpose. If you are not the addressee (a) you may not disclose, copy, distribute or take any action based on the contents hereof; (b) kindly inform the sender immediately and destroy all copies hereof. Any copying, publication or disclosure of this message, or part hereof, in any form whatsoever, without the sender's express written consent, is prohibited. No opinion expressed or implied by the sender necessarily constitutes the opinion of MTN. This message does not constitute a guarantee or proof of the facts mentioned herein. No Employee or intermediary is authorised to conclude a binding agreement on behalf of MTN Group Limited, or any of its subsidiary companies, by e-mail without the express written confirmation by a duly authorised representative of MTN Group Limited.
