[v5,2/2] devtools: fix ABI update in map files

Message ID 20200811140339.2123929-2-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Headers
Series [v5,1/2] version: 20.11-rc0 |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed

Commit Message

Thomas Monjalon Aug. 11, 2020, 2:03 p.m. UTC
  The script was using the full ABI version, including the minor number,
to version the symbols in the map files.
It is fixed to use only the major number for symbol versioning.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 devtools/update_version_map_abi.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
  

Comments

Ray Kinsella Aug. 12, 2020, 6:57 a.m. UTC | #1
On 11/08/2020 15:03, Thomas Monjalon wrote:
> The script was using the full ABI version, including the minor number,
> to version the symbols in the map files.
> It is fixed to use only the major number for symbol versioning.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  devtools/update_version_map_abi.py | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/devtools/update_version_map_abi.py b/devtools/update_version_map_abi.py
> index 80a61641ed..10c3bc8098 100755
> --- a/devtools/update_version_map_abi.py
> +++ b/devtools/update_version_map_abi.py
> @@ -105,9 +105,9 @@ def __parse_map_file(f_in):
>      return has_stable, stable_lines, experimental_lines, internal_lines
>  
>  
> -def __generate_stable_abi(f_out, abi_version, lines):
> +def __generate_stable_abi(f_out, abi_major, lines):
>      # print ABI version header
> -    print("DPDK_{} {{".format(abi_version), file=f_out)
> +    print("DPDK_{} {{".format(abi_major), file=f_out)
>  
>      # print global section if it exists
>      if lines:
> @@ -186,6 +186,7 @@ def __main():
>                file=sys.stderr)
>          arg_parser.print_help()
>          sys.exit(1)
> +    abi_major = parsed.abi_version.split('.')[0]
>  
>      with open(parsed.map_file) as f_in:
>          has_stable, stable_lines, experimental_lines, internal_lines = __parse_map_file(f_in)
> @@ -193,7 +194,7 @@ def __main():
>      with open(parsed.map_file, 'w') as f_out:
>          need_newline = has_stable and experimental_lines
>          if has_stable:
> -            __generate_stable_abi(f_out, parsed.abi_version, stable_lines)
> +            __generate_stable_abi(f_out, abi_major, stable_lines)
>          if need_newline:
>              # separate sections with a newline
>              print(file=f_out)
> 
Acked-by: Ray Kinsella <mdr@ashroe.eu>
  

Patch

diff --git a/devtools/update_version_map_abi.py b/devtools/update_version_map_abi.py
index 80a61641ed..10c3bc8098 100755
--- a/devtools/update_version_map_abi.py
+++ b/devtools/update_version_map_abi.py
@@ -105,9 +105,9 @@  def __parse_map_file(f_in):
     return has_stable, stable_lines, experimental_lines, internal_lines
 
 
-def __generate_stable_abi(f_out, abi_version, lines):
+def __generate_stable_abi(f_out, abi_major, lines):
     # print ABI version header
-    print("DPDK_{} {{".format(abi_version), file=f_out)
+    print("DPDK_{} {{".format(abi_major), file=f_out)
 
     # print global section if it exists
     if lines:
@@ -186,6 +186,7 @@  def __main():
               file=sys.stderr)
         arg_parser.print_help()
         sys.exit(1)
+    abi_major = parsed.abi_version.split('.')[0]
 
     with open(parsed.map_file) as f_in:
         has_stable, stable_lines, experimental_lines, internal_lines = __parse_map_file(f_in)
@@ -193,7 +194,7 @@  def __main():
     with open(parsed.map_file, 'w') as f_out:
         need_newline = has_stable and experimental_lines
         if has_stable:
-            __generate_stable_abi(f_out, parsed.abi_version, stable_lines)
+            __generate_stable_abi(f_out, abi_major, stable_lines)
         if need_newline:
             # separate sections with a newline
             print(file=f_out)