emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r100938: Update package-x to latest p


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100938: Update package-x to latest package.el changes.
Date: Thu, 29 Jul 2010 12:01:14 -0400
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100938
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Thu 2010-07-29 12:01:14 -0400
message:
  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.
modified:
  lisp/ChangeLog
  lisp/emacs-lisp/package-x.el
  lisp/emacs-lisp/package.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-07-29 13:13:11 +0000
+++ b/lisp/ChangeLog    2010-07-29 16:01:14 +0000
@@ -1,3 +1,15 @@
+2010-07-29  Chong Yidong  <address@hidden>
+
+       * 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.
+
 2010-07-29  Michael Albinus  <address@hidden>
 
        * net/tramp.el (tramp-handle-start-file-process): Check only for

=== modified file 'lisp/emacs-lisp/package-x.el'
--- a/lisp/emacs-lisp/package-x.el      2010-06-19 22:36:51 +0000
+++ b/lisp/emacs-lisp/package-x.el      2010-07-29 16:01:14 +0000
@@ -56,12 +56,12 @@
     (setq string (replace-match "&quot;" t nil string)))
   string)
 
-(defun package--make-rss-entry (title text)
+(defun package--make-rss-entry (title text archive-url)
   (let ((date-string (format-time-string "%a, %d %B %Y %T %z")))
     (concat "<item>\n"
            "<title>" (package--encode title) "</title>\n"
            ;; FIXME: should have a link in the web page.
-           "<link>" package-archive-base "news.html</link>\n"
+           "<link>" archive-url "news.html</link>\n"
            "<description>" (package--encode text) "</description>\n"
            "<pubDate>" date-string "</pubDate>\n"
            "</item>\n")))
@@ -85,7 +85,7 @@
        (unless old-buffer
          (kill-buffer (current-buffer)))))))
 
-(defun package-maint-add-news-item (title description)
+(defun package-maint-add-news-item (title description archive-url)
   "Add a news item to the ELPA web pages.
 TITLE is the title of the news item.
 DESCRIPTION is the text of the news item.
@@ -93,21 +93,28 @@
   (interactive "sTitle: \nsText: ")
   (package--update-file (concat package-archive-upload-base "elpa.rss")
                        "<description>"
-                       (package--make-rss-entry title description))
+                       (package--make-rss-entry title description archive-url))
   (package--update-file (concat package-archive-upload-base "news.html")
                        "New entries go here"
                        (package--make-html-entry title description)))
 
-(defun package--update-news (package version description)
+(defun package--update-news (package version description archive-url)
   "Update the ELPA web pages when a package is uploaded."
   (package-maint-add-news-item (concat package " version " version)
-                              description))
+                              description
+                              archive-url))
 
-(defun package-upload-buffer-internal (pkg-info extension)
+(defun package-upload-buffer-internal (pkg-info extension &optional 
archive-url)
   "Upload a package whose contents are in the current buffer.
 PKG-INFO is the package info, see `package-buffer-info'.
 EXTENSION is the file extension, a string.  It can be either
-\"el\" or \"tar\"."
+\"el\" or \"tar\".
+
+Optional arg ARCHIVE-URL is the URL of the destination archive.
+If nil, the \"gnu\" archive is used."
+  (unless archive-url
+    (or (setq archive-url (cdr (assoc "gnu" package-archives)))
+       (error "No destination URL")))
   (save-excursion
     (save-restriction
       (let* ((file-type (cond
@@ -127,7 +134,7 @@
 
             ;; Download latest archive-contents.
             (buffer (url-retrieve-synchronously
-                     (concat package-archive-base "archive-contents"))))
+                     (concat archive-url "archive-contents"))))
 
        ;; Parse archive-contents.
        (set-buffer buffer)
@@ -178,7 +185,7 @@
 
          ;; Write a news entry.
          (package--update-news (concat file-name "." extension)
-                               pkg-version desc)
+                               pkg-version desc archive-url)
 
          ;; special-case "package": write a second copy so that the
          ;; installer can easily find the latest version.

=== modified file 'lisp/emacs-lisp/package.el'
--- a/lisp/emacs-lisp/package.el        2010-07-28 18:54:42 +0000
+++ b/lisp/emacs-lisp/package.el        2010-07-29 16:01:14 +0000
@@ -685,7 +685,7 @@
 (defun package-download-single (name version desc requires)
   "Download and install a single-file package."
   (let ((buffer (url-retrieve-synchronously
-                (concat (package-archive-id name)
+                (concat (package-archive-url name)
                         (symbol-name name) "-" version ".el"))))
     (with-current-buffer buffer
       (package-handle-response)
@@ -698,7 +698,7 @@
 (defun package-download-tar (name version)
   "Download and install a tar package."
   (let ((tar-buffer (url-retrieve-synchronously
-                    (concat (package-archive-id name)
+                    (concat (package-archive-url name)
                             (symbol-name name) "-" version ".tar"))))
     (with-current-buffer tar-buffer
       (package-handle-response)
@@ -856,7 +856,7 @@
 (defun package-install (name)
   "Install the package named NAME.
 Interactively, prompt for the package name.
-The package is found on one of the archives in `package-archive-base'."
+The package is found on one of the archives in `package-archives'."
   (interactive
    (list (intern (completing-read "Install package: "
                                  (mapcar (lambda (elt)
@@ -1030,7 +1030,7 @@
                     ;; FIXME: query user?
                     'always))
 
-(defun package-archive-id (name)
+(defun package-archive-url (name)
   "Return the archive containing the package NAME."
   (let ((desc (cdr (assq (intern-soft name) package-archive-contents))))
     (cdr (assoc (aref desc (- (length desc) 1)) package-archives))))
@@ -1350,7 +1350,7 @@
   (interactive)
   (let* ((pkg-name (package-menu-get-package))
         (buffer (url-retrieve-synchronously
-                 (concat (package-archive-id pkg-name)
+                 (concat (package-archive-url pkg-name)
                          pkg-name
                          "-readme.txt")))
         start-point ok)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]