[S] Re: [A] Re: Major update and overhaul of PUI (sync to 21.5).

Adrian Aichner adrian at xemacs.org
Thu Feb 19 19:40:45 EST 2004


SUPERSEDES <545znbgl0qj.fsf at xemacs.org>

Steve, Vin, I found another instance of
(substring (car path-list) -14)
and
(substring (car path-list) -16)
which I had overlooked before.

It's part of this patch now.

Best regards,

Adrian

Index: lisp/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/ChangeLog,v
retrieving revision 1.266.2.56
diff -u -U0 -r1.266.2.56 ChangeLog
--- lisp/ChangeLog	2004/02/16 14:25:19	1.266.2.56
+++ lisp/ChangeLog	2004/02/18 17:40:52
@@ -0,0 +1,13 @@
+2003-07-06  Adrian Aichner  <adrian at xemacs.org>
+
+	* package-get.el (package-get-package-index-file-location): Handle
+	missing "EMACSPACKAGEPATH" environment variable.
+
+2003-07-05  Adrian Aichner  <adrian at xemacs.org>
+
+	* package-admin.el (package-admin-find-top-directory): Simplify
+	directory comparisions and fix substring errors on short path
+	components.
+	* package-get.el (package-get-package-index-file-location):
+	Default to first component of "EMACSPACKAGEPATH", if set.
+

Index: lisp/package-get.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/package-get.el,v
retrieving revision 1.39.2.6
diff -u -u -r1.39.2.6 package-get.el
--- lisp/package-get.el	16 Feb 2004 14:25:21 -0000	1.39.2.6
+++ lisp/package-get.el	20 Feb 2004 00:26:03 -0000
@@ -171,8 +171,7 @@
 
 ;;;###autoload
 (defcustom package-get-package-index-file-location 
-  (or (getenv "EMACSPACKAGEPATH")
-      user-init-directory)
+  (car (split-path (or (getenv "EMACSPACKAGEPATH") user-init-directory)))
   "*The directory where the package-index file can be found."
   :type 'directory
   :group 'package-get)

Index: lisp/package-admin.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/package-admin.el,v
retrieving revision 1.16.2.2
diff -u -u -r1.16.2.2 package-admin.el
--- lisp/package-admin.el	27 Jan 2004 02:58:13 -0000	1.16.2.2
+++ lisp/package-admin.el	20 Feb 2004 00:21:27 -0000
@@ -173,14 +173,16 @@
 	(let ((path-list (paths-decode-directory-path env-value 'drop-empties)))
 	  (cond ((eq type 'std)
 		 (while path-list
-		   (if (equal (substring (car path-list) -16) 
-			      (concat "xemacs-packages" (char-to-string directory-sep-char)))
+		   (if (equal (file-name-nondirectory 
+			       (directory-file-name (car path-list)))
+			      "xemacs-packages")
 		       (setq top-dir (car path-list)))
 		   (setq path-list (cdr path-list))))
 		((eq type 'mule)
 		 (while path-list
-		   (if (equal (substring (car path-list) -14) 
-			      (concat "mule-packages" (char-to-string directory-sep-char)))
+		   (if (equal (file-name-nondirectory 
+			       (directory-file-name (car path-list)))
+			      "mule-packages")
 		       (setq top-dir (car path-list)))
 		   (setq path-list (cdr path-list)))))))
     ;; Wasn't in the environment, try `user-init-directory' if
@@ -200,14 +202,16 @@
 				 (packages-compute-package-locations user-init-directory)))))
 	  (cond ((eq type 'std)
 		 (while path-list
-		   (if (equal (substring (car path-list) -16) 
-			      (concat "xemacs-packages" (char-to-string directory-sep-char)))
+		   (if (equal (file-name-nondirectory 
+			       (directory-file-name (car path-list)))
+			      "xemacs-packages")
 		       (setq top-dir (car path-list)))
 		   (setq path-list (cdr path-list))))
 		((eq type 'mule)
 		 (while path-list
-		   (if (equal (substring (car path-list) -14) 
-			      (concat "mule-packages" (char-to-string directory-sep-char)))
+		   (if (equal (file-name-nondirectory 
+			       (directory-file-name (car path-list)))
+			      "mule-packages")
 		       (setq top-dir (car path-list)))
 		   (setq path-list (cdr path-list)))))))
     ;; Now return either the directory or nil.

-- 
Adrian Aichner
 mailto:adrian at xemacs.org
 http://www.xemacs.org/




More information about the XEmacs-Beta mailing list