From 2d7601e8a0a5dc696402d1e5d87c49f0c41c61c9 Mon Sep 17 00:00:00 2001 From: Paul Park Date: Wed, 12 Jul 1995 18:59:38 +0000 Subject: [PATCH] Correctly set LD_LIBRARY_PATH (again) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6290 dc483132-0cff-0310-8789-dd5450dbe970 --- src/tests/dejagnu/config/ChangeLog | 4 ++++ src/tests/dejagnu/config/default.exp | 31 ++++++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/tests/dejagnu/config/ChangeLog b/src/tests/dejagnu/config/ChangeLog index 3fb75c551..bf8c719ed 100644 --- a/src/tests/dejagnu/config/ChangeLog +++ b/src/tests/dejagnu/config/ChangeLog @@ -1,4 +1,8 @@ +Wed Jul 12 14:10:09 EDT 1995 Paul Park (pjpark@mit.edu) + * default.exp - Correctly set LD_LIBRARY_PATH. Also set it before + using RESOLVE. + Thu Jun 22 12:02:15 EDT 1995 Paul Park (pjpark@mit.edu) * default.exp - Change argument ordering for KDC. Realm must come last. diff --git a/src/tests/dejagnu/config/default.exp b/src/tests/dejagnu/config/default.exp index e80582e4d..f830a9d01 100644 --- a/src/tests/dejagnu/config/default.exp +++ b/src/tests/dejagnu/config/default.exp @@ -170,21 +170,42 @@ proc get_hostname { } { global hostname global localhostname global domain + global SHLIBDIR + global env if {[info exists hostname] && [info exists localhostname]} { return 1 } + if [info exists env(LD_LIBRARY_PATH)] { + set tmp_ldlib_path $env(LD_LIBRARY_PATH) + set env(LD_LIBRARY_PATH) "$SHLIBDIR:$env(LD_LIBRARY_PATH)" + } else { + catch "unset tmp_ldlib_path" + set env(LD_LIBRARY_PATH) "$SHLIBDIR" + } catch "exec $RESOLVE -q >tmpdir/hostname" exec_output if ![string match "" $exec_output] { send_log "$exec_output\n" verbose $exec_output send_error "ERROR: can't get hostname\n" + if [info exists tmp_ldlib_path] { + set env(LD_LIBRARY_PATH) $tmp_ldlib_path + } else { + catch "unset env(LD_LIBRARY_PATH)" + } + catch "unset tmp_ldlib_path" return 0 } set file [open tmpdir/hostname r] if { [ gets $file hostname ] == -1 } { send_error "ERROR: no output from hostname\n" + if [info exists tmp_ldlib_path] { + set env(LD_LIBRARY_PATH) $tmp_ldlib_path + } else { + catch "unset env(LD_LIBRARY_PATH)" + } + catch "unset tmp_ldlib_path" return 0 } close $file @@ -195,6 +216,12 @@ proc get_hostname { } { set localhostname [string tolower $localhostname] set domain [string tolower $domain] verbose "hostname: $hostname; localhostname: $localhostname; domain $domain" + if [info exists tmp_ldlib_path] { + set env(LD_LIBRARY_PATH) $tmp_ldlib_path + } else { + catch "unset env(LD_LIBRARY_PATH)" + } + catch "unset tmp_ldlib_path" return 1 } @@ -314,7 +341,7 @@ proc setup_kerberos_env { } { # Tell the dynamic loader where to get our shared libraries if [info exists env(LD_LIBRARY_PATH)] { set oldpath $env(LD_LIBRARY_PATH) - set env(LD_LIBRARY_PATH) "$SHLIBDIR $env(LD_LIBRARY_PATH)" + set env(LD_LIBRARY_PATH) "$SHLIBDIR:$env(LD_LIBRARY_PATH)" } else { catch "unset oldpath" set env(LD_LIBRARY_PATH) "$SHLIBDIR" @@ -981,7 +1008,7 @@ proc setup_root_shell { testname } { # Tell the dynamic loader where to get our shared libraries if [info exists env(LD_LIBRARY_PATH)] { set oldpath $env(LD_LIBRARY_PATH) - set env(LD_LIBRARY_PATH) "$SHLIBDIR $env(LD_LIBRARY_PATH)" + set env(LD_LIBRARY_PATH) "$SHLIBDIR:$env(LD_LIBRARY_PATH)" } else { catch "unset oldpath" set env(LD_LIBRARY_PATH) "$SHLIBDIR" -- 2.26.2