From: Neil Horman Date: Thu, 16 Aug 2018 11:08:01 +0000 (-0400) Subject: devtools: relax rule for identifying symbol section X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=7281cf520f890a5e779596c872e2440af7131eae;p=dpdk.git devtools: relax rule for identifying symbol section It was reported recently that some patches that add symbols to an existing EXPERIMENTAL section of a version map file generate errors because the check-symbol-change script was identifying the section as "@@" rather than EXPERIMENTAL. This was fairly clearly due to the fact that the rule identifying the version section expected the whole section to be added, rather than having it already exist, with only new symbols being added to the existing section. This led the match rule to misread the format of that line and pull the wrong word out of it. The fix is to relax the rule slightly. Rather than assume that the section must exist on a line that was added, allow the section name to be set by any line that ends in a '{', which should be correct, given our coding practices. The section name is then extracted as the next to the last word on the line ( $(NF-1) ). Fixes: 4bec48184e33 ("devtools: add checks for ABI symbol addition") Cc: stable@dpdk.org Reported-by: Nikhil Rao Signed-off-by: Neil Horman Tested-by: Nikhil Rao --- diff --git a/devtools/check-symbol-change.sh b/devtools/check-symbol-change.sh index daaf45e14c..cf9cfc745b 100755 --- a/devtools/check-symbol-change.sh +++ b/devtools/check-symbol-change.sh @@ -25,14 +25,14 @@ build_map_changes() # supresses the subordonate rules below /[-+] a\/.*\.^(map)/ {in_map=0} - # Triggering this rule, which starts a line with a + and ends it + # Triggering this rule, which starts a line and ends it # with a { identifies a versioned section. The section name is # the rest of the line with the + and { symbols remvoed. # Triggering this rule sets in_sec to 1, which actives the # symbol rule below - /+.*{/ {gsub("+",""); + /^.*{/ { if (in_map == 1) { - sec=$1; in_sec=1; + sec=$(NF-1); in_sec=1; } }