comparison lisp/package-admin.el @ 628:e545f3ec2337

[xemacs-hg @ 2001-07-14 08:42:16 by youngs] 2001-07-14 Sean MacLennan <seanm@storm.ca> * package-admin.el (package-install-hook): New. (package-delete-hook): New. (package-admin-add-single-file-package): Use package-delete-hook. * package-get.el (package-get): Use package-install-hook.
author youngs
date Sat, 14 Jul 2001 08:42:17 +0000
parents 3078fd1074e8
children a6c89d799f00
comparison
equal deleted inserted replaced
627:a813963500d8 628:e545f3ec2337
101 Note that \"\\(\" and \"\\)\" must be used to delimit the pathname (as 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 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, 103 is already implicit, as `looking-at' is used. Filenames can,
104 unfortunately, contain spaces, so be careful in constructing any 104 unfortunately, contain spaces, so be careful in constructing any
105 regexps.") 105 regexps.")
106
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.")
106 116
107 ;;;###autoload 117 ;;;###autoload
108 (defun package-admin-add-single-file-package (file destdir &optional pkg-dir) 118 (defun package-admin-add-single-file-package (file destdir &optional pkg-dir)
109 "Install a single file Lisp package into XEmacs package hierarchy. 119 "Install a single file Lisp package into XEmacs package hierarchy.
110 `file' should be the full path to the lisp file to install. 120 `file' should be the full path to the lisp file to install.
400 "Delete a binary installation of PACKAGE below directory PKG-TOPDIR. 410 "Delete a binary installation of PACKAGE below directory PKG-TOPDIR.
401 PACKAGE is a symbol, not a string." 411 PACKAGE is a symbol, not a string."
402 (let ( (tmpbuf " *pkg-manifest*") manifest-file package-lispdir dirs file) 412 (let ( (tmpbuf " *pkg-manifest*") manifest-file package-lispdir dirs file)
403 (setq pkg-topdir (package-admin-get-install-dir package pkg-topdir)) 413 (setq pkg-topdir (package-admin-get-install-dir package pkg-topdir))
404 (setq manifest-file (package-admin-get-manifest-file pkg-topdir package)) 414 (setq manifest-file (package-admin-get-manifest-file pkg-topdir package))
415 (run-hook-with-args 'package-delete-hook package pkg-topdir)
405 (if (file-exists-p manifest-file) 416 (if (file-exists-p manifest-file)
406 (progn 417 (progn
407 ;; The manifest file exists! Use it to delete the old distribution. 418 ;; The manifest file exists! Use it to delete the old distribution.
408 (message "Removing old files for package \"%s\" ..." package) 419 (message "Removing old files for package \"%s\" ..." package)
409 (sit-for 0) 420 (sit-for 0)