From 24a78fe7315c962dde892ca85ddb0675eae622f7 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Wed, 23 Jan 2013 19:28:58 -0500 Subject: paclog-pkglist: parse entries with caller info Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- contrib/paclog-pkglist.sh.in | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/contrib/paclog-pkglist.sh.in b/contrib/paclog-pkglist.sh.in index 222bbc4c..908bd4ad 100644 --- a/contrib/paclog-pkglist.sh.in +++ b/contrib/paclog-pkglist.sh.in @@ -50,25 +50,35 @@ fi <"$logfile" awk ' { - action = $3 - pkgname = $4 - pkgver = $5 - upgver = $7 + if ($3 ~ /^\[.*\]$/) { + # new style with caller name + action = $4 + pkgname = $5 + pkgver = $6 + upgver = $8 + nfields = NF + } else { + action = $3 + pkgname = $4 + pkgver = $5 + upgver = $7 + nfields = (NF + 1) # compensate for missing caller field + } } -NF == 5 && action == "installed" { +nfields == 6 && action == "installed" { gsub(/[()]/, "", pkgver) pkg[pkgname] = pkgver next } -NF == 7 && action == "upgraded" { +nfields == 8 && action == "upgraded" { sub(/\)/, "", upgver) pkg[pkgname] = upgver next } -NF == 5 && action == "removed" { +nfields == 6 && action == "removed" { pkg[pkgname] = -1 } -- cgit v1.2.3-70-g09d2