annotate lisp/update-elc-2.el @ 2618:6db7dbf7f88b

[xemacs-hg @ 2005-02-28 07:43:17 by adrian] [PATCH] xemacs-21.5-clean: show-memory-usage to sort sections by <fyzlbidk.fsf@smtprelay.t-online.de>
author adrian
date Mon, 28 Feb 2005 07:43:18 +0000
parents c4c8a36043be
children 9fec7fedbf1b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
1 ;;; update-elc-2.el --- Recompile remaining .el files, post-dumping
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
2
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
3 ;; Copyright (C) 1997 by Free Software Foundation, Inc.
1261
465bd3c7d932 [xemacs-hg @ 2003-02-06 06:35:47 by ben]
ben
parents: 1232
diff changeset
4 ;; Copyright (C) 2000, 2003 Ben Wing.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
5
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
6 ;; Author: Ben Wing <ben@xemacs.org>, based on cleantree.el by
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
7 ;; Steven L Baur <steve@xemacs.org>
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
8 ;; Maintainer: XEmacs Development Team
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
9 ;; Keywords: internal
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
10
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
11 ;; This file is part of XEmacs.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
12
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
13 ;; XEmacs is free software; you can redistribute it and/or modify it
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
14 ;; under the terms of the GNU General Public License as published by
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
15 ;; the Free Software Foundation; either version 2, or (at your option)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
16 ;; any later version.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
17
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
18 ;; XEmacs is distributed in the hope that it will be useful, but
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
21 ;; General Public License for more details.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
22
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
24 ;; along with XEmacs; see the file COPYING. If not, write to the Free
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
25 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
26 ;; 02111-1307, USA.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
27
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
28 ;;; Synched up with: Not in FSF
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
29
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
30 ;;; Commentary:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
31
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
32 ;; This file should be used after XEmacs has been dumped, to recompile
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
33 ;; all remaining out-of-date .els and clean up orphaned .elcs. It should
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
34 ;; be called as
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
35 ;;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
36 ;; xemacs -batch -vanilla -l update-elc-2.el -f batch-update-elc-2 ${dirname}
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
37 ;;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
38 ;; where ${dirname} is the directory tree to recompile, usually `lisp'.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
39 ;;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
40 ;; Note that this is very different from update-elc.el, which is called
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
41 ;; BEFORE dumping, handles only the files needed to dump, and is called
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
42 ;; from temacs instead of xemacs.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
43 ;;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
44 ;; The original cleantree.el had the comment: This code is derived
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
45 ;; from Gnus based on a suggestion by David Moore <dmoore@ucsd.edu>
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
46
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
47 ;;; Code:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
48
1261
465bd3c7d932 [xemacs-hg @ 2003-02-06 06:35:47 by ben]
ben
parents: 1232
diff changeset
49 ;; Help debug problems.
465bd3c7d932 [xemacs-hg @ 2003-02-06 06:35:47 by ben]
ben
parents: 1232
diff changeset
50 (setq stack-trace-on-error t
465bd3c7d932 [xemacs-hg @ 2003-02-06 06:35:47 by ben]
ben
parents: 1232
diff changeset
51 load-always-display-messages t)
465bd3c7d932 [xemacs-hg @ 2003-02-06 06:35:47 by ben]
ben
parents: 1232
diff changeset
52
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
53 (defvar update-elc-ignored-dirs
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
54 `("." ".." "CVS" "SCCS" "RCS" ,@(unless (featurep 'mule) '("mule"))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
55
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
56 (defvar update-elc-ignored-files
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
57 ;; note: entries here are regexps
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
58 '("^," ;; #### huh?
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
59 "^paths\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
60 "^loadup\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
61 "^loadup-el\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
62 "^update-elc\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
63 "^update-elc-2\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
64 "^dumped-lisp\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
65 "^make-docfile\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
66 "^site-start\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
67 "^site-load\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
68 "^site-init\\.el$"
1315
70921960b980 [xemacs-hg @ 2003-02-20 08:19:28 by ben]
ben
parents: 1303
diff changeset
69 "^version\\.el$"))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
70
1298
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
71 (defvar dirfiles-table (make-hash-table :test 'equal))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
72
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
73 ;; SEEN accumulates the list of already-handled dirs.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
74 (defun do-update-elc-2 (dir compile-stage-p seen)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
75 (setq dir (file-name-as-directory dir))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
76 ;; Only scan this sub-tree if we haven't been here yet.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
77 (unless (member (file-truename dir) seen)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
78 (push (file-truename dir) seen)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
79
1298
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
80 (let ((files (or (gethash dir dirfiles-table)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
81 (directory-files dir t nil t))))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
82
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
83 ;; Do this directory.
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
84 (if compile-stage-p
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
85 ;; Stage 2: Recompile necessary .els
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
86 (dolist (file files)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
87 (when (string-match "\\.el$" file)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
88 (let ((file-c (concat file "c")))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
89 (when (and (not (member file-c files))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
90 ;; no need to check for out-of-date-ness because
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
91 ;; that was already done, and .elc removed.
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
92 (let (ignore)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
93 (mapcar
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
94 #'(lambda (regexp)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
95 (if (string-match
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
96 regexp
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
97 (file-name-nondirectory file))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
98 (setq ignore t)))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
99 update-elc-ignored-files)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
100 (not ignore)))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
101 (byte-compile-file file)))))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
102
1298
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
103 ;; Stage 1.
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
104 ;; Remove out-of-date elcs
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
105 (let (deleted)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
106 (dolist (file files)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
107 (when (string-match "\\.el$" file)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
108 (let ((file-c (concat file "c")))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
109 (when (and (member file-c files)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
110 (file-newer-than-file-p file file-c))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
111 (message "Removing out-of-date %s" file-c)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
112 (delete-file file-c)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
113 (push file-c deleted)))))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
114
1298
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
115 ;; Remove elcs without corresponding el
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
116 (dolist (file-c files)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
117 (when (string-match "\\.elc$" file-c)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
118 (let ((file (replace-in-string file-c "c$" "")))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
119 (when (not (member file files))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
120 (message "Removing %s; no corresponding .el" file-c)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
121 (delete-file file-c)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
122 (push file-c deleted)))))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
123
1303
f99d3d25df86 [xemacs-hg @ 2003-02-15 10:15:54 by ben]
ben
parents: 1298
diff changeset
124 (setq files (set-difference files deleted :test 'equal))))
1298
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
125
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
126 (puthash dir files dirfiles-table)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
127
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
128 ;; We descend recursively. On my Windows machine, it is much faster
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
129 ;; to call directory-files again to recompute than to call
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
130 ;; file-directory-p on each member of the files list.
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
131 (dolist (dir (directory-files dir t nil t 'dir))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
132 (when (not (member (file-name-nondirectory dir)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
133 update-elc-ignored-dirs))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
134 (do-update-elc-2 dir compile-stage-p seen))))))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
135
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
136 (defun batch-update-elc-2 ()
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
137 (defvar command-line-args-left)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
138 (unless noninteractive
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
139 (error "`batch-update-elc-2' is to be used only with -batch"))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
140 (let ((dir (car command-line-args-left)))
1298
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
141 ;; don't depend on being able to autoload `update-autoload-files'!
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
142 (load "autoload")
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
143 (load "bytecomp")
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
144 (load "byte-optimize")
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
145 ;; #### the API used here is deprecated, convert to one with explicit
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
146 ;; arguments when it is available
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
147 ;; update-elc.el signals us to rebuild the autoloads when necessary.
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
148 ;; in some cases it will rebuild the autoloads itself, but doing it this
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
149 ;; way is slow, so we avoid it when possible.
1330
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1315
diff changeset
150 (when (file-exists-p (expand-file-name "REBUILD_AUTOLOADS"
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1315
diff changeset
151 invocation-directory))
2548
c4c8a36043be [xemacs-hg @ 2005-02-03 07:11:19 by ben]
ben
parents: 1330
diff changeset
152 ;; if we were instructed to rebuild the autoloads, force the file
c4c8a36043be [xemacs-hg @ 2005-02-03 07:11:19 by ben]
ben
parents: 1330
diff changeset
153 ;; to be touched even w/o changes; otherwise, we won't ever stop
c4c8a36043be [xemacs-hg @ 2005-02-03 07:11:19 by ben]
ben
parents: 1330
diff changeset
154 ;; being told to rebuild them.
c4c8a36043be [xemacs-hg @ 2005-02-03 07:11:19 by ben]
ben
parents: 1330
diff changeset
155 (update-autoload-files dir "auto" nil t)
c4c8a36043be [xemacs-hg @ 2005-02-03 07:11:19 by ben]
ben
parents: 1330
diff changeset
156 (byte-recompile-file (expand-file-name "auto-autoloads.el" dir) 0)
1298
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
157 (when (featurep 'mule)
2548
c4c8a36043be [xemacs-hg @ 2005-02-03 07:11:19 by ben]
ben
parents: 1330
diff changeset
158 (let ((muledir (expand-file-name "../lisp/mule" (file-truename dir))))
1330
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1315
diff changeset
159 ;; force here just like above.
2548
c4c8a36043be [xemacs-hg @ 2005-02-03 07:11:19 by ben]
ben
parents: 1330
diff changeset
160 (update-autoload-files muledir "mule" nil t)
c4c8a36043be [xemacs-hg @ 2005-02-03 07:11:19 by ben]
ben
parents: 1330
diff changeset
161 (byte-recompile-file (expand-file-name "auto-autoloads.el" dir) 0))))
1298
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
162 (when (featurep 'modules)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
163 (let* ((moddir (expand-file-name "../modules" (file-truename dir)))
2548
c4c8a36043be [xemacs-hg @ 2005-02-03 07:11:19 by ben]
ben
parents: 1330
diff changeset
164 (autofile (expand-file-name "auto-autoloads.el" moddir)))
c4c8a36043be [xemacs-hg @ 2005-02-03 07:11:19 by ben]
ben
parents: 1330
diff changeset
165 (update-autoload-files
1298
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
166 (delete (concat (file-name-as-directory moddir) ".")
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
167 (delete (concat (file-name-as-directory moddir) "..")
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
168 (directory-files moddir t nil nil 0)))
2548
c4c8a36043be [xemacs-hg @ 2005-02-03 07:11:19 by ben]
ben
parents: 1330
diff changeset
169 "modules" autofile)
c4c8a36043be [xemacs-hg @ 2005-02-03 07:11:19 by ben]
ben
parents: 1330
diff changeset
170 (byte-recompile-file autofile 0)))
1298
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
171 ;; now load the (perhaps newly rebuilt) autoloads; we were called with
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
172 ;; -no-autoloads so they're not already loaded.
1330
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1315
diff changeset
173 (load (expand-file-name "auto-autoloads" lisp-directory))
1298
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
174 (when (featurep 'mule)
1330
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1315
diff changeset
175 (load (expand-file-name "mule/auto-autoloads" lisp-directory)))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
176 ;; We remove all the bad .elcs before any byte-compilation, because
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
177 ;; there may be dependencies between one .el and another (even across
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
178 ;; directories), and we don't want to load an out-of-date .elc while
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
179 ;; byte-compiling a file.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
180 (message "Removing old or spurious .elcs in directory tree `%s'..." dir)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
181 (do-update-elc-2 dir nil nil)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
182 (message "Removing old or spurious .elcs in directory tree `%s'...done"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
183 dir)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
184 (message "Recompiling updated .els in directory tree `%s'..." dir)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
185 (do-update-elc-2 dir t nil)
528
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
186 (message "Recompiling updated .els in directory tree `%s'...done" dir)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
187 ;; likewise here.
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
188 (load "cus-dep")
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
189 (Custom-make-dependencies dir)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
190 (byte-recompile-file (expand-file-name "custom-load.el" dir) 0)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
191 (when (featurep 'mule)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
192 (Custom-make-dependencies (expand-file-name "mule" dir))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
193 (byte-recompile-file (expand-file-name "mule/custom-load.el" dir) 0))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
194 )
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
195 (setq command-line-args-left nil))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
196
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
197 ;;; update-elc-2.el ends here