generate-version-script: Don't skip methods on plain structs

This resulted in losing g_usb_source_set_callback@LIBGUSB_0.1.0 from
the ABI in version 0.3.4.

Signed-off-by: Simon McVittie <smcv@debian.org>
Forwarded: https://github.com/hughsie/libgusb/pull/31

Gbp-Pq: Name generate-version-script-Don-t-skip-methods-on-plain-struc.patch
This commit is contained in:
Simon McVittie 2020-03-04 10:21:37 +00:00 committed by Lu zhiping
parent bd2f66e88f
commit 529832c440
2 changed files with 5 additions and 3 deletions

View File

@ -50,9 +50,6 @@ class LdVersionScript:
# choose the lowest version method for the _get_type symbol
version_lowest = None
if '{http://www.gtk.org/introspection/glib/1.0}get-type' not in cls.attrib:
return
type_name = cls.attrib['{http://www.gtk.org/introspection/glib/1.0}get-type']
# add all class methods
for node in cls.findall(XMLNS + 'method'):
@ -68,6 +65,10 @@ class LdVersionScript:
if not version_lowest or version_tmp < version_lowest:
version_lowest = version_tmp
if '{http://www.gtk.org/introspection/glib/1.0}get-type' not in cls.attrib:
return
type_name = cls.attrib['{http://www.gtk.org/introspection/glib/1.0}get-type']
# finally add the get_type symbol
if version_lowest:
self.releases[version_lowest].append(type_name)

View File

@ -40,6 +40,7 @@ LIBGUSB_0.1.0 {
g_usb_device_reset;
g_usb_device_set_configuration;
g_usb_source_error_quark;
g_usb_source_set_callback;
g_usb_strerror;
# LIBGUSB_0.2.5
g_usb_context_get_main_context;