# HG changeset patch # User youngs # Date 995100137 0 # Node ID e545f3ec233754e4ef815679345ef74ff2a99879 # Parent a813963500d8ad828e88f32631783a4d74bf542e [xemacs-hg @ 2001-07-14 08:42:16 by youngs] 2001-07-14 Sean MacLennan * 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. diff -r a813963500d8 -r e545f3ec2337 lisp/ChangeLog --- a/lisp/ChangeLog Thu Jul 12 06:29:10 2001 +0000 +++ b/lisp/ChangeLog Sat Jul 14 08:42:17 2001 +0000 @@ -1,3 +1,11 @@ +2001-07-14 Sean MacLennan + + * 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. + 2001-06-26 Robert Pluim * packages.el (locate-library): change to use read-library-name so diff -r a813963500d8 -r e545f3ec2337 lisp/package-admin.el --- a/lisp/package-admin.el Thu Jul 12 06:29:10 2001 +0000 +++ b/lisp/package-admin.el Sat Jul 14 08:42:17 2001 +0000 @@ -104,6 +104,16 @@ unfortunately, contain spaces, so be careful in constructing any regexps.") +(defvar package-install-hook nil + "*List of hook functions to be called when a new package is successfully +installed. The hook function is passed two arguments: the package name, and +the install directory.") + +(defvar package-delete-hook nil + "*List of hook functions to be called when a package is deleted. The +hook is called *before* the package is deleted. The hook function is passed +two arguments: the package name, and the install directory.") + ;;;###autoload (defun package-admin-add-single-file-package (file destdir &optional pkg-dir) "Install a single file Lisp package into XEmacs package hierarchy. @@ -402,6 +412,7 @@ (let ( (tmpbuf " *pkg-manifest*") manifest-file package-lispdir dirs file) (setq pkg-topdir (package-admin-get-install-dir package pkg-topdir)) (setq manifest-file (package-admin-get-manifest-file pkg-topdir package)) + (run-hook-with-args 'package-delete-hook package pkg-topdir) (if (file-exists-p manifest-file) (progn ;; The manifest file exists! Use it to delete the old distribution. diff -r a813963500d8 -r e545f3ec2337 lisp/package-get.el --- a/lisp/package-get.el Thu Jul 12 06:29:10 2001 +0000 +++ b/lisp/package-get.el Sat Jul 14 08:42:17 2001 +0000 @@ -865,6 +865,7 @@ (if (package-get-init-package (package-admin-get-lispdir install-dir package)) (progn + (run-hook-with-args 'package-install-hook package install-dir) (message "Added package `%s'" package) (sit-for 0) )