[ooo-build-commit] .: sal/osl

Jan Holesovsky kendy at kemper.freedesktop.org
Tue Aug 24 05:00:40 PDT 2010


 sal/osl/unx/file_url.cxx |   30 ++++++++++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

New commits:
commit bd266224916987d79a661530df0cabc1d48c47b3
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Tue Aug 24 13:54:50 2010 +0200

    fix-linkoo.diff: Fix linkoo to work again.
    
    We cannot absolutize all the links, otherwise we have bootstrap
    problems - i#83548.

diff --git a/sal/osl/unx/file_url.cxx b/sal/osl/unx/file_url.cxx
index 2253e8a..53f27b3 100644
--- a/sal/osl/unx/file_url.cxx
+++ b/sal/osl/unx/file_url.cxx
@@ -692,6 +692,7 @@ oslFileError osl_getAbsoluteFileURL(rtl_uString*  ustrBaseDirURL, rtl_uString* u
 {
     FileBase::RC  rc;
     rtl::OUString unresolved_path;    
+    static char *allow_symlinks = getenv( "SAL_ALLOW_LINKOO_SYMLINKS" );
     
     rc = FileBase::getSystemPathFromFileURL(rtl::OUString(ustrRelativeURL), unresolved_path);
     
@@ -712,8 +713,33 @@ oslFileError osl_getAbsoluteFileURL(rtl_uString*  ustrBaseDirURL, rtl_uString* u
         unresolved_path = abs_path;        
     }
 
-    rtl::OUString resolved_path;	  
-    rc = (FileBase::RC) osl_getAbsoluteFileURL_impl_(unresolved_path, resolved_path);
+    rtl::OUString resolved_path;
+
+    if (!allow_symlinks)
+    {
+        rc = (FileBase::RC) osl_getAbsoluteFileURL_impl_(unresolved_path, resolved_path);
+    }
+    else
+    {
+        // SAL_ALLOW_LINKOO_SYMLINKS environment variable:
+        // for linkoo to work, we need to let the symlinks to the libraries untouched
+        rtl::OUString base;
+        sal_Int32 last_slash = unresolved_path.lastIndexOf( UNICHAR_SLASH );
+
+        if (last_slash >= 0 && last_slash + 1 < unresolved_path.getLength())
+        {
+            base = unresolved_path.copy(last_slash+1);
+            unresolved_path = unresolved_path.copy(0, last_slash);
+        }
+
+        rc = (FileBase::RC) osl_getAbsoluteFileURL_impl_(unresolved_path, resolved_path);
+
+        if (base.getLength() > 0)
+        {
+            resolved_path += rtl::OUString( UNICHAR_SLASH );
+            resolved_path += base;
+        }
+    }
         
     if (FileBase::E_None == rc)
     {


More information about the ooo-build-commit mailing list