diff options
| author | Michael Albinus | 2011-03-08 13:58:40 +0100 |
|---|---|---|
| committer | Michael Albinus | 2011-03-08 13:58:40 +0100 |
| commit | b511b994ae5fc66d36a64f54eb71b87612463918 (patch) | |
| tree | 8180e7329d4a19cfe6f69a572503ce44b1ccb1f1 | |
| parent | 6446548e027a18582e1f6661d553902b25d15157 (diff) | |
| download | emacs-b511b994ae5fc66d36a64f54eb71b87612463918.tar.gz emacs-b511b994ae5fc66d36a64f54eb71b87612463918.zip | |
* 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.
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/emacs-lisp/package-x.el | 8 | ||||
| -rw-r--r-- | lisp/emacs-lisp/package.el | 77 | ||||
| -rw-r--r-- | lisp/simple.el | 2 |
4 files changed, 55 insertions, 42 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6aa6993a70a..ca21c9ebf2c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2011-03-08 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * simple.el (shell-command-to-string): Use `process-file'. | ||
| 4 | |||
| 5 | * emacs-lisp/package.el (package-tar-file-info): Handle also | ||
| 6 | remote files. | ||
| 7 | |||
| 8 | * emacs-lisp/package-x.el (package-upload-buffer-internal): Use | ||
| 9 | `equal' for upload base check. | ||
| 10 | |||
| 1 | 2011-03-08 Arni Magnusson <arnima@hafro.is> (tiny change) | 11 | 2011-03-08 Arni Magnusson <arnima@hafro.is> (tiny change) |
| 2 | 12 | ||
| 3 | * textmodes/texinfo.el (texinfo-environments): | 13 | * textmodes/texinfo.el (texinfo-environments): |
diff --git a/lisp/emacs-lisp/package-x.el b/lisp/emacs-lisp/package-x.el index 4de95f65702..cd4b5ee231c 100644 --- a/lisp/emacs-lisp/package-x.el +++ b/lisp/emacs-lisp/package-x.el | |||
| @@ -185,9 +185,9 @@ if it exists." | |||
| 185 | (let ((package-archive-upload-base package-archive-upload-base)) | 185 | (let ((package-archive-upload-base package-archive-upload-base)) |
| 186 | ;; Check if `package-archive-upload-base' is valid. | 186 | ;; Check if `package-archive-upload-base' is valid. |
| 187 | (when (or (not (stringp package-archive-upload-base)) | 187 | (when (or (not (stringp package-archive-upload-base)) |
| 188 | (eq package-archive-upload-base | 188 | (equal package-archive-upload-base |
| 189 | (car-safe | 189 | (car-safe |
| 190 | (get 'package-archive-upload-base 'standard-value)))) | 190 | (get 'package-archive-upload-base 'standard-value)))) |
| 191 | (setq package-archive-upload-base | 191 | (setq package-archive-upload-base |
| 192 | (read-directory-name | 192 | (read-directory-name |
| 193 | "Base directory for package archive: "))) | 193 | "Base directory for package archive: "))) |
| @@ -306,4 +306,4 @@ This should be invoked from the gnus *Summary* buffer." | |||
| 306 | 306 | ||
| 307 | (provide 'package-x) | 307 | (provide 'package-x) |
| 308 | 308 | ||
| 309 | ;;; package.el ends here | 309 | ;;; package-x.el ends here |
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 2552ad4eb68..397feb45633 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el | |||
| @@ -911,43 +911,46 @@ boundaries." | |||
| 911 | "Find package information for a tar file. | 911 | "Find package information for a tar file. |
| 912 | FILE is the name of the tar file to examine. | 912 | FILE is the name of the tar file to examine. |
| 913 | The return result is a vector like `package-buffer-info'." | 913 | The return result is a vector like `package-buffer-info'." |
| 914 | (unless (string-match "^\\(.+\\)-\\([0-9.]+\\)\\.tar$" file) | 914 | (let ((default-directory (file-name-directory file)) |
| 915 | (error "Invalid package name `%s'" file)) | 915 | (file (file-name-nondirectory file))) |
| 916 | (let* ((pkg-name (file-name-nondirectory (match-string-no-properties 1 file))) | 916 | (unless (string-match "^\\(.+\\)-\\([0-9.]+\\)\\.tar$" file) |
| 917 | (pkg-version (match-string-no-properties 2 file)) | 917 | (error "Invalid package name `%s'" file)) |
| 918 | ;; Extract the package descriptor. | 918 | (let* ((pkg-name (match-string-no-properties 1 file)) |
| 919 | (pkg-def-contents (shell-command-to-string | 919 | (pkg-version (match-string-no-properties 2 file)) |
| 920 | ;; Requires GNU tar. | 920 | ;; Extract the package descriptor. |
| 921 | (concat "tar -xOf " file " " | 921 | (pkg-def-contents (shell-command-to-string |
| 922 | pkg-name "-" pkg-version "/" | 922 | ;; Requires GNU tar. |
| 923 | pkg-name "-pkg.el"))) | 923 | (concat "tar -xOf " file " " |
| 924 | (pkg-def-parsed (package-read-from-string pkg-def-contents))) | 924 | |
| 925 | (unless (eq (car pkg-def-parsed) 'define-package) | 925 | pkg-name "-" pkg-version "/" |
| 926 | (error "No `define-package' sexp is present in `%s-pkg.el'" pkg-name)) | 926 | pkg-name "-pkg.el"))) |
| 927 | (let ((name-str (nth 1 pkg-def-parsed)) | 927 | (pkg-def-parsed (package-read-from-string pkg-def-contents))) |
| 928 | (version-string (nth 2 pkg-def-parsed)) | 928 | (unless (eq (car pkg-def-parsed) 'define-package) |
| 929 | (docstring (nth 3 pkg-def-parsed)) | 929 | (error "No `define-package' sexp is present in `%s-pkg.el'" pkg-name)) |
| 930 | (requires (nth 4 pkg-def-parsed)) | 930 | (let ((name-str (nth 1 pkg-def-parsed)) |
| 931 | (readme (shell-command-to-string | 931 | (version-string (nth 2 pkg-def-parsed)) |
| 932 | ;; Requires GNU tar. | 932 | (docstring (nth 3 pkg-def-parsed)) |
| 933 | (concat "tar -xOf " file " " | 933 | (requires (nth 4 pkg-def-parsed)) |
| 934 | pkg-name "-" pkg-version "/README")))) | 934 | (readme (shell-command-to-string |
| 935 | (unless (equal pkg-version version-string) | 935 | ;; Requires GNU tar. |
| 936 | (error "Package has inconsistent versions")) | 936 | (concat "tar -xOf " file " " |
| 937 | (unless (equal pkg-name name-str) | 937 | pkg-name "-" pkg-version "/README")))) |
| 938 | (error "Package has inconsistent names")) | 938 | (unless (equal pkg-version version-string) |
| 939 | ;; Kind of a hack. | 939 | (error "Package has inconsistent versions")) |
| 940 | (if (string-match ": Not found in archive" readme) | 940 | (unless (equal pkg-name name-str) |
| 941 | (setq readme nil)) | 941 | (error "Package has inconsistent names")) |
| 942 | ;; Turn string version numbers into list form. | 942 | ;; Kind of a hack. |
| 943 | (if (eq (car requires) 'quote) | 943 | (if (string-match ": Not found in archive" readme) |
| 944 | (setq requires (car (cdr requires)))) | 944 | (setq readme nil)) |
| 945 | (setq requires | 945 | ;; Turn string version numbers into list form. |
| 946 | (mapcar (lambda (elt) | 946 | (if (eq (car requires) 'quote) |
| 947 | (list (car elt) | 947 | (setq requires (car (cdr requires)))) |
| 948 | (version-to-list (cadr elt)))) | 948 | (setq requires |
| 949 | requires)) | 949 | (mapcar (lambda (elt) |
| 950 | (vector pkg-name requires docstring version-string readme)))) | 950 | (list (car elt) |
| 951 | (version-to-list (cadr elt)))) | ||
| 952 | requires)) | ||
| 953 | (vector pkg-name requires docstring version-string readme))))) | ||
| 951 | 954 | ||
| 952 | ;;;###autoload | 955 | ;;;###autoload |
| 953 | (defun package-install-from-buffer (pkg-info type) | 956 | (defun package-install-from-buffer (pkg-info type) |
diff --git a/lisp/simple.el b/lisp/simple.el index a2dda5f04d2..653501625b5 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -2628,7 +2628,7 @@ specifies the value of ERROR-BUFFER." | |||
| 2628 | (with-output-to-string | 2628 | (with-output-to-string |
| 2629 | (with-current-buffer | 2629 | (with-current-buffer |
| 2630 | standard-output | 2630 | standard-output |
| 2631 | (call-process shell-file-name nil t nil shell-command-switch command)))) | 2631 | (process-file shell-file-name nil t nil shell-command-switch command)))) |
| 2632 | 2632 | ||
| 2633 | (defun process-file (program &optional infile buffer display &rest args) | 2633 | (defun process-file (program &optional infile buffer display &rest args) |
| 2634 | "Process files synchronously in a separate process. | 2634 | "Process files synchronously in a separate process. |