From xemacs-m  Wed Sep  3 16:03:04 1997
Received: from altair.xemacs.org (steve@xemacs.miranova.com [206.190.83.19])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id QAA21730
	for <xemacs-beta@xemacs.org>; Wed, 3 Sep 1997 16:03:03 -0500 (CDT)
Received: (from steve@localhost)
	by altair.xemacs.org (8.8.7/8.8.7) id OAA15420;
	Wed, 3 Sep 1997 14:06:55 -0700
Mail-Copies-To: never
To: xemacs-beta@xemacs.org
Subject: [PATCH]  Re: Kyiv package failure under sparc-sun-solaris2.5.1
References: <ocrbu2al4j1.fsf@ml.com>
X-Face: `'%\i;ySOu]g?NlziJSk_$&@]KP`}~PEQPjZ5;nxSaDW_o$4+4%Ab]%Ifw3ZR;7TIT3,O,'
 @2{L;]ox6kc;$_5kU'n**9vFg-]eV~GbxSVCx|(s%uR[],*:^WKmC`B}(;|k9/m]gwt?&`t;^rfCJg
 khHH>pP1W\)xM0U@!FNDD72{3fDP$PkBhx^7Z?-WxH6DbFN:QOnT`llzW}VGdYv;n9lzljQvKTIBhQ
 YuV
X-Attribution: sb
From: SL Baur <steve@xemacs.org>
In-Reply-To: Colin Rafferty's message of "03 Sep 1997 12:56:50 -0400"
Mime-Version: 1.0 (generated by tm-edit 7.108)
Content-Type: text/plain; charset=US-ASCII
Date: 03 Sep 1997 14:06:55 -0700
Message-ID: <m2bu2a5cpc.fsf@altair.xemacs.org>
Lines: 115
X-Mailer: Gnus v5.4.65/XEmacs 20.3(beta20) - "Tirana"

FMH, why does XEmacs blow chunks when non-interactive functions are
given filenames of the form "/path/to/something//foo.elc"?

This patch is lightly tested but should cure the fuckage associated
with non-package loading at dump.  As a bonus, package directories
beginning with `~' like `~/.xemacs' are no longer searched at dump
time, but will searched at run time (the auto-autoloads are still not 
loaded, that will be fixed by beta20).

Wed Sep  3 13:53:10 1997  SL Baur  <steve@altair.xemacs.org>

	* prim/loadup.el:  *Never* add directories to the load-path
	without trailing slashes.

1997-09-03  SL Baur  <steve@altair.xemacs.org>

	* prim/packages.el (packages-find-packages): New argument:
	`suppress-user' to allow suppression of searching package
	hierarchies beginning with "~".
	(Top Level): Suppress searching user directories at dump time.

Index: lisp/prim/loaddefs.el
===================================================================
RCS file: /usr/local/xemacs/xemacs-20.0/lisp/prim/loaddefs.el,v
retrieving revision 1.6
diff -u -r1.6 loaddefs.el
--- loaddefs.el	1997/08/17 03:24:14	1.6
+++ loaddefs.el	1997/09/03 20:44:40
@@ -383,7 +383,7 @@
 (let ((dir load-path))
   (while dir
     (condition-case nil
-	(load (concat (car dir) "/auto-autoloads"))
+	(load (concat (car dir) "auto-autoloads"))
       (t nil))
     (pop dir)))
 
Index: lisp/prim/loadup.el
===================================================================
RCS file: /usr/local/xemacs/xemacs-20.0/lisp/prim/loadup.el,v
retrieving revision 1.13
diff -u -r1.13 loadup.el
--- loadup.el	1997/06/29 23:13:17	1.13
+++ loadup.el	1997/09/03 20:52:33
@@ -59,8 +59,10 @@
      ;;
      (let ((temp-path (expand-file-name ".." (car load-path))))
        (setq source-directory temp-path)
-       (setq load-path (nconc (directory-files temp-path t "^[^-.]"
-					       nil 'dirs-only)
+       (setq load-path (nconc (mapcar
+			       #'(lambda (i) (concat i "/"))
+			       (directory-files temp-path t "^[^-.]"
+						nil 'dirs-only))
 			      (cons temp-path load-path))))
 
      (setq load-warn-when-source-newer t ; set to nil at the end
Index: lisp/prim/packages.el
===================================================================
RCS file: /usr/local/xemacs/xemacs-20.0/lisp/prim/packages.el,v
retrieving revision 1.7
diff -u -r1.7 packages.el
--- packages.el	1997/09/03 02:55:42	1.7
+++ packages.el	1997/09/03 20:57:02
@@ -184,27 +184,38 @@
   ;; Lisp files
   (if (file-directory-p (concat package "/lisp"))
       (progn
+	;; (print (concat "DIR: " package "/lisp/"))
 	(setq load-path (cons (concat package "/lisp/") load-path))
 	(let ((dirs (directory-files (concat package "/lisp/")
 				     t "^[^-.]" nil 'dirs-only))
 	      dir)
 	  (while dirs
 	    (setq dir (car dirs))
+	    ;; (print (concat "DIR: " dir "/"))
 	    (setq load-path (cons (concat dir "/") load-path))
 	    (packages-find-packages-1 dir path-only)
 	    (setq dirs (cdr dirs)))))))
 
 ;; The following function is called from temacs
-(defun packages-find-packages (pkg-path path-only)
+(defun packages-find-packages (pkg-path path-only &optional suppress-user)
   "Search the supplied path for additional info/etc/lisp directories.
 Lisp directories if configured prior to build time will have equivalent
-status as bundled packages."
+status as bundled packages.
+If the argument `path-only' is non-nil, only the `load-path' will be set,
+otherwise data directories and info directories will be added.
+If the optional argument `suppress-user' is non-nil, package directories
+rooted in a user login directory (like ~/.xemacs) will not be searched.
+This is used at dump time to suppress the builder's local environment."
   (let ((path pkg-path)
 	dir)
     (while path
       (setq dir (car path))
       ;; (prin1 (concat "Find: " (expand-file-name dir) "\n"))
-      (packages-find-packages-1 (expand-file-name dir) path-only)
+      (if (null (and suppress-user
+		     (string-match "^~" dir)))
+	  (progn
+	    ;; (print dir)
+	    (packages-find-packages-1 (expand-file-name dir) path-only)))
       (setq path (cdr path)))))
 
 ;; Data-directory is really a list now.  Provide something to search it for
@@ -225,7 +236,7 @@
 ;; If we are being loaded as part of being dumped, bootstrap the rest of the
 ;; load-path for loaddefs.
 (if (fboundp 'load-gc)
-    (packages-find-packages package-path t))
+    (packages-find-packages package-path t t))
 
 (provide 'packages)
 

