Correctly set LD_LIBRARY_PATH (again)
authorPaul Park <pjpark@mit.edu>
Wed, 12 Jul 1995 18:59:38 +0000 (18:59 +0000)
committerPaul Park <pjpark@mit.edu>
Wed, 12 Jul 1995 18:59:38 +0000 (18:59 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6290 dc483132-0cff-0310-8789-dd5450dbe970

src/tests/dejagnu/config/ChangeLog
src/tests/dejagnu/config/default.exp

index 3fb75c55116d64455f1da685120aeb6657726487..bf8c719ed1dcb5aed0964403b4dc64e3c0a7d50e 100644 (file)
@@ -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.
 
index e80582e4df649e147eb82ba8d90b9bb8c95b9958..f830a9d014f18e3d4885f0eb1d50fbf23930f403 100644 (file)
@@ -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"