[Dirvish] client/server scripts - environment variables
madworm_de.dirvish
madworm_de.dirvish at spitzenpfeil.org
Tue Nov 24 11:51:13 UTC 2009
Hi,
I just tried to use the environment variables that should be accessible
from the scripts.
DIRVISH_SRC
DIRVISH_DEST
DIRVISH_CLIENT
DIRVISH_SERVER
It didn't work.
First I tired "echo $DIRVISH_SRC" | wall;" as a post_server script, but
it returned _empty_. I then used "set | wall;" to dump all environment
variables and it turned out that they are there, but dirvish related
ones are all in one line. After that I had a look at dirvish.pl and
found this:
$WRAPPER_ENV = sprintf (" %s=%s" x 5,
'DIRVISH_SERVER', $$Options{Server},
'DIRVISH_CLIENT', $$Options{client},
#-SIS: 'DIRVISH_SRC', $srctree,
'DIRVISH_SRC', $env_srctree, #+SIS:
'DIRVISH_DEST', $destree,
'DIRVISH_IMAGE', join(':',
$$Options{vault},
$$Options{branch},
$$Options{Image}),
);
This packs all the variables into a single line ! On my Debian system
that didn't work.
I made this little change to fix it:
---- SNIP ----
--- dirvish.old 2009-11-24 12:47:20.000000000 +0100
+++ dirvish.new 2009-11-24 12:47:07.000000000 +0100
@@ -537,7 +537,7 @@
$env_srctree = $srctree; #+SIS:
$env_srctree =~ s/ /\\ /g; #+SIS:
-$WRAPPER_ENV = sprintf (" %s=%s" x 5,
+$WRAPPER_ENV = sprintf (" %s=%s;" x 5,
'DIRVISH_SERVER', $$Options{Server},
'DIRVISH_CLIENT', $$Options{client},
#-SIS: 'DIRVISH_SRC', $srctree,
---- SNIP ----
Note the ";" in the sprintf line.
Hope this makes sense.
Robert
More information about the Dirvish
mailing list