mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Roland Hieber <rhi@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Alexander Dahl <post@lespocky.de>, Roland Hieber <rhi@pengutronix.de>
Subject: [ptxdist] [PATCH v3 1/3] ptxd_lib_dgen: add line counter
Date: Thu,  6 Jun 2019 18:26:14 +0200	[thread overview]
Message-ID: <20190606162616.28990-1-rhi@pengutronix.de> (raw)
In-Reply-To: <20190412071014.ko4vsi2mmnf2axf6@pengutronix.de>

We cannot simply use NR for line counting because RS is changed in
function dump_file. Add an extra variable to count lines, and reset it
on each new file.

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
Changes in v2 -> v3: this patch is new in v3
---
 scripts/lib/ptxd_lib_dgen.awk | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/lib/ptxd_lib_dgen.awk b/scripts/lib/ptxd_lib_dgen.awk
index f6a51c2c4daa..c577f905b8fb 100644
--- a/scripts/lib/ptxd_lib_dgen.awk
+++ b/scripts/lib/ptxd_lib_dgen.awk
@@ -45,12 +45,15 @@ FNR == 1 {
 
 	# remember the current opened file
 	old_filename = FILENAME;
+	lineno = 0;
 
 	# will be set later, if makefile belongs to a pkg
 	is_pkg = "";
 }
 
-
+/^/ {
+	lineno += 1;
+}
 
 #
 # skip comments and empty lines
-- 
2.20.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

  parent reply	other threads:[~2019-06-06 16:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04 16:42 [ptxdist] [PATCH 1/4] doc: ref_manual: split up into multiple files Roland Hieber
2019-04-04 16:42 ` [ptxdist] [PATCH 2/4] doc: ref_make_macros: install_tree knows a "strip" parameter too Roland Hieber
2019-04-04 16:42 ` [ptxdist] [PATCH 3/4] doc: ref_make_macros: merge parameter macros into a single section Roland Hieber
2019-04-04 16:42 ` [ptxdist] [PATCH 4/4] doc: ref_make_macros: document ptx/yesno, ptx/falsetrue, ptx/onoff Roland Hieber
2019-04-05 12:33 ` [ptxdist] [PATCH 5/4] doc: ref_rule_file_layout: document targetinstall inexistence for host- and image- packages Roland Hieber
2019-04-05 13:17   ` Alexander Dahl
2019-04-05 14:18     ` Michael Olbrich
2019-04-08  9:39       ` [ptxdist] [PATCH v2] ptxd_lib_dgen: warn if host or image packages have targetinstall stage Roland Hieber
2019-04-12  7:10         ` Michael Olbrich
2019-04-23 15:39           ` Roland Hieber
2019-05-07 10:38             ` Roland Hieber
2019-05-29 10:24             ` Michael Olbrich
2019-06-06 16:26           ` Roland Hieber [this message]
2019-06-06 16:26             ` [ptxdist] [PATCH v3 2/3] ptxd_lib_dgen: error out for targetinstall stages in host/cross/image packages Roland Hieber
2019-06-06 19:21               ` Alexander Dahl
2019-06-06 16:26             ` [ptxdist] [PATCH v3 3/3] ptxd_lib_dgen: fix typos Roland Hieber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190606162616.28990-1-rhi@pengutronix.de \
    --to=rhi@pengutronix.de \
    --cc=post@lespocky.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox