This patch collects all mine and Gregs changes against in one diff
against the latest CVS versions for your convenience. Please give it a
try, the stuff is more or less finished now.
[Steve!] Greg's comments from his patches still apply. Please put a
copy of package-index.LATEST.pgp in the etc/ dir of the distribution.
Make sure it is signed.
[Not Steve!] until Steve does the above "touch
etc/package-index.LATEST.pgp" and do a M-x pui-list-packages RET.
XEmacs will fetch a copy for you and put it in /etc
[Hrvoje] See next items.
[Custom Experts] We still need a nice way to use
package-get-download-sites in the customization of package-get-remote.
Accumulated Changelog:
1998-10-29 Jan Vroonhof <vroonhof(a)math.ethz.ch>
* package-get.el (host-name): New widget type.
(package-get-remote): Better customization using new type.
(package-get-download-sites): idem dito.
(package-get-custom): Do not use package-get-all untill we have
runtime dependencies.
(package-get-remove-copy): Default to 't' we no longer need this
kludge as we do not currently use depenencies.
(package-get-was-current): New variable.
(package-get-require-base): New 'force-current' argument.
(package-get-update-base): idem
(package-get-package-provider): idem
(package-get-locate-index-file): New 'no-remote' argument.
(package-get-locate-file): idem.
(package-get-maybe-save-index): New function.
(package-get-update-base): Use it.
1998-10-28 Greg Klanderman <greg(a)alphatech.com>
* package-get.el (package-get-remote): default to nil; by default,
don't go out to the net via EFS. They must select a download site.
(package-get-download-sites): new variable.
(package-get-download-menu): new function.
(package-get-locate-index-file): new function.
(package-get-update-base): use it.
* menubar-items.el (default-menubar): add "Update Package Index"
and "Add Download Site" menus under Options | Manage Packages.
1998-10-19 Greg Klanderman <greg(a)alphatech.com>
* package-get.el (package-get): bugfix code checking installed version
for case where package is not currently installed.
(package-get-require-signed-base-updates): new variable.
(package-get-update-base-from-buffer): remove REMOTE-SOURCE arg, it was
deemed not a goot thing. Use the variable
package-get-allow-unsigned-base-updates instead.
1998-10-16 Greg Klanderman <greg(a)alphatech.com>
* package-get.el (package-get): Don't install an older version than
we already have unless explicitly told to. Issue a warning.
* package-ui.el (pui-add-required-packages): when adding
dependencies, don't add packages that are up to date.
(pui-package-symbol-char): Don't consider a package out of date
if you have a newer version installed than the latest version in
package-get-base.
* package-get.el (package-get-base-filename): document that it may
be a path relative to package-get-remote; new default value.
(package-get-locate-file): new function.
(package-get-update-base): use it to expand package-get-base-filename.
(package-get-save-base): new function to save the package-get database
to file.
(package-get-update-base-from-buffer): add REMOTE-SOURCE argument.
(package-get-update-base): pass the REMOTE-SOURCE arg.
(package-get-update-base-entry): call package-get-custom-add-entry.
(package-get-file-installed-p): removed; no longer needed.
(package-get-create-custom): ditto.
(toplevel): remove code to build and load package-get-custom.el
(package-get-custom-add-entry): new function.
The patch (+306 lines -130 lines!):
bolzano:/scratch/vroonhof/cvs/xemacs-20> cvs diff lisp/package-get.el
lisp/package-ui.el lisp/menubar-items.el
Index: lisp/package-get.el
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs-20/lisp/package-get.el,v
retrieving revision 1.21
diff -u -r1.21 package-get.el
--- package-get.el 1998/10/16 06:25:25 1.21
+++ package-get.el 1998/10/30 02:30:17
@@ -3,6 +3,8 @@
;; Copyright (C) 1998 by Pete Ware
;; Author: Pete Ware <ware(a)cis.ohio-state.edu>
+;; Heavy-Modifications: Greg Klanderman <greg(a)alphatech.com>
+;; Jan Vroonhof <vroonhof(a)math.ethz.ch>
;; Keywords: internal
;; This file is part of XEmacs.
@@ -29,6 +31,9 @@
;; package-get -
;; Retrieve a package and any other required packages from an archive
;;
+;;
+;; Note (JV): Most of this no longer aplies!
+;;
;; The idea:
;; A new XEmacs lisp-only release is generated with the following steps:
;; 1. The maintainer runs some yet to be written program that
@@ -160,39 +165,123 @@
:type 'directory
:group 'package-get)
-;; JV Any Custom expert know to get "Host" and "Dir" for the remote
option
-(defcustom package-get-remote
- '(("ftp.xemacs.org" "/pub/xemacs/packages"))
+(define-widget 'host-name 'string
+ "A Host name."
+ :tag "Host")
+
+(defcustom package-get-remote nil
"*List of remote sites to contact for downloading packages.
List format is '(site-name directory-on-site). Each site is tried in
order until the package is found. As a special case, `site-name' can be
`nil', in which case `directory-on-site' is treated as a local directory."
:tag "Package repository"
:type '(repeat (choice (list :tag "Local" (const :tag "Local"
nil) directory )
- (list :tag "Remote" string string) ))
+ (list :tag "Remote" host-name directory) ))
:group 'package-get)
-(defcustom package-get-remove-copy nil
+(defcustom package-get-download-sites
+ '(
+ ;; North America
+ ("xemacs.org" "ftp.xemacs.org" "pub/xemacs/packages")
+ ("cso.uiuc.edu" "ftp.cso.uiuc.edu"
"pub/packages/xemacs/packages")
+
+ ;; South America
+ ("unicamp.br" "ftp.unicamp.br" "pub/xemacs/packages")
+
+ ;; Europe
+ ("sunsite.cnlab-switch.ch" "sunsite.cnlab-switch.ch"
"mirror/xemacs/packages")
+ ("tu-darmstadt.de" "ftp.tu-darmstadt.de"
"pub/editors/xemacs/packages")
+ ("sunsite.auc.dk" "sunsite.auc.dk"
"pub/emacs/xemacs/packages")
+ ("pasteur.fr" "ftp.pasteur.fr"
"pub/computing/xemacs/packages")
+ ("cenatls.cena.dgac.fr" "ftp.cenatls.cena.dgac.fr"
"pub/Emacs/xemacs/packages")
+ ("kfki.hu" "ftp.kfki.hu"
"pub/packages/xemacs/packages")
+ ("uniroma2.it" "ftp.uniroma2.it"
"unix/misc/dist/XEMACS/packages")
+ ("icm.edu.pl" "ftp.icm.edu.pl"
"pub/unix/editors/xemacs/packages")
+ ("sunet.se" "ftp.sunet.se" "pub/gnu/xemacs/packages")
+ ("doc.ic.ac.uk" "ftp.doc.ic.ac.uk"
"packages/xemacs/packages")
+ ("srcc.msu.su" "ftp1.srcc.msu.su"
"mirror/ftp.xemacs.org/packages")
+
+ ;; Asia
+ ("usyd.edu.au" "ftp.usyd.edu.au"
"pub/Xemacs/packages")
+ ("netlab.is.tsukuba.ac.jp" "ftp.netlab.is.tsukuba.ac.jp"
"pub/GNU/xemacs/packages")
+ ("jaist.ac.jp" "ftp.jaist.ac.jp"
"pub/GNU/xemacs/packages")
+ ("ring.aist.go.jp" "ring.aist.go.jp"
"pub/text/xemacs/packages")
+ ("ring.asahi-net.or.jp" "ring.asahi-net.or.jp"
"pub/text/xemacs/packages")
+ ("SunSITE.sut.ac.jp" "SunSITE.sut.ac.jp"
"pub/archives/packages/xemacs/packages")
+ ("dti.ad.jp" "ftp.dti.ad.jp"
"pub/unix/editor/xemacs/packages")
+ ("kreonet.re.kr" "ftp.kreonet.re.kr"
"pub/tools/emacs/xemacs/packages")
+ )
+ "*List of remote sites available for downloading packages.
+List format is '(site-description site-name directory-on-site).
+SITE-DESCRIPTION is a textual description of the site. SITE-NAME
+is the internet address of the download site. DIRECTORY-ON-SITE
+is the directory on the site in which packages may be found.
+This variable is used to initialize `package-get-remote', the
+variable actually used to specify package download sites."
+ :tag "Package download sites"
+ :type '(repeat (list hostname directory))
+ :group 'package-get)
+
+(defcustom package-get-remove-copy t
"*After copying and installing a package, if this is T, then remove the
copy. Otherwise, keep it around."
:type 'boolean
:group 'package-get)
-(defcustom package-get-base-filename
- "/ftp.xemacs.org:/pub/xemacs/packages/package-index.LATEST"
- "*Name of the default package database file, usually on ftp.xemacs.org."
+;; #### it may make sense for this to be a list of names.
+;; #### also, should we rename "*base*" to "*index*" or
"*db*"?
+;; "base" is a pretty poor name.
+(defcustom package-get-base-filename "package-index.LATEST.pgp"
+ "*Name of the default package-get database file.
+This may either be a relative path, in which case it is interpreted
+with respect to `package-get-remote', or an absolute path."
:type 'file
:group 'package-get)
+(defcustom package-get-always-update nil
+ "*If Non-nil always make sure we are using the latest package index (base).
+Otherwise respect the `force-current' argument of
`package-get-require-base'."
+ :type 'boolean
+ :group 'package-get)
+
+(defcustom package-get-require-signed-base-updates t
+ "*If set to a non-nil value, require explicit user confirmation for updates
+to the package-get database which cannot have their signature verified via PGP.
+When nil, updates which are not PGP signed are allowed without confirmation."
+ :type 'boolean
+ :group 'package-get)
+
+(defvar package-get-was-current nil
+ "Non-nil we did our best to fetch a current database.")
+
;;;###autoload
-(defun package-get-require-base ()
- "Require that a package-get database has been loaded."
- (when (or (not (boundp 'package-get-base))
- (not package-get-base))
- (package-get-update-base))
- (when (or (not (boundp 'package-get-base))
- (not package-get-base))
- (error "Package-get database not loaded")))
+(defun package-get-download-menu ()
+ "Build the `Add Download Site' menu."
+ (mapcar (lambda (site)
+ (vector (car site)
+ `(push (quote ,(cdr site))
+ package-get-remote)))
+ package-get-download-sites))
+
+;;;###autoload
+(defun package-get-require-base (&optional force-current)
+ "Require that a package-get database has been loaded.
+If the optional FORCE-CURRENT argument or the value of
+`package-get-always-update' is Non-nil, try to update the database
+from a location in `package-get-remote'. Otherwise a local copy is used
+if available and remote access is never done.
+
+Please use FORCE-CURRENT only when the user is explictly dealing with packages
+and remote access is likely in the near future."
+ (setq force-current (or force-current package-get-always-update))
+ (unless (and (boundp 'package-get-base)
+ package-get-base
+ (or (not force-current) package-get-was-current))
+ (package-get-update-base nil force-current))
+ (if (or (not (boundp 'package-get-base))
+ (not package-get-base))
+ (error "Package-get database not loaded")
+ (setq package-get-was-current force-current)))
(defconst package-get-pgp-signed-begin-line "^-----BEGIN PGP SIGNED
MESSAGE-----"
"Text for start of PGP signed messages.")
@@ -204,21 +293,72 @@
;;;###autoload
(defun package-get-update-base-entry (entry)
"Update an entry in `package-get-base'."
- (let ((existing (assoc (car entry) package-get-base)))
+ (let ((existing (assq (car entry) package-get-base)))
(if existing
(setcdr existing (cdr entry))
- (setq package-get-base (cons entry package-get-base)))))
+ (setq package-get-base (cons entry package-get-base))
+ (package-get-custom-add-entry (car entry) (car (cdr entry))))))
+
+(defun package-get-locate-file (file &optional nil-if-not-found no-remote)
+ "Locate an existing FILE with respect to `package-get-remote'.
+If FILE is an absolute path or is not found, simply return FILE.
+If optional argument NIL-IF-NOT-FOUND is non-nil, return nil
+if FILE can not be located.
+If NO-REMOTE is non-nil never search remote locations."
+ (if (file-name-absolute-p file)
+ file
+ (let ((entries package-get-remote)
+ (expanded nil))
+ (while entries
+ (unless (and no-remote (caar entries))
+ (let ((expn (package-get-remote-filename (car entries) file)))
+ (if (and expn (file-exists-p expn))
+ (setq entries nil
+ expanded expn))))
+ (setq entries (cdr entries)))
+ (or expanded
+ (and (not nil-if-not-found)
+ file)))))
+
+(defun package-get-locate-index-file (no-remote)
+ "Locate the package-get index file. Do not return remote paths if NO-REMOTE
+is non-nil."
+ (or (package-get-locate-file package-get-base-filename t no-remote)
+ (locate-data-file package-get-base-filename)
+ package-get-base-filename))
+
+(defvar package-get-user-package-location user-init-directory)
+
+(defun package-get-maybe-save-index (filename)
+ "Offer to save the current buffer as the local package index file,
+if different."
+ (let ((location (package-get-locate-index-file t)))
+ (unless (and filename (equal filename location))
+ (unless (equal (md5 (current-buffer))
+ (with-temp-buffer
+ (insert-file-contents location)
+ (md5 (current-buffer))))
+ (unless (file-writable-p location)
+ (setq location (expand-file-name package-get-base-filename
+ (expand-file-name "etc/" package-get-user-package-location))))
+ (when (y-or-n-p (concat "Update package index in" location "? "))
+ (write-file location))))))
+
;;;###autoload
-(defun package-get-update-base (&optional db-file)
- "Update the package-get database file with entries from DB-FILE."
- (interactive (list
- (read-file-name "Load package-get database: "
- (file-name-directory package-get-base-filename)
- package-get-base-filename
- t
- (file-name-nondirectory package-get-base-filename))))
- (setq db-file (expand-file-name (or db-file package-get-base-filename)))
+(defun package-get-update-base (&optional db-file force-current)
+ "Update the package-get database file with entries from DB-FILE.
+Unless FORCE-CURRENT is non-nil never try to update the database."
+ (interactive
+ (let ((dflt (package-get-locate-index-file nil)))
+ (list (read-file-name "Load package-get database: "
+ (file-name-directory dflt)
+ dflt
+ t
+ (file-name-nondirectory dflt)))))
+ (setq db-file (expand-file-name (or db-file
+ (package-get-locate-index-file
+ (not force-current)))))
(if (not (file-exists-p db-file))
(error "Package-get database file `%s' does not exist" db-file))
(if (not (file-readable-p db-file))
@@ -229,7 +369,9 @@
(set-buffer buf)
(erase-buffer buf)
(insert-file-contents-internal db-file)
- (package-get-update-base-from-buffer buf))
+ (package-get-update-base-from-buffer buf)
+ (if (file-remote-p db-file)
+ (package-get-maybe-save-index db-file)))
(kill-buffer buf))))
;;;###autoload
@@ -253,7 +395,8 @@
(when (re-search-forward package-get-pgp-signature-end-line nil t)
(setq end (point)))
(if (not (and content-beg content-end beg end))
- (or (yes-or-no-p "Package-get entries not PGP signed, continue? ")
+ (or (not package-get-require-signed-base-updates)
+ (yes-or-no-p "Package-get entries not PGP signed, continue? ")
(error "Package-get database not updated")))
(if (and content-beg content-end beg end)
(if (not (condition-case nil
@@ -261,7 +404,8 @@
(load-library "mc-pgp")
(fboundp 'mc-pgp-verify-region))
(error nil)))
- (or (yes-or-no-p
+ (or (not package-get-require-signed-base-updates)
+ (yes-or-no-p
"No mailcrypt; can't verify package-get DB signature,
continue? ")
(error "Package-get database not updated"))))
(if (and beg end
@@ -271,10 +415,13 @@
(mc-pgp-verify-region beg end)
(file-error
(and (string-match "No such file" (nth 2 err))
- (yes-or-no-p
- "Can't find PGP, continue without package-get DB
verification? ")))
+ (or (not package-get-require-signed-base-updates)
+ (yes-or-no-p
+ (concat "Can't find PGP, continue without
"
+ "package-get DB verification? ")))))
(t nil)))))
(error "Package-get PGP signature failed to verify"))
+ ;; ToDo: We shoud call package-get-maybe-save-index on the region
(package-get-update-base-entries content-beg content-end)
(message "Updated package-get database"))))
@@ -299,12 +446,45 @@
(setq count (1+ count))))
(message "Got %d package-get database entries" count))))
+;;;###autoload
+(defun package-get-save-base (file)
+ "Write the package-get database to FILE.
+
+Note: This database will be unsigned of course."
+ (interactive "FSave package-get database to: ")
+ (package-get-require-base t)
+ (let ((buf (get-buffer-create "*package database*")))
+ (unwind-protect
+ (save-excursion
+ (set-buffer buf)
+ (erase-buffer buf)
+ (goto-char (point-min))
+ (let ((entries package-get-base) entry plist)
+ (insert ";; Package Index file -- Do not edit manually.\n")
+ (insert ";;;@@@\n")
+ (while entries
+ (setq entry (car entries))
+ (setq plist (car (cdr entry)))
+ (insert "(package-get-update-base-entry (quote\n")
+ (insert (format "(%s\n" (symbol-name (car entry))))
+ (while plist
+ (insert (format " %s%s %S\n"
+ (if (eq plist (car (cdr entry))) "(" "
")
+ (symbol-name (car plist))
+ (car (cdr plist))))
+ (setq plist (cdr (cdr plist))))
+ (insert "))\n))\n;;;@@@\n")
+ (setq entries (cdr entries))))
+ (insert ";; Package Index file ends here\n")
+ (write-region (point-min) (point-max) file))
+ (kill-buffer buf))))
+
(defun package-get-interactive-package-query (get-version package-symbol)
"Perform interactive querying for package and optional version.
Query for a version if GET-VERSION is non-nil. Return package name as
a symbol instead of a string if PACKAGE-SYMBOL is non-nil.
The return value is suitable for direct passing to `interactive'."
- (package-get-require-base)
+ (package-get-require-base t)
(let ( (table (mapcar '(lambda (item)
(let ( (name (symbol-name (car item))) )
(cons name name)
@@ -347,7 +527,7 @@
(defun package-get-update-all ()
"Fetch and install the latest versions of all currently installed packages."
(interactive)
- (package-get-require-base)
+ (package-get-require-base t)
;; Load a fresh copy
(catch 'exit
(mapcar (lambda (pkg)
@@ -392,7 +572,7 @@
(while this-requires
(if (not (member (car this-requires) fetched-packages))
(let* ((reqd-package (package-get-package-provider
- (car this-requires)))
+ (car this-requires) t))
(reqd-version (cadr reqd-package))
(reqd-name (car reqd-package)))
(if (null reqd-name)
@@ -415,7 +595,7 @@
Uses `package-get-base' to determine just what is required and what
package provides that functionality. Returns the list of packages
required by PACKAGES."
- (package-get-require-base)
+ (package-get-require-base t)
(let ((orig-packages packages)
dependencies provided)
(while packages
@@ -509,10 +689,13 @@
successfully installed but errors occurred during initialization, or
`nil' upon error."
(interactive (package-get-interactive-package-query nil t))
+ (catch 'skip-update
(let* ((this-package
(package-get-info-version
(package-get-info-find-package package-get-base
package) version))
+ (latest (package-get-info-prop this-package 'version))
+ (installed (package-get-key package :version))
(this-requires (package-get-info-prop this-package 'requires))
(found nil)
(search-dirs package-get-remote)
@@ -529,6 +712,22 @@
(package-admin-get-install-dir package install-dir
(or (eq package 'mule-base) (memq 'mule-base this-requires))))
+ ;; If they asked for the latest using version=nil, don't get an older
+ ;; version than we already have.
+ (if installed
+ (if (> (if (stringp installed)
+ (string-to-number installed)
+ installed)
+ (if (stringp latest)
+ (string-to-number latest)
+ latest))
+ (if (not (null version))
+ (warn "Installing %s package version %s, you had a newer version
%s"
+ package latest installed)
+ (warn "Skipping %s package, you have a newer version %s"
+ package installed)
+ (throw 'skip-update t))))
+
;; Contrive a list of possible package filenames.
;; Ugly. Is there a better way to do this?
(setq filenames (cons base-filename nil))
@@ -537,7 +736,7 @@
(list (concat (match-string 1 base-filename)
".tgz")))))
- (setq version (package-get-info-prop this-package 'version))
+ (setq version latest)
(unless (and (eq conflict 'never)
(package-get-installedp package version))
;; Find the package from the search list in package-get-remote
@@ -657,7 +856,7 @@
(if (and found package-get-remove-copy)
(delete-file full-package-filename))
package-status
- ))
+ )))
(defun package-get-info-find-package (which name)
"Look in WHICH for the package called NAME and return all the info
@@ -758,13 +957,16 @@
(if (floatp version) version (string-to-number version))))
;;;###autoload
-(defun package-get-package-provider (sym)
+(defun package-get-package-provider (sym &optional force-current)
"Search for a package that provides SYM and return the name and
version. Searches in `package-get-base' for SYM. If SYM is a
consp, then it must match a corresponding (provide (SYM VERSION)) from
- the package."
+ the package.
+
+If FORCE-CURRENT is non-nil make sure the database is up to date. This might
+lead to Emacs accessing remote sites."
(interactive "SSymbol: ")
- (package-get-require-base)
+ (package-get-require-base force-current)
(let ((packages package-get-base)
(done nil)
(found nil))
@@ -774,12 +976,14 @@
(while (and (not done) this-package)
(if (or (eq this-name sym)
(eq (cons this-name
- (package-get-info-prop (car this-package) 'version))
+ (package-get-info-prop (car this-package) 'version))
sym)
- (member sym (package-get-info-prop (car this-package) 'provides)))
+ (member sym
+ (package-get-info-prop (car this-package) 'provides)))
(progn (setq done t)
- (setq found (list (caar packages)
- (package-get-info-prop (car this-package) 'version))))
+ (setq found
+ (list (caar packages)
+ (package-get-info-prop (car this-package) 'version))))
(setq this-package (cdr this-package)))))
(setq packages (cdr packages)))
found))
@@ -796,12 +1000,12 @@
(defun package-get-custom ()
"Fetch and install the latest versions of all customized packages."
(interactive)
- (package-get-require-base)
+ (package-get-require-base t)
;; Load a fresh copy
(load "package-get-custom.el")
(mapcar (lambda (pkg)
(if (eval (intern (concat (symbol-name (car pkg)) "-package")))
- (package-get-all (car pkg) nil))
+ (package-get (car pkg) nil))
t)
package-get-base))
@@ -814,83 +1018,26 @@
(intern (substring (symbol-name pkg) 0 (match-beginning 0))))
t)))
-(defun package-get-file-installed-p (file &optional paths)
- "Return absolute-path of FILE if FILE exists in PATHS.
-If PATHS is omitted, `load-path' is used."
- (if (null paths)
- (setq paths load-path)
- )
- (catch 'tag
- (let (path)
- (while paths
- (setq path (expand-file-name file (car paths)))
- (if (file-exists-p path)
- (throw 'tag path)
- )
- (setq paths (cdr paths))
- ))))
+(defvar package-get-custom-groups nil
+ "List of package-get-custom groups")
-(defun package-get-create-custom ()
- "Creates a package customization file package-get-custom.el.
-Entries in the customization file are retrieved from package-get-base.el."
- (interactive)
- ;; Load a fresh copy
- (let ((custom-buffer (find-file-noselect
- (or (package-get-file-installed-p
- "package-get-custom.el")
- (expand-file-name
- "package-get-custom.el"
- (file-name-directory
- (package-get-file-installed-p
- "package-get-base.el"))
- ))))
- (pkg-groups nil))
-
- ;; clear existing stuff
- (delete-region (point-min custom-buffer)
- (point-max custom-buffer) custom-buffer)
- (insert-string "(require 'package-get)\n" custom-buffer)
+(defun package-get-custom-add-entry (package props)
+ (let* ((category (plist-get props 'category))
+ (group (intern (concat category "-packages")))
+ (custom-var (intern (concat (symbol-name package) "-package")))
+ (description (plist-get props 'description)))
+ (when (not (memq group package-get-custom-groups))
+ (setq package-get-custom-groups (cons package
+ package-get-custom-groups))
+ (eval `(defgroup ,group nil
+ ,(concat category " package group")
+ :group 'packages)))
+ (eval `(defcustom ,custom-var nil
+ ,description
+ :group ',group
+ :initialize 'package-get-ever-installed-p
+ :type 'boolean))))
- (mapcar (lambda (pkg)
- (let ((category (plist-get (car (cdr pkg)) 'category)))
- (or (memq (intern category) pkg-groups)
- (progn
- (setq pkg-groups (cons (intern category) pkg-groups))
- (insert-string
- (concat "(defgroup " category "-packages nil\n"
- " \"" category " package group\"\n"
- " :group 'packages)\n\n") custom-buffer)))
-
- (insert-string
- (concat "(defcustom " (symbol-name (car pkg))
- "-package nil \n"
- " \"" (plist-get (car (cdr pkg)) 'description)
"\"\n"
- " :group '" category "-packages\n"
- " :initialize 'package-get-ever-installed-p\n"
- " :type 'boolean)\n\n") custom-buffer)))
- package-get-base) custom-buffer)
- )
-;; need this first to avoid infinite dependency loops
(provide 'package-get)
-
-;; potentially update the custom dependencies every time we load this
-(when nil ;; #### disable for now... -gk
-(unless noninteractive
-(let ((custom-file (package-get-file-installed-p "package-get-custom.el"))
- (package-file (package-get-file-installed-p "package-get-base.el")))
- ;; update custom file if it doesn't exist
- (if (or (not custom-file)
- (and (< (car (nth 5 (file-attributes custom-file)))
- (car (nth 5 (file-attributes package-file))))
- (< (car (nth 5 (file-attributes custom-file)))
- (car (nth 5 (file-attributes package-file))))))
- (save-excursion
- (message "generating package customizations...")
- (set-buffer (package-get-create-custom))
- (save-buffer)
- (message "generating package customizations...done")))
- (load "package-get-custom.el")))
-)
-
;;; package-get.el ends here
Index: lisp/package-ui.el
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs-20/lisp/package-ui.el,v
retrieving revision 1.6
diff -u -r1.6 package-ui.el
--- package-ui.el 1998/10/15 22:29:06 1.6
+++ package-ui.el 1998/10/30 02:30:17
@@ -213,9 +213,15 @@
(defun pui-package-symbol-char (pkg-sym version)
(progn
(if (package-get-info-find-package packages-package-list pkg-sym)
- (if (package-get-installedp pkg-sym version)
- (list " " pui-up-to-date-package-face)
- (list "*" pui-outdated-package-face))
+ (let ((installed (package-get-key pkg-sym :version)))
+ (if (>= (if (stringp installed)
+ (string-to-number installed)
+ installed)
+ (if (stringp version)
+ (string-to-number version)
+ version))
+ (list " " pui-up-to-date-package-face)
+ (list "*" pui-outdated-package-face)))
(list "-" pui-uninstalled-package-face))
))
@@ -353,7 +359,26 @@
(interactive)
(let ((tmpbuf "*Required-Packages*") do-select)
(if pui-selected-packages
- (let ((dependencies (package-get-dependencies pui-selected-packages)))
+ (let ((dependencies
+ (delq nil (mapcar
+ (lambda (pkg)
+ (let ((installed
+ (package-get-key pkg :version))
+ (current
+ (package-get-info-prop
+ (package-get-info-version
+ (package-get-info-find-package
+ package-get-base pkg) nil)
+ 'version)))
+ (if (< (if (stringp installed)
+ (string-to-number installed)
+ installed)
+ (if (stringp current)
+ (string-to-number current)
+ current))
+ pkg
+ nil)))
+ (package-get-dependencies pui-selected-packages)))))
;; Don't change window config when asking the user if he really
;; wants to add the packages. We do this to avoid messing up
;; the window configuration if errors occur (we don't want to
@@ -471,7 +496,7 @@
which are out-of-date (a newer version is available). The user can then
select packages for installation via the keyboard or mouse."
(interactive)
- (package-get-require-base)
+ (package-get-require-base t)
(let ( (outbuf (get-buffer-create pui-info-buffer))
(sep-string
"===============================================================================\n")
start )
Index: lisp/menubar-items.el
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs-20/lisp/menubar-items.el,v
retrieving revision 1.9
diff -u -r1.9 menubar-items.el
--- menubar-items.el 1998/10/13 07:36:45 1.9
+++ menubar-items.el 1998/10/30 02:30:17
@@ -234,6 +234,10 @@
["Browse..." customize-browse])
("Manage Packages"
+ ("Add Download Site"
+ :filter (lambda (&rest junk)
+ (package-get-download-menu)))
+ ["Update Package Index" package-get-update-base]
["List & Install" pui-list-packages]
("Using Custom"
("Select" :filter (lambda (&rest junk)