Ce serveur Gitlab sera éteint le 30 juin 2020, pensez à migrer vos projets vers les serveurs gitlab-research.centralesupelec.fr et gitlab-student.centralesupelec.fr !

Commit 0e908c81 authored by Ryan C. Thompson's avatar Ryan C. Thompson

Add checksum methods for git and hg.

These return the hash of the current revision of the package
parent dc22e60e
......@@ -89,8 +89,19 @@ found."
:error "Could not update git submodules"))
post-update-fun)))
(defun el-get-git-compute-checksum (package)
"Return the hash of the checked-out revision of PACKAGE."
(with-temp-buffer
(cd (el-get-package-directory package))
(let* ((args '("git" "show-ref" "HEAD"))
(cmd (mapconcat 'shell-quote-argument args " "))
(output (shell-command-to-string cmd))
(hash (and (string-match "^[[:space:]]*\\([^[:space:]]+\\)" output)
(match-string 0 output))))
hash)))
(el-get-register-method
:git #'el-get-git-clone #'el-get-git-pull #'el-get-rmdir
#'el-get-git-clone-hook)
#'el-get-git-clone-hook nil #'el-get-git-compute-checksum)
(provide 'el-get-git)
......@@ -58,8 +58,19 @@
:error ,ko))
post-update-fun)))
(defun el-get-hg-compute-checksum (package)
"Return the hash of the checked-out revision of PACKAGE."
(with-temp-buffer
(cd (el-get-package-directory package))
(let* ((args '("hg" "--debug" "tags"))
(cmd (mapconcat 'shell-quote-argument args " "))
(output (shell-command-to-string cmd))
(hash (and (string-match "^tip[[:space:]]+[0-9]+\\:\\([0-9A-Fa-f]+\\)" output)
(match-string 0 output))))
hash)))
(el-get-register-method
:hg #'el-get-hg-clone #'el-get-hg-pull #'el-get-rmdir
#'el-get-hg-clone-hook)
#'el-get-hg-clone-hook nil #'el-get-hg-compute-checksum)
(provide 'el-get-hg)
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