summaryrefslogtreecommitdiff
path: root/dh-elpa.el
diff options
context:
space:
mode:
Diffstat (limited to 'dh-elpa.el')
-rw-r--r--dh-elpa.el28
1 files changed, 13 insertions, 15 deletions
diff --git a/dh-elpa.el b/dh-elpa.el
index 5f799b9..a0385c9 100644
--- a/dh-elpa.el
+++ b/dh-elpa.el
@@ -69,28 +69,31 @@ packaging guidelines; see info node `(elisp)Packaging'."
;;;###autoload
(defun dhelpa-batch-install-file ()
- "Install third command line argument (an emacs lisp file or
-tar file) into second command line argument (a directory)"
- (let ((dest (car command-line-args-left))
- (el-file (cadr command-line-args-left)))
- (dhelpa-install-file dest el-file)))
+ "Install third command line argument (an emacs lisp file or tar
+file) into second command line argument (a directory). The
+optional fourth argument specifies a destination for a package
+description file."
+ (apply #'dhelpa-install-file command-line-args-left))
;;;###autoload
(defun dhelpa-batch-install-directory ()
"Install third command line argument (a directory containing a
multifile elpa package) into second command line argument (a
directory). An optional third command line argument specifies
-where to make temporary files."
+where to make temporary files and write a descriptor file."
(apply #'dhelpa-install-directory command-line-args-left))
;;;###autoload
-(defun dhelpa-install-file (dest el-file)
+(defun dhelpa-install-file (dest el-file &optional desc-dir)
"Install second argument (an emacs lisp file or tar file) into
-first command line argument (a directory)"
+first command line argument (a directory). The optional third
+argument specifies where to write a simplified package description file."
(with-temp-buffer
(insert-file-contents-literally el-file)
(when (string-match "\\.tar\\'" el-file) (tar-mode))
- (dhelpa-install-from-buffer (expand-file-name dest))))
+ (let ((desc (dhelpa-install-from-buffer (expand-file-name dest))))
+ (when desc-dir
+ (dhelpa-write-desc desc desc-dir)))))
;;;###autoload
(defun dhelpa-install-directory (dest elpa-dir &optional work-dir)
@@ -102,21 +105,16 @@ specified, cleaning up is the caller's responsibility."
(if (not desc)
(message "Could not compute version from directory %s" elpa-dir)
(let* ((canonical-dir (package-desc-full-name desc))
- (elpa-name (package-desc-name desc))
- (elpa-version (package-version-join (package-desc-version desc)))
(base-dir (file-name-nondirectory elpa-dir))
(parent-dir (file-name-directory elpa-dir))
(temp-dir (or work-dir (make-temp-file nil t)))
- (version-file (expand-file-name (format "%s.version" elpa-name) temp-dir))
(tar-file (concat (expand-file-name canonical-dir temp-dir) ".tar"))
;; this relies on GNU tar features.
(transform-command (concat "--transform=s/"
(regexp-quote base-dir) "/" canonical-dir "/")))
(call-process "tar" nil nil nil "--create" "-C" parent-dir transform-command
"--file" tar-file base-dir)
- (when work-dir
- (with-temp-file version-file (insert elpa-version)))
- (dhelpa-install-file dest tar-file)
+ (dhelpa-install-file dest tar-file work-dir)
(unless work-dir
(delete-file tar-file)
(delete-directory temp-dir))))))