armh

2017-08-07 23:24 UTC
  • Xyne

Metadata

Description: Pacman history parser and helper script for the Arch Rollback Machine (ARM).
Latest Version: 2013.5.22.1
Source Code: src/
Architecture:
  • any
Dependencies:
  • pyalpm
  • python3
Arch Repositories:
  • [xyne-any]
  • [xyne-i686]
  • [xyne-x86_64]
AUR Page: armh
Arch Forum Thread: 145517
Tags:

About

Armh is a command-line utility that can be used to retrieve old packages from the Arch Rollback Machine (ARM).

Features

Search By Package Name

The simplest usage is searching for old packages on ARM.

$ armh --search nvidia --color --table
[2010-09-01 03:36] nvidia      256.53-1 http://arm.konnichi.com/pool/packages/nvidia-256.53-1-x86_64.pkg.tar.xz
[2010-10-18 07:40] nvidia   260.19.12-1 http://arm.konnichi.com/pool/packages/nvidia-260.19.12-1-x86_64.pkg.tar.xz
[2010-10-25 13:58] nvidia   260.19.12-2 http://arm.konnichi.com/pool/packages/nvidia-260.19.12-2-x86_64.pkg.tar.xz
[2010-11-11 11:44] nvidia   260.19.21-1 http://arm.konnichi.com/pool/packages/nvidia-260.19.21-1-x86_64.pkg.tar.xz
[2010-11-11 11:49] nvidia   260.19.21-2 http://arm.konnichi.com/pool/packages/nvidia-260.19.21-2-x86_64.pkg.tar.xz
[2010-12-14 06:34] nvidia   260.19.29-1 http://arm.konnichi.com/pool/packages/nvidia-260.19.29-1-x86_64.pkg.tar.xz
[2011-01-08 01:05] nvidia   260.19.29-2 http://arm.konnichi.com/pool/packages/nvidia-260.19.29-2-x86_64.pkg.tar.xz
[2011-01-21 13:48] nvidia   260.19.36-1 http://arm.konnichi.com/pool/packages/nvidia-260.19.36-1-x86_64.pkg.tar.xz
[2011-01-21 13:51] nvidia   260.19.36-2 http://arm.konnichi.com/pool/packages/nvidia-260.19.36-2-x86_64.pkg.tar.xz
[2011-03-09 00:42] nvidia   260.19.44-1 http://arm.konnichi.com/pool/packages/nvidia-260.19.44-1-x86_64.pkg.tar.xz
[2011-03-15 23:40] nvidia   260.19.44-2 http://arm.konnichi.com/pool/packages/nvidia-260.19.44-2-x86_64.pkg.tar.xz
[2011-03-18 02:48] nvidia      270.30-1 http://arm.konnichi.com/pool/packages/nvidia-270.30-1-x86_64.pkg.tar.xz
[2011-03-22 07:14] nvidia      270.30-2 http://arm.konnichi.com/pool/packages/nvidia-270.30-2-x86_64.pkg.tar.xz
[2011-03-26 00:44] nvidia      270.30-3 http://arm.konnichi.com/pool/packages/nvidia-270.30-3-x86_64.pkg.tar.xz
[2011-03-26 00:49] nvidia      270.30-4 http://arm.konnichi.com/pool/packages/nvidia-270.30-4-x86_64.pkg.tar.xz
[2011-04-11 13:41] nvidia   270.41.03-1 http://arm.konnichi.com/pool/packages/nvidia-270.41.03-1-x86_64.pkg.tar.xz
[2011-04-20 11:12] nvidia   270.41.06-1 http://arm.konnichi.com/pool/packages/nvidia-270.41.06-1-x86_64.pkg.tar.xz
[2011-05-20 10:51] nvidia   270.41.19-1 http://arm.konnichi.com/pool/packages/nvidia-270.41.19-1-x86_64.pkg.tar.xz
[2011-05-20 10:53] nvidia   270.41.19-1 http://arm.konnichi.com/pool/packages/nvidia-270.41.19-1-x86_64.pkg.tar.xz.sig
[2011-06-07 07:31] nvidia 270.41.19-1.1 http://arm.konnichi.com/pool/packages/nvidia-270.41.19-1.1-x86_64.pkg.tar.xz
[2011-05-20 11:00] nvidia   270.41.19-2 http://arm.konnichi.com/pool/packages/nvidia-270.41.19-2-x86_64.pkg.tar.xz
[2011-05-20 11:01] nvidia   270.41.19-2 http://arm.konnichi.com/pool/packages/nvidia-270.41.19-2-x86_64.pkg.tar.xz.sig
[2011-06-07 05:07] nvidia   270.41.19-3 http://arm.konnichi.com/pool/packages/nvidia-270.41.19-3-x86_64.pkg.tar.xz
[2011-06-07 05:07] nvidia   270.41.19-3 http://arm.konnichi.com/pool/packages/nvidia-270.41.19-3-x86_64.pkg.tar.xz.sig
[2011-06-14 11:56] nvidia   275.09.07-1 http://arm.konnichi.com/pool/packages/nvidia-275.09.07-1-x86_64.pkg.tar.xz
[2011-06-14 11:56] nvidia   275.09.07-1 http://arm.konnichi.com/pool/packages/nvidia-275.09.07-1-x86_64.pkg.tar.xz.sig
[2011-07-17 07:56] nvidia      275.19-1 http://arm.konnichi.com/pool/packages/nvidia-275.19-1-x86_64.pkg.tar.xz
[2011-07-17 07:56] nvidia      275.19-1 http://arm.konnichi.com/pool/packages/nvidia-275.19-1-x86_64.pkg.tar.xz.sig
[2011-07-22 06:02] nvidia      275.21-1 http://arm.konnichi.com/pool/packages/nvidia-275.21-1-x86_64.pkg.tar.xz
[2011-07-22 06:02] nvidia      275.21-1 http://arm.konnichi.com/pool/packages/nvidia-275.21-1-x86_64.pkg.tar.xz.sig
[2011-07-24 00:47] nvidia      275.21-2 http://arm.konnichi.com/pool/packages/nvidia-275.21-2-x86_64.pkg.tar.xz
[2011-07-24 00:47] nvidia      275.21-2 http://arm.konnichi.com/pool/packages/nvidia-275.21-2-x86_64.pkg.tar.xz.sig
[2011-07-28 23:13] nvidia      275.21-3 http://arm.konnichi.com/pool/packages/nvidia-275.21-3-x86_64.pkg.tar.xz
[2011-07-28 23:13] nvidia      275.21-3 http://arm.konnichi.com/pool/packages/nvidia-275.21-3-x86_64.pkg.tar.xz.sig
[2011-08-02 10:14] nvidia      280.13-1 http://arm.konnichi.com/pool/packages/nvidia-280.13-1-x86_64.pkg.tar.xz
[2011-08-02 10:19] nvidia      280.13-1 http://arm.konnichi.com/pool/packages/nvidia-280.13-1-x86_64.pkg.tar.xz.sig
[2011-10-05 01:19] nvidia   285.05.09-1 http://arm.konnichi.com/pool/packages/nvidia-285.05.09-1-x86_64.pkg.tar.xz
[2011-10-05 01:19] nvidia   285.05.09-1 http://arm.konnichi.com/pool/packages/nvidia-285.05.09-1-x86_64.pkg.tar.xz.sig
[2011-10-25 11:38] nvidia   285.05.09-3 http://arm.konnichi.com/pool/packages/nvidia-285.05.09-3-x86_64.pkg.tar.xz
[2011-10-25 11:38] nvidia   285.05.09-3 http://arm.konnichi.com/pool/packages/nvidia-285.05.09-3-x86_64.pkg.tar.xz.sig
[2011-11-22 02:01] nvidia      290.10-1 http://arm.konnichi.com/pool/packages/nvidia-290.10-1-x86_64.pkg.tar.xz
[2011-11-22 02:01] nvidia      290.10-1 http://arm.konnichi.com/pool/packages/nvidia-290.10-1-x86_64.pkg.tar.xz.sig
[2012-01-05 05:39] nvidia      290.10-2 http://arm.konnichi.com/pool/packages/nvidia-290.10-2-x86_64.pkg.tar.xz
[2012-01-05 05:39] nvidia      290.10-2 http://arm.konnichi.com/pool/packages/nvidia-290.10-2-x86_64.pkg.tar.xz.sig
[2012-02-08 01:35] nvidia      290.10-3 http://arm.konnichi.com/pool/packages/nvidia-290.10-3-x86_64.pkg.tar.xz
[2012-02-08 01:35] nvidia      290.10-3 http://arm.konnichi.com/pool/packages/nvidia-290.10-3-x86_64.pkg.tar.xz.sig
[2012-02-12 01:59] nvidia      295.17-1 http://arm.konnichi.com/pool/packages/nvidia-295.17-1-x86_64.pkg.tar.xz
[2012-02-12 02:05] nvidia      295.17-1 http://arm.konnichi.com/pool/packages/nvidia-295.17-1-x86_64.pkg.tar.xz.sig
[2012-02-14 03:09] nvidia      295.20-1 http://arm.konnichi.com/pool/packages/nvidia-295.20-1-x86_64.pkg.tar.xz
[2012-02-14 03:17] nvidia      295.20-1 http://arm.konnichi.com/pool/packages/nvidia-295.20-1-x86_64.pkg.tar.xz.sig
[2012-02-28 01:12] nvidia      295.20-2 http://arm.konnichi.com/pool/packages/nvidia-295.20-2-x86_64.pkg.tar.xz
[2012-02-28 01:12] nvidia      295.20-2 http://arm.konnichi.com/pool/packages/nvidia-295.20-2-x86_64.pkg.tar.xz.sig
[2012-03-01 03:08] nvidia      295.20-3 http://arm.konnichi.com/pool/packages/nvidia-295.20-3-x86_64.pkg.tar.xz
[2012-03-01 03:08] nvidia      295.20-3 http://arm.konnichi.com/pool/packages/nvidia-295.20-3-x86_64.pkg.tar.xz.sig
[2012-03-19 04:16] nvidia      295.20-4 http://arm.konnichi.com/pool/packages/nvidia-295.20-4-x86_64.pkg.tar.xz
[2012-03-19 04:16] nvidia      295.20-4 http://arm.konnichi.com/pool/packages/nvidia-295.20-4-x86_64.pkg.tar.xz.sig
[2012-03-22 10:23] nvidia      295.20-5 http://arm.konnichi.com/pool/packages/nvidia-295.20-5-x86_64.pkg.tar.xz
[2012-03-22 10:23] nvidia      295.20-5 http://arm.konnichi.com/pool/packages/nvidia-295.20-5-x86_64.pkg.tar.xz.sig
[2012-03-23 01:08] nvidia      295.33-1 http://arm.konnichi.com/pool/packages/nvidia-295.33-1-x86_64.pkg.tar.xz
[2012-03-23 01:08] nvidia      295.33-1 http://arm.konnichi.com/pool/packages/nvidia-295.33-1-x86_64.pkg.tar.xz.sig
[2012-03-23 01:11] nvidia      295.33-2 http://arm.konnichi.com/pool/packages/nvidia-295.33-2-x86_64.pkg.tar.xz
[2012-03-23 01:11] nvidia      295.33-2 http://arm.konnichi.com/pool/packages/nvidia-295.33-2-x86_64.pkg.tar.xz.sig
[2012-04-11 09:37] nvidia      295.40-2 http://arm.konnichi.com/pool/packages/nvidia-295.40-2-x86_64.pkg.tar.xz
[2012-04-11 09:37] nvidia      295.40-2 http://arm.konnichi.com/pool/packages/nvidia-295.40-2-x86_64.pkg.tar.xz.sig
[2012-04-28 00:33] nvidia      295.40-3 http://arm.konnichi.com/pool/packages/nvidia-295.40-3-x86_64.pkg.tar.xz
[2012-04-28 00:33] nvidia      295.40-3 http://arm.konnichi.com/pool/packages/nvidia-295.40-3-x86_64.pkg.tar.xz.sig
[2012-05-03 09:27] nvidia      295.49-1 http://arm.konnichi.com/pool/packages/nvidia-295.49-1-x86_64.pkg.tar.xz
[2012-05-03 09:27] nvidia      295.49-1 http://arm.konnichi.com/pool/packages/nvidia-295.49-1-x86_64.pkg.tar.xz.sig
[2012-05-16 13:04] nvidia      295.53-1 http://arm.konnichi.com/pool/packages/nvidia-295.53-1-x86_64.pkg.tar.xz
[2012-05-16 13:04] nvidia      295.53-1 http://arm.konnichi.com/pool/packages/nvidia-295.53-1-x86_64.pkg.tar.xz.sig
[2012-05-21 03:59] nvidia      295.53-2 http://arm.konnichi.com/pool/packages/nvidia-295.53-2-x86_64.pkg.tar.xz
[2012-05-21 03:59] nvidia      295.53-2 http://arm.konnichi.com/pool/packages/nvidia-295.53-2-x86_64.pkg.tar.xz.sig
[2012-06-15 19:39] nvidia      295.59-1 http://arm.konnichi.com/pool/packages/nvidia-295.59-1-x86_64.pkg.tar.xz
[2012-06-15 19:39] nvidia      295.59-1 http://arm.konnichi.com/pool/packages/nvidia-295.59-1-x86_64.pkg.tar.xz.sig
[2012-06-16 15:01] nvidia      302.17-1 http://arm.konnichi.com/pool/packages/nvidia-302.17-1-x86_64.pkg.tar.xz
[2012-06-16 15:01] nvidia      302.17-1 http://arm.konnichi.com/pool/packages/nvidia-302.17-1-x86_64.pkg.tar.xz.sig
[2012-07-03 17:41] nvidia      302.17-2 http://arm.konnichi.com/pool/packages/nvidia-302.17-2-x86_64.pkg.tar.xz
[2012-07-03 17:41] nvidia      302.17-2 http://arm.konnichi.com/pool/packages/nvidia-302.17-2-x86_64.pkg.tar.xz.sig
[2012-07-17 23:45] nvidia      302.17-3 http://arm.konnichi.com/pool/packages/nvidia-302.17-3-x86_64.pkg.tar.xz
[2012-07-17 23:45] nvidia      302.17-3 http://arm.konnichi.com/pool/packages/nvidia-302.17-3-x86_64.pkg.tar.xz.sig
[2012-07-20 01:29] nvidia      302.17-4 http://arm.konnichi.com/pool/packages/nvidia-302.17-4-x86_64.pkg.tar.xz
[2012-07-20 01:29] nvidia      302.17-4 http://arm.konnichi.com/pool/packages/nvidia-302.17-4-x86_64.pkg.tar.xz.sig

Determine Package Changes

Armh can use the Pacman log to determine changes in the set of installed packages (see caveats below). This can be useful for determining the cause of recent breakage:

$ armh --show changes --days 5 --color --table
- rng-tools                           3-2               
^ aurploader                2012.7.23.7-1  2012.7.24.1-1
^ bind                         9.9.1.P1-2     9.9.1.P2-1
^ dbus                            1.6.2-1        1.6.4-1
^ dbus-core                       1.6.2-2        1.6.4-1
^ dnsutils                     9.9.1.P1-1     9.9.1.P2-1
^ filesystem                     2012.6-4       2012.7-1
^ haskell-blaze-html            0.4.3.3-5      0.5.0.0-1
^ haskell-highlighting-kate       0.5.1-5        0.5.1-6
^ haskell-pandoc                1.9.4.2-1      1.9.4.2-2
^ iana-etc                         2.30-2         2.30-3
^ imagemagick                   6.7.8.4-1      6.7.8.6-1
^ initscripts                 2012.06.3-2    2012.07.5-1
^ iptables                       1.4.14-2       1.4.14-3
^ libcups                         1.5.3-6        1.5.4-1
^ libpng                         1.5.11-1       1.5.12-1
^ libsystemd                        186-2          187-2
^ mpg123                         1.14.3-1       1.14.4-1
^ netcfg                          2.8.5-3        2.8.8-1
^ pm2ml                       2012.7.20-1    2012.7.25-1
^ pngcrush                       1.7.31-1       1.7.33-1
^ python-distribute              0.6.27-1       0.6.28-1
^ python-numpy                    1.6.1-1        1.6.2-1
^ python2-distribute             0.6.27-1       0.6.28-1
^ python2-numpy                   1.6.1-1        1.6.2-1
^ reflector                   2012.7.15-1    2012.7.26-1
^ systemd-tools                     186-2          187-2
^ texlive-bin                    2012.0-2       2012.0-3
^ whois                          5.0.17-1       5.0.18-1
^ xac                         2012.7.20-1    2012.7.28-1
^ xf86-input-evdev                2.7.0-2        2.7.1-1
^ xf86-input-keyboard             1.6.1-2        1.6.2-1
^ xf86-input-mouse                1.7.2-1        1.8.0-1
+ aha-git                                     20120729-1
+ haskell-blaze-markup                         0.5.1.0-1
+ valgrind                                       3.7.0-4

It can also determine the full set of packages at a given date:

$ armh --date 2012-04-12 --show set
a52dec-0.7.4-6
aalib-1.4rc5-9
abcde-2.4.2-2
acl-2.2.51-1
adns-1.4-3
alsa-lib-1.0.25-1
alsa-oss-1.0.25-1
alsa-plugins-1.0.25-1
alsa-utils-1.0.25-2
...

Of course, it can show URLs for such package sets:

$ armh --date 2012-02-28 --show urls  --needed -q
http://arm.konnichi.com/pool/community/abcde-2.4.2-2-any.pkg.tar.xz
http://arm.konnichi.com/pool/community/abcde-2.4.2-2-any.pkg.tar.xz.sig
http://arm.konnichi.com/pool/packages/acl-2.2.51-1-x86_64.pkg.tar.xz
http://arm.konnichi.com/pool/packages/acl-2.2.51-1-x86_64.pkg.tar.xz.sig
http://arm.konnichi.com/pool/packages/alex-2.3.5-2-x86_64.pkg.tar.xz
http://arm.konnichi.com/pool/packages/alex-2.3.5-2-x86_64.pkg.tar.xz.sig
http://arm.konnichi.com/pool/packages/alsa-plugins-1.0.25-1-x86_64.pkg.tar.xz
http://arm.konnichi.com/pool/packages/alsa-plugins-1.0.25-1-x86_64.pkg.tar.xz.sig
http://arm.konnichi.com/pool/packages/alsa-utils-1.0.25-1-x86_64.pkg.tar.xz
http://arm.konnichi.com/pool/packages/alsa-utils-1.0.25-1-x86_64.pkg.tar.xz.sig
http://arm.konnichi.com/pool/packages/apache-2.2.22-3-x86_64.pkg.tar.xz
http://arm.konnichi.com/pool/packages/apache-2.2.22-3-x86_64.pkg.tar.xz.sig
http://arm.konnichi.com/pool/packages/apr-1.4.5-2-x86_64.pkg.tar.xz
http://arm.konnichi.com/pool/packages/apr-1.4.5-2-x86_64.pkg.tar.xz.sig
http://arm.konnichi.com/pool/community/aria2-1.14.1-1-x86_64.pkg.tar.xz
http://arm.konnichi.com/pool/community/aria2-1.14.1-1-x86_64.pkg.tar.xz.sig
http://arm.konnichi.com/pool/packages/aspell-de-20110609-1-x86_64.pkg.tar.xz
http://arm.konnichi.com/pool/packages/aspell-de-20110609-1-x86_64.pkg.tar.xz.sig
http://arm.konnichi.com/pool/community/astyle-2.02-2-x86_64.pkg.tar.xz
http://arm.konnichi.com/pool/community/astyle-2.02-2-x86_64.pkg.tar.xz.sig
...

You could download these with e.g. aria2c, or you could tell Armh to download the files itself:

$ armh --date 2012-02-28 --needed --download --dir oldpkgs

Installation history for specific packages can also be shown with the --trace option.

$ armh --days 60 --color --trace linux pacman armh
[2012-12-15 05:16] ^ linux (3.6.9-1 -> 3.6.10-1)
[2012-12-05 19:16] ^ linux (3.6.8-1 -> 3.6.9-1)
[2012-11-29 16:52] ^ linux (3.6.7-1 -> 3.6.8-1)
[2012-11-25 00:41] ^ linux (3.6.6-1 -> 3.6.7-1)
[2012-11-06 19:15] ^ linux (3.6.5-1 -> 3.6.6-1)
[2012-11-03 05:55] ^ linux (3.6.4-1 -> 3.6.5-1)
[2012-10-31 17:19] ^ linux (3.6.3-1 -> 3.6.4-1)
[2012-10-25 04:40] ^ linux (3.6.2-1 -> 3.6.3-1)
[2012-12-11 23:43] ^ pacman (4.0.3-5 -> 4.0.3-5)
[2012-11-18 17:33] ^ pacman (4.0.3-3 -> 4.0.3-5)
[2012-10-24 02:12] ^ armh (2012.10-1 -> 2012.10-2)

Advanced Usage Examples

You could use Armh to download a set of packages to a directory then run repo-add in that directory to create a snapshot database. This will make it easier to manage dependencies with Pacman. The --symlink option is useful in this case because it will symlink locally cached packages while in the target directory to create the target package set.

Signatures files are also downloaded when available and will thus be included in the snapshot database. Note that the signatures files may no longer be valid if the key has been revoked. There is nothing that can be done about this. It’s up to you if you want to trust the package at that point.

Remember that you can manually verify signatures with pacman-key --verify.

Caveats

Pacman Log

Armh assumes that the Pacman log is complete when determining package sets. It works backwards through the log so you only need a log dating back to the target date, but not before.

Installation Reasons

Armh cannot determine which packages were explicitly installed at a previous point. It’s up to you to figure that out. You can create a cronjob to periodically store the output of pacman -Qqe and then use that in the future.

TODO

  • clean up code (it was hacked together in one sitting)
  • maybe add options to generate scripts for package installation and repo creation
  • contact ARM maintainer to discuss terser index file format (sent an email, no reply so far)

Help Message

$ armh --help

usage: armh [-h] [--date <date> | --days n] [--datefmt <format>]
            [--show {set,changes,urls} | --search <pkgname> [<pkgname> ...] |
            --download | --trace <pkgname> [<pkgname> ...]] [--sigs]
            [--sort {name,version,date}] [--symlink] [--dir <dirpath>]
            [--config CONF] [--logfile LOG] [--arch ARCH] [-q] [-y] [--needed]
            [--ignore <pkgname>] [--color] [--table]

Pacman log parser and ARM helper for determining and retrieving previously
installed package sets.

optional arguments:
  -h, --help            show this help message and exit
  --date <date>         Determine the installed package set on the given date.
                        See the "--datefmt" option.
  --days n              Determine the installed package set n days ago, where
                        n may be a rational number.
  --datefmt <format>    The format of the given date as understood by Python's
                        strptime. Default: "%Y-%m-%d".
  --show {set,changes,urls}
                        set: show the full package set at the given time.
                        changes: show changes between the current set and the
                        set at the given time ("+": installed, "-": removed,
                        "^": upgraded). urls: print a list of URLs to the
                        matching package files
  --search <pkgname> [<pkgname> ...]
                        Search for old versions of the given packages.
  --download            Recache the packages for the determined set in the
                        output directory (see "--dir"). Packages found in the
                        Pacman cache will not be redownloaded.
  --trace <pkgname> [<pkgname> ...]
                        Trace operations on the given packages between now and
                        the date given.
  --sigs                Include signature files when available.
  --sort {name,version,date}
                        Sort hits.
  --symlink             When downloading, symlink cached packages in the
                        output directory. This is useful for creating repos
                        with repo-add later.
  --dir <dirpath>       Output directory for downloaded files. Set
                        XDG_CACHE_HOME to configure the location of downloaded
                        indices.

Pacman-esque:
  --config CONF         Pacman configuration file. Default: "/etc/pacman.conf"
  --logfile LOG         Pacman log file. Default: "/var/log/pacman.log"
  --arch ARCH           Target architecture.
  -q, --quiet           Emulate Pacman's "-q" option: suppress package
                        versions in output.
  -y, --refresh         Check for new ARM indices.
  --needed              Only include URLs for packages not in the cache.
  --ignore <pkgname>    Ignore given package names.

Formatting:
  --color               Colorize output (not implemented for all output
                        types).
  --table               Tabulate output (not implemented for all output
                        types).

CHANGELOG

2013-05-21

  • search terms are now Python regular expressions

2012-12-21

  • add --trace option for tracing the history of specific packages
Contact
echo xyne.archlinux.org | sed 's/\./@/'
Validation
XHTML 1.0 Strict CSS level 3 Atom 1.0