[PATCH v1 4/4] scripts: apibuild: add 'version' to variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Differently from the previous patches, we don't parse nor export
comments associated with variables. This isn't a big deal because we
only export a single variable: virConnectAuthPtrDefault

Nonetheless, add version field to the exported XML by checking the
allowlist file. This way, if we add another variable in the future, we
can simply add it to that file. Calling the function should also warn
in case we are exporting a new Variable without adding to the file,
e.g:
    Missing 'Since' tag for: virConnectAuthPtrDefault

Signed-off-by: Victor Toso <victortoso@xxxxxxxxxx>
---
 scripts/apibuild.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/scripts/apibuild.py b/scripts/apibuild.py
index 1235e75999..5493b3065e 100755
--- a/scripts/apibuild.py
+++ b/scripts/apibuild.py
@@ -2341,12 +2341,14 @@ class docBuilder:
 
     def serialize_variable(self, output, name):
         id = self.idx.variables[name]
+        # Only a single variable exported at the moment. Comments are not parser nor exported.
+        (_, since) = self.retrieve_comment_tags(name, "")
         if id.info is not None:
-            output.write("    <variable name='%s' file='%s' type='%s'/>\n" % (
-                name, self.modulename_file(id.header), id.info))
+            output.write("    <variable name='%s' file='%s' type='%s' version='%s'/>\n" % (
+                name, self.modulename_file(id.header), id.info, since))
         else:
-            output.write("    <variable name='%s' file='%s'/>\n" % (
-                name, self.modulename_file(id.header)))
+            output.write("    <variable name='%s' file='%s' version='%s'/>\n" % (
+                name, self.modulename_file(id.header), since))
 
     def serialize_function(self, output, name):
         id = self.idx.functions[name]
-- 
2.35.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux