[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: post-commit REPOS var empty

From: Hunkel, Manfred <M.Hunkel_at_t-systems.com>
Date: 2004-11-16 15:15:30 CET

I should think that this is caused by your starting a sub-shell by putting
'cd /home...' into parentheses. That sub-shell might not be able to "see"
your REPOS variable. Try inserting an 'export REPOS' after 'REPOS="$1"'.

;-) -Manfred

| -----Original Message-----
| From: Toni Price [mailto:zapcat3@yahoo.co.uk]
| Sent: Tuesday, November 16, 2004 2:54 PM
| To: users@subversion.tigris.org
| Subject: post-commit REPOS var empty
|
| I have just attempted to compile and install Subversion 1.1.1 on SUSE
| Linux 9.1 and it seems to be working but I'm having a problem with a
| post-commit hook. I've got the following post-commit script called
| 'post-commit':
|
| REPOS="$1"
| REV="$2"
| echo ${REPOS} >> env_vars.txt
| echo ${REV} >> env_vars.txt
| (cd /home/srv/svn/hook_scripts; ./hot-backup.py ${REPOS} \
| /bak/svn/hotbak &)
|
| I've put it in the relevant 'hooks' directory and made sure it has
| execute permissions. There's a copy of hot-backup.py in the location
| referred to (i.e. /home/srv/svn/hook_scripts/hot-backup.py exists) and
| the scripts are owned by the same user as the Apache webserver (wwwrun).
|
| If I try to run the script with the following command:
| $ sudo -u wwwrun ./post-commit
|
| It starts running and prints the following to the console:
| Usage: hot-backup.py <repos_path> <backup_path>
|
| Then it hangs and I need to Ctrl-c.
|
| So I put in the "echo ..." lines to try and test what the values of
| $REPOS and $REV are when the script gets called. Curiously, they seem to
| be empty, which would explain why hot-backup.py is failing like that.
|
| I couldn't seem to find any information (on the mailing lists or from
| searching the Internet) showing other people might have had the same
| sort of problem - so I have no idea what I may be doing wrong.
|
| Any pointers would be appreciated ...
| Thanks,
| Toni
|
|
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
| For additional commands, e-mail: users-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Nov 16 15:30:51 2004

This is an archived mail posted to the Subversion Users mailing list.