Zouari wrote:
>>>>>>>
it doesnt work, it seems as the system does not call that script
(search-replace.sh) , even if i insert an 'echo something' on top of
the script it doesnt echo anything.
am using this to do Revision number insertion in source code when
committing :
so here's my post-commit file :
---------------------------begin
#!/bin/sh
REPOS="$1"
REV="$2"
#echo errr>>/tmp/log.test
/var/subversion/search-replace.sh .SVNREV. $REV "$REPOS/version"
---------------------------end
here's my bash script search-replace.sh (it search for a string in a
file and replace it by a given value)
---------------------------begin
#!/bin/sh
ARGS=3
if [ $# -ne "$ARGS" ]
then
echo "Usage: `basename $0` <search-word> <replace-word> <file>"
exit $E_BADARGS
fi
mv $3 $3.old.svn
sed "s/$1/$2/g" $3.old.svn > $3
rm -f $3.old.svn
---------------------------end
it does not work even with this post-commit file :
---------------------------begin
#!/bin/sh
mv "$REPOS/version" "$REPOS/version.old.svn"
sed "s/.SVNREV./$REV/g" "$REPOS/version.old.svn">"$REPOS/version"
rm -f "$REPOS/version.old.svn"
---------------------------end
<<<<<<<<<<<<< end of Zouari wrote
Zouari, first, did you successfully get the post commit hook script to
execute?
Assuming so, perhaps you need to fully qualify all commands, since I
believe that no PATH is sent to script.
One more thing, you could send an output of your call to your script to a
log, catching stderr and stdout.
OK, third thing, will your search/replace work after the first
substitution? It seems like you're
doing a token search/replace on .SVNREV. but then it looks to me like the
next time it will not be there--
it will already be replaced by the actual SVN rev number? (perhaps not
all the script typed)
-----------------------------------------
The information contained in this message is proprietary of Amdocs,
protected from disclosure, and may be privileged. The information is
intended to be conveyed only to the designated recipient(s) of the message.
If the reader of this message is not the intended recipient, you are hereby
notified that any dissemination, use, distribution or copying of this
communication is strictly prohibited and may be unlawful. If you have
received this communication in error, please notify us immediately by
replying to the message and deleting it from your computer.
Received on Fri Oct 28 21:35:38 2005