| | 1 | = Using Yum as an SPMA backend = |
| | 2 | |
| | 3 | [[TOC]] |
| | 4 | |
| | 5 | == Introduction == |
| | 6 | |
| | 7 | This document describes the internals of the integration of Yum and SPMA. User documentation will be provided in Github pages. |
| | 8 | |
| | 9 | The main priority is to make the transition as smooth as possible for users. În the first stage, all changes are on the client side. This means *no changes to any Pan schemas*. In the second phase, some schemas may add fields for the user's benefit, but it *should* be backwards-compatible. |
| | 10 | |
| | 11 | Whatever changes we do to SPMA schema or internals, we *must* port them into AII, which is going to be time consuming. |
| | 12 | |
| | 13 | === What `ncm-spma` does === |
| | 14 | |
| | 15 | `ncm-spma`, essentially, writes two files: `/etc/spma.conf` and `/var/lib/spma-target.cf`. Afterwards, it may need to transfer the control to the `spma` program, who actually deals with the packages. |
| | 16 | |
| | 17 | === What `spma` does === |
| | 18 | |
| | 19 | The `spma` program reads its configuration file and the list of desired packages, potentially manipulates some URLs, and passes control to `SPM::RPMPPkgr`. |
| | 20 | |
| | 21 | === Current problems === |
| | 22 | |
| | 23 | First of all, it's the obvious lack of dependency resolution. To avoid any dependency problems in Pan, we install way too much. |
| | 24 | |
| | 25 | Also, there are bugs in some RPM bindings that limit the size of our transactions. |
| | 26 | |
| | 27 | == Proposal == |
| | 28 | |
| | 29 | We'll fork off `ncm-spma` completely. Updating the system will require running `ncm-ncd --co spma`, as is currently done. The new `ncm-spma` will: |
| | 30 | |
| | 31 | 1. Use `/software/repositories` to populate `/etc/yum.repos.d`. |
| | 32 | * In a future iteration, all fields allowed in a Yum repository will be allowed. |
| | 33 | 1. For packages with a fixed repository, include them in the `includepkgs` entry of the relevant repository. |
| | 34 | 1. For packages with no fixed repository, include them in the `includepkgs` entry of `/etc/main.conf`. |
| | 35 | 1. Compute the set difference between `rpm -qa` and `/software/packages`. |
| | 36 | 1. Execute `yum shell` to: |
| | 37 | 1. Remove the difference (these are outdated packages), unless `userpkgs` is set. |
| | 38 | 1. Install all entries in `/software/packages` |
| | 39 | |
| | 40 | In future iterations, version and architecture of any given package will be optional. |
| | 41 | |
| | 42 | The `spma` command will become an alias for `ncm-ncd --co spma`. The `rpmt-py` and `spma` packages will become deprecated. |
| | 43 | |
| | 44 | Users willing to go back to the previous behaviour can just downgrade ncm-spma, and it will just work. |