[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/system-packages bccbab3 002/117: Initial commit
From: |
Stefan Monnier |
Subject: |
[elpa] externals/system-packages bccbab3 002/117: Initial commit |
Date: |
Fri, 14 Dec 2018 17:01:57 -0500 (EST) |
branch: externals/system-packages
commit bccbab36f9077b33368768f22445018101cd45b4
Author: Alex Branham <address@hidden>
Commit: Alex Branham <address@hidden>
Initial commit
---
system-packages.el | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/system-packages.el b/system-packages.el
new file mode 100644
index 0000000..f78bceb
--- /dev/null
+++ b/system-packages.el
@@ -0,0 +1,43 @@
+(when (executable-find "pacman")
+ (setq system-packages-packagemanager "pacman"))
+(when (executable-find "apt-get")
+ (setq system-packages-packagemanager "apt-get"))
+(when (executable-find "brew")
+ (setq system-packages-packagemanager "brew"))
+
+(when (equal system-packages-packagemanager "pacman")
+ (setq system-packages-installcommand "pacman -S"
+ system-packages-searchcommand "pacman -Ss"
+ system-packages-uninstallcommand "pacman -Rs"
+ system-packages-updatecommand "pacman -Syu"))
+
+(when (equal system-packages-packagemanager "apt-get")
+ (setq system-packages-installcommand "apt-get install"
+ system-packages-searchcommand "apt-cache search"
+ system-packages-uninstallcommand "apt-get remove"
+ system-packages-updatecommand "apt-get update && sudo apt-get
upgrade"))
+
+(when (equal system-packages-packagemanager "brew")
+ (setq system-packages-installcommand "brew install"
+ system-packages-searchcommand "brew search"
+ system-packages-uninstallcommand "brew uninstall"
+ system-packages-updatecommand "brew update && brew upgrade"))
+
+(setq system-packages-usesudo t)
+
+(defun system-packages-install ()
+ (if (equal system-packages-usesudo t)
+ (async-shell-command (concat "sudo " system-packages-installcommand)))
+ (async-shell-command system-packages-installcommand))
+(defun system-packages-search ()
+ (if (equal system-packages-usesudo t)
+ (async-shell-command (concat "sudo " system-packages-searchcommand))
+ (async-shell-command system-packages-searchcommand)))
+(defun system-packages-uninstall ()
+ (if (equal system-packages-usesudo t)
+ (async-shell-command (concat "sudo " system-packages-uninstallcommand)))B
+ (async-shell-command system-packages-uninstallcommand))
+(defun system-packages-update ()
+ (if (equal system-packages-usesudo t)
+ (async-shell-command (concat "sudo " system-packages-updatecommand))
+ (async-shell-command system-packages-updatecommand)))
- [elpa] branch externals/system-packages created (now ce23c0e), Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages 2737c65 003/117: Modifications, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages 7c17a8b 005/117: Adds function to remove orphaned packages, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages bccbab3 002/117: Initial commit,
Stefan Monnier <=
- [elpa] externals/system-packages 4e7e9e2 006/117: Working install command, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages 7553ef9 004/117: More work..., Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages 6d0ebd5 008/117: All working, working on listing installed packages, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages a6e053e 011/117: Fix parens, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages 34f898e 007/117: A wild functional package appears!, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages fd49fc8 012/117: Fixes list function, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages d2884f5 018/117: Use idiomatic prompts in interactive commands, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages eef3e8e 017/117: Fix Arch Linux package list (explicit) commands, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages a6dcd04 015/117: Refactor the package manager specific commands into a defconst, Stefan Monnier, 2018/12/14
- [elpa] externals/system-packages 07c4faa 026/117: Use defcustom for customizable variable, Stefan Monnier, 2018/12/14