summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-05-23 15:20:32 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-05-23 15:20:32 +0200
commit0b62a0875f01370f9db10c45253966f4fed74272 (patch)
tree961e14390883cdbac1ef6ea4c45ae5afbdb2ae80
parent5eed56d0ad5245a346ea564bc34e882828394611 (diff)
downloadsamba-0b62a0875f01370f9db10c45253966f4fed74272.tar.gz
samba-0b62a0875f01370f9db10c45253966f4fed74272.tar.bz2
samba-0b62a0875f01370f9db10c45253966f4fed74272.zip
selftest: Use convenience function for prepending paths to environment variables.
(This used to be commit f71cb65a9057fb426748dd5fe45cf2962da42ae4)
-rwxr-xr-xsource4/selftest/selftest.pl17
1 files changed, 11 insertions, 6 deletions
diff --git a/source4/selftest/selftest.pl b/source4/selftest/selftest.pl
index 3270364a91..5854a94b8d 100755
--- a/source4/selftest/selftest.pl
+++ b/source4/selftest/selftest.pl
@@ -407,14 +407,19 @@ my $tls_enabled = not $opt_quick;
$ENV{TLS_ENABLED} = ($tls_enabled?"yes":"no");
$ENV{LDB_MODULES_PATH} = "$old_pwd/bin/modules/ldb";
$ENV{LD_SAMBA_MODULE_PATH} = "$old_pwd/bin/modules";
-if (defined($ENV{PKG_CONFIG_PATH})) {
- $ENV{PKG_CONFIG_PATH} = "$old_pwd/bin/pkgconfig:$ENV{PKG_CONFIG_PATH}";
-} else {
- $ENV{PKG_CONFIG_PATH} = "$old_pwd/bin/pkgconfig";
+sub prefix_pathvar($$)
+{
+ my ($name, $newpath) = @_;
+ if (defined($ENV{$name})) {
+ $ENV{$name} = "$newpath:$ENV{$name}";
+ } else {
+ $ENV{$name} = $newpath;
+ }
}
+prefix_pathvar("PKG_CONFIG_PATH", "$old_pwd/bin/pkgconfig");
# Required for smbscript:
-$ENV{PATH} = "$old_pwd/bin:$old_pwd:$ENV{PATH}";
-$ENV{PYTHONPATH} = "$builddir/bin/python:$ENV{PYTHONPATH}";
+prefix_pathvar("PATH", "$old_pwd/bin");
+prefix_pathvar("PYTHONPATH", "$old_pwd/bin/python");
if ($opt_socket_wrapper_keep_pcap) {
# Socket wrapper keep pcap implies socket wrapper pcap