path: root/dh-elpa.el
diff options
authorDavid Bremner <>2015-09-21 22:04:34 -0300
committerDavid Bremner <>2015-09-21 22:04:34 -0300
commit68a9351702c6f264c503c44ccfc78e60923f77f4 (patch)
tree7850f7eb6cdb57be386814be6b84b73d93a9daf4 /dh-elpa.el
parente3a7e05c485f3c1ad16090baf0a330abcef19c1a (diff)
write version to file in work-dir
We only do this if passed a working directory. The protocol is maybe a bit odd, but filtering the output from emacs looks messy.
Diffstat (limited to 'dh-elpa.el')
1 files changed, 5 insertions, 0 deletions
diff --git a/dh-elpa.el b/dh-elpa.el
index 7dee0c5..f16c73b 100644
--- a/dh-elpa.el
+++ b/dh-elpa.el
@@ -92,15 +92,20 @@ 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)
(unless work-dir
(delete-file tar-file)