1
votes

below is my code for a pre-commit hook to check for text and an open trac ticket. the text check work but when the assignment happens to get the text from svnlook and place it into the variable $LOG I get an error that log can not be found. I'm sure I'm just mental and doing something stupid but it is evading me as to why this is not working. any help would be appreciated.

REPOS="$1"
TXN="$2"
SVNLOOK=/usr/bin/svnlook

# Make sure that the log message contains some text.
$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" > /dev/null || exit 1

# Exit on all errors.
set -e

#ensure the commit is assciated to a TRAC ticket
TRAC_ENV="/trac"
LOG=$SVNLOOK log -t "$TXN" "$REPOS"
/usr/bin/python /trac/conf/trac-pre-commit-hook "$TRAC_ENV" "$LOG" || exit 1
1

1 Answers

1
votes
LOG=$SVNLOOK log -t "$TXN" "$REPOS"

This sets LOG to $SNVLOOK (for that line only), then tries to execute log with the parameters that follow. If you want to output of that command to be stored in the LOG env. var., use something like:

LOG=$($SVNLOOK log -t "$TXN" "$REPOS")

or

LOG=`$SVNLOOK log -t "$TXN" "$REPOS"`