]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/package-x.el
* lisp/subr.el (set-transient-map): Don't wait for some "nested"
[gnu-emacs] / lisp / emacs-lisp / package-x.el
index 11053158d3ea61118ad652679a475a06cb9955b2..1d9d1a04668a965082f782ca022c5d233c9bece3 100644 (file)
@@ -1,6 +1,6 @@
 ;;; package-x.el --- Package extras
 
-;; Copyright (C) 2007-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2014 Free Software Foundation, Inc.
 
 ;; Author: Tom Tromey <tromey@redhat.com>
 ;; Created: 10 Mar 2007
@@ -114,18 +114,12 @@ inserted after its first occurrence in the file."
 (defun package--archive-contents-from-url (archive-url)
   "Parse archive-contents file at ARCHIVE-URL.
 Return the file contents, as a string, or nil if unsuccessful."
-  (ignore-errors
-    (when archive-url
-      (let* ((buffer (url-retrieve-synchronously
-                     (concat archive-url "archive-contents"))))
-       (set-buffer buffer)
-       (package-handle-response)
-       (re-search-forward "^$" nil 'move)
-       (forward-char)
-       (delete-region (point-min) (point))
-       (prog1 (package-read-from-string
-               (buffer-substring-no-properties (point-min) (point-max)))
-         (kill-buffer buffer))))))
+  (when archive-url
+    (with-temp-buffer
+      (ignore-errors
+       (url-insert-file-contents (concat archive-url "archive-contents"))
+       (package-read-from-string
+        (buffer-substring-no-properties (point-min) (point-max)))))))
 
 (defun package--archive-contents-from-file ()
   "Parse the archive-contents at `package-archive-upload-base'"