pkgsrc-wip/pkg_summary-utils/files
2011-05-11 19:11:33 +00:00
..
tests fix "make test" broken by recent changes in Makefile 2011-05-11 19:11:33 +00:00
cvs_checksum.1
cvs_checksum.in
direct_deps.in
get_processed_pkgs.in
Makefile fix "make test" broken by recent changes in Makefile 2011-05-11 19:11:33 +00:00
NEWS pkg_update_src_summary was reimplemented (-80 LOC) 2011-05-09 21:11:53 +00:00
pkg_assignments2pkgpath.in
pkg_bin_summary.1
pkg_bin_summary.in
pkg_cleanup_distdir.1
pkg_cleanup_distdir.in
pkg_cmp_summary.1
pkg_cmp_summary.in
pkg_digger.1
pkg_digger.conf
pkg_digger.in Update to 0.53.2 2011-04-13 19:13:49 +00:00
pkg_digger_backend.in
pkg_grep_summary.1
pkg_grep_summary.awk
pkg_grep_summary.in
pkg_lint_summary.1
pkg_lint_summary.in Version -> 0.53.1 2011-04-05 11:11:31 +00:00
pkg_list_all_pkgs.1
pkg_list_all_pkgs.in
pkg_micro_src_summary.1
pkg_micro_src_summary.in
pkg_refresh_summary.1
pkg_refresh_summary.in
pkg_src_fetch_var.in
pkg_src_summary.1
pkg_src_summary.in
pkg_src_summary.mk
pkg_subgraph_deps.1
pkg_subgraph_deps.in
pkg_summary-utils.7
pkg_summary2bb_pkgs.in
pkg_summary2build_graph.1
pkg_summary2build_graph.in
pkg_summary2deps.1
pkg_summary2deps.in
pkg_summary2leaves.1
pkg_summary2leaves.in
pkg_summary4view.1
pkg_summary4view.in
pkg_uniq_summary.1
pkg_uniq_summary.in
pkg_update_src_summary.1
pkg_update_src_summary.in pkg_update_src_summary was reimplemented (-80 LOC) 2011-05-09 21:11:53 +00:00
pkg_update_summary.1
pkg_update_summary.in
pkgsrc-dewey.awk
psu_funcs.awk
README
TODO
version.mk Update to 0.53.2 2011-04-13 19:13:49 +00:00
XB2bin_summary.in A field ASSIGNMENTS is set according to recently introduced field MULTI 2011-03-27 19:51:41 +00:00

pkg_summary-utils is a collection of tools designed to handle summary
files about pkgsrc (http://www.pkgsrc.org) packages, both binary
summaries (pkg_summary(5)) and source summaries.
Despite orientation on pkgsrc, most(all?) scripts are
rather universal and can be adapted for othe packaging systems.

Just a few words about the included tools.

=================================================================

A collection of utilities for manipulating pkg_summary files,
pkg_summary(5) and pkg_src_summary (the same but for pkgsrc tree).

   pkg_list_all_pkgs      - list (in PKGPATH form) all packages in pkgsrc tree
   pkg_src_summary        - create a full pkg_src_summary
                            for given (in PKGPATH form) packages
   pkg_micro_src_summary  - create a micro pkg_src_summary
                            for given (in PKGPATH form) packages
   pkg_cmp_summary        - compare two summary files, i.e. packages
                            are compared by their versions
   pkg_digger             - high-level searcher for package summaries,
                            pkg_online databases etc.
   pkg_digger_backend     - pkg_summary.txt backend for pkg_digger
   pkg_update_summary     - updates pkg_summary(5) by analysing the modification
                            time of binary packages and pkg_summary(5) file
   pkg_update_src_summary - efficiently updates pkg_src_summary for all
                            packages in pkgsrc tree
   pkg_summary4view       - convert a summary file to human readable format
   pkg_refresh_summary    - output an information about latest/newest version
                            of packages
   pkg_grep_summary       - output summaries about packages that matches
                            the specified condition.
   pkg_cleanup_distdir    - cleanups directory with binary packages,
                            that is remove all binaries absent
                            in input summary.
   pkg_uniq_summary        - filters out repeated package summaries.
   pkg_assignments2pkgpath - makes an ASSIGNMENTS field a part of PKGPATH
   pkg_summary2bb_pkgs     - outputs packages ready for bulk builds
   pkg_summary2deps        - extract dependencies from summary

=================================================================

Samples of usage are below.

-----

All pkgsrc packages (uses SUBDIR variable)

   pkg_list_all_pkgs

-----

Analog for 'lintpkgsrc -i', but MUCH faster:

   pkg_info -Q PKGPATH '*' > packages.txt
   pkg_micro_src_summary < packages.txt 2>/dev/null > micro_summary.txt
   pkg_info -X '*' > inst_pkgs_summary.txt
   pkg_cmp_summary -p inst_pkgs_summary.txt micro_summary.txt

-----

Comparison of binary packages against pkgsrc source tree

   (It is assumed that multiple versions of package may present
   in pkg_summary(5)).

   cd /usr/pkgsrc
   cvs up
   pkg_update_src_summary /usr/pkgsrc/pkg_src_summary.txt # first run is slow
   pkg_update_summary /usr/pkgsrc/pkg_summary.txt
   pkg_refresh_summary /usr/pkgsrc/pkg_summary.txt > newest_pkgs.txt
   pkg_cmp_summary -p newest_pkgs.txt \
                      /usr/pkgsrc/pkg_src_summary.txt

  or (only newest versions are in pkg_summary(5))

   pkg_update_src_summary /usr/pkgsrc/pkg_src_summary.txt # first run is slow
   pkg_update_summary -r /usr/pkgsrc/pkg_summary.txt
   pkg_cmp_summary -p /usr/pkgsrc/pkg_summary.txt \
                      /usr/pkgsrc/pkg_src_summary.txt

-----

The same but with micro summary (much faster!)

   pkg_list_all_pkgs | \
      pkg_micro_src_summary > /usr/pkgsrc/pkg_micro_summary.txt
   pkg_update_summary /usr/pkgsrc/pkg_summary.txt
   pkg_cmp_summary -p /usr/pkgsrc/pkg_micro_summary.txt \
                      /usr/pkgsrc/pkg_src_summary.txt

-----

Summary for humans (looks nice but still easily parsable)

   pkg_summary4view /usr/pkgsrc/pkg_src_summary.txt

  or 

   pkg_summary4view /usr/pkgsrc/pkg_summary.txt

-----

Close to 'pkg_chk -an'

   pkg_info -X '*' > packages.txt
   pkg_cmp_summary -p packages.txt /path/to/simplified_pkgchk.conf

-----

Close to 'pkg_chk -usn'

   pkg_info -X '*' > packages.txt
   pkg_cmp_summary -p packages.txt /usr/pkgsrc/pkg_src_summary.txt |
      awk '$1 !~ /^[+=]$/'

  or 

   pkg_info -X '*' > packages.txt
   pkg_cmp_summary -p packages.txt /usr/pkgsrc/pkg_micro_summary.txt |
      awk '$1 !~ /^[+=]$/'

-----

Close to 'pkg_chk -ubn'

   pkg_info -X '*' > packages.txt
   pkg_cmp_summary -p packages.txt /usr/pkgsrc/pkg_summary.txt |
      awk '$1 !~ /^[+=]$/'

NOTE: To keep pkg_src_summary.txt up-to-date it makes sense to run
pkg_update_src_summary after updating pkgsrc source tree.

-----

Are you tired of PKGSRCDIR/pkglocate, pkg_find etc.?
Try to use pkg_grep_summary like the following

  pkg_grep_summary -h

  pkg_grep_summary 'PKGNAME' 'fvalue ~ /judy/' \
        < /usr/pkgsrc/packages/pkg_summary.txt
  pkg_grep_summary 'PKGPATH' 'fvalue ~ /^lang\//' \
        < /usr/pkgsrc/packages/pkg_summary.txt
  pkg_grep_summary 'DEPENDS' 'fvalue ~ /libX/' \
        < /usr/pkgsrc/pkg_src_summary.txt
  pkg_grep_summary 'COMMENT' 'toupper(fvalue) ~ /DNS/' \
        < /usr/pkgsrc/pkg_src_summary.txt

-----

In some situations the installed packages may be in inconsistent state
due to problems with required and installed shared libraries
(REQUIRES/PROVIDES fields in summary)

  pkg_info -Xa | pkg_lint_summary -l