Skip to content

Commit

Permalink
Make check for apt-get package work (#2434)
Browse files Browse the repository at this point in the history
* Pass package name to dpkg-query

* dpkg-query reports status as 'install ok installed'

* when el-get name is different from apt-get name
  • Loading branch information
manandbytes authored and dimitri committed Aug 27, 2016
1 parent 5696301 commit a6638a6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions methods/el-get-apt-get.el
Expand Up @@ -40,8 +40,8 @@
;;
(defun el-get-dpkg-package-installed-p (package)
"Return non-nil if PACKAGE is installed according to dpkg."
(equal "installed"
(car (process-lines "dpkg-query" "--show" "--showformat=${Status}\n"))))
(equal "install ok installed"
(car (process-lines "dpkg-query" "--show" "--showformat=${Status}\n" package))))

;;
;; those functions are meant as hooks at install and remove, and they will
Expand Down Expand Up @@ -123,7 +123,8 @@ password prompt."
(defun el-get-apt-get-install-if-needed (package url post-install-fun)
"Call `el-get-apt-get-install' if PACKAGE isn't installed yet.
The installation status is retrieved from the system, not el-get."
(when (el-get-dpkg-package-installed-p package)
(when (el-get-dpkg-package-installed-p (or (plist-get (el-get-package-def package) :pkgname)
(el-get-as-string package)))
(el-get-apt-get-install package url post-install-fun)))

(defun el-get-apt-get-install (package url post-install-fun)
Expand Down

0 comments on commit a6638a6

Please sign in to comment.