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

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

[elpa] externals/system-packages 4e7e9e2 006/117: Working install comman


From: Stefan Monnier
Subject: [elpa] externals/system-packages 4e7e9e2 006/117: Working install command
Date: Fri, 14 Dec 2018 17:01:58 -0500 (EST)

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

    Working install command
---
 system-packages.el | 64 ++++++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 48 insertions(+), 16 deletions(-)

diff --git a/system-packages.el b/system-packages.el
index 6946067..4cd8d88 100644
--- a/system-packages.el
+++ b/system-packages.el
@@ -1,10 +1,49 @@
-  ;;; system-packages.el --- functions to manage system packages
+;;; system-packages.el --- functions to manage system packages
 
-;; Copyright
+;; Copyright (C) 2016 J. Alexander Branham
 
-;; Author: J. Alexander Branham
+;; Author: J. Alexander Branham <address@hidden>
+;; Maintainer: J. Alexander Branham <address@hidden>
+;; URL: https://github.com/jabranham/system-packages
 ;; Version: 0.1
 
+;; This file is not part of GNU Emacs.
+
+;;; License:
+;;
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see
+;; <http://www.gnu.org/licenses/>
+
+;;; Commentary:
+
+;; This is a package to manage installed system packages. Useful
+;; functions include installing packages, removing packages, listing
+;; installed packages, and others.
+
+;; Usage:
+
+;; (require 'system-packages)
+;;
+
+;;; Code:
+
+(defgroup system-packages nil
+  "Manages system packages"
+  :tag "System Packages"
+  :prefix "system-packages"
+  :group 'packages)
+
 (defvar system-packages-packagemanager
   (if (executable-find "pacman") "pacman"
     (if (executable-find "apt") "apt"
@@ -16,24 +55,16 @@
   "If non-nil, system-packages will use sudo for appropriate
   commands")
 
-
 (defun system-packages-install (pack)
   "Installs system packages"
   (interactive "sWhat package to install?")
   (let ((command
-         (cond ((equal system-packages-packagemanager "pacman") "pacman -S")
-               ((equal system-packages-packagemanager "apt") "apt-get install")
-               ((equal system-packages-packagemanager "brew") "brew 
install"))))
+         (if (equal system-packages-packagemanager "pacman") "pacman -S"
+           (if (equal system-packages-packagemanager "apt") "apt-get install"
+             (if (equal system-packages-packagemanager "brew") "brew 
install")))))
     (if (equal system-packages-usesudo t)
-        (async-shell-command
-         (mapconcat 'identity
-                    '("sudo" command pack)
-                    " "))
-      (async-shell-command
-       (mapconcat 'identity
-                  '(command pack)
-                  " ")))))
-
+        (async-shell-command (mapconcat 'identity (list "sudo" command pack) " 
"))
+      (async-shell-command (mapconcat 'identity '(command pack) " ")))))
 
 (defun system-packages-search ()
   "Search for system packages"
@@ -78,3 +109,4 @@
         (async-shell-command (concat "sudo " command))
       (async-shell-command command))
   
+(provide 'system-packages)



reply via email to

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