From cb48c2c967be4d0f09b97bf865ae0d278cb7f376 Mon Sep 17 00:00:00 2001 From: Xiaole He Date: Wed, 21 Sep 2022 10:42:31 +0800 Subject: [PATCH] abg-reader: fix comment of function Backport from upstream git repository. This patch fixes a problematic comment of function. Original discussion for the patch lists below: Link: https://sourceware.org/pipermail/libabigail/2022q3/004715.html Signed-off-by: Xiaole He --- 0002-abg-reader-fix-comment-of-function.patch | 50 +++++++++++++++++++ libabigail.spec | 6 ++- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 0002-abg-reader-fix-comment-of-function.patch diff --git a/0002-abg-reader-fix-comment-of-function.patch b/0002-abg-reader-fix-comment-of-function.patch new file mode 100644 index 0000000..89b01ec --- /dev/null +++ b/0002-abg-reader-fix-comment-of-function.patch @@ -0,0 +1,50 @@ +From a2263db66eb8ae10614ac1c4ab942bda8c7cd78c Mon Sep 17 00:00:00 2001 +From: Xiaole He via Libabigail +Date: Mon, 19 Sep 2022 18:03:50 +0800 +Subject: [PATCH] abg-reader: fix comment of function + +In 'src/abg-reader.cc', the function +'walk_xml_node_to_map_type_ids(read_context& ctxt, xmlNodePtr node)' +finds all of the child nodes of 'node' that has the 'id' attribute, +and then put the child node into map where the 'id' of the child node +as key and the child node itself as the value. +But the comment for this function writes: +/* src/abg-reader.cc begin */ +/// Walk an entire XML sub-tree to build a map where the key is the +/// the value of the 'id' attribute (for type definitions) and the key +/// is the xml node containing the 'id' attribute. +... +static void +walk_xml_node_to_map_type_ids(read_context& ctxt, + xmlNodePtr node) +... +/* src/abg-reader.cc end */ +The second and third lines of the comment above says the the child node +as the key of the map, but it should be the value of the map. +This patch fix the problematic comment described above, from +'and the key is the xml node' to 'and the value is the xml node'. + + * src/abg-reader.cc (walk_xml_node_to_map_type_ids): fix comment + +Signed-off-by: Xiaole He +Signed-off-by: Dodji Seketeli +--- + src/abg-reader.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/abg-reader.cc b/src/abg-reader.cc +index 1ca36b7..1df3515 100644 +--- a/src/abg-reader.cc ++++ b/src/abg-reader.cc +@@ -1418,7 +1418,7 @@ advance_cursor(read_context& ctxt) + } + + /// Walk an entire XML sub-tree to build a map where the key is the +-/// the value of the 'id' attribute (for type definitions) and the key ++/// the value of the 'id' attribute (for type definitions) and the value + /// is the xml node containing the 'id' attribute. + /// + /// @param ctxt the context of the reader. +-- +2.27.0 + diff --git a/libabigail.spec b/libabigail.spec index 6e56cfe..408e457 100644 --- a/libabigail.spec +++ b/libabigail.spec @@ -1,11 +1,12 @@ Name: libabigail Version: 2.0 -Release: 1 +Release: 2 Summary: ABI generic analysis and instrumentation library License: LGPLv3+ URL: https://sourceware.org/libabigail/ Source0: http://mirrors.kernel.org/sourceware/libabigail/libabigail-%{version}.tar.gz Patch0000: 0001-compiler-flags.patch +Patch0001: 0002-abg-reader-fix-comment-of-function.patch BuildRequires: gcc-c++ libtool elfutils-devel libxml2-devel doxygen BuildRequires: python3-sphinx texinfo dos2unix dpkg python3-devel python3-rpm BuildRequires: python3-mock python3-unittest2 python3-pyxdg wget mailcap @@ -91,6 +92,9 @@ fi %doc doc/manuals/html/* README AUTHORS ChangeLog %changelog +* Wed Sep 21 2022 Xiaole He - 2.0-2 +- backport patch:0002 to fix problematic comment + * Sat Aug 27 2022 tianlijing - 2.0-1 - update to 2.0