mirror of
https://github.com/dimitri/el-get.git
synced 2024-09-29 13:08:51 +08:00
Serialize runs of pacman
Pacman won't wait for a lock on its database. It just bails out with non-zero exit code and error message.
This commit is contained in:
parent
882aea64d7
commit
9ba344de1e
18
el-get.el
18
el-get.el
|
@ -1092,6 +1092,8 @@ the files up."
|
|||
;;
|
||||
(add-hook 'el-get-pacman-install-hook 'el-get-dpkg-symlink)
|
||||
|
||||
(defvar el-get-pacman-running nil)
|
||||
|
||||
(defun el-get-pacman-install (package url post-install-fun)
|
||||
"echo $pass | sudo -S pacman install PACKAGE"
|
||||
(let* ((source (el-get-package-def package))
|
||||
|
@ -1099,6 +1101,9 @@ the files up."
|
|||
(name (format "*pacman install %s*" package))
|
||||
(ok (format "Package %s installed." package))
|
||||
(ko (format "Could not install package %s." package)))
|
||||
(while el-get-pacman-running
|
||||
(sit-for 0.250))
|
||||
(setq el-get-pacman-running t)
|
||||
|
||||
(el-get-start-process-list
|
||||
package
|
||||
|
@ -1109,7 +1114,10 @@ the files up."
|
|||
:args ("-S" ,(executable-find "pacman") "--sync" "--noconfirm" "--needed" ,pkgname)
|
||||
:message ,ok
|
||||
:error ,ko))
|
||||
post-install-fun)))
|
||||
`(lambda (package)
|
||||
(setq el-get-pacman-running nil)
|
||||
(when (functionp ',post-install-fun)
|
||||
(funcall ',post-install-fun package))))))
|
||||
|
||||
(defun el-get-pacman-remove (package url post-remove-fun)
|
||||
"pacman remove PACKAGE, URL is there for API compliance"
|
||||
|
@ -1118,6 +1126,9 @@ the files up."
|
|||
(name (format "*pacman remove %s*" package))
|
||||
(ok (format "Package %s removed." package))
|
||||
(ko (format "Could not remove package %s." package)))
|
||||
(while el-get-pacman-running
|
||||
(sit-for 0.250))
|
||||
(setq el-get-pacman-running t)
|
||||
|
||||
(el-get-start-process-list
|
||||
package
|
||||
|
@ -1128,7 +1139,10 @@ the files up."
|
|||
:args ("-S" ,(executable-find "pacman") "--remove" "--noconfirm" ,pkgname)
|
||||
:message ,ok
|
||||
:error ,ko))
|
||||
post-remove-fun)))
|
||||
`(lambda (package)
|
||||
(setq el-get-pacman-running nil)
|
||||
(when (functionp ',post-install-fun)
|
||||
(funcall ',post-install-fun package))))))
|
||||
|
||||
(add-hook 'el-get-pacman-remove-hook 'el-get-dpkg-remove-symlink)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user