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

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

[elpa] externals/system-packages 7c17a8b 005/117: Adds function to remov


From: Stefan Monnier
Subject: [elpa] externals/system-packages 7c17a8b 005/117: Adds function to remove orphaned packages
Date: Fri, 14 Dec 2018 17:01:58 -0500 (EST)

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

    Adds function to remove orphaned packages
---
 system-packages.el | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/system-packages.el b/system-packages.el
index 9855309..6946067 100644
--- a/system-packages.el
+++ b/system-packages.el
@@ -66,3 +66,15 @@
         (async-shell-command (concat "sudo " command))
       (async-shell-command command))))
 
+(defun system-packages-remove-orphaned ()
+  "This function removes orphaned packages i.e. unused packages."
+  (interactive)
+  (if (equal system-packages-packagemanager "brew")
+      (error "Not supported on homebrew"))
+  (let ((command
+         (cond ((equal system-packages-packagemanager "pacman") "pacman -Rns 
$(pacman -Qtdq)")
+               ((equal system-packages-packagemanager "apt") "apt-get 
autoremove"))))))
+    (if (equal system-packages-usesudo t)
+        (async-shell-command (concat "sudo " command))
+      (async-shell-command command))
+  



reply via email to

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