system-packages-1.0.13/0000755000175000017500000000000014476561550014543 5ustar dogslegdogslegsystem-packages-1.0.13/test/0000755000175000017500000000000014463410264015511 5ustar dogslegdogslegsystem-packages-1.0.13/test/system-packages-test.el0000644000175000017500000000476214463410264022121 0ustar dogslegdogsleg;;; system-packages-test.el --- ERT testing framework for system-packages.el -*- lexical-binding: t; -*- ;; Copyright (C) 2018-2023 Free Software Foundation, Inc. ;; Author: J. Alexander Branham ;; 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 . ;;; Code: (require 'ert) (require 'system-packages) (ert-deftest system-packages-get-install () "Return correct installation command." (should (string= (let ((system-packages-use-sudo nil) (system-packages-package-manager 'guix)) (system-packages-get-command 'install)) "guix package -i ")) (should (string= (let ((system-packages-use-sudo nil) (system-packages-package-manager 'pacman)) (system-packages-get-command 'install)) "pacman -S "))) (ert-deftest system-packages-get-install-noconfirm () "Return correct installation command." (should (string= (let ((system-packages-noconfirm t) (system-packages-use-sudo nil) (system-packages-package-manager 'guix)) (system-packages-get-command 'install)) "guix package -i ")) (should (string= (let ((system-packages-noconfirm t) (system-packages-use-sudo nil) (system-packages-package-manager 'pacman)) (system-packages-get-command 'install)) "pacman -S --noconfirm")) (should (string= (let ((system-packages-noconfirm t) (system-packages-use-sudo nil) (system-packages-package-manager 'apt)) (system-packages-get-command 'install "rg")) "apt-get install rg -y"))) (ert-deftest system-packages-errors () "Error when we don't know a command." (should-error (let ((system-packages-package-manager 'pacaur)) (system-packages-get-command 'install)))) ;;; system-packages-test.el ends here system-packages-1.0.13/.elpaignore0000644000175000017500000000001014463410264016647 0ustar dogslegdogslegLICENSE system-packages-1.0.13/system-packages-pkg.el0000644000175000017500000000064114476561546020752 0ustar dogslegdogsleg;; Generated package description from system-packages.el -*- no-byte-compile: t -*- (define-package "system-packages" "1.0.13" "functions to manage system packages" '((emacs "24.3")) :commit "781f8d40ed35a86a65dda3123506dc810adc10e3" :authors '(("J. Alexander Branham" . "alex.branham@gmail.com")) :maintainer '("J. Alexander Branham" . "alex.branham@gmail.com") :url "https://gitlab.com/jabranham/system-packages") system-packages-1.0.13/README-elpa0000644000175000017500000001005614476561550016344 0ustar dogslegdogsleg ━━━━━━━━━━━━━━━━━ SYSTEM PACKAGES ━━━━━━━━━━━━━━━━━ This is a collection of functions to make handling installed system packages more convenient through Emacs. 1 Installation ══════════════ System packages is available on [GNU ELPA]. You can get it by doing M-x package-install RET system-packages RET. Users of Debian ≥10 and derivatives can install it with the following: ┌──── │ sudo apt install elpa-system-packages └──── [GNU ELPA] 2 Configuration ═══════════════ The package attempts to guess which package manager you use. If it guesses wrong (or you'd like to set it manually), you may modify the variable `system-packages-package-manager'. We also attempt to guess whether or not to use sudo with appropriate commands (like installing and uninstalling packages). Some package managers (like homebrew) warn not to use sudo, others (like `apt') need sudo privileges. You may set this manually by configuring `system-packages-use-sudo'. Other package customization options can be accessed with M-x `customize-group RET system-packages RET'. 3 Supported package managers ════════════════════════════ Currently, `system-packages' knows about the following package managers. You can see exactly what commands are associated with `system-packages' commands by checking `system-packages-supported-package-managers'. The default package manager that we use is the first one found from this list: • guix • nix • brew • macports • pacman • apt • aptitude • emerge • zypper • dnf • xbps 4 Usage ═══════ The package doesn't presume to set keybindings for you, so you may set those up yourself or simply call functions with `M-x'. All commands start with `system-packages' 5 Adding other package managers ═══════════════════════════════ It is straightforward to add support for package managers. First, add the commands to `system-packages-supported-package-managers' like so: ┌──── │ (add-to-list 'system-packages-supported-package-managers │ '(pacaur . │ ((default-sudo . nil) │ (install . "pacaur -S") │ (search . "pacaur -Ss") │ (uninstall . "pacaur -Rs") │ (update . "pacaur -Syu") │ (clean-cache . "pacaur -Sc") │ (log . "cat /var/log/pacman.log") │ (change-log . "pacaur -Qc") │ (get-info . "pacaur -Qi") │ (get-info-remote . "pacaur -Si") │ (list-files-provided-by . "pacaur -Ql") │ (owning-file . "pacaur -Qo") │ (owning-file-remote . "pacaur -F") │ (verify-all-packages . "pacaur -Qkk") │ (verify-all-dependencies . "pacaur -Dk") │ (remove-orphaned . "pacaur -Rns $(pacman -Qtdq)") │ (list-installed-packages . "pacaur -Qe") │ (list-installed-packages-all . "pacaur -Q") │ (list-dependencies-of . "pacaur -Qi") │ (noconfirm . "--noconfirm")))) └──── Any occurrences of `%p' in a command will be replaced with the package name during execution, otherwise the package name is simply appended to the command. You may also need to adjust `system-packages-package-manager' and `system-packages-use-sudo' accordingly: ┌──── │ (setq system-packages-use-sudo t) │ (setq system-packages-package-manager 'pacaur) └──── 6 See also ══════════ Helm users might like [helm-system-packages] [helm-system-packages] system-packages-1.0.13/Makefile0000644000175000017500000000073313405150543016171 0ustar dogslegdogslegEMACS ?= emacs EMACS_FLAGS = --quick --directory . EMACS_BATCH = $(EMACS) --batch $(EMACS_FLAGS) EL := $(wildcard *.el) ELC := $(patsubst %.el,%.elc,$(EL)) .PHONY: all all: compile .PHONY: compile test compile: $(ELC) %.elc: %.el $(EMACS_BATCH) --eval "(progn (message (emacs-version)) (setq byte-compile-error-on-warn t) (batch-byte-compile))" $< test: $(EMACS_BATCH) --eval "(progn\ (load-file \"test/system-packages-test.el\") \ (ert-run-tests-batch-and-exit))" system-packages-1.0.13/.dir-locals.el0000644000175000017500000000034013405150543017154 0ustar dogslegdogsleg((nil . ((fill-column . 70) (sentence-end-double-space . t) (bug-reference-bug-regexp . "#\\(?2:[0-9]+\\)") (bug-reference-url-format . "https://gitlab.com/jabranham/system-packages/issues/%s")))) system-packages-1.0.13/README.org0000644000175000017500000000733514024216366016210 0ustar dogslegdogsleg#+TITLE: System Packages #+AUTHOR: J. Alexander Branham #+LANGUAGE: en #+NAME: pipeline-status [[https://gitlab.com/jabranham/system-packages/badges/master/pipeline.svg]] This is a collection of functions to make handling installed system packages more convenient through Emacs. * Installation System packages is available on [[https://elpa.gnu.org/packages/system-packages.html][GNU ELPA]]. You can get it by doing M-x package-install RET system-packages RET. Users of Debian ≥10 and derivatives can install it with the following: #+BEGIN_SRC sh sudo apt install elpa-system-packages #+END_SRC * Configuration The package attempts to guess which package manager you use. If it guesses wrong (or you'd like to set it manually), you may modify the variable =system-packages-package-manager=. We also attempt to guess whether or not to use sudo with appropriate commands (like installing and uninstalling packages). Some package managers (like homebrew) warn not to use sudo, others (like =apt=) need sudo privileges. You may set this manually by configuring =system-packages-use-sudo=. Other package customization options can be accessed with M-x =customize-group RET system-packages RET=. * Supported package managers Currently, =system-packages= knows about the following package managers. You can see exactly what commands are associated with =system-packages= commands by checking =system-packages-supported-package-managers=. The default package manager that we use is the first one found from this list: - guix - nix - brew - macports - pacman - apt - aptitude - emerge - zypper - dnf - xbps * Usage The package doesn't presume to set keybindings for you, so you may set those up yourself or simply call functions with =M-x=. All commands start with =system-packages= * Adding other package managers It is straightforward to add support for package managers. First, add the commands to =system-packages-supported-package-managers= like so: #+BEGIN_SRC emacs-lisp (add-to-list 'system-packages-supported-package-managers '(pacaur . ((default-sudo . nil) (install . "pacaur -S") (search . "pacaur -Ss") (uninstall . "pacaur -Rs") (update . "pacaur -Syu") (clean-cache . "pacaur -Sc") (log . "cat /var/log/pacman.log") (change-log . "pacaur -Qc") (get-info . "pacaur -Qi") (get-info-remote . "pacaur -Si") (list-files-provided-by . "pacaur -Ql") (owning-file . "pacaur -Qo") (owning-file-remote . "pacaur -F") (verify-all-packages . "pacaur -Qkk") (verify-all-dependencies . "pacaur -Dk") (remove-orphaned . "pacaur -Rns $(pacman -Qtdq)") (list-installed-packages . "pacaur -Qe") (list-installed-packages-all . "pacaur -Q") (list-dependencies-of . "pacaur -Qi") (noconfirm . "--noconfirm")))) #+END_SRC Any occurrences of ~%p~ in a command will be replaced with the package name during execution, otherwise the package name is simply appended to the command. You may also need to adjust =system-packages-package-manager= and =system-packages-use-sudo= accordingly: #+BEGIN_SRC emacs-lisp (setq system-packages-use-sudo t) (setq system-packages-package-manager 'pacaur) #+END_SRC * See also Helm users might like [[https://github.com/emacs-helm/helm-system-packages][helm-system-packages]] system-packages-1.0.13/system-packages.el0000644000175000017500000005233114476561540020170 0ustar dogslegdogsleg;;; system-packages.el --- functions to manage system packages -*- lexical-binding: t; -*- ;; Copyright (C) 2016-2023 Free Software Foundation, Inc. ;; Author: J. Alexander Branham ;; Maintainer: J. Alexander Branham ;; URL: https://gitlab.com/jabranham/system-packages ;; Package-Requires: ((emacs "24.3")) ;; Version: 1.0.13 ;; This file is 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 . ;;; Commentary: ;; This is a package to manage installed system packages. Useful ;; functions include installing packages, removing packages, listing ;; installed packages, and others. ;; Helm users might also be interested in helm-system-packages.el ;; ;; Usage: ;; (require 'system-packages) ;; ;;; Code: (defgroup system-packages nil "Manages system packages" :tag "System Packages" :prefix "system-packages" :group 'packages) (defvar system-packages-supported-package-managers `( ;; guix (guix . ((default-sudo . nil) (install . "guix package -i") (search . "guix package -s") (uninstall . "guix package -r") (update . "guix package --upgrade") (clean-cache . "guix gc") (log . nil) (get-info . nil) (get-info-remote . nil) (list-files-provided-by . nil) (verify-all-packages . nil) (verify-all-dependencies . nil) (remove-orphaned . nil) (list-installed-packages . "guix package -I") (list-installed-packages-all . "guix package -I") (list-dependencies-of . nil) (noconfirm . nil))) ;; nix (nix . ((default-sudo . nil) (install . "nix-env -i") (search . "nix search") (uninstall . "nix-env -e") (update . "nix-env -u") (clean-cache . "nix-collect-garbage") (log . nil) (get-info . nil) (get-info-remote . nil) (list-files-provided-by . nil) (verify-all-packages . nil) (verify-all-dependencies . nil) (remove-orphaned . nil) (list-installed-packages . "nix-env -q") (list-installed-packages-all . "nix-env -q") (list-dependencies-of . nil) (noconfirm . nil))) ;; Mac (brew . ((default-sudo . nil) (install . "brew install") (search . "brew search") (uninstall . "brew uninstall") (update . "brew update && brew upgrade") (clean-cache . "brew cleanup") (log . nil) (get-info . nil) (get-info-remote . nil) (list-files-provided-by . "brew ls --verbose") (verify-all-packages . nil) (verify-all-dependencies . nil) (remove-orphaned . nil) (list-installed-packages . "brew list") (list-installed-packages-all . "brew list") (list-dependencies-of . "brew deps") (noconfirm . nil))) (port . ((default-sudo . t) (install . "port install") (search . "port search") (uninstall . "port uninstall") (update . "port sync && port upgrade outdated") (clean-cache . "port clean --all") (log . "port log") (get-info . "port info") (get-info-remote . nil) (list-files-provided-by . "port contents") (verify-all-packages . nil) (verify-all-dependencies . nil) (remove-orphaned . "port uninstall leaves") (list-installed-packages . "port installed") (list-installed-packages-all . "port installed") (list-dependencies-of . "port deps") (noconfirm . nil))) ;; Debian (and Ubuntu) based systems (apt . ((default-sudo . t) (install . "apt-get install") (search . "apt-cache search") (uninstall . "apt-get --purge remove") (update . "apt-get update && apt-get upgrade") (clean-cache . "apt-get clean") (log . "cat /var/log/dpkg.log") (change-log . "apt-get changelog") (get-info . "dpkg -s") (get-info-remote . "apt-cache show") (list-files-provided-by . "dpkg -L") (owning-file . "dpkg -S") (owning-file-remote . "apt-file search") (verify-all-packages . "debsums") (verify-all-dependencies . "apt-get check") (remove-orphaned . "apt-get autoremove") (list-installed-packages . "dpkg -l") (list-installed-packages-all . "dpkg -l") (list-dependencies-of . "apt-cache depends") (noconfirm . "-y"))) (aptitude . ((default-sudo . t) (install . "aptitude install") (search . "aptitude search") (uninstall . "aptitude remove") (update . "apt update && aptitude safe-upgrade") (clean-cache . "aptitude clean") (log . "cat /var/log/dpkg.log") (change-log . "aptitude changelog") (get-info . "aptitude show") (get-info-remote . "aptitude show") (list-files-provided-by . "dpkg -L") (owning-file . "dpkg -S") (owning-file-remote . "apt-file search") (verify-all-packages . "debsums") (verify-all-dependencies . "apt-get check") (remove-orphaned . nil) ; aptitude does this automatically (list-installed-packages . "aptitude search '~i!~M'") (list-installed-packages-all . "aptitude search '~i!~M'") (list-dependencies-of . "apt-cache deps") (noconfirm . "-y"))) ;; Gentoo (emerge . ((default-sudo . t) (install . "emerge") (search . ,(if (executable-find "eix") "eix" "emerge -S")) (uninstall . "emerge --depclean") (update . "emerge -u world") (clean-cache . "eclean distfiles") (log . "cat /var/log/portage") (change-log . "equery changes -f") (get-info . "emerge -pv") (get-info-remote . "emerge -S") (list-files-provided-by . "equery files") (owning-file . "equery belongs") (owning-file-remote . "equery belongs") (verify-all-packages . "equery check") (verify-all-dependencies . "emerge -uDN world") (remove-orphaned . "emerge --depclean") (list-installed-packages . nil) (list-installed-packages-all . nil) (list-dependencies-of . "emerge -ep") (noconfirm . nil))) ;; openSUSE (zypper . ((default-sudo . t) (install . "zypper install") (search . "zypper search") (uninstall . "zypper remove") (update . "zypper update") (clean-cache . "zypper clean") (log . "cat /var/log/zypp/history") (get-info . "zypper info") (get-info-remote . "zypper info") (list-files-provided-by . "rpm -Ql") (owning-file . "zypper search -f") (owning-file-remote . "zypper search -f") (verify-all-packages . "rpm -Va") (verify-all-dependencies . "zypper verify") (remove-orphaned . "zypper rm -u") (list-installed-packages . nil) (list-installed-packages-all . nil) (list-dependencies-of . "zypper info --requires") (noconfirm . nil))) ;; Fedora (dnf . ((default-sudo . t) (install . "dnf install") (search . "dnf search") (uninstall . "dnf remove") (update . "dnf upgrade") (clean-cache . "dnf clean all") (change-log . "rpm -q --changelog") (log . "dnf history") (get-info . "rpm -qi") (get-info-remote . "dnf info") (list-files-provided-by . "rpm -ql") (owning-file . "rpm -qf") (owning-file-remote . "dnf provides") (verify-all-packages . "rpm -Va") (verify-all-dependencies . "dnf repoquery --requires") (remove-orphaned . "dnf autoremove") (list-installed-packages . "dnf list --installed") (list-installed-packages-all . nil) (list-dependencies-of . "rpm -qR") (noconfirm . nil))) ;; RedHat derivatives (yum . ((default-sudo . t) (install . "yum install") (search . "yum search") (uninstall . "yum remove") (update . "yum update") (clean-cache . "yum clean expire-cache") (log . "cat /var/log/yum.log") (change-log . "rpm -q --changelog") (get-info . "yum info") (get-info-remote . "repoquery --plugins -i") (list-files-provided-by . "rpm -ql") (owning-file . "rpm -qf") (owning-file-remote . "repoquery -f") (verify-all-packages) (verify-all-dependencies) (remove-orphaned . "yum autoremove") (list-installed-packages . "yum list installed") (list-installed-packages-all . "yum list installed") (list-dependencies-of . "yum deplist") (noconfirm . "-y"))) ;; Void ;; xbps is the name of the package manager, but that doesn't appear as an ;; executable, so let's just call it xbps-install: (xbps-install . ((default-sudo . t) (install . "xbps-install") (search . "xbps-query -Rs") (uninstall . "xbps-remove -R") (update . "xbps-install -Su") (clean-cache . "xbps-remove -O") (log . nil) (get-info . "xbps-query") (get-info-remote . "xbps-query -R") (list-files-provided-by . "xbps-query -f") (verify-all-packages . nil) (verify-all-dependencies . "xbps-pkgdb -a") (remove-orphaned . "dnf autoremove") (list-installed-packages . "xbps-query -l ") (list-installed-packages-all . "xbps-query -l ") (list-dependencies-of . "xbps-query -x") (noconfirm . nil))) ;; Arch-based systems (pacman . ((default-sudo . t) (install . "pacman -S") (search . "pacman -Ss") (uninstall . "pacman -Rns") (update . "pacman -Syu") (clean-cache . "pacman -Sc") (change-log . "pacman -Qc") (log . "cat /var/log/pacman.log") (get-info . "pacman -Qi") (get-info-remote . "pacman -Si") (list-files-provided-by . "pacman -qQl") (owning-file . "pacman -Qo") (owning-file-remote . "pacman -F") (verify-all-packages . "pacman -Qkk") (verify-all-dependencies . "pacman -Dk") (remove-orphaned . "pacman -Rns $(pacman -Qtdq)") (list-installed-packages . "pacman -Qe") (list-installed-packages-all . "pacman -Q") (list-dependencies-of . "pacman -Qi") (noconfirm . "--noconfirm")))) "An alist of package manager commands. The key is the package manager and value (usually) the shell command to run. Any occurrences of ~%p~ in the command will be replaced with the package name during execution, otherwise the package name is simply appended to the command.") (put 'system-packages-supported-package-managers 'risky-local-variable t) (define-obsolete-variable-alias 'system-packages-packagemanager 'system-packages-package-manager "2017-12-25") (defcustom system-packages-package-manager (let ((managers system-packages-supported-package-managers) manager) (while managers (progn (setq manager (pop managers)) (let ((found (executable-find (symbol-name (car manager))))) (if (and found ;; The package manager named "pacman" conflicts ;; with the game binary on non-Arch systems. (not (string-match (rx "games/pacman" eos) found))) (setq managers nil) (setq manager nil))))) (car manager)) "Symbol naming the package manager to use. See `system-packages-supported-package-managers' for the list of supported software. Tries to be smart about selecting the default. If you change this value, you may also want to change `system-packages-use-sudo'." :type '(choice (const guix) (const nix-env) (const brew) (const port) (const pacman) (const apt) (const aptitude) (const emerge) (const zypper) (const dnf) (const xbps-install))) (define-obsolete-variable-alias 'system-packages-usesudo 'system-packages-use-sudo "2017-12-25") (defcustom system-packages-use-sudo (cdr (assoc 'default-sudo (cdr (assoc system-packages-package-manager system-packages-supported-package-managers)))) "If non-nil, system-packages uses sudo for appropriate commands. Tries to be smart for selecting the default." :type 'boolean) (defcustom system-packages-noconfirm nil "If non-nil, bypass prompts asking the user to confirm package upgrades." :type 'boolean) (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))))) (noconfirm (when system-packages-noconfirm (cdr (assoc 'noconfirm (cdr (assoc system-packages-package-manager system-packages-supported-package-managers))))))) (unless command (error (format "%S not supported in %S" action system-packages-package-manager))) (setq command (if (string-match-p "%p" command) (replace-regexp-in-string "%p" pack command t t) (concat command " " pack))) (when noconfirm (setq args (concat args (and pack " ") noconfirm))) (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)) (default-directory (if system-packages-use-sudo "/sudo::" default-directory)) (inhibit-read-only t)) (async-shell-command command "*system-packages*"))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; functions on named packages ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;###autoload (defun system-packages-install (pack &optional args) "Install system packages. Use the package manager from `system-packages-package-manager' to install PACK. You may use ARGS to pass options to the package manger." (interactive "sPackage to install: ") (system-packages--run-command 'install pack args)) ;;;###autoload (defun system-packages-ensure (pack &optional args) "Ensure PACK is installed on system. Search for PACK with `system-packages-package-installed-p', and install the package if not found. Use ARGS to pass options to the package manager." (interactive "sPackage to ensure is present: ") (if (system-packages-package-installed-p pack) t (system-packages-install pack args))) ;;;###autoload (defalias 'system-packages-package-installed-p #'executable-find "Return t if PACK is installed. Currently an alias for `executable-find', so it will give wrong results if the package and executable names are different.") ;;;###autoload (defun system-packages-search (pack &optional args) "Search for system packages. Use the package manager named in `system-packages-package-manager' to search for PACK. You may use ARGS to pass options to the package manager." (interactive "sSearch string: ") (system-packages--run-command 'search pack args)) ;;;###autoload (defun system-packages-uninstall (pack &optional args) "Uninstall system packages. Uses the package manager named in `system-packages-package-manager' to uninstall PACK. You may use ARGS to pass options to the package manager." (interactive "sPackage to uninstall: ") (system-packages--run-command 'uninstall pack args)) ;;;###autoload (defun system-packages-list-dependencies-of (pack &optional args) "List the dependencies of PACK. You may use ARGS to pass options to the package manager." (interactive "sPackage to list dependencies of: ") (system-packages--run-command 'list-dependencies-of pack args)) ;;;###autoload (defun system-packages-get-info (pack &optional args) "Display local package information of PACK. With a prefix argument, display remote package information. You may use ARGS to pass options to the package manager." (interactive "sPackage to list info for: ") (if current-prefix-arg (system-packages--run-command 'get-info-remote pack args) (system-packages--run-command 'get-info pack args))) ;;;###autoload (defun system-packages-list-files-provided-by (pack &optional args) "List the files provided by PACK. You may use ARGS to pass options to the package manager." (interactive "sPackage to list provided files of: ") (system-packages--run-command 'list-files-provided-by pack args)) ;;;###autoload (defun system-packages-owning-file (file &optional args) "Search for packages containing FILE. Search only locally installed packages by default. With a prefix argument, try to search packages not yet installed. You may use ARGS to pass options to the package manager." (interactive "FFile name: ") (if current-prefix-arg (system-packages--run-command 'owning-file-remote file args) (system-packages--run-command 'owning-file file args))) ;;;###autoload (defun system-packages-change-log (pack &optional args) "Show the change log of PACK. You may use ARGS to pass options to the package manager." (interactive "sPackage to show change log of: ") (system-packages--run-command 'change-log pack args)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; functions that don't take a named package ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;###autoload (defun system-packages-update (&optional args) "Update system packages. Use the package manager `system-packages-package-manager'. You may use ARGS to pass options to the package manger." (interactive) (system-packages--run-command 'update nil args)) ;;;###autoload (defun system-packages-remove-orphaned (&optional args) "Remove orphaned packages. Uses the package manager named in `system-packages-package-manager'. You may use ARGS to pass options to the package manger." (interactive) (system-packages--run-command 'remove-orphaned nil args)) ;;;###autoload (defun system-packages-list-installed-packages (all &optional args) "List explicitly installed packages. Uses the package manager named in `system-packages-package-manager'. With \\[universal-argument] (for ALL), list all installed packages. You may use ARGS to pass options to the package manger." (interactive "P") (if all (system-packages--run-command 'list-installed-packages-all nil args) (system-packages--run-command 'list-installed-packages nil args))) ;;;###autoload (defun system-packages-clean-cache (&optional args) "Clean the cache of the package manager. You may use ARGS to pass options to the package manger." (interactive) (system-packages--run-command 'clean-cache nil args)) ;;;###autoload (defun system-packages-log (&optional args) "Show a log from `system-packages-package-manager'. You may use ARGS to pass options to the package manger." (interactive) (system-packages--run-command 'log args)) ;;;###autoload (defun system-packages-verify-all-packages (&optional args) "Check that files owned by packages are present on the system. You may use ARGS to pass options to the package manger." (interactive) (system-packages--run-command 'verify-all-packages nil args)) ;;;###autoload (defun system-packages-verify-all-dependencies (&optional args) "Verify that all required dependencies are installed on the system. You may use ARGS to pass options to the package manger." (interactive) (system-packages--run-command 'verify-all-dependencies nil args)) (provide 'system-packages) ;;; system-packages.el ends here