PKG_CMP_SUMMARY(1)

NAME
pkg_cmp_summary - compares two summary files (pkg_summary(5) format)

SYNOPSIS
pkg_cmp_summary [OPTIONS] pkg_summary1 pkg_summary2

DESCRIPTION
pkg_cmp_summary compares package versions in two pkg_summary(5) files. These files may be generated by pkg_info -X, pkg_src_summary(1) and other utils. By default PKGBASE is used for identifying the package.

Format of the results:
  <R> [PKGPATH] <PKGBASE> <VER1> <VER2> where R is
  - present in the first file but absent in the second one (disappears)
  + absent in the first file but present in the second one (appears/new)
  <NUM> more than one package with the same PKGBASE is in the first file
  = versions are the same
  < second file contains newer version
  > second file contains earlier version
  ? versions are incomparable (incorrect version, for example)
  ! packages are different (versions are the equal but
           CVS_CHECKSUMs, BUILD_DATE or DEPENDS are different)

PKGBASE is PKGNAME with version stripped, VER1 and VER2 are package versions. PKGPATH appears in output if -p option is specified.

OPTIONS

-h  display help message.

-f id
    specifies what fields to use for package identifying. Letter "b" means PKGBASE (the default), "p" -- PKGPATH, "a" -- ASSIGNMENTS.

-c  synonym for -a CVS_CHECKSUM.

-b  synonym for -a BUILD_DATE.

-d  use DEPENDS field for comparing in addition to PKGNAME and/or PKGPATH.

-u  output A at the end of line for automatically installed packages and U for packages installed by user. A field automatic is expected in summary1, if it is specified in summary2, it is ignored.
    NOTE: This option is deprecated, consider using -EA automatic

-2  output PKGPATHe from summary1 and from summary2 (<>!=).

-e  normally a number of duplications is output as a result of comparison if they (duplications) exist. If -e is applied, = (or !) is output if package from summary2 exists (or doesn't exist) in summary1.

-a fields
    use the specified fields for comparing packages in addition to package versions. Fields are separated by space or comma.

-A fields
    implies -a and outputs different fields on the following lines with leading space. First, field and value from pkg_summary1 are output then field and value from pkg_summary2 with single space character between them.

-E  if applied together with -A, field values are output even if they are equal in summary1 and summary2.

-O fields
    implies -E, output the specified fields but don't use them for comparison.

EXAMPLES
   # pkg_bin_summary -f PKGNAME,automatic runawk > 1
   # pkg_admin set automatic=yes runawk
   # pkg_bin_summary -f PKGNAME,automatic runawk > 2
   # pkg_cmp_summary 1 2
   = runawk 1.3.1nb1 1.3.1nb1
   # pkg_cmp_summary -a automatic 1 2
   ! runawk 1.3.1nb1 1.3.1nb1
   # pkg_cmp_summary -A automatic 1 2
   ! runawk 1.3.1nb1 1.3.1nb1
    automatic
    automatic yes
   #
   # pkg_bin_summary -f PKGNAME,PKGPATH pkg_summary-utils > 1
   # pkg_src_summary wip/pkg_summary-utils > 2
   # pkg_cmp_summary 1 2
   < pkg_summary-utils 0.54.0 0.55alpha4
   # pkg_cmp_summary -p 1 2
   + wip/pkg_summary-utils pkg_summary-utils 0.55alpha4
   - pkgtools/pkg_summary-utils pkg_summary-utils 0.54.0
   #
   # pkg_info -Q PKGPATH tmux rtorrent ikiwiki > pkgpaths.txt
   # pkg_micro_src_summary < pkgpaths.txt > summary.txt
   # pkg_info -X tmux rtorrent ikiwiki > bin_summary.txt
   # pkg_cmp_summary -p bin_summary.txt summary.txt
   < misc/tmux tmux 1.4nb1 1.5
   < net/rtorrent rtorrent 0.8.9 0.8.9nb2
   < www/ikiwiki ikiwiki 3.20110715 3.20110715nb1
   #

SEE ALSO
pkg_summary-utils(7), pkg_summary(5), pkg_src_summary(1), pkg_info(1)

AUTHOR
Aleksey Cheusov <vle@gmx.net>