;; Copyright (C) 1997 by Free Software Foundation, Inc.
-;; Author: SL Baur <steve@altair.xemacs.org>
+;; Author: SL Baur <steve@xemacs.org>
;; Keywords: internal
;; This file is part of XEmacs.
(defvar package-admin-temp-buffer "*Package Output*"
"Temporary buffer where output of backend commands is saved.")
-(defvar package-admin-install-function 'package-admin-default-install-function
+(defvar package-admin-install-function (if (eq system-type 'windows-nt)
+ 'package-admin-install-function-mswindows
+ 'package-admin-default-install-function)
"The function to call to install a package.
-Three args are passed: FILENAME PKG-DIR BUF
+Three args are passed: FILENAME PKG-DIR BUFFER
Install package FILENAME into directory PKG-DIR, with any messages output
-to buffer BUF.")
+to buffer BUFFER.")
(defvar package-admin-error-messages '(
"No space left on device"
;; rest of command line follows
package-admin-xemacs file destination)))
-(defun package-admin-install-function-mswindows (file pkg-dir buf)
- "Install function for mswindows"
- (let ( (default-directory pkg-dir) )
- (call-process "djtar" nil buf t "-x" file)
- ))
+(defun package-admin-install-function-mswindows (file pkg-dir buffer)
+ "Install function for mswindows."
+ (let ((default-directory (file-name-as-directory pkg-dir)))
+ (unless (file-directory-p default-directory)
+ (make-directory default-directory t))
+ (call-process "minitar" nil buffer t file)))
-(defun package-admin-default-install-function (file pkg-dir buf)
+(defun package-admin-default-install-function (filename pkg-dir buffer)
"Default function to install a package.
Install package FILENAME into directory PKG-DIR, with any messages output
-to buffer BUF."
- (let (filename)
- (setq filename (expand-file-name file pkg-dir))
+to BUFFER."
+ (let* ((pkg-dir (file-name-as-directory pkg-dir))
+ (default-directory pkg-dir)
+ (filename (expand-file-name filename)))
+ (unless (file-directory-p pkg-dir)
+ (make-directory pkg-dir t))
;; Don't assume GNU tar.
- (if (shell-command (concat "gunzip -c " filename " | tar xvf -") buf)
+ (if (shell-command (concat "gunzip -c " filename " | tar xvf -") buffer)
0
1)
))
; (call-process "add-big-package.sh"
; nil
-; buf
+; buffer
; t
; ;; rest of command line follows
; package-admin-xemacs file pkg-dir))
(featurep package-feature)
(setq autoload-dir (feature-file package-feature))
(setq autoload-dir (file-name-directory autoload-dir))
- (member autoload-dir late-package-load-path))
- ;; Find the corresonding entry in late-package
+ (member autoload-dir (append early-package-load-path late-package-load-path)))
+ ;; Find the corresponding entry in late-package
(setq pkg-dir
(car-safe (member-if (lambda (h)
(string-match (concat "^" (regexp-quote h))
autoload-dir))
- late-packages))))
+ (append (cdr early-packages) late-packages)))))
(if pkg-dir
pkg-dir
;; Ok we need to guess
(if mule-related
(package-admin-get-install-dir 'mule-base nil nil)
- (car (last late-packages)))))))
-
+ (if (eq package 'xemacs-base)
+ (car (last late-packages))
+ (package-admin-get-install-dir 'xemacs-base nil nil)))))))
+
(defun package-admin-get-manifest-file (pkg-topdir package)
;; Create pkginfo, if necessary
(if (not (file-directory-p pathname))
(make-directory pathname))
- (setq pathname (expand-file-name
+ (setq pathname (expand-file-name
(concat "MANIFEST." package-name)
pathname))
(save-excursion
start err-list
)
(setq pkg-dir (package-admin-get-install-dir 'unknown pkg-dir))
- ;; Insure that the current directory doesn't change
+ ;; Ensure that the current directory doesn't change
(save-excursion
(set-buffer buf)
- (setq default-directory pkg-dir)
+ ;; This is not really needed
+ (setq default-directory (file-name-as-directory pkg-dir))
(setq case-fold-search t)
(buffer-disable-undo)
(goto-char (setq start (point-max)))
;; Note, user might have removed the file!
(condition-case ()
(delete-file file)
- (error nil))) ;; We may want to turn the error into a Warning?
+ (error nil))) ;; We may want to turn the error into a Warning?
(forward-line 1))
-
+
;; Delete empty directories.
(if dirs
(let ( (orig-default-directory default-directory)
-; directory files file
+ ;; directory files file
)
;; Make sure we preserve the existing `default-directory'.
;; JV, why does this change the default directory? Does it indeed?
(lambda (dir)
(condition-case ()
(delete-directory dir)))
- dirs))
+ dirs))
(setq default-directory orig-default-directory)
)))
)
(package-admin-rmtree package-lispdir)
(message "Removing old lisp directory \"%s\" ... done"
package-lispdir)
- ))
+ ))
;; Delete the package from the database of installed packages.
(package-delete-name package)))