pkgsrc-wip/pkg_summary-utils/files/get_processed_pkgs.in

43 lines
871 B
Text
Raw Normal View History

#!/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
}