Changelogs for installable pending updates, or available/uninstalled packages
Project description
Changelog tool for Zypper
Both YUM & DNF can provide changelogs for pending package updates, or as-yet uninstalled packages. Zypper, the package manager favoured by openSUSE, lacks these capabilities currently.
This tool is a stand-alone work-around that resources zypper local cache files,
specifically each repo's /var/cache/zypp/raw/(REPOSITORY-ALIAS)/repodata/*primary.xml.[gz|zst],
to discover the latest version of each package that is available within each repository.
An RPM python interface is then utilized to interrogate the header of that latest-per-repo version. This facilitates having to only download the header of each rpm from the remote repositories, for each package queried.
The default is to consider only installable pending package updates. Analyzing a large repository for all available packages is still somewhat extreme, and rarely required.
History
This endeavour represents a heavily modified version of zypper-changelog-plugin by Zoltán Balogh of SUSE.
These references differ in packaging details/config but share the LGPL-2.1-only licensed zypper-changelog file.
The single Python source file differs by a pending GitHub PR fix; already in the OBS zypper-changelog-plugin-0.6.tar.gz.
This file is renamed to zypper-changelog-lib.py with the original preserved within Git to help with Aims 6.
Aims
This fork aims to:
- Add library capability, enabling its use in other Python projects,
- Add common, non-optional constrains/optimisations not found in the original work. E.g. retrieving changelogs only for the latest version of each package in each repo.
- Lightly re-work the CLI options available; with the aim of simplifying its use.
- Add repo authentication capability, as per for example SLES repos, via password-store initially. Required outside that already provided by zypper by virtue of our partial (http 206) requests.
- Reduce RAM requirements by further optimisations. The original, and still to a large extent this fork, struggle with larger repos on systems with < 4 GB RAM.
- Ultimately contribute back to the original project if these goals align.
Use within a Python projects
The current maintainer of this fork has a time-sensitive specific use for the modified code as presented. But as per Aims 6 above, it is hoped that any and hopefully all improvements in time can be shared with the above referenced project.
pip install zypper-changelog-lib
import zypper-changelog-lib
OS package dependencies
Names based on openSUSE packages.
Python311- A suspected minimum.Python311-rpm- to interface with the OS's RPM version.python311-requests- used for the partial (HTTP 206) rpm header retrievals.password-store- repo authentication, via the Pythonkeyring-passmodule.zstd- decompression tool used for the zypper cache files.zypper- Obviously.
If running within a virtual environment, as per the included Poetry .venv config:
- the rpm-shim module rpm will be required.
- the
requestslibrary will be auto installed if OSpython311-requestsis not found.
CLI use
The initial focus here is on enabling library functionality,
but the following should work for testing purposes using python 3.11.
Poetry specific run commands to follow.
Note that zypper refresh ensures its cache files are up-to-date with repository content.
Default
List the changelogs for all installable updates
zypper refresh
python3.11 /path/zypper-changelog-lib/zypper-changelog-lib.py
Not all pending updates have accompanying changelog entries,
in this case only the package name header will be output;
e.g. Package: libvpl2 in the following example.
Similarly, companion packages can sometimes share a changelog.
The following is an example output containing both of the above.
Package: iproute2
* Wed Mar 19 2025 mkubecek@suse.cz
- avoid spurious cgroup warning (bsc#1234383):
- ss-Tone-down-cgroup-path-resolution.patch
Package: iproute2-bash-completion
* Wed Mar 19 2025 mkubecek@suse.cz
- avoid spurious cgroup warning (bsc#1234383):
- ss-Tone-down-cgroup-path-resolution.patch
Package: libvpl2
Debug
And example containing both package and repository filtering (recommended) with all debug logging redirected to a file:
zypper refresh
python3.11 /path/zypper-changelog-lib.py -p zstd,acl,deltarpm -r openSUSE:update-slowroll -d 2> output-file.txt
Options and parameters
From:
python3.11 /path/zypper-changelog-lib.py --help
usage: zypper-changelog-lib [-h] [-p PACKAGES] [-r REPOS] [-d] [-t] [-re] [-AA]
Changelogs for installable pending updates, or available/uninstalled packages (requires options).
Note: '--all-available' alone is extreme: it retrieves rpm headers for the latest version (per repo) of
all available packages - taking no account of what packages are installed. '--all-available' still
heeds the filters of '--packages' & '--repos' if specified, but the changelogs presented are full
default length: not a difference to installed pks where they may or may-not exist.
options:
-h, --help show this help message and exit
-p PACKAGES, --packages PACKAGES
Comma separated list (no spaces) of packages to consider. Default is all installed packages.
-r REPOS, --repos REPOS
Comma separated list (no spaces) of repository aliases to consider. Default is all enabled repositories.
-d, --debug Enable debug mode.
-t, --titles-only List only the changelog titles.
-re, --regex Enable regular expression in package names.
-AA, --all-available Changelogs for all available packages (latest versions only): USE WITH CAUTION.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file zypper_changelog_lib-0.7.2.tar.gz.
File metadata
- Download URL: zypper_changelog_lib-0.7.2.tar.gz
- Upload date:
- Size: 40.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.11 Linux/6.4.0-150600.23.47-default
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52455f7a7a439575ba6506abd3d07c677f7afc71bf1a14a4902018eb24096eec
|
|
| MD5 |
286f0706c693aa04ab3f1fb34260ded2
|
|
| BLAKE2b-256 |
57fbda04d5900d1a601611aa948ab60d3c7dc62c131571d53a80559cc4735a5f
|