diff options
| author | Chong Yidong | 2010-07-29 12:01:14 -0400 |
|---|---|---|
| committer | Chong Yidong | 2010-07-29 12:01:14 -0400 |
| commit | 063e52940d4d97fe372f226c895d6d0f9d87f5d4 (patch) | |
| tree | b08402714b51509bcc0bd6561ed46e5c61c11405 | |
| parent | 26469a38e110614fd3ea603f0b6ee2ab6d27a3be (diff) | |
| download | emacs-063e52940d4d97fe372f226c895d6d0f9d87f5d4.tar.gz emacs-063e52940d4d97fe372f226c895d6d0f9d87f5d4.zip | |
Update package-x to latest package.el changes.
* emacs-lisp/package-x.el (package--make-rss-entry):
(package-maint-add-news-item, package--update-news)
(package-upload-buffer-internal): New arg ARCHIVE-URL.
* emacs-lisp/package.el (package-archive-url): Rename from
package-archive-id.
(package-install): Doc fix.
(package-download-single, package-download-tar, package-install)
(package-menu-view-commentary): Callers changed.
| -rw-r--r-- | lisp/ChangeLog | 12 | ||||
| -rw-r--r-- | lisp/emacs-lisp/package-x.el | 27 | ||||
| -rw-r--r-- | lisp/emacs-lisp/package.el | 10 |
3 files changed, 34 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 49dcafca9da..6cd759ee0a3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2010-07-29 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * emacs-lisp/package-x.el (package--make-rss-entry): | ||
| 4 | (package-maint-add-news-item, package--update-news) | ||
| 5 | (package-upload-buffer-internal): New arg ARCHIVE-URL. | ||
| 6 | |||
| 7 | * emacs-lisp/package.el (package-archive-url): Rename from | ||
| 8 | package-archive-id. | ||
| 9 | (package-install): Doc fix. | ||
| 10 | (package-download-single, package-download-tar, package-install) | ||
| 11 | (package-menu-view-commentary): Callers changed. | ||
| 12 | |||
| 1 | 2010-07-29 Michael Albinus <michael.albinus@gmx.de> | 13 | 2010-07-29 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 14 | ||
| 3 | * net/tramp.el (tramp-handle-start-file-process): Check only for | 15 | * net/tramp.el (tramp-handle-start-file-process): Check only for |
diff --git a/lisp/emacs-lisp/package-x.el b/lisp/emacs-lisp/package-x.el index 21bd7960d89..2a5d84f339b 100644 --- a/lisp/emacs-lisp/package-x.el +++ b/lisp/emacs-lisp/package-x.el | |||
| @@ -56,12 +56,12 @@ | |||
| 56 | (setq string (replace-match """ t nil string))) | 56 | (setq string (replace-match """ t nil string))) |
| 57 | string) | 57 | string) |
| 58 | 58 | ||
| 59 | (defun package--make-rss-entry (title text) | 59 | (defun package--make-rss-entry (title text archive-url) |
| 60 | (let ((date-string (format-time-string "%a, %d %B %Y %T %z"))) | 60 | (let ((date-string (format-time-string "%a, %d %B %Y %T %z"))) |
| 61 | (concat "<item>\n" | 61 | (concat "<item>\n" |
| 62 | "<title>" (package--encode title) "</title>\n" | 62 | "<title>" (package--encode title) "</title>\n" |
| 63 | ;; FIXME: should have a link in the web page. | 63 | ;; FIXME: should have a link in the web page. |
| 64 | "<link>" package-archive-base "news.html</link>\n" | 64 | "<link>" archive-url "news.html</link>\n" |
| 65 | "<description>" (package--encode text) "</description>\n" | 65 | "<description>" (package--encode text) "</description>\n" |
| 66 | "<pubDate>" date-string "</pubDate>\n" | 66 | "<pubDate>" date-string "</pubDate>\n" |
| 67 | "</item>\n"))) | 67 | "</item>\n"))) |
| @@ -85,7 +85,7 @@ | |||
| 85 | (unless old-buffer | 85 | (unless old-buffer |
| 86 | (kill-buffer (current-buffer))))))) | 86 | (kill-buffer (current-buffer))))))) |
| 87 | 87 | ||
| 88 | (defun package-maint-add-news-item (title description) | 88 | (defun package-maint-add-news-item (title description archive-url) |
| 89 | "Add a news item to the ELPA web pages. | 89 | "Add a news item to the ELPA web pages. |
| 90 | TITLE is the title of the news item. | 90 | TITLE is the title of the news item. |
| 91 | DESCRIPTION is the text of the news item. | 91 | DESCRIPTION is the text of the news item. |
| @@ -93,21 +93,28 @@ You need administrative access to ELPA to use this." | |||
| 93 | (interactive "sTitle: \nsText: ") | 93 | (interactive "sTitle: \nsText: ") |
| 94 | (package--update-file (concat package-archive-upload-base "elpa.rss") | 94 | (package--update-file (concat package-archive-upload-base "elpa.rss") |
| 95 | "<description>" | 95 | "<description>" |
| 96 | (package--make-rss-entry title description)) | 96 | (package--make-rss-entry title description archive-url)) |
| 97 | (package--update-file (concat package-archive-upload-base "news.html") | 97 | (package--update-file (concat package-archive-upload-base "news.html") |
| 98 | "New entries go here" | 98 | "New entries go here" |
| 99 | (package--make-html-entry title description))) | 99 | (package--make-html-entry title description))) |
| 100 | 100 | ||
| 101 | (defun package--update-news (package version description) | 101 | (defun package--update-news (package version description archive-url) |
| 102 | "Update the ELPA web pages when a package is uploaded." | 102 | "Update the ELPA web pages when a package is uploaded." |
| 103 | (package-maint-add-news-item (concat package " version " version) | 103 | (package-maint-add-news-item (concat package " version " version) |
| 104 | description)) | 104 | description |
| 105 | archive-url)) | ||
| 105 | 106 | ||
| 106 | (defun package-upload-buffer-internal (pkg-info extension) | 107 | (defun package-upload-buffer-internal (pkg-info extension &optional archive-url) |
| 107 | "Upload a package whose contents are in the current buffer. | 108 | "Upload a package whose contents are in the current buffer. |
| 108 | PKG-INFO is the package info, see `package-buffer-info'. | 109 | PKG-INFO is the package info, see `package-buffer-info'. |
| 109 | EXTENSION is the file extension, a string. It can be either | 110 | EXTENSION is the file extension, a string. It can be either |
| 110 | \"el\" or \"tar\"." | 111 | \"el\" or \"tar\". |
| 112 | |||
| 113 | Optional arg ARCHIVE-URL is the URL of the destination archive. | ||
| 114 | If nil, the \"gnu\" archive is used." | ||
| 115 | (unless archive-url | ||
| 116 | (or (setq archive-url (cdr (assoc "gnu" package-archives))) | ||
| 117 | (error "No destination URL"))) | ||
| 111 | (save-excursion | 118 | (save-excursion |
| 112 | (save-restriction | 119 | (save-restriction |
| 113 | (let* ((file-type (cond | 120 | (let* ((file-type (cond |
| @@ -127,7 +134,7 @@ EXTENSION is the file extension, a string. It can be either | |||
| 127 | 134 | ||
| 128 | ;; Download latest archive-contents. | 135 | ;; Download latest archive-contents. |
| 129 | (buffer (url-retrieve-synchronously | 136 | (buffer (url-retrieve-synchronously |
| 130 | (concat package-archive-base "archive-contents")))) | 137 | (concat archive-url "archive-contents")))) |
| 131 | 138 | ||
| 132 | ;; Parse archive-contents. | 139 | ;; Parse archive-contents. |
| 133 | (set-buffer buffer) | 140 | (set-buffer buffer) |
| @@ -178,7 +185,7 @@ EXTENSION is the file extension, a string. It can be either | |||
| 178 | 185 | ||
| 179 | ;; Write a news entry. | 186 | ;; Write a news entry. |
| 180 | (package--update-news (concat file-name "." extension) | 187 | (package--update-news (concat file-name "." extension) |
| 181 | pkg-version desc) | 188 | pkg-version desc archive-url) |
| 182 | 189 | ||
| 183 | ;; special-case "package": write a second copy so that the | 190 | ;; special-case "package": write a second copy so that the |
| 184 | ;; installer can easily find the latest version. | 191 | ;; installer can easily find the latest version. |
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 6470d345dff..73434a1717b 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el | |||
| @@ -685,7 +685,7 @@ It will move point to somewhere in the headers." | |||
| 685 | (defun package-download-single (name version desc requires) | 685 | (defun package-download-single (name version desc requires) |
| 686 | "Download and install a single-file package." | 686 | "Download and install a single-file package." |
| 687 | (let ((buffer (url-retrieve-synchronously | 687 | (let ((buffer (url-retrieve-synchronously |
| 688 | (concat (package-archive-id name) | 688 | (concat (package-archive-url name) |
| 689 | (symbol-name name) "-" version ".el")))) | 689 | (symbol-name name) "-" version ".el")))) |
| 690 | (with-current-buffer buffer | 690 | (with-current-buffer buffer |
| 691 | (package-handle-response) | 691 | (package-handle-response) |
| @@ -698,7 +698,7 @@ It will move point to somewhere in the headers." | |||
| 698 | (defun package-download-tar (name version) | 698 | (defun package-download-tar (name version) |
| 699 | "Download and install a tar package." | 699 | "Download and install a tar package." |
| 700 | (let ((tar-buffer (url-retrieve-synchronously | 700 | (let ((tar-buffer (url-retrieve-synchronously |
| 701 | (concat (package-archive-id name) | 701 | (concat (package-archive-url name) |
| 702 | (symbol-name name) "-" version ".tar")))) | 702 | (symbol-name name) "-" version ".tar")))) |
| 703 | (with-current-buffer tar-buffer | 703 | (with-current-buffer tar-buffer |
| 704 | (package-handle-response) | 704 | (package-handle-response) |
| @@ -856,7 +856,7 @@ Also, add the originating archive to the end of the package vector." | |||
| 856 | (defun package-install (name) | 856 | (defun package-install (name) |
| 857 | "Install the package named NAME. | 857 | "Install the package named NAME. |
| 858 | Interactively, prompt for the package name. | 858 | Interactively, prompt for the package name. |
| 859 | The package is found on one of the archives in `package-archive-base'." | 859 | The package is found on one of the archives in `package-archives'." |
| 860 | (interactive | 860 | (interactive |
| 861 | (list (intern (completing-read "Install package: " | 861 | (list (intern (completing-read "Install package: " |
| 862 | (mapcar (lambda (elt) | 862 | (mapcar (lambda (elt) |
| @@ -1030,7 +1030,7 @@ The file can either be a tar file or an Emacs Lisp file." | |||
| 1030 | ;; FIXME: query user? | 1030 | ;; FIXME: query user? |
| 1031 | 'always)) | 1031 | 'always)) |
| 1032 | 1032 | ||
| 1033 | (defun package-archive-id (name) | 1033 | (defun package-archive-url (name) |
| 1034 | "Return the archive containing the package NAME." | 1034 | "Return the archive containing the package NAME." |
| 1035 | (let ((desc (cdr (assq (intern-soft name) package-archive-contents)))) | 1035 | (let ((desc (cdr (assq (intern-soft name) package-archive-contents)))) |
| 1036 | (cdr (assoc (aref desc (- (length desc) 1)) package-archives)))) | 1036 | (cdr (assoc (aref desc (- (length desc) 1)) package-archives)))) |
| @@ -1350,7 +1350,7 @@ For larger packages, shows the README file." | |||
| 1350 | (interactive) | 1350 | (interactive) |
| 1351 | (let* ((pkg-name (package-menu-get-package)) | 1351 | (let* ((pkg-name (package-menu-get-package)) |
| 1352 | (buffer (url-retrieve-synchronously | 1352 | (buffer (url-retrieve-synchronously |
| 1353 | (concat (package-archive-id pkg-name) | 1353 | (concat (package-archive-url pkg-name) |
| 1354 | pkg-name | 1354 | pkg-name |
| 1355 | "-readme.txt"))) | 1355 | "-readme.txt"))) |
| 1356 | start-point ok) | 1356 | start-point ok) |