emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/system-packages 2737c65 003/117: Modifications


From: Stefan Monnier
Subject: [elpa] externals/system-packages 2737c65 003/117: Modifications
Date: Fri, 14 Dec 2018 17:01:57 -0500 (EST)

branch: externals/system-packages
commit 2737c65ff608168c02a6e8f2bf71be594e9c04b5
Author: Alex Branham <address@hidden>
Commit: Alex Branham <address@hidden>

    Modifications
---
 system-packages.el | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/system-packages.el b/system-packages.el
index f78bceb..f6f392b 100644
--- a/system-packages.el
+++ b/system-packages.el
@@ -1,3 +1,13 @@
+;;; system-packages.el --- functions to manage system packages
+
+;; Copyright
+
+;; Author: J. Alexander Branham
+;; Version: 0.1
+
+(defvar system-packages-packagemanager nil
+  "String containing the package manager to use")
+
 (when (executable-find "pacman")
   (setq system-packages-packagemanager "pacman"))
 (when (executable-find "apt-get")
@@ -5,6 +15,15 @@
 (when (executable-find "brew")
   (setq system-packages-packagemanager "brew"))
 
+(defvar system-packages-installcommand nil
+  "Defines the command to use to install system packages ")
+(defvar system-packages-searchcommand nil
+  "Defines the command to use to search for system packages")
+(defvar system-packages-uninstallcommand nil
+  "Defines the command to use to uninstall system packages")
+(defvar system-packages-updatecommand nil
+  "Defines the command to use to update system packages")
+
 (when (equal system-packages-packagemanager "pacman")
   (setq system-packages-installcommand "pacman -S"
         system-packages-searchcommand "pacman -Ss"
@@ -23,16 +42,15 @@
         system-packages-uninstallcommand "brew uninstall"
         system-packages-updatecommand "brew update && brew upgrade"))
 
-(setq system-packages-usesudo t)
+(defvar system-packages-usesudo t
+  "If non-nil, system-packages will use sudo for appropriate commands")
 
 (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)))
+  (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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]