diff lisp/find-paths.el @ 4092:9c0151d05116

[xemacs-hg @ 2007-08-02 06:33:04 by michaels] 2007-07-31 Mike Sperber <mike@xemacs.org> * configure.ac: Don't divert `share' to `lib' for datadir. Also, define AC_DATAROOTDIR_CHECKED to shut up autoconf. 2007-07-31 Mike Sperber <mike@xemacs.org> * find-paths.el (paths-for-each-site-directory): (paths-find-site-directory): (paths-find-site-directories): (paths-for-each-version-directory): (paths-find-version-directory): (paths-find-version-directories): Add `arch-dependent-p' argument to distinguish between `lib' and `share'. (paths-find-architecture-directory): Follow above change. * packages.el (packages-find-installation-package-directories): Ditto. * setup-paths.el (paths-find-site-lisp-directory): (paths-find-site-module-directory): (paths-find-lisp-directory): (paths-find-mule-lisp-directory): (paths-find-module-directory): (paths-find-data-directory): Ditto.
author michaels
date Thu, 02 Aug 2007 06:33:59 +0000
parents a452d2a78a4e
children 5da4cc7d5968
line wrap: on
line diff
--- a/lisp/find-paths.el	Wed Aug 01 21:51:10 2007 +0000
+++ b/lisp/find-paths.el	Thu Aug 02 06:33:59 2007 +0000
@@ -207,12 +207,13 @@
 				    suffix base
 				    envvar default keep-suffix)))
 
-(defun paths-for-each-site-directory (func roots base &optional envvar default)
+(defun paths-for-each-site-directory (func roots base arch-dependent-p &optional envvar default)
   "Iterate over the site-specific directories in the XEmacs hierarchy.
 FUNC is a function that called for each directory, with the directory
 as the only argument.
 ROOTS must be a list of installation roots.
 BASE is the base to look for.
+ARCH-DEPENDENT-P says whether the file is architecture-specific.
 ENVVAR is the name of the environment variable that might also
 specify the directory.
 DEFAULT is the preferred value."
@@ -220,45 +221,48 @@
 				  roots
 				  (file-name-as-directory
 				   (paths-construct-path (list
-							  "lib"
+							  (if arch-dependent-p "lib" "share")
 							  emacs-program-name)))
 				  base
 				  envvar default))
 
-(defun paths-find-site-directory (roots base &optional envvar default)
+(defun paths-find-site-directory (roots base arch-dependent-p &optional envvar default)
   "Find a site-specific directory in the XEmacs hierarchy.
 ROOTS must be a list of installation roots.
 BASE is the base to look for.
+ARCH-DEPENDENT-P says whether the file is architecture-specific.
 ENVVAR is the name of the environment variable that might also
 specify the directory.
 DEFAULT is the preferred value."
   (catch 'gotcha
     (paths-for-each-site-directory #'(lambda (dir)
 				       (throw 'gotcha dir))
-				   roots base
+				   roots base arch-dependent-p
 				   envvar default)))
 
-(defun paths-find-site-directories (roots base &optional envvar default)
+(defun paths-find-site-directories (roots base arch-dependent-p &optional envvar default)
   "Find a list of site-specific directories in the XEmacs hierarchy.
 ROOTS must be a list of installation roots.
 BASE is the base to look for.
+ARCH-DEPENDENT-P says whether the file is architecture-specific.
 ENVVAR is the name of the environment variable that might also
 specify the directory.
 DEFAULT is the preferred value."
   (let ((l '()))
     (paths-for-each-site-directory #'(lambda (dir)
 					(setq l (cons dir l)))
-				   roots base
+				   roots base arch-dependent-p
 				   envvar default)
     (reverse l)))
 
-(defun paths-for-each-version-directory (func roots base
+(defun paths-for-each-version-directory (func roots base arch-dependent-p
 					 &optional envvar default enforce-version)
   "Iterate over version-specific directories in the XEmacs hierarchy.
 FUNC is a function that called for each directory, with the directory
 as the only argument.
 ROOTS must be a list of installation roots.
 BASE is the base to look for.
+ARCH-DEPENDENT-P says whether the file is architecture-specific.
 ENVVAR is the name of the environment variable that might also
 specify the directory.
 DEFAULT is the preferred value.
@@ -267,16 +271,17 @@
 				  roots
 				  (file-name-as-directory
 				   (paths-construct-path
-				    (list "lib"
+				    (list (if arch-dependent-p "lib" "share")
 					  (construct-emacs-version-name))))
 				  base
 				  envvar default))
 
-(defun paths-find-version-directory (roots base
+(defun paths-find-version-directory (roots base arch-dependent-p
 				     &optional envvar default enforce-version)
   "Find a version-specific directory in the XEmacs hierarchy.
 ROOTS must be a list of installation roots.
 BASE is the base to look for.
+ARCH-DEPENDENT-P says whether the file is architecture-specific.
 ENVVAR is the name of the environment variable that might also
 specify the directory.
 DEFAULT is the preferred value.
@@ -284,23 +289,24 @@
   (catch 'gotcha
     (paths-for-each-version-directory #'(lambda (dir)
 					  (throw 'gotcha dir))
-				      roots base
+				      roots base arch-dependent-p
 				      envvar default)))
 
-(defun paths-find-version-directories (roots base
+(defun paths-find-version-directories (roots base arch-dependent-p
 				       &optional envvar default enforce-version)
   "Find a list of version-specific directories in the XEmacs hierarchy.
 ROOTS must be a list of installation roots.
 BASE is the base to look for.
+ARCH-DEPENDENT-P says whether the file is architecture-specific.
 ENVVAR is the name of the environment variable that might also
 specify the directory.
 DEFAULT is the preferred value.
 If ENFORCE-VERSION is non-nil, the directory must contain the XEmacs version."
   (let ((l '()))
-    (paths-for-each-site-directory #'(lambda (dir)
-				       (setq l (cons dir l)))
-				   roots base
-				   envvar default)
+    (paths-for-each-version-directory #'(lambda (dir)
+					  (setq l (cons dir l)))
+				      roots base arch-dependent-p
+				      envvar default)
     (reverse l)))
 
 (defun paths-find-architecture-directory (roots base &optional envvar default)
@@ -315,12 +321,13 @@
    (paths-find-version-directory roots
 				 (paths-construct-path
 				  (list system-configuration base))
+				 t
 				 envvar default)
    (paths-find-version-directory roots
-				 base
+				 base t
 				 envvar)
    (paths-find-version-directory roots
-				 system-configuration
+				 system-configuration t
 				 envvar)))
 
 (defun construct-emacs-version-name ()