]> code.delx.au - gnu-emacs/commitdiff
* simple.el (shell-command-to-string): Use `process-file'.
authorMichael Albinus <michael.albinus@gmx.de>
Tue, 8 Mar 2011 12:58:40 +0000 (13:58 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Tue, 8 Mar 2011 12:58:40 +0000 (13:58 +0100)
* 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.

lisp/ChangeLog
lisp/emacs-lisp/package-x.el
lisp/emacs-lisp/package.el
lisp/simple.el

index 6aa6993a70aaf48577eb377497cfdfcc4a362e1c..ca21c9ebf2ce459be5e4771f4bb3682d7a3642fb 100644 (file)
@@ -1,3 +1,13 @@
+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):
index 4de95f65702bf70732b06f302b5e0d681992b1cd..cd4b5ee231c57303a7f3e0b3f233167aa1598338 100644 (file)
@@ -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
index 2552ad4eb6806e88c7db58e832ee9158700ac5d7..397feb45633529939d44eec7a1a83c2f31883cf1 100644 (file)
@@ -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)
index a2dda5f04d204abb993672e3500d0c5284a73732..653501625b5073744641d708a54944159b281659 100644 (file)
@@ -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.