428
|
1 ;;; package-get.el --- Retrieve XEmacs package
|
|
2
|
|
3 ;; Copyright (C) 1998 by Pete Ware
|
793
|
4 ;; Copyright (C) 2002 Ben Wing.
|
1410
|
5 ;; Copyright (C) 2003, Steve Youngs
|
428
|
6
|
|
7 ;; Author: Pete Ware <ware@cis.ohio-state.edu>
|
|
8 ;; Heavy-Modifications: Greg Klanderman <greg@alphatech.com>
|
|
9 ;; Jan Vroonhof <vroonhof@math.ethz.ch>
|
1410
|
10 ;; Steve Youngs <youngs@xemacs.org>
|
428
|
11 ;; Keywords: internal
|
|
12
|
|
13 ;; This file is part of XEmacs.
|
|
14
|
|
15 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
16 ;; under the terms of the GNU General Public License as published by
|
|
17 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
18 ;; any later version.
|
|
19
|
|
20 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
21 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
23 ;; General Public License for more details.
|
|
24
|
|
25 ;; You should have received a copy of the GNU General Public License
|
|
26 ;; along with XEmacs; see the file COPYING. If not, write to the Free
|
|
27 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
28 ;; 02111-1307, USA.
|
|
29
|
|
30 ;;; Synched up with: Not in FSF
|
|
31
|
|
32 ;;; Commentary:
|
|
33
|
|
34 ;; package-get -
|
|
35 ;; Retrieve a package and any other required packages from an archive
|
|
36 ;;
|
|
37 ;;
|
440
|
38 ;; Note (JV): Most of this no longer applies!
|
428
|
39 ;;
|
|
40 ;; The idea:
|
|
41 ;; A new XEmacs lisp-only release is generated with the following steps:
|
|
42 ;; 1. The maintainer runs some yet to be written program that
|
|
43 ;; generates all the dependency information. This should
|
|
44 ;; determine all the require and provide statements and associate
|
|
45 ;; them with a package.
|
|
46 ;; 2. All the packages are then bundled into their own tar balls
|
|
47 ;; (or whatever format)
|
|
48 ;; 3. Maintainer automatically generates a new `package-get-base'
|
|
49 ;; data structure which contains information such as the
|
|
50 ;; package name, the file to be retrieved, an md5 checksum,
|
|
51 ;; etc (see `package-get-base').
|
|
52 ;; 4. The maintainer posts an announcement with the new version
|
|
53 ;; of `package-get-base'.
|
|
54 ;; 5. A user/system manager saves this posting and runs
|
|
55 ;; `package-get-update' which uses the previously saved list
|
|
56 ;; of packages, `package-get-here' that the user/site
|
|
57 ;; wants to determine what new versions to download and
|
|
58 ;; install.
|
|
59 ;;
|
|
60 ;; A user/site manager can generate a new `package-get-here' structure
|
|
61 ;; by using `package-get-setup' which generates a customize like
|
|
62 ;; interface to the list of packages. The buffer looks something
|
|
63 ;; like:
|
|
64 ;;
|
|
65 ;; gnus - a mail and news reader
|
|
66 ;; [] Always install
|
|
67 ;; [] Needs updating
|
|
68 ;; [] Required by other [packages]
|
|
69 ;; version: 2.0
|
|
70 ;;
|
|
71 ;; vm - a mail reader
|
|
72 ;; [] Always install
|
|
73 ;; [] Needs updating
|
442
|
74 ;; [] Required by other [packages]
|
428
|
75 ;;
|
|
76 ;; Where `[]' indicates a toggle box
|
|
77 ;;
|
|
78 ;; - Clicking on "Always install" puts this into
|
|
79 ;; `package-get-here' list. "Needs updating" indicates a new
|
|
80 ;; version is available. Anything already in
|
|
81 ;; `package-get-here' has this enabled.
|
|
82 ;; - "Required by other" means some other packages are going to force
|
|
83 ;; this to be installed. Clicking on [packages] gives a list
|
|
84 ;; of packages that require this.
|
442
|
85 ;;
|
428
|
86 ;; The `package-get-base' should be installed in a file in
|
|
87 ;; `data-directory'. The `package-get-here' should be installed in
|
|
88 ;; site-lisp. Both are then read at run time.
|
|
89 ;;
|
|
90 ;; TODO:
|
|
91 ;; - Implement `package-get-setup'
|
|
92 ;; - Actually put `package-get-base' and `package-get-here' into
|
|
93 ;; files that are read.
|
|
94 ;; - Allow users to have their own packages that they want installed
|
|
95 ;; in ~/.xemacs/.
|
|
96 ;; - SOMEONE needs to write the programs that generate the
|
|
97 ;; provides/requires database and makes it into a lisp data
|
|
98 ;; structure suitable for `package-get-base'
|
|
99 ;; - Handle errors such as no package providing a required symbol.
|
|
100 ;; - Tie this into the `require' function to download packages
|
|
101 ;; transparently.
|
|
102
|
|
103 ;;; Change Log
|
|
104
|
|
105 ;;; Code:
|
|
106
|
|
107 (require 'package-admin)
|
|
108 ;; (require 'package-get-base)
|
|
109
|
|
110 (defgroup package-tools nil
|
|
111 "Tools to manipulate packages."
|
|
112 :group 'emacs)
|
|
113
|
|
114 (defgroup package-get nil
|
|
115 "Automatic Package Fetcher and Installer."
|
|
116 :prefix "package-get"
|
|
117 :group 'package-tools)
|
|
118
|
442
|
119 ;;;###autoload
|
428
|
120 (defvar package-get-base nil
|
|
121 "List of packages that are installed at this site.
|
|
122 For each element in the alist, car is the package name and the cdr is
|
|
123 a plist containing information about the package. Typical fields
|
|
124 kept in the plist are:
|
|
125
|
|
126 version - version of this package
|
|
127 provides - list of symbols provided
|
|
128 requires - list of symbols that are required.
|
|
129 These in turn are provided by other packages.
|
|
130 filename - name of the file.
|
|
131 size - size of the file (aka the bundled package)
|
|
132 md5sum - computed md5 checksum
|
|
133 description - What this package is for.
|
|
134 type - Whether this is a 'binary (default) or 'single file package
|
|
135
|
|
136 More fields may be added as needed. An example:
|
|
137
|
|
138 '(
|
|
139 (name
|
|
140 (version \"<version 2>\"
|
|
141 file \"filename\"
|
|
142 description \"what this package is about.\"
|
|
143 provides (<list>)
|
|
144 requires (<list>)
|
|
145 size <integer-bytes>
|
|
146 md5sum \"<checksum\"
|
|
147 type single
|
|
148 )
|
|
149 (version \"<version 1>\"
|
|
150 file \"filename\"
|
|
151 description \"what this package is about.\"
|
|
152 provides (<list>)
|
|
153 requires (<list>)
|
|
154 size <integer-bytes>
|
|
155 md5sum \"<checksum\"
|
|
156 type single
|
|
157 )
|
|
158 ...
|
|
159 ))
|
|
160
|
|
161 For version information, it is assumed things are listed in most
|
|
162 recent to least recent -- in other words, the version names don't have to
|
|
163 be lexically ordered. It is debatable if it makes sense to have more than
|
|
164 one version of a package available.")
|
|
165
|
|
166 (defcustom package-get-dir (temp-directory)
|
|
167 "*Where to store temporary files for staging."
|
|
168 :tag "Temporary directory"
|
|
169 :type 'directory
|
|
170 :group 'package-get)
|
|
171
|
1378
|
172 ;;;###autoload
|
1483
|
173 (defcustom package-get-package-index-file-location
|
3179
|
174 (cond
|
|
175 ;; historical backage
|
|
176 ((getenv "EMACSPACKAGEPATH")
|
|
177 (split-path (getenv "EMACSPACKAGEPATH")))
|
|
178 ((getenv "EMACSEARLYPACKAGES")
|
|
179 (split-path (getenv "EMACSEARLYPACKAGES")))
|
|
180 (configure-early-package-directories
|
|
181 (car configure-early-package-directories))
|
|
182 (t
|
|
183 user-init-directory))
|
1483
|
184 "*The directory where the package-index file can be found."
|
|
185 :type 'directory
|
|
186 :group 'package-get)
|
|
187
|
|
188 ;;;###autoload
|
1378
|
189 (defcustom package-get-install-to-user-init-directory nil
|
|
190 "*If non-nil install packages under `user-init-directory'."
|
|
191 :type 'boolean
|
|
192 :group 'package-get)
|
|
193
|
428
|
194 (define-widget 'host-name 'string
|
|
195 "A Host name."
|
|
196 :tag "Host")
|
|
197
|
|
198 (defcustom package-get-remote nil
|
1365
|
199 "*The remote site to contact for downloading packages.
|
|
200 Format is '(site-name directory-on-site). As a special case, `site-name'
|
|
201 can be `nil', in which case `directory-on-site' is treated as a local
|
|
202 directory."
|
428
|
203 :tag "Package repository"
|
1365
|
204 :type '(set (choice (const :tag "None" nil)
|
|
205 (list :tag "Local" (const :tag "Local" nil) directory)
|
|
206 (list :tag "Remote" host-name directory)))
|
428
|
207 :group 'package-get)
|
|
208
|
|
209 ;;;###autoload
|
|
210 (defcustom package-get-download-sites
|
|
211 '(
|
1365
|
212 ;; Main XEmacs Site (ftp.xemacs.org)
|
1368
|
213 ("US (Main XEmacs Site)"
|
1365
|
214 "ftp.xemacs.org" "pub/xemacs/packages")
|
|
215 ;; In alphabetical order of Country, our mirrors...
|
3013
|
216 ("Argentina (xmundo.net)" "xemacs.xmundo.net" "pub/mirrors/xemacs/packages")
|
1365
|
217 ("Australia (aarnet.edu.au)" "mirror.aarnet.edu.au" "pub/xemacs/packages")
|
|
218 ("Australia (au.xemacs.org)" "ftp.au.xemacs.org" "pub/xemacs/packages")
|
|
219 ("Austria (at.xemacs.org)" "ftp.at.xemacs.org" "editors/xemacs/packages")
|
|
220 ("Belgium (be.xemacs.org)" "ftp.be.xemacs.org" "xemacs/packages")
|
|
221 ("Brazil (br.xemacs.org)" "ftp.br.xemacs.org" "pub/xemacs/packages")
|
|
222 ("Canada (ca.xemacs.org)" "ftp.ca.xemacs.org" "pub/Mirror/xemacs/packages")
|
|
223 ("Canada (crc.ca)" "ftp.crc.ca" "pub/packages/editors/xemacs/packages")
|
3013
|
224 ("Canada (nrc.ca)" "ftp.nrc.ca" "pub/packages/editors/xemacs/packages")
|
1365
|
225 ("Czech Republic (cz.xemacs.org)" "ftp.cz.xemacs.org" "MIRRORS/ftp.xemacs.org/pub/xemacs/packages")
|
|
226 ("Denmark (dk.xemacs.org)" "ftp.dk.xemacs.org" "pub/emacs/xemacs/packages")
|
|
227 ("Finland (fi.xemacs.org)" "ftp.fi.xemacs.org" "pub/mirrors/ftp.xemacs.org/pub/tux/xemacs/packages")
|
|
228 ("France (fr.xemacs.org)" "ftp.fr.xemacs.org" "pub/xemacs/packages")
|
1368
|
229 ("France (mirror.cict.fr)" "mirror.cict.fr" "xemacs/packages")
|
1365
|
230 ("France (pasteur.fr)" "ftp.pasteur.fr" "pub/computing/xemacs/packages")
|
|
231 ("Germany (de.xemacs.org)" "ftp.de.xemacs.org" "pub/ftp.xemacs.org/tux/xemacs/packages")
|
3141
|
232 ("Hong Kong (hk.xemacs.org)" "ftp.hk.xemacs.org" "pub/xemacsftp/packages")
|
3013
|
233 ("Iceland (is.xemacs.org)" "ftp.is.xemacs.org" "pub/xemacs/packages")
|
1365
|
234 ("Ireland (ie.xemacs.org)" "ftp.ie.xemacs.org" "mirrors/ftp.xemacs.org/pub/xemacs/packages")
|
3013
|
235 ("Ireland (heanet.ie)" "ftp.heanet.ie" "mirrors/ftp.xemacs.org/packages")
|
1365
|
236 ("Italy (it.xemacs.org)" "ftp.it.xemacs.org" "unix/packages/XEMACS/packages")
|
|
237 ("Japan (aist.go.jp)" "ring.aist.go.jp" "pub/text/xemacs/packages")
|
|
238 ("Japan (asahi-net.or.jp)" "ring.asahi-net.or.jp" "pub/text/xemacs/packages")
|
|
239 ("Japan (dti.ad.jp)" "ftp.dti.ad.jp" "pub/unix/editor/xemacs/packages")
|
3116
|
240 ; ("Japan (jaist.ac.jp)" "ftp.jaist.ac.jp" "pub/GNU/xemacs/packages")
|
|
241 ; ("Japan (jp.xemacs.org)" "ftp.jp.xemacs.org" "pub/GNU/xemacs/packages")
|
3013
|
242 ; ("Japan (nucba.ac.jp)" "mirror.nucba.ac.jp" "mirror/xemacs/packages")
|
1365
|
243 ("Japan (sut.ac.jp)" "sunsite.sut.ac.jp" "pub/archives/packages/xemacs/packages")
|
1374
|
244 ("Korea (kr.xemacs.org)" "ftp.kr.xemacs.org" "pub/tools/emacs/xemacs/packages")
|
3438
|
245 ("Netherlands (nl.xemacs.org)" "ftp.nl.xemacs.org" "pub/xemacs/ftp/packages")
|
1368
|
246 ("New Zealand (nz.xemacs.org)" "ftp.nz.xemacs.org" "mirror/ftp.xemacs.org/packages")
|
1365
|
247 ("Norway (no.xemacs.org)" "ftp.no.xemacs.org" "pub/xemacs/packages")
|
|
248 ("Poland (pl.xemacs.org)" "ftp.pl.xemacs.org" "pub/unix/editors/xemacs/packages")
|
3193
|
249 ("Portugal (pt.xemacs.org)" "ftp.pt.xemacs.org" "pub/MIRRORS/ftp.xemacs.org/packages")
|
3116
|
250 ("Russia (ru.xemacs.org)" "ftp.ru.xemacs.org" "pub/emacs/xemacs/packages")
|
3021
|
251 ; ("South Africa (za.xemacs.org)" "ftp.za.xemacs.org" "mirrorsites/ftp.xemacs.org/packages")
|
1365
|
252 ("Sweden (se.xemacs.org)" "ftp.se.xemacs.org" "pub/gnu/xemacs/packages")
|
|
253 ("Switzerland (ch.xemacs.org)" "ftp.ch.xemacs.org" "mirror/xemacs/packages")
|
3021
|
254 ("Taiwan (ftp.tw.xemacs.org)" "ftp.tw.xemacs.org" "Unix/Editors/XEmacs/packages")
|
1365
|
255 ("UK (uk.xemacs.org)" "ftp.uk.xemacs.org" "sites/ftp.xemacs.org/pub/xemacs/packages")
|
3021
|
256 ("US (ibiblio.org)" "mirrors.ibiblio.org" "pub/mirrors/xemacs/packages")
|
1365
|
257 ("US (stealth.net)" "ftp.stealth.net" "pub/mirrors/ftp.xemacs.org/pub/xemacs/packages")
|
1368
|
258 ("US (unc.edu)" "metalab.unc.edu" "pub/packages/editors/xemacs/packages")
|
|
259 ("US (us.xemacs.org)" "ftp.us.xemacs.org" "pub/xemacs/packages")
|
3116
|
260 ; ("US (utk.edu)" "ftp.sunsite.utk.edu" "pub/xemacs/packages")
|
|
261 )
|
428
|
262 "*List of remote sites available for downloading packages.
|
|
263 List format is '(site-description site-name directory-on-site).
|
|
264 SITE-DESCRIPTION is a textual description of the site. SITE-NAME
|
|
265 is the internet address of the download site. DIRECTORY-ON-SITE
|
|
266 is the directory on the site in which packages may be found.
|
|
267 This variable is used to initialize `package-get-remote', the
|
|
268 variable actually used to specify package download sites."
|
|
269 :tag "Package download sites"
|
442
|
270 :type '(repeat (list (string :tag "Name") host-name directory))
|
428
|
271 :group 'package-get)
|
|
272
|
1365
|
273 ;;;###autoload
|
|
274 (defcustom package-get-pre-release-download-sites
|
|
275 '(
|
|
276 ;; Main XEmacs Site (ftp.xemacs.org)
|
3116
|
277 ("US Pre-Releases (Main XEmacs Site)" "ftp.xemacs.org"
|
1365
|
278 "pub/xemacs/beta/experimental/packages")
|
|
279 ;; In alphabetical order of Country, our mirrors...
|
3013
|
280 ("Argentina Pre-Releases (xmundo.net)" "xemacs.xmundo.net"
|
|
281 "pub/mirrors/xemacs/beta/experimental/packages")
|
1368
|
282 ("Australia Pre-Releases (aarnet.edu.au)" "mirror.aarnet.edu.au"
|
1365
|
283 "pub/xemacs/beta/experimental/packages")
|
1368
|
284 ("Australia Pre-Releases (au.xemacs.org)" "ftp.au.xemacs.org"
|
1365
|
285 "pub/xemacs/beta/experimental/packages")
|
1368
|
286 ("Austria Pre-Releases (at.xemacs.org)" "ftp.at.xemacs.org"
|
3013
|
287 "editors/xemacs/beta/experimental/packages")
|
|
288 ("Belgium (be.xemacs.org)" "ftp.be.xemacs.org"
|
|
289 "xemacs/beta/experimental/packages")
|
1368
|
290 ("Brazil Pre-Releases (br.xemacs.org)" "ftp.br.xemacs.org"
|
1365
|
291 "pub/xemacs/xemacs-21.5/experimental/packages")
|
1368
|
292 ("Canada Pre-Releases (ca.xemacs.org)" "ftp.ca.xemacs.org"
|
1365
|
293 "pub/Mirror/xemacs/beta/experimental/packages")
|
1368
|
294 ("Canada Pre-Releases (crc.ca)" "ftp.crc.ca"
|
1365
|
295 "pub/packages/editors/xemacs/beta/experimental/packages")
|
3013
|
296 ("Canada Pre-Releases (nrc.ca)" "ftp.nrc.ca"
|
|
297 "pub/packages/editors/xemacs/beta/experimental/packages")
|
1368
|
298 ("Czech Republic Pre-Releases (cz.xemacs.org)" "ftp.cz.xemacs.org"
|
1365
|
299 "MIRRORS/ftp.xemacs.org/pub/xemacs/xemacs-21.5/experimental/packages")
|
1368
|
300 ("Denmark Pre-Releases (dk.xemacs.org)" "ftp.dk.xemacs.org"
|
1365
|
301 "pub/emacs/xemacs/beta/experimental/packages")
|
1368
|
302 ("Finland Pre-Releases (fi.xemacs.org)" "ftp.fi.xemacs.org"
|
1365
|
303 "pub/mirrors/ftp.xemacs.org/pub/tux/xemacs/beta/experimental/packages")
|
1368
|
304 ("France Pre-Releases (fr.xemacs.org)" "ftp.fr.xemacs.org"
|
1365
|
305 "pub/xemacs/beta/experimental/packages")
|
1368
|
306 ("France Pre-Releases (mirror.cict.fr)" "mirror.cict.fr"
|
|
307 "xemacs/beta/experimental/packages")
|
|
308 ("France Pre-Releases (pasteur.fr)" "ftp.pasteur.fr"
|
1365
|
309 "pub/computing/xemacs/beta/experimental/packages")
|
1368
|
310 ("Germany Pre-Releases (de.xemacs.org)" "ftp.de.xemacs.org"
|
1365
|
311 "pub/ftp.xemacs.org/tux/xemacs/beta/experimental/packages")
|
3141
|
312 ("Hong Kong Pre-Releases (hk.xemacs.org)" "ftp.hk.xemacs.org"
|
|
313 "pub/xemacsftp/beta/experimental/packages")
|
3013
|
314 ("Iceland Pre-Releases (is.xemacs.org)" "ftp.is.xemacs.org"
|
|
315 "pub/xemacs/beta/experimental/packages")
|
1368
|
316 ("Ireland Pre-Releases (ie.xemacs.org)" "ftp.ie.xemacs.org"
|
1365
|
317 "mirrors/ftp.xemacs.org/pub/xemacs/beta/experimental/packages")
|
3013
|
318 ("Ireland Pre-Releases (heanet.ie)" "ftp.heanet.ie"
|
|
319 "mirrors/ftp.xemacs.org/beta/experimental/packages")
|
1368
|
320 ("Italy Pre-Releases (it.xemacs.org)" "ftp.it.xemacs.org"
|
1365
|
321 "unix/packages/XEMACS/beta/experimental/packages")
|
1368
|
322 ("Japan Pre-Releases (aist.go.jp)" "ring.aist.go.jp"
|
1365
|
323 "pub/text/xemacs/beta/experimental/packages")
|
1368
|
324 ("Japan Pre-Releases (asahi-net.or.jp)" "ring.asahi-net.or.jp"
|
1365
|
325 "pub/text/xemacs/beta/experimental/packages")
|
1368
|
326 ("Japan Pre-Releases (dti.ad.jp)" "ftp.dti.ad.jp"
|
1365
|
327 "pub/unix/editor/xemacs/beta/experimental/packages")
|
3116
|
328 ; ("Japan Pre-Releases (jaist.ac.jp)" "ftp.jaist.ac.jp"
|
|
329 ; "pub/GNU/xemacs/beta/experimental/packages")
|
|
330 ; ("Japan Pre-Releases (jp.xemacs.org)" "ftp.jp.xemacs.org"
|
|
331 ; "pub/GNU/xemacs/beta/experimental/packages")
|
1368
|
332 ("Japan Pre-Releases (sut.ac.jp)" "sunsite.sut.ac.jp"
|
1365
|
333 "pub/archives/packages/xemacs/xemacs-21.5/experimental/packages")
|
3013
|
334 ("Korea (kr.xemacs.org)" "ftp.kr.xemacs.org"
|
|
335 "pub/tools/emacs/xemacs/beta/experimental/packages")
|
3438
|
336 ("Netherlands (nl.xemacs.org)" "ftp.nl.xemacs.org"
|
|
337 "pub/xemacs/ftp/beta/experimental/packages")
|
3013
|
338 ("New Zealand Pre-Releases (nz.xemacs.org)" "ftp.nz.xemacs.org"
|
|
339 "mirror/ftp.xemacs.org/packages")
|
1368
|
340 ("Norway Pre-Releases (no.xemacs.org)" "ftp.no.xemacs.org"
|
1365
|
341 "pub/xemacs/beta/experimental/packages")
|
1368
|
342 ("Poland Pre-Releases (pl.xemacs.org)" "ftp.pl.xemacs.org"
|
1365
|
343 "pub/unix/editors/xemacs/beta/experimental/packages")
|
3193
|
344 ("Portugal Pre-Releases (pt.xemacs.org)" "ftp.pt.xemacs.org"
|
|
345 "pub/MIRRORS/ftp.xemacs.org/beta/experimental/packages")
|
1368
|
346 ("Russia Pre-Releases (ru.xemacs.org)" "ftp.ru.xemacs.org"
|
3116
|
347 "pub/emacs/xemacs/beta/experimental/packages")
|
3021
|
348 ; ("South Africa Pre-Releases (za.xemacs.org)" "ftp.za.xemacs.org"
|
|
349 ; "mirrorsites/ftp.xemacs.org/beta/experimental/packages")
|
1368
|
350 ("Sweden Pre-Releases (se.xemacs.org)" "ftp.se.xemacs.org"
|
1365
|
351 "pub/gnu/xemacs/beta/experimental/packages")
|
1368
|
352 ("Switzerland Pre-Releases (ch.xemacs.org)" "ftp.ch.xemacs.org"
|
1365
|
353 "mirror/xemacs/beta/experimental/packages")
|
3021
|
354 ("Taiwan Pre-Releases (ftp.tw.xemacs.org)" "ftp.tw.xemacs.org"
|
|
355 "Unix/Editors/XEmacs/beta/experimental/packages")
|
1368
|
356 ("UK Pre-Releases (uk.xemacs.org)" "ftp.uk.xemacs.org"
|
1365
|
357 "sites/ftp.xemacs.org/pub/xemacs/beta/experimental/packages")
|
3021
|
358 ("US Pre-Releases (ibiblio.org)" "mirrors.ibiblio.org"
|
|
359 "pub/mirrors/xemacs/beta/experimental/packages")
|
1368
|
360 ("US Pre-Releases (stealth.net)" "ftp.stealth.net"
|
1365
|
361 "pub/mirrors/ftp.xemacs.org/pub/xemacs/beta/experimental/packages")
|
1368
|
362 ("US Pre-Releases (unc.edu)" "metalab.unc.edu"
|
|
363 "pub/packages/editors/xemacs/beta/experimental/packages")
|
|
364 ("US Pre-Releases (us.xemacs.org)" "ftp.us.xemacs.org"
|
|
365 "pub/xemacs/beta/experimental/packages")
|
3116
|
366 ; ("US Pre-Releases (utk.edu)" "ftp.sunsite.utk.edu"
|
|
367 ; "pub/xemacs/beta/experimental/packages")
|
|
368 )
|
1365
|
369 "*List of remote sites available for downloading \"Pre-Release\" packages.
|
|
370 List format is '(site-description site-name directory-on-site).
|
|
371 SITE-DESCRIPTION is a textual description of the site. SITE-NAME
|
|
372 is the internet address of the download site. DIRECTORY-ON-SITE
|
|
373 is the directory on the site in which packages may be found.
|
|
374 This variable is used to initialize `package-get-remote', the
|
|
375 variable actually used to specify package download sites."
|
|
376 :tag "Pre-Release Package download sites"
|
|
377 :type '(repeat (list (string :tag "Name") host-name directory))
|
|
378 :group 'package-get)
|
|
379
|
1374
|
380 ;;;###autoload
|
|
381 (defcustom package-get-site-release-download-sites
|
|
382 nil
|
|
383 "*List of remote sites available for downloading \"Site Release\" packages.
|
|
384 List format is '(site-description site-name directory-on-site).
|
|
385 SITE-DESCRIPTION is a textual description of the site. SITE-NAME
|
|
386 is the internet address of the download site. DIRECTORY-ON-SITE
|
|
387 is the directory on the site in which packages may be found.
|
|
388 This variable is used to initialize `package-get-remote', the
|
|
389 variable actually used to specify package download sites."
|
|
390 :tag "Site Release Package download sites"
|
|
391 :type '(repeat (list (string :tag "Name") host-name directory))
|
|
392 :group 'package-get)
|
|
393
|
428
|
394 (defcustom package-get-remove-copy t
|
|
395 "*After copying and installing a package, if this is t, then remove the
|
|
396 copy. Otherwise, keep it around."
|
|
397 :type 'boolean
|
|
398 :group 'package-get)
|
|
399
|
|
400 ;; #### it may make sense for this to be a list of names.
|
|
401 ;; #### also, should we rename "*base*" to "*index*" or "*db*"?
|
|
402 ;; "base" is a pretty poor name.
|
681
|
403 (defcustom package-get-base-filename "package-index.LATEST.gpg"
|
428
|
404 "*Name of the default package-get database file.
|
|
405 This may either be a relative path, in which case it is interpreted
|
|
406 with respect to `package-get-remote', or an absolute path."
|
|
407 :type 'file
|
|
408 :group 'package-get)
|
|
409
|
|
410 (defcustom package-get-always-update nil
|
|
411 "*If Non-nil always make sure we are using the latest package index (base).
|
|
412 Otherwise respect the `force-current' argument of `package-get-require-base'."
|
|
413 :type 'boolean
|
|
414 :group 'package-get)
|
|
415
|
1410
|
416 (defun package-get-pgp-available-p ()
|
|
417 "Checks the availability of Mailcrypt and PGP executable.
|
|
418
|
|
419 Returns t if both are found, nil otherwise. As a side effect, set
|
|
420 `mc-default-scheme' dependent on the PGP executable found."
|
|
421 (let (result)
|
|
422 (when (featurep 'mailcrypt-autoloads)
|
|
423 (autoload 'mc-setversion "mc-setversion"))
|
|
424 (when-fboundp 'mc-setversion
|
|
425 (cond ((locate-file "gpg" exec-path
|
|
426 '("" ".btm" ".bat" ".cmd" ".exe" ".com")
|
|
427 'executable)
|
|
428 (mc-setversion "gpg")
|
|
429 (setq result t))
|
|
430 ((locate-file "pgpe" exec-path
|
|
431 '("" ".btm" ".bat" ".cmd" ".exe" ".com")
|
|
432 'executable)
|
|
433 (mc-setversion "5.0")
|
|
434 (setq result t))
|
|
435 ((locate-file "pgp" exec-path
|
|
436 '("" ".btm" ".bat" ".cmd" ".exe" ".com")
|
|
437 'executable)
|
|
438 (mc-setversion "2.6")
|
|
439 (setq result t))))
|
|
440 (if result
|
|
441 result
|
|
442 nil)))
|
|
443
|
1479
|
444 (defcustom package-get-require-signed-base-updates (package-get-pgp-available-p)
|
1410
|
445 "*If non-nil, try to verify the package index database via PGP.
|
|
446
|
|
447 If nil, no PGP verification is done. If the package index database
|
|
448 entries are not PGP signed and this variable is non-nil, require user
|
|
449 confirmation to continue with the package-get procedure.
|
|
450
|
|
451 The default for this variable is the return value of
|
|
452 `package-get-pgp-available-p', non-nil if both the \"Mailcrypt\"
|
|
453 package and a suitable PGP executable are available, nil otherwise."
|
428
|
454 :type 'boolean
|
|
455 :group 'package-get)
|
|
456
|
681
|
457 (defvar package-entries-are-signed nil
|
|
458 "Non-nil when the package index file has been PGP signed.")
|
|
459
|
|
460 (defvar package-get-continue-update-base nil
|
|
461 "Non-nil update the index even if it hasn't been signed.")
|
|
462
|
428
|
463 (defvar package-get-was-current nil
|
|
464 "Non-nil we did our best to fetch a current database.")
|
|
465
|
|
466 ;;;###autoload
|
|
467 (defun package-get-require-base (&optional force-current)
|
|
468 "Require that a package-get database has been loaded.
|
|
469 If the optional FORCE-CURRENT argument or the value of
|
|
470 `package-get-always-update' is Non-nil, try to update the database
|
|
471 from a location in `package-get-remote'. Otherwise a local copy is used
|
|
472 if available and remote access is never done.
|
|
473
|
|
474 Please use FORCE-CURRENT only when the user is explictly dealing with packages
|
|
475 and remote access is likely in the near future."
|
|
476 (setq force-current (or force-current package-get-always-update))
|
|
477 (unless (and (boundp 'package-get-base)
|
|
478 package-get-base
|
|
479 (or (not force-current) package-get-was-current))
|
|
480 (package-get-update-base nil force-current))
|
|
481 (if (or (not (boundp 'package-get-base))
|
|
482 (not package-get-base))
|
1410
|
483 (error 'void-variable
|
|
484 "Package-get database not loaded")
|
428
|
485 (setq package-get-was-current force-current)))
|
|
486
|
|
487 (defconst package-get-pgp-signed-begin-line "^-----BEGIN PGP SIGNED MESSAGE-----"
|
|
488 "Text for start of PGP signed messages.")
|
|
489 (defconst package-get-pgp-signature-begin-line "^-----BEGIN PGP SIGNATURE-----"
|
|
490 "Text for beginning of PGP signature.")
|
|
491 (defconst package-get-pgp-signature-end-line "^-----END PGP SIGNATURE-----"
|
|
492 "Text for end of PGP signature.")
|
|
493
|
|
494 ;;;###autoload
|
|
495 (defun package-get-update-base-entry (entry)
|
|
496 "Update an entry in `package-get-base'."
|
|
497 (let ((existing (assq (car entry) package-get-base)))
|
|
498 (if existing
|
|
499 (setcdr existing (cdr entry))
|
824
|
500 (setq package-get-base (cons entry package-get-base)))))
|
428
|
501
|
|
502 (defun package-get-locate-file (file &optional nil-if-not-found no-remote)
|
|
503 "Locate an existing FILE with respect to `package-get-remote'.
|
|
504 If FILE is an absolute path or is not found, simply return FILE.
|
|
505 If optional argument NIL-IF-NOT-FOUND is non-nil, return nil
|
|
506 if FILE can not be located.
|
|
507 If NO-REMOTE is non-nil never search remote locations."
|
|
508 (if (file-name-absolute-p file)
|
|
509 file
|
1365
|
510 (let ((site package-get-remote)
|
428
|
511 (expanded nil))
|
1365
|
512 (when site
|
|
513 (unless (and no-remote (caar (list site)))
|
|
514 (let ((expn (package-get-remote-filename (car (list site)) file)))
|
428
|
515 (if (and expn (file-exists-p expn))
|
1365
|
516 (setq site nil
|
|
517 expanded expn)))))
|
428
|
518 (or expanded
|
|
519 (and (not nil-if-not-found)
|
|
520 file)))))
|
|
521
|
|
522 (defun package-get-locate-index-file (no-remote)
|
1483
|
523 "Locate the package-get index file.
|
|
524
|
|
525 Do not return remote paths if NO-REMOTE is non-nil. If the index
|
|
526 file doesn't exist in `package-get-package-index-file-location', ask
|
|
527 the user if one should be created using the index file in core as a
|
|
528 template."
|
428
|
529 (or (package-get-locate-file package-get-base-filename t no-remote)
|
1483
|
530 (if (file-exists-p (expand-file-name package-get-base-filename
|
|
531 package-get-package-index-file-location))
|
|
532 (expand-file-name package-get-base-filename
|
|
533 package-get-package-index-file-location)
|
|
534 (if (y-or-n-p (format "No index file, shall I create one in %s? "
|
|
535 package-get-package-index-file-location))
|
|
536 (progn
|
|
537 (save-excursion
|
|
538 (set-buffer
|
|
539 (find-file-noselect (expand-file-name
|
|
540 package-get-base-filename
|
|
541 package-get-package-index-file-location)))
|
|
542 (let ((coding-system-for-write 'binary))
|
|
543 (erase-buffer)
|
|
544 (insert-file-contents-literally
|
|
545 (locate-data-file package-get-base-filename))
|
|
546 (save-buffer (current-buffer))
|
|
547 (kill-buffer (current-buffer))))
|
|
548 (expand-file-name package-get-base-filename
|
|
549 package-get-package-index-file-location))
|
|
550 (error 'search-failed
|
|
551 "Can't locate a package index file.")))))
|
428
|
552
|
|
553 (defun package-get-maybe-save-index (filename)
|
|
554 "Offer to save the current buffer as the local package index file,
|
|
555 if different."
|
|
556 (let ((location (package-get-locate-index-file t)))
|
|
557 (unless (and filename (equal filename location))
|
|
558 (unless (and location
|
|
559 (equal (md5 (current-buffer))
|
|
560 (with-temp-buffer
|
|
561 (insert-file-contents-literally location)
|
|
562 (md5 (current-buffer)))))
|
1483
|
563 (when (not (file-writable-p location))
|
|
564 (if (y-or-n-p (format "Sorry, %s is read-only, can I use %s? "
|
|
565 location user-init-directory))
|
|
566 (setq location (expand-file-name
|
|
567 package-get-base-filename
|
|
568 package-get-package-index-file-location))
|
|
569 (error 'file-error
|
|
570 (format "%s is read-only" location))))
|
434
|
571 (when (y-or-n-p (concat "Update package index in " location "? "))
|
442
|
572 (let ((coding-system-for-write 'binary))
|
|
573 (write-file location)))))))
|
|
574
|
428
|
575 ;;;###autoload
|
|
576 (defun package-get-update-base (&optional db-file force-current)
|
|
577 "Update the package-get database file with entries from DB-FILE.
|
|
578 Unless FORCE-CURRENT is non-nil never try to update the database."
|
|
579 (interactive
|
|
580 (let ((dflt (package-get-locate-index-file nil)))
|
|
581 (list (read-file-name "Load package-get database: "
|
|
582 (file-name-directory dflt)
|
|
583 dflt
|
|
584 t
|
|
585 (file-name-nondirectory dflt)))))
|
|
586 (setq db-file (expand-file-name (or db-file
|
|
587 (package-get-locate-index-file
|
|
588 (not force-current)))))
|
|
589 (if (not (file-exists-p db-file))
|
1410
|
590 (error 'file-error
|
|
591 (format "Package-get database file `%s' does not exist" db-file)))
|
428
|
592 (if (not (file-readable-p db-file))
|
1410
|
593 (error 'file-error
|
|
594 (format "Package-get database file `%s' not readable" db-file)))
|
428
|
595 (let ((buf (get-buffer-create "*package database*")))
|
|
596 (unwind-protect
|
|
597 (save-excursion
|
|
598 (set-buffer buf)
|
|
599 (erase-buffer buf)
|
442
|
600 (insert-file-contents-literally db-file)
|
428
|
601 (package-get-update-base-from-buffer buf)
|
|
602 (if (file-remote-p db-file)
|
|
603 (package-get-maybe-save-index db-file)))
|
|
604 (kill-buffer buf))))
|
|
605
|
|
606 ;;;###autoload
|
|
607 (defun package-get-update-base-from-buffer (&optional buf)
|
|
608 "Update the package-get database with entries from BUFFER.
|
|
609 BUFFER defaults to the current buffer. This command can be
|
|
610 used interactively, for example from a mail or news buffer."
|
|
611 (interactive)
|
|
612 (setq buf (or buf (current-buffer)))
|
1937
|
613 (let ((coding-system-for-read 'binary)
|
|
614 (coding-system-for-write 'binary)
|
|
615 content-beg content-end)
|
428
|
616 (save-excursion
|
|
617 (set-buffer buf)
|
|
618 (goto-char (point-min))
|
|
619 (setq content-beg (point))
|
|
620 (setq content-end (save-excursion (goto-char (point-max)) (point)))
|
|
621 (when (re-search-forward package-get-pgp-signed-begin-line nil t)
|
|
622 (setq content-beg (match-end 0)))
|
|
623 (when (re-search-forward package-get-pgp-signature-begin-line nil t)
|
681
|
624 (setq content-end (match-beginning 0))
|
|
625 (setq package-entries-are-signed t))
|
1365
|
626 (re-search-forward package-get-pgp-signature-end-line nil t)
|
681
|
627 (setq package-get-continue-update-base t)
|
1410
|
628 ;; This is a little overkill because the default value of
|
|
629 ;; `package-get-require-signed-base-updates' is the return of
|
|
630 ;; `package-get-pgp-available-p', but we have to allow for
|
|
631 ;; someone explicitly setting
|
|
632 ;; `package-get-require-signed-base-updates' to t. --SY
|
|
633 (when (and package-get-require-signed-base-updates
|
|
634 (package-get-pgp-available-p))
|
|
635 (if package-entries-are-signed
|
|
636 (let (good-sig)
|
1365
|
637 (setq package-get-continue-update-base nil)
|
1410
|
638 (autoload 'mc-verify "mc-toplev")
|
|
639 (when (declare-fboundp (mc-verify))
|
|
640 (setq good-sig t))
|
|
641 (if good-sig
|
|
642 (setq package-get-continue-update-base t)
|
|
643 (error 'process-error
|
|
644 "GnuPG error. Package database not updated")))
|
|
645 (if (yes-or-no-p
|
|
646 "Package Index is not PGP signed. Continue anyway? ")
|
|
647 (setq package-get-continue-update-base t)
|
|
648 (setq package-get-continue-update-base nil)
|
|
649 (warn "Package database not updated"))))
|
440
|
650 ;; ToDo: We should call package-get-maybe-save-index on the region
|
1410
|
651 (when package-get-continue-update-base
|
|
652 (package-get-update-base-entries content-beg content-end)
|
|
653 (message "Updated package database")))))
|
428
|
654
|
444
|
655 (defun package-get-update-base-entries (start end)
|
428
|
656 "Update the package-get database with the entries found between
|
444
|
657 START and END in the current buffer."
|
428
|
658 (save-excursion
|
444
|
659 (goto-char start)
|
428
|
660 (if (not (re-search-forward "^(package-get-update-base-entry" nil t))
|
1410
|
661 (error 'search-failed
|
|
662 "Buffer does not contain package-get database entries"))
|
428
|
663 (beginning-of-line)
|
|
664 (let ((count 0))
|
|
665 (while (and (< (point) end)
|
|
666 (re-search-forward "^(package-get-update-base-entry" nil t))
|
|
667 (beginning-of-line)
|
|
668 (let ((entry (read (current-buffer))))
|
|
669 (if (or (not (consp entry))
|
|
670 (not (eq (car entry) 'package-get-update-base-entry)))
|
1410
|
671 (error 'syntax-error
|
|
672 "Invalid package-get database entry found"))
|
428
|
673 (package-get-update-base-entry
|
|
674 (car (cdr (car (cdr entry)))))
|
|
675 (setq count (1+ count))))
|
|
676 (message "Got %d package-get database entries" count))))
|
|
677
|
|
678 ;;;###autoload
|
|
679 (defun package-get-save-base (file)
|
|
680 "Write the package-get database to FILE.
|
|
681
|
|
682 Note: This database will be unsigned of course."
|
|
683 (interactive "FSave package-get database to: ")
|
|
684 (package-get-require-base t)
|
|
685 (let ((buf (get-buffer-create "*package database*")))
|
|
686 (unwind-protect
|
|
687 (save-excursion
|
|
688 (set-buffer buf)
|
|
689 (erase-buffer buf)
|
|
690 (goto-char (point-min))
|
|
691 (let ((entries package-get-base) entry plist)
|
|
692 (insert ";; Package Index file -- Do not edit manually.\n")
|
|
693 (insert ";;;@@@\n")
|
|
694 (while entries
|
|
695 (setq entry (car entries))
|
|
696 (setq plist (car (cdr entry)))
|
|
697 (insert "(package-get-update-base-entry (quote\n")
|
|
698 (insert (format "(%s\n" (symbol-name (car entry))))
|
|
699 (while plist
|
|
700 (insert (format " %s%s %S\n"
|
|
701 (if (eq plist (car (cdr entry))) "(" " ")
|
|
702 (symbol-name (car plist))
|
|
703 (car (cdr plist))))
|
|
704 (setq plist (cdr (cdr plist))))
|
|
705 (insert "))\n))\n;;;@@@\n")
|
|
706 (setq entries (cdr entries))))
|
|
707 (insert ";; Package Index file ends here\n")
|
|
708 (write-region (point-min) (point-max) file))
|
|
709 (kill-buffer buf))))
|
|
710
|
|
711 (defun package-get-interactive-package-query (get-version package-symbol)
|
|
712 "Perform interactive querying for package and optional version.
|
|
713 Query for a version if GET-VERSION is non-nil. Return package name as
|
|
714 a symbol instead of a string if PACKAGE-SYMBOL is non-nil.
|
|
715 The return value is suitable for direct passing to `interactive'."
|
|
716 (package-get-require-base t)
|
442
|
717 (let ((table (mapcar #'(lambda (item)
|
|
718 (let ((name (symbol-name (car item))))
|
|
719 (cons name name)))
|
|
720 package-get-base))
|
|
721 package package-symbol default-version version)
|
428
|
722 (save-window-excursion
|
|
723 (setq package (completing-read "Package: " table nil t))
|
|
724 (setq package-symbol (intern package))
|
|
725 (if get-version
|
|
726 (progn
|
442
|
727 (setq default-version
|
|
728 (package-get-info-prop
|
428
|
729 (package-get-info-version
|
|
730 (package-get-info-find-package package-get-base
|
|
731 package-symbol) nil)
|
|
732 'version))
|
|
733 (while (string=
|
|
734 (setq version (read-string "Version: " default-version))
|
1365
|
735 ""))
|
428
|
736 (if package-symbol
|
|
737 (list package-symbol version)
|
1365
|
738 (list package version)))
|
428
|
739 (if package-symbol
|
|
740 (list package-symbol)
|
442
|
741 (list package))))))
|
428
|
742
|
|
743 ;;;###autoload
|
|
744 (defun package-get-delete-package (package &optional pkg-topdir)
|
|
745 "Delete an installation of PACKAGE below directory PKG-TOPDIR.
|
|
746 PACKAGE is a symbol, not a string.
|
|
747 This is just an interactive wrapper for `package-admin-delete-binary-package'."
|
|
748 (interactive (package-get-interactive-package-query nil t))
|
|
749 (package-admin-delete-binary-package package pkg-topdir))
|
|
750
|
|
751 ;;;###autoload
|
|
752 (defun package-get-update-all ()
|
|
753 "Fetch and install the latest versions of all currently installed packages."
|
|
754 (interactive)
|
|
755 (package-get-require-base t)
|
|
756 ;; Load a fresh copy
|
|
757 (catch 'exit
|
|
758 (mapcar (lambda (pkg)
|
|
759 (if (not (package-get (car pkg) nil 'never))
|
1365
|
760 (throw 'exit nil))) ;; Bail out if error detected
|
707
|
761 packages-package-list))
|
|
762 (package-net-update-installed-db))
|
428
|
763
|
|
764 ;;;###autoload
|
|
765 (defun package-get-all (package version &optional fetched-packages install-dir)
|
|
766 "Fetch PACKAGE with VERSION and all other required packages.
|
|
767 Uses `package-get-base' to determine just what is required and what
|
|
768 package provides that functionality. If VERSION is nil, retrieves
|
|
769 latest version. Optional argument FETCHED-PACKAGES is used to keep
|
|
770 track of packages already fetched. Optional argument INSTALL-DIR,
|
|
771 if non-nil, specifies the package directory where fetched packages
|
|
772 should be installed.
|
|
773
|
|
774 Returns nil upon error."
|
|
775 (interactive (package-get-interactive-package-query t nil))
|
|
776 (let* ((the-package (package-get-info-find-package package-get-base
|
|
777 package))
|
|
778 (this-package (package-get-info-version
|
|
779 the-package version))
|
1365
|
780 (this-requires (package-get-info-prop this-package 'requires)))
|
428
|
781 (catch 'exit
|
|
782 (setq version (package-get-info-prop this-package 'version))
|
|
783 (unless (package-get-installedp package version)
|
|
784 (if (not (package-get package version nil install-dir))
|
|
785 (progn
|
|
786 (setq fetched-packages nil)
|
|
787 (throw 'exit nil))))
|
|
788 (setq fetched-packages
|
|
789 (append (list package)
|
|
790 (package-get-info-prop this-package 'provides)
|
|
791 fetched-packages))
|
|
792 ;; grab everything that this package requires plus recursively
|
|
793 ;; grab everything that the requires require. Keep track
|
|
794 ;; in `fetched-packages' the list of things provided -- this
|
|
795 ;; keeps us from going into a loop
|
|
796 (while this-requires
|
|
797 (if (not (member (car this-requires) fetched-packages))
|
|
798 (let* ((reqd-package (package-get-package-provider
|
|
799 (car this-requires) t))
|
|
800 (reqd-version (cadr reqd-package))
|
|
801 (reqd-name (car reqd-package)))
|
|
802 (if (null reqd-name)
|
1410
|
803 (error 'search-failed
|
|
804 (format "Unable to find a provider for %s"
|
|
805 (car this-requires))))
|
428
|
806 (if (not (setq fetched-packages
|
|
807 (package-get-all reqd-name reqd-version
|
|
808 fetched-packages
|
|
809 install-dir)))
|
1365
|
810 (throw 'exit nil))))
|
|
811 (setq this-requires (cdr this-requires))))
|
|
812 fetched-packages))
|
428
|
813
|
|
814 ;;;###autoload
|
|
815 (defun package-get-dependencies (packages)
|
|
816 "Compute dependencies for PACKAGES.
|
|
817 Uses `package-get-base' to determine just what is required and what
|
|
818 package provides that functionality. Returns the list of packages
|
|
819 required by PACKAGES."
|
|
820 (package-get-require-base t)
|
|
821 (let ((orig-packages packages)
|
|
822 dependencies provided)
|
|
823 (while packages
|
|
824 (let* ((package (car packages))
|
|
825 (the-package (package-get-info-find-package
|
|
826 package-get-base package))
|
|
827 (this-package (package-get-info-version
|
|
828 the-package nil))
|
|
829 (this-requires (package-get-info-prop this-package 'requires))
|
|
830 (new-depends (set-difference
|
|
831 (mapcar
|
|
832 #'(lambda (reqd)
|
|
833 (let* ((reqd-package (package-get-package-provider reqd))
|
|
834 (reqd-name (car reqd-package)))
|
|
835 (if (null reqd-name)
|
1410
|
836 (error 'search-failed
|
|
837 (format "Unable to find a provider for %s" reqd)))
|
428
|
838 reqd-name))
|
|
839 this-requires)
|
|
840 dependencies))
|
|
841 (this-provides (package-get-info-prop this-package 'provides)))
|
|
842 (setq dependencies
|
|
843 (union dependencies new-depends))
|
|
844 (setq provided
|
|
845 (union provided (union (list package) this-provides)))
|
|
846 (setq packages
|
|
847 (union new-depends (cdr packages)))))
|
|
848 (set-difference dependencies orig-packages)))
|
|
849
|
|
850 (defun package-get-load-package-file (lispdir file)
|
|
851 (let (pathname)
|
|
852 (setq pathname (expand-file-name file lispdir))
|
793
|
853 (with-trapping-errors
|
|
854 :operation (format "loading package file \"%s\"" pathname)
|
|
855 :error-form nil
|
|
856 (load pathname t)
|
|
857 t)))
|
428
|
858
|
|
859 (defun package-get-init-package (lispdir)
|
|
860 "Initialize the package.
|
|
861 This really assumes that the package has never been loaded. Updating
|
|
862 a newer package can cause problems, due to old, obsolete functions in
|
|
863 the old package.
|
|
864
|
|
865 Return `t' upon complete success, `nil' if any errors occurred."
|
|
866 (progn
|
|
867 (if (and lispdir
|
|
868 (file-accessible-directory-p lispdir))
|
|
869 (progn
|
|
870 ;; Add lispdir to load-path if it doesn't already exist.
|
|
871 ;; NOTE: this does not take symlinks, etc., into account.
|
2802
|
872 (add-to-list 'load-path (file-name-as-directory lispdir))
|
428
|
873 (if (not (package-get-load-package-file lispdir "auto-autoloads"))
|
|
874 (package-get-load-package-file lispdir "_pkg"))
|
|
875 t)
|
1365
|
876 nil)))
|
|
877
|
2151
|
878 (defun package-get-info-name-array ()
|
|
879 "Internal, used by `package-get-info'."
|
|
880 (let ((pkgs package-get-base)
|
|
881 names)
|
|
882 (while pkgs
|
|
883 (setq names (let ((name (caar pkgs)))
|
|
884 (push (cons (format "%s" name) name) names)))
|
|
885 (setq pkgs (cdr pkgs)))
|
|
886 names))
|
|
887
|
|
888 (defconst package-get-info-info-array
|
|
889 '(("standards-version" . standards-version)
|
|
890 ("version" . version)
|
|
891 ("author-version" . author-version)
|
|
892 ("date" . date)
|
|
893 ("build-date" . build-date)
|
|
894 ("maintainer" . maintainer)
|
|
895 ("distribution" . distribution)
|
|
896 ("priority" . priority)
|
|
897 ("category" . category)
|
|
898 ("dump" . dump)
|
|
899 ("description" . description)
|
|
900 ("filename" . filename)
|
|
901 ("md5sum" . md5sum)
|
|
902 ("size" . size)
|
|
903 ("provides" . provides)
|
|
904 ("requires" . requires)
|
|
905 ("type" . type))
|
|
906 "Internal, used by `package-get-info'.")
|
|
907
|
1365
|
908 ;;;###autoload
|
|
909 (defun package-get-info (package information &optional arg remote)
|
|
910 "Get information about a package.
|
|
911
|
|
912 Quite similar to `package-get-info-prop', but can retrieve a lot more
|
|
913 information.
|
|
914
|
|
915 Argument PACKAGE is the name of an XEmacs package (a symbol). It must
|
|
916 be a valid package, ie, a member of `package-get-base'.
|
|
917
|
|
918 Argument INFORMATION is a symbol that can be any one of:
|
|
919
|
|
920 standards-version Package system version (not used).
|
|
921 version Version of the XEmacs package.
|
|
922 author-version The upstream version of the package.
|
|
923 date The date the package was last modified.
|
|
924 build-date The date the package was last built.
|
|
925 maintainer The maintainer of the package.
|
|
926 distribution Will always be \"xemacs\" (not used).
|
|
927 priority \"low\", \"medium\", or \"high\" (not used).
|
|
928 category Either \"standard\", \"mule\", or \"unsupported\"..
|
|
929 dump Is the package dumped (not used).
|
|
930 description A description of the package.
|
|
931 filename The filename of the binary tarball of the package.
|
|
932 md5sum The md5sum of filename.
|
|
933 size The size in bytes of filename.
|
|
934 provides A list of symbols that this package provides.
|
|
935 requires A list of packages that this package requires.
|
|
936 type Can be either \"regular\" or \"single-file\".
|
|
937
|
2151
|
938 Optional argument ARG is a prefix arg. Without a value, ie, just
|
|
939 doing `C-u M-x package-get-info' will insert the information at point
|
|
940 in the current buffer using a local package list.
|
|
941
|
|
942 ARG can also be given a value of 2 or 3. If 2, use a remote package
|
|
943 list, displaying the information in the minubuffer. If 3, use a remote
|
|
944 package list and insert the information at point in the current buffer.
|
1365
|
945
|
|
946 If optional argument REMOTE is non-nil use a package list from a
|
2151
|
947 remote site.
|
|
948
|
|
949 To use a remote package list, either via the prefix argument ARG or
|
|
950 via the REMOTE argument `package-get-remote' must be non-nil. If
|
|
951 `package-get-remote' is nil, the local package list will be used.
|
1365
|
952
|
|
953 If this function is called interactively it will display INFORMATION
|
|
954 in the minibuffer."
|
2151
|
955 (interactive "i\ni\np")
|
|
956 (if (and package-get-remote
|
|
957 (or (eq arg 2)
|
|
958 (eq arg 3)
|
|
959 remote))
|
|
960 (package-get-require-base t)
|
|
961 (package-get-require-base nil))
|
|
962 (let ((all-pkgs package-get-base)
|
|
963 (package (or package
|
|
964 (intern (completing-read
|
|
965 "Package: "
|
|
966 (package-get-info-name-array) nil t))))
|
|
967 (information (or information
|
|
968 (intern (completing-read
|
|
969 "Info: "
|
|
970 package-get-info-info-array nil t))))
|
|
971 info)
|
1365
|
972 (loop until (equal package (caar all-pkgs))
|
|
973 do (setq all-pkgs (cdr all-pkgs))
|
|
974 do (if (not all-pkgs)
|
1410
|
975 (error 'invalid-argument
|
|
976 (format "%s is not a valid package" package))))
|
1365
|
977 (setq info (plist-get (cadar all-pkgs) information))
|
|
978 (if (interactive-p)
|
2151
|
979 (if (or (eq arg 3)
|
|
980 (eq arg 4))
|
1365
|
981 (insert (format "%s" info))
|
|
982 (if (package-get-key package :version)
|
|
983 (message "%s" info)
|
|
984 (message "%s (Package: %s is not installed)" info package)))
|
2151
|
985 info)))
|
428
|
986
|
|
987 ;;;###autoload
|
1832
|
988 (defun package-get-list-packages-where (item field &optional arg)
|
|
989 "Return a list of packages that fulfill certain criteria.
|
|
990
|
|
991 Argument ITEM, a symbol, is what you want to check for. ITEM must be a
|
|
992 symbol even when it doesn't make sense to be a symbol \(think, searching
|
|
993 maintainers, descriptions, etc\). The function will convert the symbol
|
|
994 to a string if a string is what is needed. The downside to this is that
|
|
995 ITEM can only ever be a single word.
|
|
996
|
|
997 Argument FIELD, a symbol, is the field to check in. You can specify
|
|
998 any one of:
|
|
999
|
|
1000 Field Sane or Allowable Content
|
|
1001 description any single word
|
|
1002 category `standard' or `mule'
|
|
1003 maintainer any single word
|
|
1004 build-date yyyy-mm-dd
|
|
1005 date yyyy-mm-dd
|
|
1006 type `regular' or `single'
|
|
1007 requires any package name
|
|
1008 provides any symbol
|
|
1009 priority `low', `medium', or `high'
|
|
1010
|
|
1011 Optional Argument ARG, a prefix arg, insert output at point in the
|
|
1012 current buffer."
|
2151
|
1013 (interactive
|
|
1014 (list (intern (read-string "List packages that contain (text): "))
|
|
1015 (intern (completing-read "in their package-info field (completion available): "
|
|
1016 '(("description" . description)
|
|
1017 ("category" . category)
|
|
1018 ("maintainer" . maintainer)
|
|
1019 ("build-date" . build-date)
|
|
1020 ("date" . date)
|
|
1021 ("type" . type)
|
|
1022 ("requires" . requires)
|
|
1023 ("provides" . provides)
|
|
1024 ("priority" . priority)) nil t))
|
|
1025 current-prefix-arg))
|
1832
|
1026 (package-get-require-base nil)
|
|
1027 (let ((pkgs package-get-base)
|
|
1028 (strings '(description category maintainer build-date date))
|
|
1029 (symbols '(type requires provides priority))
|
|
1030 results)
|
|
1031 (cond ((memq field strings)
|
|
1032 (setq item (symbol-name item))
|
|
1033 (while pkgs
|
|
1034 (when (string-match item (package-get-info (caar pkgs) field))
|
|
1035 (setq results (push (caar pkgs) results)))
|
|
1036 (setq pkgs (cdr pkgs))))
|
|
1037 ((memq field symbols)
|
|
1038 (if (or (eq field 'type)
|
|
1039 (eq field 'priority))
|
|
1040 (while pkgs
|
|
1041 (when (eq item (package-get-info (caar pkgs) field))
|
|
1042 (setq results (push (caar pkgs) results)))
|
|
1043 (setq pkgs (cdr pkgs)))
|
|
1044 (while pkgs
|
|
1045 (when (memq item (package-get-info (caar pkgs) field))
|
|
1046 (setq results (push (caar pkgs) results)))
|
|
1047 (setq pkgs (cdr pkgs)))))
|
|
1048 (t
|
|
1049 (error 'wrong-type-argument field)))
|
|
1050 (if (interactive-p)
|
|
1051 (if arg
|
|
1052 (insert (format "%s" results))
|
|
1053 (message "%s" results)))
|
|
1054 results))
|
|
1055
|
|
1056 ;;;###autoload
|
428
|
1057 (defun package-get (package &optional version conflict install-dir)
|
|
1058 "Fetch PACKAGE from remote site.
|
|
1059 Optional arguments VERSION indicates which version to retrieve, nil
|
|
1060 means most recent version. CONFLICT indicates what happens if the
|
|
1061 package is already installed. Valid values for CONFLICT are:
|
|
1062 'always always retrieve the package even if it is already installed
|
|
1063 'never do not retrieve the package if it is installed.
|
|
1064 INSTALL-DIR, if non-nil, specifies the package directory where
|
|
1065 fetched packages should be installed.
|
|
1066
|
442
|
1067 The value of `package-get-base' is used to determine what files should
|
428
|
1068 be retrieved. The value of `package-get-remote' is used to determine
|
1365
|
1069 where a package should be retrieved from.
|
428
|
1070
|
|
1071 Once the package is retrieved, its md5 checksum is computed. If that
|
|
1072 sum does not match that stored in `package-get-base' for this version
|
|
1073 of the package, an error is signalled.
|
|
1074
|
|
1075 Returns `t' upon success, the symbol `error' if the package was
|
|
1076 successfully installed but errors occurred during initialization, or
|
|
1077 `nil' upon error."
|
|
1078 (interactive (package-get-interactive-package-query nil t))
|
|
1079 (catch 'skip-update
|
|
1080 (let* ((this-package
|
|
1081 (package-get-info-version
|
|
1082 (package-get-info-find-package package-get-base
|
|
1083 package) version))
|
|
1084 (latest (package-get-info-prop this-package 'version))
|
|
1085 (installed (package-get-key package :version))
|
|
1086 (found nil)
|
1365
|
1087 (search-dir package-get-remote)
|
428
|
1088 (base-filename (package-get-info-prop this-package 'filename))
|
|
1089 (package-status t)
|
|
1090 filenames full-package-filename)
|
1365
|
1091 (if (and (equal (package-get-info package 'category) "mule")
|
|
1092 (not (featurep 'mule)))
|
1410
|
1093 (error 'invalid-state
|
|
1094 "Mule packages can't be installed with a non-Mule XEmacs"))
|
428
|
1095 (if (null this-package)
|
|
1096 (if package-get-remote
|
1410
|
1097 (error 'search-failed
|
|
1098 (format "Couldn't find package %s with version %s"
|
|
1099 package version))
|
|
1100 (error 'syntax-error
|
|
1101 "No download site or local package location specified.")))
|
428
|
1102 (if (null base-filename)
|
1410
|
1103 (error 'syntax-error
|
|
1104 (format "No filename associated with package %s, version %s"
|
|
1105 package version)))
|
1378
|
1106 (setq install-dir (package-admin-get-install-dir package install-dir))
|
428
|
1107
|
|
1108 ;; If they asked for the latest using version=nil, don't get an older
|
|
1109 ;; version than we already have.
|
|
1110 (if installed
|
|
1111 (if (> (if (stringp installed)
|
|
1112 (string-to-number installed)
|
|
1113 installed)
|
|
1114 (if (stringp latest)
|
|
1115 (string-to-number latest)
|
|
1116 latest))
|
|
1117 (if (not (null version))
|
825
|
1118 (warn "Installing %s package version %s, you had a newer version %s"
|
793
|
1119 package latest installed)
|
825
|
1120 (warn "Skipping %s package, you have a newer version %s"
|
793
|
1121 package installed)
|
428
|
1122 (throw 'skip-update t))))
|
|
1123
|
|
1124 ;; Contrive a list of possible package filenames.
|
|
1125 ;; Ugly. Is there a better way to do this?
|
|
1126 (setq filenames (cons base-filename nil))
|
|
1127 (if (string-match "^\\(..*\\)\.tar\.gz$" base-filename)
|
|
1128 (setq filenames (append filenames
|
|
1129 (list (concat (match-string 1 base-filename)
|
|
1130 ".tgz")))))
|
|
1131
|
|
1132 (setq version latest)
|
|
1133 (unless (and (eq conflict 'never)
|
|
1134 (package-get-installedp package version))
|
|
1135 ;; Find the package from the search list in package-get-remote
|
|
1136 ;; and copy it into the staging directory. Then validate
|
|
1137 ;; the checksum. Finally, install the package.
|
|
1138 (catch 'done
|
1365
|
1139 (let (search-filenames host dir current-filename dest-filename)
|
428
|
1140 ;; In each search directory ...
|
1365
|
1141 (when search-dir
|
|
1142 (setq host (car search-dir)
|
|
1143 dir (car (cdr search-dir))
|
|
1144 search-filenames filenames)
|
428
|
1145
|
|
1146 ;; Look for one of the possible package filenames ...
|
|
1147 (while search-filenames
|
|
1148 (setq current-filename (car search-filenames)
|
|
1149 dest-filename (package-get-staging-dir current-filename))
|
|
1150 (cond
|
|
1151 ;; No host means look on the current system.
|
1365
|
1152 ((null host)
|
|
1153 (setq full-package-filename
|
|
1154 (substitute-in-file-name
|
|
1155 (expand-file-name current-filename
|
|
1156 (file-name-as-directory dir)))))
|
428
|
1157
|
|
1158 ;; If it's already on the disk locally, and the size is
|
1365
|
1159 ;; correct
|
|
1160 ((and (file-exists-p dest-filename)
|
|
1161 (eq (nth 7 (file-attributes dest-filename))
|
|
1162 (package-get-info package 'size)))
|
|
1163 (setq full-package-filename dest-filename))
|
428
|
1164
|
|
1165 ;; If the file exists on the remote system ...
|
1365
|
1166 ((file-exists-p (package-get-remote-filename
|
|
1167 search-dir current-filename))
|
|
1168 ;; Get it
|
|
1169 (setq full-package-filename dest-filename)
|
|
1170 (message "Retrieving package `%s' ..."
|
|
1171 current-filename)
|
|
1172 (sit-for 0)
|
|
1173 (copy-file (package-get-remote-filename search-dir
|
|
1174 current-filename)
|
|
1175 full-package-filename t)))
|
428
|
1176
|
|
1177 ;; If we found it, we're done.
|
|
1178 (if (and full-package-filename
|
|
1179 (file-exists-p full-package-filename))
|
|
1180 (throw 'done nil))
|
|
1181 ;; Didn't find it. Try the next possible filename.
|
1365
|
1182 (setq search-filenames (cdr search-filenames))))))
|
428
|
1183
|
|
1184 (if (or (not full-package-filename)
|
|
1185 (not (file-exists-p full-package-filename)))
|
|
1186 (if package-get-remote
|
1410
|
1187 (error 'search-failed
|
|
1188 (format "Unable to find file %s" base-filename))
|
|
1189 (error 'syntax-error
|
|
1190 "No download sites or local package locations specified.")))
|
428
|
1191 ;; Validate the md5 checksum
|
|
1192 ;; Doing it with XEmacs removes the need for an external md5 program
|
|
1193 (message "Validating checksum for `%s'..." package) (sit-for 0)
|
|
1194 (with-temp-buffer
|
442
|
1195 (insert-file-contents-literally full-package-filename)
|
428
|
1196 (if (not (string= (md5 (current-buffer))
|
|
1197 (package-get-info-prop this-package
|
|
1198 'md5sum)))
|
1365
|
1199 (progn
|
|
1200 (delete-file full-package-filename)
|
1410
|
1201 (error 'process-error
|
|
1202 (format "Package %s does not match md5 checksum %s has been deleted"
|
|
1203 base-filename full-package-filename)))))
|
428
|
1204
|
|
1205 (package-admin-delete-binary-package package install-dir)
|
|
1206
|
|
1207 (message "Installing package `%s' ..." package) (sit-for 0)
|
|
1208 (let ((status
|
|
1209 (package-admin-add-binary-package full-package-filename
|
|
1210 install-dir)))
|
|
1211 (if (= status 0)
|
|
1212 (progn
|
|
1213 ;; clear messages so that only messages from
|
|
1214 ;; package-get-init-package are seen, below.
|
|
1215 (clear-message)
|
|
1216 (if (package-get-init-package (package-admin-get-lispdir
|
|
1217 install-dir package))
|
|
1218 (progn
|
628
|
1219 (run-hook-with-args 'package-install-hook package install-dir)
|
428
|
1220 (message "Added package `%s'" package)
|
1365
|
1221 (sit-for 0))
|
428
|
1222 (progn
|
|
1223 ;; display message only if there isn't already one.
|
|
1224 (if (not (current-message))
|
|
1225 (progn
|
|
1226 (message "Added package `%s' (errors occurred)"
|
|
1227 package)
|
1365
|
1228 (sit-for 0)))
|
428
|
1229 (if package-status
|
1365
|
1230 (setq package-status 'errors)))))
|
428
|
1231 (message "Installation of package %s failed." base-filename)
|
|
1232 (sit-for 0)
|
|
1233 (switch-to-buffer package-admin-temp-buffer)
|
1365
|
1234 (delete-file full-package-filename)
|
|
1235 (setq package-status nil)))
|
428
|
1236 (setq found t))
|
|
1237 (if (and found package-get-remove-copy)
|
|
1238 (delete-file full-package-filename))
|
1365
|
1239 package-status)))
|
428
|
1240
|
|
1241 (defun package-get-info-find-package (which name)
|
|
1242 "Look in WHICH for the package called NAME and return all the info
|
|
1243 associated with it. See `package-get-base' for info on the format
|
|
1244 returned.
|
|
1245
|
|
1246 To access fields returned from this, use
|
|
1247 `package-get-info-version' to return information about particular a
|
442
|
1248 version. Use `package-get-info-find-prop' to find particular property
|
428
|
1249 from a version returned by `package-get-info-version'."
|
|
1250 (interactive "xPackage list: \nsPackage Name: ")
|
|
1251 (if which
|
|
1252 (if (eq (caar which) name)
|
|
1253 (cdar which)
|
|
1254 (if (cdr which)
|
|
1255 (package-get-info-find-package (cdr which) name)))))
|
|
1256
|
|
1257 (defun package-get-info-version (package version)
|
|
1258 "In PACKAGE, return the plist associated with a particular VERSION of the
|
|
1259 package. PACKAGE is typically as returned by
|
442
|
1260 `package-get-info-find-package'. If VERSION is nil, then return the
|
428
|
1261 first (aka most recent) version. Use `package-get-info-find-prop'
|
|
1262 to retrieve a particular property from the value returned by this."
|
|
1263 (interactive (package-get-interactive-package-query t t))
|
|
1264 (while (and version package (not (string= (plist-get (car package) 'version) version)))
|
|
1265 (setq package (cdr package)))
|
|
1266 (if package (car package)))
|
|
1267
|
|
1268 (defun package-get-info-prop (package-version property)
|
|
1269 "In PACKAGE-VERSION, return the value associated with PROPERTY.
|
|
1270 PACKAGE-VERSION is typically returned by `package-get-info-version'
|
|
1271 and PROPERTY is typically (although not limited to) one of the
|
|
1272 following:
|
|
1273
|
|
1274 version - version of this package
|
|
1275 provides - list of symbols provided
|
|
1276 requires - list of symbols that are required.
|
|
1277 These in turn are provided by other packages.
|
|
1278 size - size of the bundled package
|
|
1279 md5sum - computed md5 checksum"
|
|
1280 (interactive "xPackage Version: \nSProperty")
|
|
1281 (plist-get package-version property))
|
|
1282
|
|
1283 (defun package-get-info-version-prop (package-list package version property)
|
|
1284 "In PACKAGE-LIST, search for PACKAGE with this VERSION and return
|
|
1285 PROPERTY value."
|
|
1286 (package-get-info-prop
|
|
1287 (package-get-info-version
|
|
1288 (package-get-info-find-package package-list package) version) property))
|
|
1289
|
|
1290 (defun package-get-staging-dir (filename)
|
|
1291 "Return a good place to stash FILENAME when it is retrieved.
|
|
1292 Use `package-get-dir' for directory to store stuff.
|
629
|
1293 Creates `package-get-dir' if it doesn't exist."
|
428
|
1294 (interactive "FPackage filename: ")
|
|
1295 (if (not (file-exists-p package-get-dir))
|
|
1296 (make-directory package-get-dir))
|
|
1297 (expand-file-name
|
776
|
1298 (file-name-nondirectory (or (and-fboundp 'efs-ftp-path
|
|
1299 (nth 2 (efs-ftp-path filename)))
|
428
|
1300 filename))
|
|
1301 (file-name-as-directory package-get-dir)))
|
|
1302
|
|
1303 (defun package-get-remote-filename (search filename)
|
|
1304 "Return FILENAME as a remote filename.
|
|
1305 It first checks if FILENAME already is a remote filename. If it is
|
|
1306 not, then it uses the (car search) as the remote site-name and the (cadr
|
|
1307 search) as the remote-directory and concatenates filename. In other
|
|
1308 words
|
|
1309 site-name:remote-directory/filename.
|
|
1310
|
|
1311 If (car search) is nil, (cadr search is interpreted as a local directory).
|
|
1312 "
|
|
1313 (if (file-remote-p filename)
|
|
1314 filename
|
|
1315 (let ((dir (cadr search)))
|
|
1316 (concat (when (car search)
|
|
1317 (concat
|
|
1318 (if (string-match "@" (car search))
|
|
1319 "/"
|
|
1320 "/anonymous@")
|
|
1321 (car search) ":"))
|
|
1322 (if (string-match "/$" dir)
|
|
1323 dir
|
|
1324 (concat dir "/"))
|
|
1325 filename))))
|
|
1326
|
|
1327 (defun package-get-installedp (package version)
|
|
1328 "Determine if PACKAGE with VERSION has already been installed.
|
442
|
1329 I'm not sure if I want to do this by searching directories or checking
|
428
|
1330 some built in variables. For now, use packages-package-list."
|
|
1331 ;; Use packages-package-list which contains name and version
|
|
1332 (equal (plist-get
|
|
1333 (package-get-info-find-package packages-package-list
|
|
1334 package) ':version)
|
1368
|
1335 (if (floatp version)
|
|
1336 version
|
1365
|
1337 (string-to-number version))))
|
428
|
1338
|
|
1339 ;;;###autoload
|
|
1340 (defun package-get-package-provider (sym &optional force-current)
|
|
1341 "Search for a package that provides SYM and return the name and
|
|
1342 version. Searches in `package-get-base' for SYM. If SYM is a
|
442
|
1343 consp, then it must match a corresponding (provide (SYM VERSION)) from
|
428
|
1344 the package.
|
|
1345
|
|
1346 If FORCE-CURRENT is non-nil make sure the database is up to date. This might
|
|
1347 lead to Emacs accessing remote sites."
|
|
1348 (interactive "SSymbol: ")
|
|
1349 (package-get-require-base force-current)
|
|
1350 (let ((packages package-get-base)
|
|
1351 (done nil)
|
|
1352 (found nil))
|
|
1353 (while (and (not done) packages)
|
|
1354 (let* ((this-name (caar packages))
|
|
1355 (this-package (cdr (car packages)))) ;strip off package name
|
|
1356 (while (and (not done) this-package)
|
|
1357 (if (or (eq this-name sym)
|
|
1358 (eq (cons this-name
|
|
1359 (package-get-info-prop (car this-package) 'version))
|
|
1360 sym)
|
|
1361 (member sym
|
|
1362 (package-get-info-prop (car this-package) 'provides)))
|
|
1363 (progn (setq done t)
|
|
1364 (setq found
|
|
1365 (list (caar packages)
|
|
1366 (package-get-info-prop (car this-package) 'version))))
|
|
1367 (setq this-package (cdr this-package)))))
|
|
1368 (setq packages (cdr packages)))
|
|
1369 (when (interactive-p)
|
|
1370 (if found
|
|
1371 (message "%S" found)
|
|
1372 (message "No appropriate package found")))
|
|
1373 found))
|
|
1374
|
|
1375 (defun package-get-ever-installed-p (pkg &optional notused)
|
|
1376 (string-match "-package$" (symbol-name pkg))
|
442
|
1377 (custom-initialize-set
|
|
1378 pkg
|
|
1379 (if (package-get-info-find-package
|
|
1380 packages-package-list
|
428
|
1381 (intern (substring (symbol-name pkg) 0 (match-beginning 0))))
|
|
1382 t)))
|
|
1383
|
|
1384 (provide 'package-get)
|
|
1385 ;;; package-get.el ends here
|