428
|
1 ;;; package-admin.el --- Installation and Maintenance of XEmacs packages
|
|
2
|
|
3 ;; Copyright (C) 1997 by Free Software Foundation, Inc.
|
|
4
|
|
5 ;; Author: SL Baur <steve@xemacs.org>
|
|
6 ;; Keywords: internal
|
|
7
|
|
8 ;; This file is part of XEmacs.
|
|
9
|
|
10 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
11 ;; under the terms of the GNU General Public License as published by
|
|
12 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
13 ;; any later version.
|
|
14
|
|
15 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
18 ;; General Public License for more details.
|
|
19
|
|
20 ;; You should have received a copy of the GNU General Public License
|
|
21 ;; along with XEmacs; see the file COPYING. If not, write to the Free
|
|
22 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
23 ;; 02111-1307, USA.
|
|
24
|
|
25 ;;; Synched up with: Not in FSF
|
|
26
|
|
27 ;;; Commentary:
|
|
28
|
|
29 ;; First pass at lisp front end to package maintenance.
|
|
30
|
|
31 ;;; Code:
|
|
32
|
|
33 (require 'config)
|
|
34
|
|
35 (defvar package-admin-xemacs (concat invocation-directory invocation-name)
|
|
36 "Location of XEmacs binary to use.")
|
|
37
|
|
38 (defvar package-admin-temp-buffer "*Package Output*"
|
|
39 "Temporary buffer where output of backend commands is saved.")
|
|
40
|
|
41 (defvar package-admin-install-function (if (eq system-type 'windows-nt)
|
|
42 'package-admin-install-function-mswindows
|
|
43 'package-admin-default-install-function)
|
|
44 "The function to call to install a package.
|
444
|
45 Three args are passed: FILENAME PKG-DIR BUFFER
|
428
|
46 Install package FILENAME into directory PKG-DIR, with any messages output
|
444
|
47 to buffer BUFFER.")
|
428
|
48
|
|
49 (defvar package-admin-error-messages '(
|
|
50 "No space left on device"
|
|
51 "No such file or directory"
|
|
52 "Filename too long"
|
|
53 "Read-only file system"
|
|
54 "File too large"
|
|
55 "Too many open files"
|
|
56 "Not enough space"
|
|
57 "Permission denied"
|
|
58 "Input/output error"
|
|
59 "Out of memory"
|
|
60 "Unable to create directory"
|
|
61 "Directory checksum error"
|
|
62 "Cannot exclusively open file"
|
|
63 "corrupted file"
|
|
64 "incomplete .* tree"
|
|
65 "Bad table"
|
|
66 "corrupt input"
|
|
67 "invalid compressed data"
|
|
68 "too many leaves in Huffman tree"
|
|
69 "not a valid zip file"
|
|
70 "first entry not deflated or stored"
|
|
71 "encrypted file --"
|
|
72 "unexpected end of file"
|
|
73 )
|
|
74 "Regular expressions of possible error messages.
|
|
75 After each package extraction, the `package-admin-temp-buffer' buffer is
|
|
76 scanned for these messages. An error code is returned if one of these are
|
|
77 found.
|
|
78
|
|
79 This is awful, but it exists because error return codes aren't reliable
|
|
80 under MS Windows.")
|
|
81
|
|
82 (defvar package-admin-tar-filename-regexps
|
|
83 '(
|
|
84 ;; GNU tar:
|
|
85 ;; drwxrwxr-x john/doe 123 1997-02-18 15:48 pathname
|
|
86 "\\S-+\\s-+[-a-z0-9_/]+\\s-+[0-9]+\\s-+[-0-9]+\\s-+[0-9:]+\\s-+\\(\\S-.*\\)"
|
|
87 ;; HP-UX & SunOS tar:
|
|
88 ;; rwxrwxr-x 501/501 123 Feb 18 15:46 1997 pathname
|
|
89 ;; Solaris tar (phooey!):
|
|
90 ;; rwxrwxr-x501/501 123 Feb 18 15:46 1997 pathname
|
|
91 ;; AIX tar:
|
|
92 ;; -rw-r--r-- 147 1019 32919 Mar 26 12:00:09 1992 pathname
|
|
93 "\\S-+\\s-*[-a-z0-9_]+[/ ][-a-z0-9_]+\\s-+[0-9]+\\s-+[a-z][a-z][a-z]\\s-+[0-9]+\\s-+[0-9:]+\\s-+[0-9]+\\s-+\\(\\S-.*\\)"
|
|
94
|
|
95 ;; djtar:
|
|
96 ;; drwx Aug 31 02:01:41 1998 123 pathname
|
|
97 "\\S-+\\s-+[a-z][a-z][a-z]\\s-+[0-9]+\\s-+[0-9:]+\\s-+[0-9]+\\s-+[0-9]+\\s-+\\(\\S-.*\\)"
|
|
98
|
|
99 )
|
|
100 "List of regexps to use to search for tar filenames.
|
|
101 Note that \"\\(\" and \"\\)\" must be used to delimit the pathname (as
|
|
102 match #1). Don't put \"^\" to match the beginning of the line; this
|
|
103 is already implicit, as `looking-at' is used. Filenames can,
|
|
104 unfortunately, contain spaces, so be careful in constructing any
|
|
105 regexps.")
|
|
106
|
628
|
107 (defvar package-install-hook nil
|
|
108 "*List of hook functions to be called when a new package is successfully
|
|
109 installed. The hook function is passed two arguments: the package name, and
|
|
110 the install directory.")
|
|
111
|
|
112 (defvar package-delete-hook nil
|
|
113 "*List of hook functions to be called when a package is deleted. The
|
|
114 hook is called *before* the package is deleted. The hook function is passed
|
|
115 two arguments: the package name, and the install directory.")
|
|
116
|
428
|
117 ;;;###autoload
|
|
118 (defun package-admin-add-single-file-package (file destdir &optional pkg-dir)
|
|
119 "Install a single file Lisp package into XEmacs package hierarchy.
|
|
120 `file' should be the full path to the lisp file to install.
|
|
121 `destdir' should be a simple directory name.
|
|
122 The optional `pkg-dir' can be used to override the default package hierarchy
|
|
123 \(car \(last late-packages))."
|
|
124 (interactive "fLisp File: \nsDestination: ")
|
|
125 (when (null pkg-dir)
|
|
126 (setq pkg-dir (car (last late-packages))))
|
|
127 (let ((destination (concat pkg-dir "/lisp/" destdir))
|
|
128 (buf (get-buffer-create package-admin-temp-buffer)))
|
|
129 (call-process "add-little-package.sh"
|
|
130 nil
|
|
131 buf
|
|
132 t
|
|
133 ;; rest of command line follows
|
|
134 package-admin-xemacs file destination)))
|
|
135
|
444
|
136 (defun package-admin-install-function-mswindows (file pkg-dir buffer)
|
|
137 "Install function for mswindows."
|
428
|
138 (let ((default-directory (file-name-as-directory pkg-dir)))
|
|
139 (unless (file-directory-p default-directory)
|
|
140 (make-directory default-directory t))
|
444
|
141 (call-process "minitar" nil buffer t file)))
|
428
|
142
|
444
|
143 (defun package-admin-default-install-function (filename pkg-dir buffer)
|
428
|
144 "Default function to install a package.
|
|
145 Install package FILENAME into directory PKG-DIR, with any messages output
|
444
|
146 to BUFFER."
|
428
|
147 (let* ((pkg-dir (file-name-as-directory pkg-dir))
|
|
148 (default-directory pkg-dir)
|
444
|
149 (filename (expand-file-name filename)))
|
428
|
150 (unless (file-directory-p pkg-dir)
|
|
151 (make-directory pkg-dir t))
|
|
152 ;; Don't assume GNU tar.
|
444
|
153 (if (shell-command (concat "gunzip -c " filename " | tar xvf -") buffer)
|
428
|
154 0
|
|
155 1)
|
|
156 ))
|
|
157
|
|
158 ; (call-process "add-big-package.sh"
|
|
159 ; nil
|
444
|
160 ; buffer
|
428
|
161 ; t
|
|
162 ; ;; rest of command line follows
|
|
163 ; package-admin-xemacs file pkg-dir))
|
|
164
|
|
165 (defun package-admin-get-install-dir (package pkg-dir &optional mule-related)
|
|
166 "If PKG-DIR is non-nil return that,
|
|
167 else return the current location of the package if it is already installed
|
|
168 or return a location appropriate for the package otherwise."
|
|
169 (if pkg-dir
|
|
170 pkg-dir
|
|
171 (let ((package-feature (intern-soft (concat
|
|
172 (symbol-name package) "-autoloads")))
|
|
173 autoload-dir)
|
|
174 (when (and (not (eq package 'unknown))
|
|
175 (featurep package-feature)
|
|
176 (setq autoload-dir (feature-file package-feature))
|
|
177 (setq autoload-dir (file-name-directory autoload-dir))
|
448
|
178 (member autoload-dir (append early-package-load-path late-package-load-path)))
|
440
|
179 ;; Find the corresponding entry in late-package
|
428
|
180 (setq pkg-dir
|
|
181 (car-safe (member-if (lambda (h)
|
|
182 (string-match (concat "^" (regexp-quote h))
|
|
183 autoload-dir))
|
448
|
184 (append (cdr early-packages) late-packages)))))
|
428
|
185 (if pkg-dir
|
|
186 pkg-dir
|
|
187 ;; Ok we need to guess
|
|
188 (if mule-related
|
|
189 (package-admin-get-install-dir 'mule-base nil nil)
|
|
190 (if (eq package 'xemacs-base)
|
|
191 (car (last late-packages))
|
|
192 (package-admin-get-install-dir 'xemacs-base nil nil)))))))
|
444
|
193
|
428
|
194
|
|
195
|
|
196 (defun package-admin-get-manifest-file (pkg-topdir package)
|
|
197 "Return the name of the MANIFEST file for package PACKAGE.
|
|
198 Note that PACKAGE is a symbol, and not a string."
|
|
199 (let (dir)
|
|
200 (setq dir (expand-file-name "pkginfo" pkg-topdir))
|
|
201 (expand-file-name (concat "MANIFEST." (symbol-name package)) dir)
|
|
202 ))
|
|
203
|
|
204 (defun package-admin-check-manifest (pkg-outbuf pkg-topdir)
|
|
205 "Check for a MANIFEST.<package> file in the package distribution.
|
|
206 If it doesn't exist, create and write one.
|
|
207 PKG-OUTBUF is the buffer that holds the output from `tar', and PKG-TOPDIR
|
|
208 is the top-level directory under which the package was installed."
|
|
209 (let ( (manifest-buf " *pkg-manifest*")
|
|
210 old-case-fold-search regexp package-name pathname regexps)
|
|
211 ;; Save and restore the case-fold-search status.
|
|
212 ;; We do this in case we have to screw with it (as it the case of
|
|
213 ;; case-insensitive filesystems such as MS Windows).
|
|
214 (setq old-case-fold-search case-fold-search)
|
|
215 (unwind-protect
|
|
216 (save-excursion ;; Probably redundant.
|
|
217 (set-buffer (get-buffer pkg-outbuf)) ;; Probably already the
|
|
218 ;; current buffer.
|
|
219 (goto-char (point-min))
|
|
220
|
|
221 ;; Make filenames case-insensitive, if necessary
|
|
222 (if (eq system-type 'windows-nt)
|
|
223 (setq case-fold-search t))
|
|
224
|
|
225 ;; We really should compute the regexp.
|
|
226 ;; However, directory-sep-char is currently broken, but we need
|
|
227 ;; functional code *NOW*.
|
|
228 (setq regexp "\\bpkginfo[\\/]MANIFEST\\...*")
|
|
229
|
|
230 ;; Look for the manifest.
|
|
231 (if (not (re-search-forward regexp nil t))
|
|
232 (progn
|
|
233 ;; We didn't find a manifest. Make one.
|
|
234
|
|
235 ;; Yuk. We weren't passed the package name, and so we have
|
|
236 ;; to dig for it. Look for it as the subdirectory name below
|
|
237 ;; "lisp", "man", "info", or "etc".
|
|
238 ;; Here, we don't use a single regexp because we want to search
|
|
239 ;; the directories for a package name in a particular order.
|
|
240 ;; The problem is that packages could have directories like
|
|
241 ;; "etc/sounds/" or "etc/photos/" and we don't want to get
|
|
242 ;; these confused with the actual package name (although, in
|
|
243 ;; the case of "etc/sounds/", it's probably correct).
|
|
244 (if (catch 'done
|
|
245 (let ( (dirs '("lisp" "info" "man" "etc")) rexp)
|
|
246 (while dirs
|
|
247 (setq rexp (concat "\\b" (car dirs)
|
|
248 "[\\/]\\([^\\/]+\\)[\//]"))
|
|
249 (if (re-search-forward rexp nil t)
|
|
250 (throw 'done t))
|
|
251 (setq dirs (cdr dirs))
|
|
252 )))
|
|
253 (progn
|
|
254 (setq package-name (buffer-substring (match-beginning 1)
|
|
255 (match-end 1)))
|
|
256
|
|
257 ;; Get and erase the manifest buffer
|
|
258 (setq manifest-buf (get-buffer-create manifest-buf))
|
|
259 (buffer-disable-undo manifest-buf)
|
|
260 (erase-buffer manifest-buf)
|
|
261
|
|
262 ;; Now, scan through the output buffer, looking for
|
|
263 ;; file and directory names.
|
|
264 (goto-char (point-min))
|
|
265 ;; for each line ...
|
|
266 (while (< (point) (point-max))
|
|
267 (beginning-of-line)
|
|
268 (setq pathname nil)
|
|
269
|
|
270 ;; scan through the regexps, looking for a pathname
|
|
271 (if (catch 'found-path
|
|
272 (setq regexps package-admin-tar-filename-regexps)
|
|
273 (while regexps
|
|
274 (if (looking-at (car regexps))
|
|
275 (progn
|
|
276 (setq pathname
|
|
277 (buffer-substring
|
|
278 (match-beginning 1)
|
|
279 (match-end 1)))
|
|
280 (throw 'found-path t)
|
|
281 ))
|
|
282 (setq regexps (cdr regexps))
|
|
283 )
|
|
284 )
|
|
285 (progn
|
|
286 ;; found a pathname -- add it to the manifest
|
|
287 ;; buffer
|
|
288 (save-excursion
|
|
289 (set-buffer manifest-buf)
|
|
290 (goto-char (point-max))
|
|
291 (insert pathname "\n")
|
|
292 )
|
|
293 ))
|
|
294 (forward-line 1)
|
|
295 )
|
|
296
|
|
297 ;; Processed all lines.
|
|
298 ;; Now, create the file, pkginfo/MANIFEST.<pkgname>
|
|
299
|
|
300 ;; We use `expand-file-name' instead of `concat',
|
|
301 ;; for portability.
|
|
302 (setq pathname (expand-file-name "pkginfo"
|
|
303 pkg-topdir))
|
|
304 ;; Create pkginfo, if necessary
|
|
305 (if (not (file-directory-p pathname))
|
|
306 (make-directory pathname))
|
444
|
307 (setq pathname (expand-file-name
|
428
|
308 (concat "MANIFEST." package-name)
|
|
309 pathname))
|
|
310 (save-excursion
|
|
311 (set-buffer manifest-buf)
|
|
312 ;; Put the files in sorted order
|
776
|
313 (if-fboundp 'sort-lines
|
|
314 (sort-lines nil (point-min) (point-max))
|
|
315 (error 'unimplemented
|
|
316 "`xemacs-base' not installed?"))
|
428
|
317 ;; Write the file.
|
|
318 ;; Note that using `write-region' *BYPASSES* any check
|
|
319 ;; to see if XEmacs is currently editing/visiting the
|
|
320 ;; file.
|
|
321 (write-region (point-min) (point-max) pathname)
|
|
322 )
|
|
323 (kill-buffer manifest-buf)
|
|
324 )
|
|
325 (progn
|
|
326 ;; We can't determine the package name from an extracted
|
|
327 ;; file in the tar output buffer.
|
|
328 ))
|
|
329 ))
|
|
330 )
|
|
331 ;; Restore old case-fold-search status
|
|
332 (setq case-fold-search old-case-fold-search))
|
|
333 ))
|
|
334
|
|
335 ;;;###autoload
|
|
336 (defun package-admin-add-binary-package (file &optional pkg-dir)
|
|
337 "Install a pre-bytecompiled XEmacs package into package hierarchy."
|
|
338 (interactive "fPackage tarball: ")
|
|
339 (let ((buf (get-buffer-create package-admin-temp-buffer))
|
|
340 (status 1)
|
|
341 start err-list
|
|
342 )
|
|
343 (setq pkg-dir (package-admin-get-install-dir 'unknown pkg-dir))
|
|
344 ;; Ensure that the current directory doesn't change
|
|
345 (save-excursion
|
|
346 (set-buffer buf)
|
|
347 ;; This is not really needed
|
|
348 (setq default-directory (file-name-as-directory pkg-dir))
|
|
349 (setq case-fold-search t)
|
|
350 (buffer-disable-undo)
|
|
351 (goto-char (setq start (point-max)))
|
|
352 (if (= 0 (setq status (funcall package-admin-install-function
|
|
353 file pkg-dir buf)))
|
|
354 (progn
|
|
355 ;; First, check for errors.
|
|
356 ;; We can't necessarily rely upon process error codes.
|
|
357 (catch 'done
|
|
358 (goto-char start)
|
|
359 (setq err-list package-admin-error-messages)
|
|
360 (while err-list
|
|
361 (if (re-search-forward (car err-list) nil t)
|
|
362 (progn
|
|
363 (setq status 1)
|
|
364 (throw 'done nil)
|
|
365 ))
|
|
366 (setq err-list (cdr err-list))
|
|
367 )
|
|
368 )
|
|
369 ;; Make sure that the MANIFEST file exists
|
|
370 (package-admin-check-manifest buf pkg-dir)
|
|
371 ))
|
|
372 )
|
|
373 status
|
|
374 ))
|
|
375
|
|
376 (defun package-admin-rmtree (directory)
|
|
377 "Delete a directory and all of its contents, recursively.
|
|
378 This is a feeble attempt at making a portable rmdir."
|
|
379 (setq directory (file-name-as-directory directory))
|
|
380 (let ((files (directory-files directory nil nil nil t))
|
|
381 (dirs (directory-files directory nil nil nil 'dirs)))
|
|
382 (while dirs
|
|
383 (if (not (member (car dirs) '("." "..")))
|
|
384 (let ((dir (expand-file-name (car dirs) directory)))
|
|
385 (condition-case err
|
|
386 (if (file-symlink-p dir) ;; just in case, handle symlinks
|
|
387 (delete-file dir)
|
|
388 (package-admin-rmtree dir))
|
|
389 (file-error
|
|
390 (message "%s: %s: \"%s\"" (nth 1 err) (nth 2 err) (nth 3 err)))))
|
|
391 (setq dirs (cdr dirs))))
|
|
392 (while files
|
|
393 (condition-case err
|
|
394 (delete-file (expand-file-name (car files) directory))
|
|
395 (file-error
|
|
396 (message "%s: %s: \"%s\"" (nth 1 err) (nth 2 err) (nth 3 err))))
|
|
397 (setq files (cdr files)))
|
|
398 (condition-case err
|
|
399 (delete-directory directory)
|
|
400 (file-error
|
|
401 (message "%s: %s: \"%s\"" (nth 1 err) (nth 2 err) (nth 3 err))))))
|
|
402
|
|
403 (defun package-admin-get-lispdir (pkg-topdir package)
|
|
404 (let (package-lispdir)
|
|
405 (if (and (setq package-lispdir (expand-file-name "lisp" pkg-topdir))
|
|
406 (setq package-lispdir (expand-file-name (symbol-name package)
|
|
407 package-lispdir))
|
|
408 (file-accessible-directory-p package-lispdir))
|
|
409 package-lispdir)
|
|
410 ))
|
|
411
|
|
412 (defun package-admin-delete-binary-package (package pkg-topdir)
|
|
413 "Delete a binary installation of PACKAGE below directory PKG-TOPDIR.
|
|
414 PACKAGE is a symbol, not a string."
|
|
415 (let ( (tmpbuf " *pkg-manifest*") manifest-file package-lispdir dirs file)
|
|
416 (setq pkg-topdir (package-admin-get-install-dir package pkg-topdir))
|
|
417 (setq manifest-file (package-admin-get-manifest-file pkg-topdir package))
|
628
|
418 (run-hook-with-args 'package-delete-hook package pkg-topdir)
|
428
|
419 (if (file-exists-p manifest-file)
|
|
420 (progn
|
|
421 ;; The manifest file exists! Use it to delete the old distribution.
|
|
422 (message "Removing old files for package \"%s\" ..." package)
|
|
423 (sit-for 0)
|
|
424 (setq tmpbuf (get-buffer-create tmpbuf))
|
|
425 (with-current-buffer tmpbuf
|
|
426 (buffer-disable-undo)
|
|
427 (erase-buffer)
|
|
428 (insert-file-contents manifest-file)
|
|
429 (goto-char (point-min))
|
|
430
|
|
431 ;; For each entry in the MANIFEST ...
|
|
432 (while (< (point) (point-max))
|
|
433 (beginning-of-line)
|
|
434 (setq file (expand-file-name (buffer-substring
|
|
435 (point)
|
|
436 (point-at-eol))
|
|
437 pkg-topdir))
|
|
438 (if (file-directory-p file)
|
|
439 ;; Keep a record of each directory
|
|
440 (setq dirs (cons file dirs))
|
|
441 ;; Delete each file.
|
|
442 ;; Make sure that the file is writable.
|
|
443 ;; (This is important under MS Windows.)
|
|
444 ;; I do not know why it important under MS Windows but
|
629
|
445 ;; 1. It bombs out when the file does not exist. This can be condition-cased
|
428
|
446 ;; 2. If I removed the write permissions, I do not want XEmacs to just ignore them.
|
|
447 ;; If it wants to, XEmacs may ask, but that is about all
|
|
448 ;; (set-file-modes file 438) ;; 438 -> #o666
|
|
449 ;; Note, user might have removed the file!
|
|
450 (condition-case ()
|
|
451 (delete-file file)
|
444
|
452 (error nil))) ;; We may want to turn the error into a Warning?
|
428
|
453 (forward-line 1))
|
444
|
454
|
428
|
455 ;; Delete empty directories.
|
|
456 (if dirs
|
|
457 (let ( (orig-default-directory default-directory)
|
442
|
458 ;; directory files file
|
|
459 )
|
428
|
460 ;; Make sure we preserve the existing `default-directory'.
|
|
461 ;; JV, why does this change the default directory? Does it indeed?
|
|
462 (unwind-protect
|
|
463 (progn
|
|
464 ;; Warning: destructive sort!
|
|
465 (setq dirs (nreverse (sort dirs 'string<)))
|
|
466 ; ;; For each directory ...
|
|
467 ; (while dirs
|
|
468 ; (setq directory (file-name-as-directory (car dirs)))
|
|
469 ; (setq files (directory-files directory))
|
|
470 ; ;; Delete the directory if it's empty.
|
|
471 ; (if (catch 'done
|
|
472 ; (while files
|
|
473 ; (setq file (car files))
|
|
474 ; (if (and (not (string= file "."))
|
|
475 ; (not (string= file "..")))
|
|
476 ; (throw 'done nil))
|
|
477 ; (setq files (cdr files))
|
|
478 ; )
|
|
479 ; t)
|
|
480 ; (
|
|
481 ; (delete-directory directory))
|
|
482 ; (setq dirs (cdr dirs))
|
|
483 ; )
|
|
484 ;; JV, On all OS's that I know of delete-directory fails on
|
|
485 ;; on non-empty dirs anyway
|
|
486 (mapc
|
|
487 (lambda (dir)
|
|
488 (condition-case ()
|
|
489 (delete-directory dir)))
|
444
|
490 dirs))
|
428
|
491 (setq default-directory orig-default-directory)
|
|
492 )))
|
|
493 )
|
|
494 (kill-buffer tmpbuf)
|
|
495 ;; Delete the MANIFEST file
|
|
496 ;; (set-file-modes manifest-file 438) ;; 438 -> #o666
|
|
497 ;; Note. Packages can have MANIFEST in MANIFEST.
|
|
498 (condition-case ()
|
|
499 (delete-file manifest-file)
|
|
500 (error nil)) ;; Do warning?
|
|
501 (message "Removing old files for package \"%s\" ... done" package))
|
|
502 ;; The manifest file doesn't exist. Fallback to just deleting the
|
|
503 ;; package-specific lisp directory, if it exists.
|
|
504 ;;
|
|
505 ;; Delete old lisp directory, if any
|
|
506 ;; Gads, this is ugly. However, we're not supposed to use `concat'
|
|
507 ;; in the name of portability.
|
|
508 (when (setq package-lispdir (package-admin-get-lispdir pkg-topdir
|
|
509 package))
|
|
510 (message "Removing old lisp directory \"%s\" ..."
|
|
511 package-lispdir)
|
|
512 (sit-for 0)
|
|
513 (package-admin-rmtree package-lispdir)
|
|
514 (message "Removing old lisp directory \"%s\" ... done"
|
|
515 package-lispdir)
|
444
|
516 ))
|
428
|
517 ;; Delete the package from the database of installed packages.
|
|
518 (package-delete-name package)))
|
|
519
|
|
520 (provide 'package-admin)
|
|
521
|
|
522 ;;; package-admin.el ends here
|