diff --git a/modules/ordo/action/apt.scm b/modules/ordo/action/apt.scm new file mode 100644 index 0000000..7cb7fd4 --- /dev/null +++ b/modules/ordo/action/apt.scm @@ -0,0 +1,51 @@ +(define-module (ordo action apt) + #:use-module (ordo context)) + +(define noninteractive-env '(("DEBIAN_FRONTEND" . "noninteractive") + ("APT_LISTCHANGES_FRONTEND" . "none"))) + +(define (apt-get . args) + (lambda (ctx) + (must ctx "apt-get" (cons* "-q" "-y" args) #:env noninteractive-env))) + +(define-public (action:apt-update) + (apt-get "update")) + +(define-public (action:apt-upgrade) + (apt-get "upgrade")) + +(define-public (action:apt-dist-upgrade) + (apt-get "dist-upgrade")) + +(define-public (action:apt-install package-name) + (apt-get "install" package-name)) + +(define-public (action:apt-install-minimal package-name) + (apt-get "install" "--no-install-recommends" package-name)) + +(define-public (action:apt-reinstall package-name) + (apt-get "reinstall" package-name)) + +(define-public (action:apt-remove package-name) + (apt-get "remove" package-name)) + +(define-public (action:apt-purge package-name) + (apt-get "purge" package-name)) + +(define-public (action:apt-build-dep package-name) + (apt-get "build-dep" package-name)) + +(define-public (action:apt-clean) + (apt-get "clean")) + +(define-public (action:apt-autoclean) + (apt-get "autoclean")) + +(define-public (action:apt-distclean) + (apt-get "distclean")) + +(define-public (action:apt-autoremove) + (apt-get "autoremove")) + +(define-public (action:apt-autopurge) + (apt-get "autoperge"))