On Jun 1, 2010, at 05:31, Mauro Gatti wrote:
> I'm trying to implement a post commit script based on svnnotify which should send an email with some information after a commit.
> Unluckily I receive a mail with a void body.
> If I run this script manually the email message is ok but I got anyway this error:
>
> substr outside of string at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 1303.
> Use of uninitialized value in index at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 1303.
>
> This is my post-commit script:
>
>
> #!/bin/sh
> MAIL_LIST="/opt/data/svn_repositories/email.list"
> PATH_TO_REPOS="/opt/data/svn_repositories/"
> REPOS="$1"
> REV="$2"
> while read line
> do
> /usr/bin/svnnotify -r "$REV" -C -d -H Alternative \
> --alt HTML::ColorDiff -p "$PATH_TO_REPOS$REPOS" -t "$line" \
> --from 'SVN @ Collaboration Server <no-reply_at_directline.italy>'
> done<$MAIL_LIST
>
>
> Does anybody has any idea about what is happening?
Inspect the value of the $REPOS variable. You should find it already contains the full path to the repository. Therefore perhaps you want:
#!/bin/sh
MAIL_LIST="/opt/data/svn_repositories/email.list"
REPOS="$1"
REV="$2"
while read line
do
/usr/bin/svnnotify -r "$REV" -C -d -H Alternative \
--alt HTML::ColorDiff -p "$REPOS" -t "$line" \
--from 'SVN @ Collaboration Server <no-reply_at_directline.italy>'
done<$MAIL_LIST
Received on 2010-06-01 12:40:45 CEST