pkgtreediff
RPM package tree diff tool
https://github.com/juhp/pkgtreediff
LTS Haskell 22.40: | 0.6.0 |
Stackage Nightly 2024-11-09: | 0.6.0 |
Latest on Hackage: | 0.6.0 |
pkgtreediff-0.6.0@sha256:fa8d129a21630aaa45a770c5b50f25eb4d705d1b6784a43ccb3b75b2a5f6d71d,2875
Module documentation for 0.6.0
- Distribution
- Distribution.RPM
pkgtreediff
pkgtreediff
compares the NVRs (name-version-release) of RPM packages
in OS package trees and/or installations:
- An OS tree can be referenced by an url or directory containing a tree of rpm files.
- A text file/url containing a list of rpm NVRs can also be compared.
- Commands can also be used to get installed RPMs, eg:
"rpm -qa"
"ssh myhost rpm -qa"
"podman run --rm myimage rpm -qa"
"sudo dnf -q repoquery --qf '%{name}-%{version}-%{release}.%{arch}'"
- A koji tag: koji://tag@KojiHubUrl (or koji://tag@fedora)
Usage examples
Help
$ pkgtreediff --version
0.6.0
$ pkgtreediff -h
Package tree comparison tool
Usage: pkgtreediff [--version] [-r|--recursive] [-d|--subdir SUBDIR]
[(-R|--ignore-release) | (-V|--ignore-version)]
[(-N|--new) | (-D|--deleted) | (-U|--updated) |
(-u|--downgraded)]
[(-s|--show-summary) | (-S|--no-summary)] [-R|--rst]
[-p|--pattern PKGPATTERN] [-t|--timeout SECONDS]
URL|DIR|FILE|KOJITAG|CMD1 URL|DIR|FILE|KOJITAG|CMD2
pkgtreediff compares the packages in two OS trees or instances
Available options:
-h,--help Show this help text
--version Show version
-r,--recursive Recursive down into subdirectories
-d,--subdir SUBDIR Select specific subdir (eg x86_64 or source)
-R,--ignore-release Only show version changes (ignore release)
-V,--ignore-version Only show package changes (ignore version-release)
-N,--new Show only added packages
-D,--deleted Show only removed packages
-U,--updated Show only upgraded packages
-u,--downgraded Show only downgraded packages
-s,--show-summary Show summary of changes (default when >20 changes)
-S,--no-summary Do not display summary
-R,--rst Use ReSTructured Text format
-p,--pattern PKGPATTERN Limit packages to glob matches
-t,--timeout SECONDS Maximum seconds to wait for http response before
timing out (default 30)
Containers
Compare the content of two rpm based containers versions, filtering for new added packages:
$ pkgtreediff --new "podman run --rm fedora:36 rpm -qa" "podman run --rm fedora:37 rpm -qa"
libb2-0.98.1-7.fc37.x86_64
Package trees
Package source changes between Fedora 35 and 36 Server at GA (ignoring release bumps):
$ pkgtreediff --ignore-release https://download.fedoraproject.org/pub/fedora/linux/releases/{35,36}/Server/source/tree/Packages/
ModemManager.src: 1.18.2-1.fc35 -> 1.18.6-1.fc36
NetworkManager.src: 1.32.12-1.fc35 -> 1.36.4-1.fc36
PackageKit.src: 1.2.4-3.fc35 -> 1.2.5-1.fc36
abrt.src: 2.14.6-9.fc35 -> 2.15.1-1.fc36
:
:
- tree-1.8.0-7.fc35.src
+ tree-pkg-2.0.1-2.fc36.src
tzdata.src: 2021b-1.fc35 -> 2022a-1.fc36
:
xorg-x11-xauth.src: 1.1-9.fc35 -> 1.1.1-2.fc36
+ xrdb-1.2.1-3.fc36.src
xxhash.src: 0.8.0-4.fc35 -> 0.8.1-2.fc36
yelp.src: 41.1-1.fc35 -> 42.1-1.fc36
yelp-xsl.src: 41.0-1.fc35 -> 42.0-1.fc36
zchunk.src: 1.1.15-2.fc35 -> 1.2.1-1.fc36
zstd.src: 1.5.0-2.fc35 -> 1.5.2-1.fc36
Summary
Updated: 293
Downgraded: 0
Added: 36
Deleted: 21
Arch changed: 0
Total packages: 915 -> 930
For very large repos like Everything it should be faster to use a repoquery command.
Hosts
Compare the packages on local and another host:
pkgtreediff "rpm -qa" "ssh otherhost rpm -qa"
Any types of sources can be compared, together with the use of flags.
Koji
Compare koji tags using the koji://tag@kojihub
syntax:
pkgtreediff koji://dist-c8-updates-build@centos koji://dist-c8_1-updates-build@centos
Please avoid using koji tags to compare full releases as it is more efficient to query URL or CMD trees.
Builds
pkgtreediff is packaged in Fedora.
Older builds are also available in copr for Fedora, EPEL, and OpenSuSE (more details).
RPM version ordering
RPM version ordering is somewhat complicated. For example “1.2.1~rc1” < “1.2.1” (greater for ^).
pkgtreediff use the rpm-nvr
library implementation of the rpmvercmp()
algorithm,
though it has not been verified to behave identically.
Changes
Changelog
0.6.0 (2022-10-27)
- significant processing performance improvement: drop expensive nub
- allow multiple mode options and separate summary & rst options
- add support for package list files via http
- fix local filesystem recursion
- initial testsuite
0.5.0 (2021-11-03)
- use rpm-nvr library for NVRA type (API changes) and rpmVerCompare to order ver-rel’s
- add –downgraded filter
- add –subdir
- remove –ignore-arch
0.4.1 (2021-04-19)
- expose a library in Distribution.RPM.PackageTreeDiff (@juhp)
- full correct rpm version comparison (ie handling ^ and ~) (@juhp)
- new koji://[email protected] method (@TristanCacqueray)
- rst summary output format (@TristanCacqueray)
0.4 (2020-03-13)
- support files of lists of rpms
- support commands for getting package NVRs
- to run “rpm -qa” etc, locally or remotely
- note commands must be quoted and include a space to be recognized
- fix sorting of packages by rpmvercmp() style ordering (#3) (fixes cumulative trees like CentOS for example)
- add –timeout option for http (#1)
0.3 (2019-06-06)
- add –pattern for href filename globbing
- use http-directory-0.1.4 for httpDirectory basic filtering
0.2.1 (2019-06-06)
- better recursion handling and href filtering
0.2 (2019-06-05)
- print summary
- add –ignore-arch
0.1 (2019-06-04)
- –ignore-version option
0.0 (2019-05-31)
- Initially created.
- –ignore-release option