Add an example for using decman

This commit is contained in:
Kivi Kaitaniemi
2025-12-18 05:45:07 +02:00
parent 20171333ae
commit 1e3b83b3d8
15 changed files with 249 additions and 459 deletions
+5 -4
View File
@@ -375,10 +375,10 @@ For conveniance, decman provides some plugins with quick access.
```py
import decman
decman.pacman = decman.plugins.get("pacman")
decman.aur = decman.plugins.get("aur")
decman.systemd = decman.plugins.get("systemd")
decman.flatpak = decman.plugins.get("flatpak")
assert decman.pacman == decman.plugins.get("pacman")
assert decman.aur == decman.plugins.get("aur")
assert decman.systemd == decman.plugins.get("systemd")
assert decman.flatpak == decman.plugins.get("flatpak")
```
### Creating custom plugins
@@ -457,6 +457,7 @@ In `pyproject.toml` set:
systemd = "decman.plugins.systemd:Systemd"
pacman = "decman.plugins.pacman:Pacman"
aur = "decman.plugins.aur:AUR"
flatpak = "decman.plugins.flatpak:Flatpak"
```
## Useful utilities
+12
View File
@@ -43,6 +43,18 @@ decman.aur.custom_packages |= {
This plugin's execution order step name is `aur`.
### Command line
This plugin accepts params via the command line.
```sh
sudo decman --params aur-upgrade-devel aur-force
```
`aur-upgrade-devel` causes devel packages (packages from version control, such as `*-git` packages) to be upgraded.
`aur-force` causes decman to rebuild packages that were already cached.
### Within modules
Modules can also define AUR packages and custom packages. Decorate a module's method with `@decman.plugins.aur.packages` or `@decman.plugins.aur.custom_packages`. For AUR packages return a `set[str]` of package names from that module. Custom packages should return a `set[CustomPackage]`.