arithpkg – the tool to compare versions of package sets.

Synopsis

arithpkg [-gt |-ge |-ge |-eq |-lt |-le] [-N |-O |-C |-A]
    [-l] [-L] [-s 'char'] [-S 'char']
    -f format ARGOLD ARGNEW [ARGNEW2 .. ARGNEW_N]

arithpkg -d [-l] [-s 'char'] [-S 'char'] -f format ARG [ARG2 .. ARG_N]

input |  arithpkg <options> ARGNEW

input |  arithpkg -d <options>

arithpkg --help|--version

Description

arithpkg compares versions of packages from 'old' set ARGOLD and 'new' one ARGNEW. Program prints the summary with package name, old version and new version.

ARGS may be:

-
directories with packages;
-
package file names directly;
-
text lists with package versions. In that case package archives are not analyzed. See -l, -L options.

Name and version to compare are extracted from package archives. Archives are searched by file extension, so they may lie in nested subdirectories of directory, given in ARG.

Default action is to print out the packages from the 'new' set, whose version is strictly higher then of the ones from 'old' set. Other criterias of comparison are possible, see -gt and grouped options.

Several package formats are supported. See -f option. This option is mandatory, besides working entirely with text lists. Supported formats are:

deb
format of packages in Debian, Ubuntu and other related distros. Used by dpkg and apt.
txz
format of packages in Slackware. Used by pkgtools and slackpkg.

With -d option arithpkg does not compare anything, but prints the versions of single set of packages, given in ARG, to stdout.

Input can be given through pipe instead of argument in command line. In that case first ARG for 'old' set is not given. When packages are compared, 'new' set still must be assigned in command line.

-- token is used to separate options of arithpkg from arguments with files or directories.

Options

Comparison

Several comparison modes are possible.

-gt
Print package from ARGNEW, if its version is strictly higher then a version from ARGOLD.
Default one.
-ge
Print package from ARGNEW, if its version is higher or equals to a version from ARGOLD.
-eq
Print package from ARGNEW, if its version equals to a version from ARGOLD.
-lt
Print package from ARGNEW, if its version is strictly lower then a version from ARGOLD.
-le
Print package from ARGNEW, if its version is lower or equals to a version from ARGOLD.

Dump

-d
Print the names and versions of single set of packages to stdout. Comparison is not performed. Output from dump can be used as text list for further arithpkg input.

There may be several ARG arguments, but they assign single set, which will be parsed and printed.

When input is given through stdin, there are no ARGS in command line in this mode.

General options

-f format
Assign the format of packages to compare. Possible formats:
deb
txz
All compared packages must be of the same format.

The option is mandatory, unless only text lists are used.

-s 'char'
Use string 'char' as separator between package name and version in output.
Default value is space symbol ' '.

--version
Print version and exit with 0 code.
--help
Print help description and exit with 0 code.

Lists

Input for arithpkg can be given with text files, or lists. Text files should contain package names and version, separated with space, one pair at a line. Text files may contain empty lines and comments, beginning with # symbol. Such lines are ignored.

-l
'old' packages are given by text file in ARGOLD, not by analyzing package archives. Note that ARGOLD with text list remains on its place in command line, after all options (unless input is piped from stdin).

-L
'new' packages are given by text file in ARGNEW, not by analyzing package archives. Note that ARGNEW with text list remains on its place in command line, after all options.

-S 'char'
Use string 'char' as separator between package name and version in text lists for input.
Default value is space symbol ' '.

Unique packages

Options for assigning what to do with packages, unique for 'old' or 'new' sets.

-N
Print unique names for ARGNEW.
Default one.
-O
Print unique names for ARGOLD.
-C
Do not print unique names.
-A
Print all unique names, from both ARGOLD and ARGNEW.

Examples

Save versions of packages from several directories and files into text file:

arithpkg -f deb -d ./repo/one ./repo/two ./package-1.2.3.deb  > dump-versions.txt

Compare two repos:

arithpkg -f txz ./repo/one ./repo/two

Compare saved list and repo:

cat dump-versions.txt | arithpkg -f deb -l ./repo
Or, like tr00 unixoids:
arithpkg -f deb -l ./repo < dump-versions.txt

Check for old packages in repo/two:

arithpkg -f deb -O -le ./repo/one ./repo/two

Check for new packages by text lists:

arithpkg -N -gt -l -L ./list-old ./list-new

See also

diff(1)