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