Commit b511b994 authored by Michael Albinus's avatar Michael Albinus

* simple.el (shell-command-to-string): Use `process-file'.

* emacs-lisp/package.el (package-tar-file-info): Handle also
remote files.

* emacs-lisp/package-x.el (package-upload-buffer-internal): Use
`equal' for upload base check.
parent 6446548e
2011-03-08 Michael Albinus <michael.albinus@gmx.de>
* simple.el (shell-command-to-string): Use `process-file'.
* emacs-lisp/package.el (package-tar-file-info): Handle also
remote files.
* emacs-lisp/package-x.el (package-upload-buffer-internal): Use
`equal' for upload base check.
2011-03-08 Arni Magnusson <arnima@hafro.is> (tiny change)
* textmodes/texinfo.el (texinfo-environments):
......
......@@ -185,9 +185,9 @@ if it exists."
(let ((package-archive-upload-base package-archive-upload-base))
;; Check if `package-archive-upload-base' is valid.
(when (or (not (stringp package-archive-upload-base))
(eq package-archive-upload-base
(car-safe
(get 'package-archive-upload-base 'standard-value))))
(equal package-archive-upload-base
(car-safe
(get 'package-archive-upload-base 'standard-value))))
(setq package-archive-upload-base
(read-directory-name
"Base directory for package archive: ")))
......@@ -306,4 +306,4 @@ This should be invoked from the gnus *Summary* buffer."
(provide 'package-x)
;;; package.el ends here
;;; package-x.el ends here
......@@ -911,43 +911,46 @@ boundaries."
"Find package information for a tar file.
FILE is the name of the tar file to examine.
The return result is a vector like `package-buffer-info'."
(unless (string-match "^\\(.+\\)-\\([0-9.]+\\)\\.tar$" file)
(error "Invalid package name `%s'" file))
(let* ((pkg-name (file-name-nondirectory (match-string-no-properties 1 file)))
(pkg-version (match-string-no-properties 2 file))
;; Extract the package descriptor.
(pkg-def-contents (shell-command-to-string
;; Requires GNU tar.
(concat "tar -xOf " file " "
pkg-name "-" pkg-version "/"
pkg-name "-pkg.el")))
(pkg-def-parsed (package-read-from-string pkg-def-contents)))
(unless (eq (car pkg-def-parsed) 'define-package)
(error "No `define-package' sexp is present in `%s-pkg.el'" pkg-name))
(let ((name-str (nth 1 pkg-def-parsed))
(version-string (nth 2 pkg-def-parsed))
(docstring (nth 3 pkg-def-parsed))
(requires (nth 4 pkg-def-parsed))
(readme (shell-command-to-string
;; Requires GNU tar.
(concat "tar -xOf " file " "
pkg-name "-" pkg-version "/README"))))
(unless (equal pkg-version version-string)
(error "Package has inconsistent versions"))
(unless (equal pkg-name name-str)
(error "Package has inconsistent names"))
;; Kind of a hack.
(if (string-match ": Not found in archive" readme)
(setq readme nil))
;; Turn string version numbers into list form.
(if (eq (car requires) 'quote)
(setq requires (car (cdr requires))))
(setq requires
(mapcar (lambda (elt)
(list (car elt)
(version-to-list (cadr elt))))
requires))
(vector pkg-name requires docstring version-string readme))))
(let ((default-directory (file-name-directory file))
(file (file-name-nondirectory file)))
(unless (string-match "^\\(.+\\)-\\([0-9.]+\\)\\.tar$" file)
(error "Invalid package name `%s'" file))
(let* ((pkg-name (match-string-no-properties 1 file))
(pkg-version (match-string-no-properties 2 file))
;; Extract the package descriptor.
(pkg-def-contents (shell-command-to-string
;; Requires GNU tar.
(concat "tar -xOf " file " "
pkg-name "-" pkg-version "/"
pkg-name "-pkg.el")))
(pkg-def-parsed (package-read-from-string pkg-def-contents)))
(unless (eq (car pkg-def-parsed) 'define-package)
(error "No `define-package' sexp is present in `%s-pkg.el'" pkg-name))
(let ((name-str (nth 1 pkg-def-parsed))
(version-string (nth 2 pkg-def-parsed))
(docstring (nth 3 pkg-def-parsed))
(requires (nth 4 pkg-def-parsed))
(readme (shell-command-to-string
;; Requires GNU tar.
(concat "tar -xOf " file " "
pkg-name "-" pkg-version "/README"))))
(unless (equal pkg-version version-string)
(error "Package has inconsistent versions"))
(unless (equal pkg-name name-str)
(error "Package has inconsistent names"))
;; Kind of a hack.
(if (string-match ": Not found in archive" readme)
(setq readme nil))
;; Turn string version numbers into list form.
(if (eq (car requires) 'quote)
(setq requires (car (cdr requires))))
(setq requires
(mapcar (lambda (elt)
(list (car elt)
(version-to-list (cadr elt))))
requires))
(vector pkg-name requires docstring version-string readme)))))
;;;###autoload
(defun package-install-from-buffer (pkg-info type)
......
......@@ -2628,7 +2628,7 @@ specifies the value of ERROR-BUFFER."
(with-output-to-string
(with-current-buffer
standard-output
(call-process shell-file-name nil t nil shell-command-switch command))))
(process-file shell-file-name nil t nil shell-command-switch command))))
(defun process-file (program &optional infile buffer display &rest args)
"Process files synchronously in a separate process.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment