docs: cover the command line, provider traces and the new catalogues
The interface, operations and plugin guides still described the old tree, the log without provider traces and a single extra language, so a reader could not tell what the app really runs or that a headless command exists.
This commit is contained in:
9 files changed
+195
-118
No files matched your search
+66
-47
@@ -14,6 +14,22 @@ Package manager for **Arch Linux** based on **pacman**, with a Qt6 graphical int
|
||||
- 📥 **Flatpak files**: drop a `.flatpakref`, `.flatpakrepo` or `.flatpak` onto the window (or right-click → **Open with PacManager** in your file manager) to install it directly — with the bytes actually downloaded and the elapsed time shown live, since flatpak prints nothing while a runtime comes down
|
||||
- 🔁 **Several installations**: an application installed per-user *and* system-wide, or from two remotes, stays a **single row**; the details panel lists the copies and **Remove** opens one checkbox per installation so the user picks the ones to get rid of
|
||||
- ⚙️ **Settings**: when the admin password is asked, **where** the journal is written and how large it may grow, drag & drop of Flatpak files on or off, the interface language, and PacManager's own update policy (automatic check, block for 1 h / 24 h / 7 days / until cancelled)
|
||||
- ⌨️ **Command line**: `pacmanager search vlc` then `pacmanager install vlc` — the same logic as the window, without a screen (see [doc/cli.md](doc/cli.md))
|
||||
|
||||
## Command line
|
||||
|
||||
The same logic as the window can be used without opening an interface:
|
||||
|
||||
```bash
|
||||
pacmanager search vlc
|
||||
pacmanager install vlc
|
||||
pacmanager updates
|
||||
```
|
||||
|
||||
Commands: `search`, `install`, `remove`, `update`, `list`, `updates`, `info`,
|
||||
`refresh`, `cleanup`, `help`, `version` (French keywords accepted too). `-y` /
|
||||
`--yes` skips confirmations, `--help` prints the help. The details are in
|
||||
[doc/cli.md](doc/cli.md).
|
||||
|
||||
## Architecture
|
||||
|
||||
@@ -45,49 +61,52 @@ signals (`listFinished`, `actionProgress`, `actionFinished`, `statusMessage`…)
|
||||
Every operation that spawns a process is asynchronous.
|
||||
|
||||
```
|
||||
package-manager/
|
||||
├── CMakeLists.txt # Build root
|
||||
├── include/
|
||||
│ ├── app-core.h # LOGIC: everything the app does (no widget)
|
||||
│ ├── workers.h # Shared threads (search / listings / actions)
|
||||
│ ├── package-manager.h # Package manager interface (IPackageManager)
|
||||
│ ├── plugin.h # Generic plugin contract (PluginInfo, IPlugin)
|
||||
│ ├── provider-plugin.h # C ABI contract for plugins (providers + addons)
|
||||
│ ├── pacman-manager.h # pacman manager (Arch Linux, built-in)
|
||||
│ ├── plugin-manager.h # Plugin registry + shared-library loading
|
||||
│ ├── plugin-package.h # Installing a .fwspacm plugin package
|
||||
│ ├── zip-archive.h # Minimal ZIP reader (zlib)
|
||||
│ ├── main-window.h # INTERFACE: the window frame
|
||||
│ ├── history-manager.h # Action history
|
||||
│ ├── package-model.h # Qt model for the list
|
||||
│ └── update-manager.h # Self-update (releases)
|
||||
├── src/
|
||||
│ ├── main.cpp
|
||||
│ ├── app-core.cpp
|
||||
│ ├── workers.cpp
|
||||
│ ├── main-window.cpp
|
||||
│ ├── pacman-manager.cpp
|
||||
│ ├── plugin-manager.cpp
|
||||
│ ├── history-manager.cpp
|
||||
│ ├── package-model.cpp
|
||||
│ ├── update-manager.cpp
|
||||
│ └── app-logging.cpp
|
||||
PacManager/
|
||||
├── CMakeLists.txt # app, plugins and tests targets
|
||||
├── app/ # FRAME: the window and the entry point
|
||||
│ ├── main.cpp # entry point: journal, language, window, CLI
|
||||
│ └── main-window.h/.cpp # sidebar, menus, dialogs, stylesheet
|
||||
├── cli/ # COMMAND LINE (no widget)
|
||||
│ ├── cli-command.h/.cpp # accepted grammar (tested)
|
||||
│ └── cli-application.h/.cpp # execution on AppCore
|
||||
├── core/ # LOGIC: everything the app does
|
||||
│ ├── app-core.h/.cpp # the controller the screens delegate to
|
||||
│ ├── workers.h/.cpp # worker threads (search, listings, actions)
|
||||
│ └── package-model.h/.cpp # Qt model for the lists
|
||||
├── providers/ # package providers
|
||||
│ ├── pacman-manager.h/.cpp # pacman, built-in
|
||||
│ ├── flatpak-provider/ # Flatpak provider
|
||||
│ ├── aur-provider/ # AUR provider (yay/paru)
|
||||
│ ├── example-provider/ # provider template
|
||||
│ └── example-addon/ # extension template
|
||||
├── plugins/ # plugin host
|
||||
│ ├── plugin-manager.h/.cpp # registry + shared-library loading
|
||||
│ └── plugin-package.h/.cpp # installing a .fwspacm package
|
||||
├── preferences/ # what the user chose
|
||||
│ ├── app-settings.h/.cpp # the settings model
|
||||
│ └── language-manager.h/.cpp # interface and journal language
|
||||
├── logging/ # the journal
|
||||
│ ├── log-manager.h/.cpp # operations.log, read by the Logs screen
|
||||
│ └── app-logging.h/.cpp # qCDebug/qCInfo categories
|
||||
├── history/ # action history (CSV)
|
||||
├── update/ # PacManager self-update
|
||||
├── archive/ # minimal ZIP reader (zlib), for .fwspacm
|
||||
├── include/sdk/ # public plugin SDK (installed flat)
|
||||
│ ├── package-manager.h # IPackageManager interface + merge helpers
|
||||
│ ├── plugin.h # generic plugin contract (IPlugin)
|
||||
│ ├── provider-plugin.h # C ABI contract for external plugins
|
||||
│ ├── progress-tracker.h # progress read from the tools' output
|
||||
│ └── provider-trace.h # provider trace, journal only
|
||||
├── pages/ # INTERFACE: one file per screen
|
||||
│ ├── page.h/.cpp # Screen contract (Page) + helpers
|
||||
│ ├── ui-kit.h/.cpp # Shared widgets (tables, cards, badges)
|
||||
│ ├── dashboard-page.h/.cpp # Dashboard
|
||||
│ ├── browse-page.h/.cpp # Search / installed / updates
|
||||
│ ├── cleanup-page.h/.cpp # Cleanup
|
||||
│ ├── history-page.h/.cpp # History
|
||||
│ ├── logs-page.h/.cpp # pacman logs
|
||||
│ └── plugins-page.h/.cpp # Plugins
|
||||
├── plugins/
|
||||
│ ├── example-provider/ # Example external provider plugin (template)
|
||||
│ ├── example-addon/ # Example external addon plugin (extension, template)
|
||||
│ └── flatpak-provider/ # Flatpak plugin (loaded at runtime, built by default)
|
||||
├── make-plugin-package.py # Builds a .fwspacm package from a shared library
|
||||
├── tests/ # Unit tests (assert, no Qt)
|
||||
└── resources/
|
||||
│ ├── base/ # screen contract + shared widgets
|
||||
│ ├── packages/ # search, installed, updates, cleanup
|
||||
│ ├── overview/ # dashboard, history
|
||||
│ ├── system/ # logs, settings
|
||||
│ └── extensions/ # plugins
|
||||
├── translations/ # catalogues, one JSON per language (French is the source)
|
||||
├── doc/ # this documentation (source of the wiki)
|
||||
├── tests/ # unit and integration tests
|
||||
└── resources/ # icons and catalogues compiled into the binary
|
||||
```
|
||||
|
||||
## Compilation (Arch Linux)
|
||||
@@ -101,7 +120,7 @@ sudo pacman -S qt6-base cmake gcc base-devel
|
||||
### Build
|
||||
|
||||
```bash
|
||||
cd package-manager
|
||||
cd FWS-PacManage
|
||||
|
||||
# Configure and compile
|
||||
cmake -B build -DFWS_BUILD_EXAMPLE_PLUGIN=ON
|
||||
@@ -211,7 +230,7 @@ The interface uses **Qt6** with a dark theme, a **navigation sidebar** and stack
|
||||
- ⬆️ **Updates**: outdated packages detected by `pacman -Qu`, **the check runs as soon as the tab opens** (no need to press "Update all" to see the list), "Update all" button
|
||||
- 🧹 **Cleanup**: **orphan** packages (`pacman -Qdt`, nothing requires them) and **legacy** ones (`pacman -Qm`, AUR / manual builds), bulk removal of the orphans, and cache trimming: `paccache` / `pacman -Sc` and unused Flatpak runtimes (`flatpak uninstall --unused`)
|
||||
- 📋 **History**: filterable table (installs / removals / updates / cleanups) + CSV export
|
||||
- 📜 **Logs**: built-in `/var/log/pacman.log` viewer with an instant filter
|
||||
- 📜 **Logs**: the application journal (`operations.log`: operations, command output, provider trace) **and** `/var/log/pacman.log`, selectable, with an instant filter
|
||||
- 🧩 **Plugins**: lists every plugin (package providers and extensions), enable / disable and plugin rescan
|
||||
- ⌨️ **Convenience**: system tray icon and keyboard shortcuts (Ctrl+F search, Ctrl+R / F5 refresh, Ctrl+U updates, Ctrl+E export, Ctrl+Q quit)
|
||||
- 🔒 **pacman lock**: when another manager (pamac, octopi, yay…) holds the database, PacManager names it (process + PID) and offers to close it and resume the operation, instead of waiting for it to finish; a leftover lock is removed the same way
|
||||
@@ -299,18 +318,18 @@ Search queries **all active providers at once**: every result shows its origin i
|
||||
|
||||
### Adding a plugin
|
||||
|
||||
**Pacman** is **built-in** (compiled into the application); **Flatpak** is an **external plugin** loaded at runtime from `plugins/` (`plugins/flatpak-provider`), next to the executable or in `~/.local/share/PacManager/plugins/`, and **built by default** (`FWS_BUILD_FLATPAK_PLUGIN=ON`). Flatpak installs auto-add the flathub remote when missing and fall back to a **per-user** install (no password) when the system-wide install fails (polkit, homonymous remotes) — the real error is shown on failure. An app installed via Flatpak appears immediately in the desktop launcher: its `.desktop` entries and icons are linked into `~/.local/share/applications` and `~/.local/share/icons` (the XDG dirs scanned by **every** environment: wofi, GNOME, KDE…), exactly like a pacman install, and are removed again on uninstall. Search shows the real status of each app (Installed / Update available). A **Flatpak file** can also be installed directly, without going through search: drop it on the window or pick **Open with PacManager** in the file manager (`.flatpakref` and `.flatpak` start an install, `.flatpakrepo` registers the remote under the file's name). This is covered by an **integration test** that drives the real flatpak CLI (install, list, update, search, uninstall).
|
||||
**Pacman** is **built-in** (compiled into the application); **Flatpak** is an **external plugin** loaded at runtime from `plugins/` (source in `providers/flatpak-provider`), next to the executable or in `~/.local/share/PacManager/plugins/`, and **built by default** (`FWS_BUILD_FLATPAK_PLUGIN=ON`). Flatpak installs auto-add the flathub remote when missing and fall back to a **per-user** install (no password) when the system-wide install fails (polkit, homonymous remotes) — the real error is shown on failure. An app installed via Flatpak appears immediately in the desktop launcher: its `.desktop` entries and icons are linked into `~/.local/share/applications` and `~/.local/share/icons` (the XDG dirs scanned by **every** environment: wofi, GNOME, KDE…), exactly like a pacman install, and are removed again on uninstall. Search shows the real status of each app (Installed / Update available). A **Flatpak file** can also be installed directly, without going through search: drop it on the window or pick **Open with PacManager** in the file manager (`.flatpakref` and `.flatpak` start an install, `.flatpakrepo` registers the remote under the file's name). This is covered by an **integration test** that drives the real flatpak CLI (install, list, update, search, uninstall).
|
||||
|
||||
**Adding a provider** (apt, dnf, zypper, or another distro's repos) without touching the application:
|
||||
|
||||
1. Implement `IPackageManager` in a `.cpp` file (copy `plugins/example-provider/example-provider.cpp` as a template).
|
||||
1. Implement `IPackageManager` in a `.cpp` file (copy `providers/example-provider/example-provider.cpp` as a template).
|
||||
2. Export the C ABI contract with the `FWS_PROVIDER_PLUGIN(MyManager, "id", "Name", "1.0.0", "Description", "Author")` macro.
|
||||
3. Compile it as a shared library and drop it into `~/.local/share/PacManager/plugins/` or `plugins/` next to the executable.
|
||||
4. Click **Rescan** on the Plugins page.
|
||||
|
||||
**Adding an extension / addon** (anything, as long as it is C++):
|
||||
|
||||
1. Implement `IPlugin` in a `.cpp` file (copy `plugins/example-addon/example-addon.cpp` as a template). The `onLoad()` / `onUnload()` lifecycle hooks are called by the application, and `onUiReady(QMainWindow*)` hands you the main window to attach your own widgets (status bar, buttons, …).
|
||||
1. Implement `IPlugin` in a `.cpp` file (copy `providers/example-addon/example-addon.cpp` as a template). The `onLoad()` / `onUnload()` lifecycle hooks are called by the application, and `onUiReady(QMainWindow*)` hands you the main window to attach your own widgets (status bar, buttons, …).
|
||||
2. Export the C ABI contract with the `FWS_ADDON_PLUGIN(MyAddon, "id", "Name", "1.0.0", "Description", "Author")` macro.
|
||||
3. Compile it as a shared library and drop it into `~/.local/share/PacManager/plugins/` or `plugins/` next to the executable.
|
||||
4. Click **Rescan** on the Plugins page.
|
||||
|
||||
Reference in new issue
Block a user