[] ensure-system-package: honor system-packages customizations
ensure-system-package doesn't honor system-packages customizations (https://github.com/jwiegley/use-package/issues/661), because system-packages didn't provide an API to retrieve shell command to be executed. This change makes use of the new system-packages' `system-package-get-command` function and therefore fixes the issue. GitHub-reference: fix https://github.com/jwiegley/use-package/issues/661 Copyright-paperwork-exempt: yes
This commit is contained in:
parent
e2a322d870
commit
9f034a0bcf
1 changed files with 2 additions and 12 deletions
|
@ -6,7 +6,7 @@
|
||||||
;; Keywords: convenience, tools, extensions
|
;; Keywords: convenience, tools, extensions
|
||||||
;; URL: https://github.com/waymondo/use-package-ensure-system-package
|
;; URL: https://github.com/waymondo/use-package-ensure-system-package
|
||||||
;; Version: 0.1
|
;; Version: 0.1
|
||||||
;; Package-Requires: ((use-package "2.1") (system-packages "0.1"))
|
;; Package-Requires: ((use-package "2.1") (system-packages "1.0.4"))
|
||||||
;; Filename: use-package-ensure-system-package.el
|
;; Filename: use-package-ensure-system-package.el
|
||||||
;; License: GNU General Public License version 3, or (at your option) any later version
|
;; License: GNU General Public License version 3, or (at your option) any later version
|
||||||
;;
|
;;
|
||||||
|
@ -29,17 +29,7 @@
|
||||||
|
|
||||||
(defun use-package-ensure-system-package-install-command (pack)
|
(defun use-package-ensure-system-package-install-command (pack)
|
||||||
"Return the default install command for PACK."
|
"Return the default install command for PACK."
|
||||||
(let ((command
|
(system-packages-get-command 'install pack))
|
||||||
(cdr (assoc 'install (cdr (assoc system-packages-package-manager
|
|
||||||
system-packages-supported-package-managers))))))
|
|
||||||
(unless command
|
|
||||||
(error (format "%S not supported in %S" 'install system-packages-package-manager)))
|
|
||||||
(unless (listp command)
|
|
||||||
(setq command (list command)))
|
|
||||||
(when system-packages-use-sudo
|
|
||||||
(setq command (mapcar (lambda (part) (concat "sudo " part)) command)))
|
|
||||||
(setq command (mapconcat 'identity command " && "))
|
|
||||||
(mapconcat 'identity (list command pack) " ")))
|
|
||||||
|
|
||||||
(defun use-package-ensure-system-package-consify (arg)
|
(defun use-package-ensure-system-package-consify (arg)
|
||||||
"Turn `arg' into a cons of (`package-name' . `install-command')."
|
"Turn `arg' into a cons of (`package-name' . `install-command')."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue