[pacman-dev] [PATCH v2 2/2] paclog-pkglist: parse entries with caller info
Allan McRae
allan at archlinux.org
Wed Jan 23 01:47:56 EST 2013
On 21/01/13 22:56, Dave Reisner wrote:
> On Fri, Jan 18, 2013 at 08:42:22PM -0500, Andrew Gregory wrote:
>> Signed-off-by: Andrew Gregory <andrew.gregory.8 at gmail.com>
>> ---
>>
>> I'm not very familiar with awk, so there is probably a better way to do this.
>>
>> contrib/paclog-pkglist.sh.in | 23 ++++++++++++++++-------
>> 1 file changed, 16 insertions(+), 7 deletions(-)
>>
>> diff --git a/contrib/paclog-pkglist.sh.in b/contrib/paclog-pkglist.sh.in
>> index 222bbc4..e1bd58e 100644
>> --- a/contrib/paclog-pkglist.sh.in
>> +++ b/contrib/paclog-pkglist.sh.in
>> @@ -50,25 +50,34 @@ 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
>> + } else {
>> + action = $3
>> + pkgname = $4
>> + pkgver = $5
>> + upgver = $7
>> + NF = (NF + 1)
>
> Would prefer using a different varname over modifying/lying about the
> value of an internal var.
>
> This seems fine otherwise.
>
This and patch 1/2 look fine to me with this change.
Allan
More information about the pacman-dev
mailing list