pkgsrc-wip/pkg_summary-utils/files/get_processed_pkgs.in
Aleksey Cheusov d661249ac4 Update to 0.42.1
pkg_grep_summary:
      - FIXED: search strategy "substring"
  pkg_summary2deps:
      - More verbose error message "Cannot find PKGPATH for %s"
  get_processed_pkgs is separated into an individual libexec script
2010-07-25 14:55:38 +00:00

42 lines
871 B
Text
Executable file

#!/usr/bin/env runawk
#use "power_getopt.awk"
#.begin-str help
# Taking summaries on input this script outputs all possible
# enriched PKGPATHs, i.e plain PKGPATHs,
# PKGPATH:<good_assignments> and
# PKGPATH:<good_assignments>,<bad_assignments> where
# <good_assignments> are assignments from ASSIGMENTS, and
# <bad_assignments> are rejected ones from _INHER_ASSIGNS_REJ.
# usage: get_process_pkgs [OPTIONS] [files...]
# OPTIONS:
# -h|--help display this screen
#.end-str
NF == 0 {
if (assigns != "")
pkgpath = pkgpath ":" assigns
print pkgpath
if (assigns_rej != "")
print pkgpath (assigns != "" ? "," : ":") assigns_rej
pkgpath = assigns_rej = assigns = ""
next
}
/^PKGPATH=/ {
pkgpath = substr($0, 9)
next
}
/^ASSIGNMENTS=/ {
assigns = substr($0, 13)
next
}
/^_INHER_ASSIGNS_REJ=/ {
assigns_rej = substr($0, 20)
next
}