Metadata-Version: 2.4
Name: saltext-opkg
Version: 0.2.0
Summary: Salt extension restoring the opkg package provider removed from Salt core in 3008
Author-email: Paul Tobias <gitlab@tobias.pt>
License-Expression: Apache-2.0
Keywords: salt,saltstack,saltext,opkg,openwrt,turrisos,nilrt,pkg
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: salt>=3007
Dynamic: license-file

# saltext-opkg

A [Salt](https://docs.saltproject.io/) extension that restores the **`opkg`** execution module — the `pkg` provider for [opkg](https://openwrt.org/docs/guide-user/additional-software/opkg)-based systems (OpenWrt up to 24.10, Turris OS, NI Linux Real-Time, OpenEmbedded).

**Source:** <https://gitlab.com/paulto/saltext-opkg>

OpenWrt 25.12 and later use apk instead: see [saltext-apk](https://gitlab.com/paulto/saltext-apk).

## Why this exists

Salt 3008 removed `salt/modules/opkg.py` in its [purge of community extensions](https://github.com/saltstack/salt/commit/dc526dc2b17660059ca19f2d486cabeba54d021a#diff-1234f878b3f16382f9136d449ff43ee66c88c447b70a1490e1a6657f3d89200a) (it was last present in [v3007.14](https://github.com/saltstack/salt/blob/v3007.14/salt/modules/opkg.py)). No replacement extension was published, so on Salt 3008 there is no `pkg` provider for opkg at all. This package restores it.

## What differs from the original

The first commit is the verbatim v3007.14 module, so the git history shows every change since. On top of reformatting:

- **`install`, `remove`, `upgrade`** call `restartcheck.restartcheck` only on NI Linux Real-Time. Upstream called it everywhere, after opkg had already done its work: on a minion without `psutil` the `restartcheck` module does not load, so every one of them died with `KeyError: 'restartcheck.restartcheck'`, and with `psutil` it answers `Only available on Debian, Red Hat and NI Linux Real-Time based systems.`, which upstream turned into a `CommandExecutionError`. Either way `pkg.installed` reported a failure for a package that was in fact installed.

## Install

Into the same environment as Salt (onedir / uv / system):

```
salt-pip install saltext-opkg
```

or as a Salt state:

```yaml
saltext.opkg:
  pip.installed:
    - bin_env: /usr/bin/salt-pip
```

Once installed, it loads as the `pkg` provider on NI Linux Real-Time and on any minion with an `/etc/opkg` directory.

## License

Apache-2.0 — the same license as the Salt code it derives from; see [`LICENSE`](LICENSE). The `opkg` module is derived from SaltStack's `salt/modules/opkg.py`; copyright of the original portions remains with the SaltStack authors.
