[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/system-packages abddd99 085/117: Expose function to ret
From: |
Stefan Monnier |
Subject: |
[elpa] externals/system-packages abddd99 085/117: Expose function to return command to run as a string |
Date: |
Fri, 14 Dec 2018 17:02:13 -0500 (EST) |
branch: externals/system-packages
commit abddd99f8e6018d7884d803c8efcf8c311900f2c
Author: Alex Branham <address@hidden>
Commit: Alex Branham <address@hidden>
Expose function to return command to run as a string
This was a request in bug #25.
Closes #25
---
system-packages.el | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/system-packages.el b/system-packages.el
index 8f306c6..92e950c 100644
--- a/system-packages.el
+++ b/system-packages.el
@@ -305,16 +305,12 @@ Tries to be smart for selecting the default."
"If non-nil, bypass prompts asking the user to confirm package upgrades."
:type 'boolean)
-(defun system-packages--run-command (action &optional pack args)
- "Run a command that affects system packages.
-
-ACTION can be `default-sudo', `install', `search', `uninstall'
-etc. Run the command according to
-`system-packages-supported-package-managers' and ACTION. PACK is
-used to operation on specific packages.
-
-ARGS gets passed to the command and is useful for passing options
-to the package manager."
+(defun system-packages-get-command (action &optional pack args)
+ "Return a command to run as a string.
+ACTION should be in
+`system-packages-supported-package-managers' (e.g. 'install).
+PACK is used to operate on a specific package, and ARGS is a way
+of passing additional arguments to the package manager."
(let ((command
(cdr (assoc action (cdr (assoc system-packages-package-manager
system-packages-supported-package-managers)))))
@@ -332,7 +328,13 @@ to the package manager."
(setq command (mapconcat 'identity (list command pack) " "))
(setq args (concat args noconfirm))
(when args
- (setq command (concat command args)))
+ (setq command (concat command args)))))
+
+(defun system-packages--run-command (action &optional pack args)
+ "Run a command asynchronously using the system's package manager.
+See `system-packages-get-command' for how to use ACTION, PACK,
+and ARGS."
+ (let ((command (system-packages-get-command action pack args)))
(async-shell-command command "*system-packages*")))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- [elpa] externals/system-packages e3493bb 052/117: Make install interactive again, (continued)
- [elpa] externals/system-packages e3493bb 052/117: Make install interactive again, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages 3e41c62 053/117: README: correct ordering of package managers, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages 1acd87a 047/117: Add an optional ARGS for package manager options & cleanup file, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages 9ef4751 067/117: Fix travis, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages f5576f3 060/117: Update copyright, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages 466785b 070/117: Defcustom should specify type, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages 0b04066 088/117: Test that we error when we don't know commands, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages c4c7a96 068/117: Travis..., Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages 4b774b9 081/117: Require cl-lib at compile time, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages 1470962 089/117: nix: Update for nix 2.0, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages abddd99 085/117: Expose function to return command to run as a string,
Stefan Monnier <=
- [elpa] externals/system-packages eead7d6 076/117: Prefer apt-get/cache to apt, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages c0354b2 057/117: README: add docs for how to add nonsupported package manager, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages 50defa4 061/117: Pass --nosave to pacman on package removal, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages 450cbbb 075/117: README: fix bug #22, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages e1a6811 073/117: Fix aptitude upgrade command, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages c4437be 086/117: Add some very simple ERT tests, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages b408ce4 106/117: Define variable aliases before their referant, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages ce23c0e 117/117: Add documentation about changing package manager and sudo, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages d18b2c0 108/117: Update dir-local bug-reference-url-format to point to gitlab, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages 2e38329 109/117: Remove cl-lib dependency, Stefan Monnier, 2018/12/14