MyNixOS website logo
Description

RPM package tree diff tool.

Tool for comparing RPM packages and version-releases in OS dist trees or instances.

pkgtreediff

Hackage GPL-3 license Stackage Lts Stackage Nightly

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.

Metadata

Version

0.6.0

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows