diff lisp/update-elc.el @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents 501cfd01ee6d
children da8ed4261e83
line wrap: on
line diff
--- a/lisp/update-elc.el	Mon Aug 13 11:19:22 2007 +0200
+++ b/lisp/update-elc.el	Mon Aug 13 11:20:41 2007 +0200
@@ -39,6 +39,9 @@
 ;; (the idea here is that you can bootstrap if your .ELC files
 ;; are missing or badly out-of-date)
 
+;; Currently this code gets the list of files to check passed to it from
+;; src/Makefile.  This must be fixed.  -slb
+
 ;;; Code:
 
 (defvar processed nil)
@@ -59,8 +62,7 @@
 ;		    ;; -batch gets filtered out.
 ;		    (nthcdr 3 command-line-args))))
 
-(let ((build-root (expand-file-name ".." invocation-directory)))
-  (setq load-path (list (expand-file-name "lisp" build-root))))
+(setq load-path (split-path (getenv "EMACSBOOTSTRAPLOADPATH")))
 
 (load "very-early-lisp" nil t)
 
@@ -81,13 +83,8 @@
 
 ;; (print (prin1-to-string update-elc-files-to-compile))
 
-(let (preloaded-file-list site-load-packages need-to-dump dumped-exe)
-  (load (expand-file-name "../lisp/dumped-lisp.el"))
-
-  (setq dumped-exe
-	(cond ((file-exists-p "../src/xemacs.exe") "../src/xemacs.exe")
-	      ((file-exists-p "../src/xemacs") "../src/xemacs")
-	      (t nil)))
+(let (preloaded-file-list site-load-packages)
+  (load (concat default-directory "../lisp/dumped-lisp.el"))
 
   ;; Path setup
   (let ((package-preloaded-file-list
@@ -96,7 +93,6 @@
     (setq preloaded-file-list
  	  (append package-preloaded-file-list
  		  preloaded-file-list
-		  '("bytecomp")
  		  packages-hardcoded-lisp)))
 
   (load (concat default-directory "../site-packages") t t)
@@ -108,26 +104,6 @@
   (while preloaded-file-list
     (let ((arg (car preloaded-file-list)))
       ;; (print (prin1-to-string arg))
-
-      ;; now check if .el or .elc is newer than the dumped exe.
-      ;; if so, need to redump.
-      (let ((frob
-	     (if (string-match "\\.elc?\\'" arg)
-		 (substring arg 0 (match-beginning 0))
-	       arg)))
-	    (when (and dumped-exe
-		       (or (and (file-exists-p
-				 (concat "../lisp/" frob ".el"))
-				(file-newer-than-file-p
-				 (concat "../lisp/" frob ".el")
-				 dumped-exe))
-			   (and (file-exists-p
-				 (concat "../lisp/" frob ".elc"))
-				(file-newer-than-file-p
-				 (concat "../lisp/" frob ".elc")
-				 dumped-exe))))
-	      (setq need-to-dump t)))
-
       (if (null (member (file-name-nondirectory arg)
 			packages-unbytecompiled-lisp))
 	  (progn
@@ -147,14 +123,7 @@
 		     (file-newer-than-file-p (concat arg ".el")
 					     (concat arg ".elc")))
 		(setq processed (cons (concat arg ".el") processed)))))
-      (setq preloaded-file-list (cdr preloaded-file-list))))
-
-  (if need-to-dump
-      (condition-case nil
-	  (write-region-internal "foo" nil "../src/NEEDTODUMP")
-	(file-error nil)))
-
-  )
+      (setq preloaded-file-list (cdr preloaded-file-list)))))
 
 (setq update-elc-files-to-compile (append update-elc-files-to-compile
 					  processed))
@@ -170,7 +139,7 @@
 		    update-elc-files-to-compile))
       (load "loadup-el.el"))
   (condition-case nil
-      (delete-file "../src/NOBYTECOMPILE")
+      (delete-file "./NOBYTECOMPILE")
     (file-error nil)))
 
 (kill-emacs)