Mercurial > hg > xemacs-beta
comparison lisp/package-net.el @ 452:3d3049ae1304 r21-2-41
Import from CVS: tag r21-2-41
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:40:21 +0200 |
parents | 3078fd1074e8 |
children | d7a9135ec789 |
comparison
equal
deleted
inserted
replaced
451:8ad70c5cd5d7 | 452:3d3049ae1304 |
---|---|
24 ;;; Synched up with: Not in FSF | 24 ;;; Synched up with: Not in FSF |
25 | 25 |
26 ;;; Commentary: | 26 ;;; Commentary: |
27 | 27 |
28 ;; Manipulate packages for the netinstall setup utility | 28 ;; Manipulate packages for the netinstall setup utility |
29 | |
30 ;; The process should be so: | |
31 | |
32 ;; 1. The package maintainer or release manager makes a release | |
33 ;; announcement. | |
34 ;; | |
35 ;; 2. For a new package releases the netinstall maintainer simply | |
36 ;; needs to update `ftp://ftp.xemacs.org/pub/xemacs/setup.ini'. This is | |
37 ;; harder than it sounds because the file also includes information | |
38 ;; about the binary releases. At the moment going to the netinstall | |
39 ;; directory and typing: | |
40 ;; | |
41 ;; `make XEMACS=<current executable location> setup.ini' | |
42 ;; | |
43 ;; will do the right thing provided that: | |
44 ;; | |
45 ;; (a) `package-net-cygwin32-binary-size' and | |
46 ;; `package-net-win32-binary-size' are set correctly. | |
47 ;; | |
48 ;; (b) The binary pointed to by `XEMACS' has a current | |
49 ;; `package-index.LATEST.pgp' file. If you don't specify the XEMACS= | |
50 ;; part then you will get whatever is current for your build tree - | |
51 ;; which is probably not what you want. | |
52 ;; | |
53 ;; You can run `package-net-convert-index-to-ini' manually and specify | |
54 ;; REMOTE but I generally found that to be inconvenient and error-prone. | |
55 ;; | |
56 ;; 3. For package releases that's all you need to do. For binary | |
57 ;; releases you need to build both cygwin and win32 binaries and put | |
58 ;; them in appropriate tarballs: | |
59 ;; | |
60 ;; For cygwin, configure, make and install and then do (this is for | |
61 ;; 21.1.13): | |
62 ;; | |
63 ;; cd <install dir> | |
64 ;; tar cvzf xemacs-i686-pc-cygwin32-21.1.13.tar.gz \ | |
65 ;; ./bin/i686-pc-cygwin32 ./lib/xemacs-21.1.13 \ | |
66 ;; ./lib/xemacs/lock ./man/man1/xemacs.1 \ | |
67 ;; ./man/man1/ctags.1 ./man/man1/gnu*.1' | |
68 ;; | |
69 ;; Note that the naming of the package is important. Don't be tempted | |
70 ;; to change the order in any way. | |
71 ;; | |
72 ;; For win32 build and install the release and then (again for | |
73 ;; 21.1.13): | |
74 ;; | |
75 ;; cd <install dir> | |
76 ;; tar cvzf xemacs-i386-pc-win32-21.1.13.tar.gz ./XEmacs-21.1.13 | |
77 ;; | |
78 ;; The binaries should be uploaded to | |
79 ;; `ftp://ftp.xemacs.org/pub/xemacs/binaries/cygwin32' and | |
80 ;; `ftp://ftp.xemacs.org/pub/xemacs/binaries/win32' respectively. Take | |
81 ;; a note of their sizes and set `package-net-cygwin32-binary-size' | |
82 ;; and `package-net-win32-binary-size' appropriately in this file and | |
83 ;; then follow step 2. | |
29 | 84 |
30 (require 'package-admin) | 85 (require 'package-admin) |
31 (require 'package-get) | 86 (require 'package-get) |
32 | 87 |
33 ;; What path should we use from the myriad available? | 88 ;; What path should we use from the myriad available? |
34 ;; For netinstall we just want something simple, and anyway this is only to | 89 ;; For netinstall we just want something simple, and anyway this is only to |
35 ;; bootstrap the process. This will be: | 90 ;; bootstrap the process. This will be: |
36 ;; <root>/setup/ for native windows | 91 ;; <root>/setup/ for native windows |
37 ;; <root>/lib/xemacs/setup for cygwin. | 92 ;; <root>/lib/xemacs/setup for cygwin. |
93 ;; | |
94 ;;; To Do: | |
95 ;; | |
96 ;; 1. Package update functions should also update the installed | |
97 ;; database so that running setup.exe again does not reinstall | |
98 ;; packages. | |
99 ;; | |
100 ;; 2. Generating setup.ini should be more automatic. | |
101 | |
102 (defvar package-net-cygwin32-binary-size 6917126 | |
103 "The size in bytes of the cygwin32 binary distribution.") | |
104 | |
105 (defvar package-net-win32-binary-size 6563941 | |
106 "The size in bytes of the win32 binary distribution.") | |
107 | |
108 ;;;###autoload | |
38 (defun package-net-setup-directory () | 109 (defun package-net-setup-directory () |
39 (file-truename (concat data-directory "../../" (if (eq system-type 'cygwin32) | 110 (file-truename (concat data-directory "../../" (if (eq system-type 'cygwin32) |
40 "xemacs/setup/" "setup/")))) | 111 "xemacs/setup/" "setup/")))) |
41 | 112 |
42 (defun package-net-convert-index-to-ini (&optional destdir remote version) | 113 (defun package-net-convert-index-to-ini (&optional destdir remote version) |
57 (insert "#\n\n") | 128 (insert "#\n\n") |
58 (insert (format "setup-timestamp: %d\n" | 129 (insert (format "setup-timestamp: %d\n" |
59 (+ (* (car (current-time)) 65536) (car (cdr (current-time)))))) | 130 (+ (* (car (current-time)) 65536) (car (cdr (current-time)))))) |
60 (insert (format "setup-version: %s\n\n" (or version "1.0"))) | 131 (insert (format "setup-version: %s\n\n" (or version "1.0"))) |
61 ;; Native version | 132 ;; Native version |
62 ;; We give the package a capitalised name so that it appears at the top | 133 (insert (format "@ %s\n" "xemacs-i386-pc-win32")) |
63 (insert (format "@ %s\n" "xemacs-i586-pc-win32")) | |
64 (insert (format "version: %s\n" emacs-program-version)) | 134 (insert (format "version: %s\n" emacs-program-version)) |
65 (insert "type: native\n") | 135 (insert "type: native\n") |
66 (insert (format "install: binaries/win32/%s %d\n\n" | 136 (insert (format "install: binaries/win32/%s %d\n\n" |
67 (concat emacs-program-name | 137 (concat emacs-program-name |
68 "-i586-pc-win32-" | 138 "-i386-pc-win32-" |
69 emacs-program-version ".tar.gz") 0)) | 139 emacs-program-version ".tar.gz") |
140 package-net-win32-binary-size)) | |
70 ;; Cygwin version | 141 ;; Cygwin version |
71 ;; We give the package a capitalised name so that it appears at the top | |
72 (insert (format "@ %s\n" "xemacs-i686-pc-cygwin32")) | 142 (insert (format "@ %s\n" "xemacs-i686-pc-cygwin32")) |
73 (insert (format "version: %s\n" emacs-program-version)) | 143 (insert (format "version: %s\n" emacs-program-version)) |
74 (insert "type: cygwin\n") | 144 (insert "type: cygwin\n") |
75 (insert (format "install: binaries/cygwin32/%s %d\n\n" | 145 (insert (format "install: binaries/cygwin32/%s %d\n\n" |
76 (concat emacs-program-name | 146 (concat emacs-program-name |
77 "-i686-pc-cygwin32-" | 147 "-i686-pc-cygwin32-" |
78 emacs-program-version ".tar.gz") 6779200)) | 148 emacs-program-version ".tar.gz") |
149 package-net-cygwin32-binary-size)) | |
79 ;; Standard packages | 150 ;; Standard packages |
80 (while entries | 151 (while entries |
81 (setq entry (car entries)) | 152 (setq entry (car entries)) |
82 (setq plist (car (cdr entry))) | 153 (setq plist (car (cdr entry))) |
83 (insert (format "@ %s\n" (symbol-name (car entry)))) | 154 ;; ignore mule packages |
84 (insert (format "version: %s\n" (plist-get plist 'version))) | 155 (unless (or (memq 'mule-base (plist-get plist 'requires)) |
85 (insert (format "install: packages/%s %s\n" (plist-get plist 'filename) | 156 (eq 'mule-base (car entry))) |
86 (plist-get plist 'size))) | 157 (insert (format "@ %s\n" (symbol-name (car entry)))) |
158 (insert (format "version: %s\n" (plist-get plist 'version))) | |
159 (insert (format "install: packages/%s %s\n" (plist-get plist 'filename) | |
160 (plist-get plist 'size))) | |
87 ;; These are not supported as yet | 161 ;; These are not supported as yet |
88 ;; | 162 ;; |
89 ;; (insert (format "source: %s\n" (plist-get plist 'source))) | 163 ;; (insert (format "source: %s\n" (plist-get plist 'source))) |
90 ;; (insert "[prev]\n") | 164 ;; (insert "[prev]\n") |
91 ;; (insert (format "version: %s\n" (plist-get plist 'version))) | 165 ;; (insert (format "version: %s\n" (plist-get plist 'version))) |
92 ;; (insert (format "install: %s\n" (plist-get plist 'filename))) | 166 ;; (insert (format "install: %s\n" (plist-get plist 'filename))) |
93 ;; (insert (format "source: %s\n" (plist-get plist 'source))) | 167 ;; (insert (format "source: %s\n" (plist-get plist 'source))) |
94 (insert "\n") | 168 (insert "\n")) |
95 (setq entries (cdr entries)))) | 169 (setq entries (cdr entries)))) |
96 (insert "# setup.ini file ends here\n") | 170 (insert "# setup.ini file ends here\n") |
97 (write-region (point-min) (point-max) (concat destdir "setup.ini"))) | 171 (write-region (point-min) (point-max) (concat destdir "setup.ini"))) |
98 (kill-buffer buf)))) | 172 (kill-buffer buf)))) |
99 | 173 |
174 (defun package-net-batch-convert-index-to-ini () | |
175 "Convert the package index to ini file format." | |
176 (unless noninteractive | |
177 (error "`package-net-batch-convert-index-to-ini' is to be used only with -batch")) | |
178 (let ((dir (car command-line-args-left)) | |
179 (version (car (cdr command-line-args-left))) | |
180 (package-get-require-signed-base-updates nil)) | |
181 (package-net-convert-index-to-ini dir nil version))) | |
182 | |
183 ;;;###autoload | |
100 (defun package-net-update-installed-db (&optional destdir) | 184 (defun package-net-update-installed-db (&optional destdir) |
101 "Write out the installed package index in a net install suitable format. | 185 "Write out the installed package index in a net install suitable format. |
102 If DESTDIR is non-nil then use that as the destination directory. | 186 If DESTDIR is non-nil then use that as the destination directory. |
103 DESTDIR defaults to the value of `package-net-setup-directory'." | 187 DESTDIR defaults to the value of `package-net-setup-directory'." |
104 ;; Need the local version | 188 ;; Need the local version |