fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ci/+/28504 )

Change subject: lint: simplify find command in exclude_paths_common_asn1c()
......................................................................

lint: simplify find command in exclude_paths_common_asn1c()

The purpose of "cut -d / -f 2-" is to strip off leading "./" in
the paths.  The same can be achieved by doing "-printf '%P\n'".

Matching "*.c" and "*.h" files can be expressed as "-name *.[hc]".

Change-Id: Iae3fc5c8842df6926e6ff16a41be5663f1dedd1b
---
M lint/checkpatch/checkpatch_osmo.sh
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, approved



diff --git a/lint/checkpatch/checkpatch_osmo.sh 
b/lint/checkpatch/checkpatch_osmo.sh
index a12d0a1..b0c3985 100755
--- a/lint/checkpatch/checkpatch_osmo.sh
+++ b/lint/checkpatch/checkpatch_osmo.sh
@@ -16,7 +16,7 @@

 exclude_paths_common_asn1c() {
        local pattern="^ \* Generated by asn1c-"
-       local files="$(find -name '*.c' -o -name '*.h' | cut -d / -f 2-)"
+       local files="$(find -name '*.[hc]' -printf '%P\n')"
        local i

        if [ -z "$files" ]; then

--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/28504
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Iae3fc5c8842df6926e6ff16a41be5663f1dedd1b
Gerrit-Change-Number: 28504
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-MessageType: merged

Reply via email to