Revision: 6740
Author: ek.kato
Date: Tue Sep 7 07:42:18 2010
Log: * scm/plguin.scm
- (uim-plugin-scm-load-path)
- (load-module-conf)
- (load-enabled-modules)
* scm/dynlib.scm
- (uim-dynlib-load-path)
- Don't assume the config-path in home directory is always
writable. This fixes build problem of uim-1.6.0
on chrooted environment using user nobody.
http://code.google.com/p/uim/source/detail?r=6740
Modified:
/trunk/scm/dynlib.scm
/trunk/scm/plugin.scm
=======================================
--- /trunk/scm/dynlib.scm Thu May 6 22:55:35 2010
+++ /trunk/scm/dynlib.scm Tue Sep 7 07:42:18 2010
@@ -34,14 +34,15 @@
(define uim-dynlib-load-path
(if (setugid?)
(list (string-append (sys-pkglibdir) "/plugin"))
- (let ((home-dir (or (home-directory (user-name)) ""))
- (ld-library-path (getenv "LD_LIBRARY_PATH")))
+ (let* ((ld-library-path (getenv "LD_LIBRARY_PATH"))
+ (config-path (get-config-path! #f))
+ (user-plugin-path (if config-path
+ (string-append config-path "/plugin")
+ '())))
(filter string?
(append (list (getenv "LIBUIM_PLUGIN_LIB_DIR")
- (if home-dir
- (string-append (get-config-path! #f)
"/plugin")
- '())
- (string-append (sys-pkglibdir) "/plugin"))
+ user-plugin-path
+ (string-append (sys-pkglibdir) "/plugin"))
;; XXX
(if ld-library-path
(string-split ld-library-path ":")
=======================================
--- /trunk/scm/plugin.scm Thu Aug 5 19:05:22 2010
+++ /trunk/scm/plugin.scm Tue Sep 7 07:42:18 2010
@@ -39,12 +39,12 @@
(define uim-plugin-scm-load-path
(if (setugid?)
(list (sys-pkgdatadir))
- (let ((home-dir (or (home-directory (user-name)) ""))
+ (let ((config-path (get-config-path! #f))
(scm-paths (string-split (load-path) ":")))
(filter string?
(append scm-paths
- (if home-dir
- (list (string-append (get-config-path! #f) "/plugin"))
+ (if config-path
+ (list (string-append config-path "/plugin"))
'())
(list (sys-pkgdatadir)))))))
@@ -71,9 +71,9 @@
;; TODO: write test
(define load-module-conf
(lambda ()
- (let* ((home-dir (or (home-directory (user-name)) ""))
- (user-module-dir (if home-dir
- (string-append (get-config-path! #f) "/plugin/")
+ (let* ((config-path (get-config-path! #f))
+ (user-module-dir (if config-path
+ (string-append config-path "/plugin/")
#f))
(conf-file "installed-modules.scm")
(user-conf-file (if user-module-dir
@@ -100,9 +100,9 @@
;; TODO: write test
(define load-enabled-modules
(lambda ()
- (let* ((home-dir (or (home-directory (user-name)) ""))
- (user-module-dir (if home-dir
- (string-append (get-config-path! #f) "/plugin/")
+ (let* ((config-path (get-config-path! #f))
+ (user-module-dir (if config-path
+ (string-append config-path "/plugin/")
#f))
(file "loader.scm")
(user-file (if user-module-dir