mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
meson: scripts: introduce meson-gen-sym.py script
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
29
scripts/meson-gen-sym.py
Executable file
29
scripts/meson-gen-sym.py
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
|
||||
if len(sys.argv) < 5:
|
||||
print('invalid arguments')
|
||||
print('usage: {0} OUTPUT VERSION PUBLIC PRIVATE ...')
|
||||
sys.exit(1)
|
||||
|
||||
outfilepath = sys.argv[1]
|
||||
version = sys.argv[2]
|
||||
public = sys.argv[3]
|
||||
private = sys.argv[4:]
|
||||
|
||||
with open(outfilepath, 'w') as out:
|
||||
out.write('# WARNING: generated from the following files:\n\n')
|
||||
|
||||
with open(public) as tmp:
|
||||
out.write(tmp.read())
|
||||
|
||||
out.write('\n\n# Private symbols\n\n')
|
||||
out.write('{0} {{\n\n'.format(version))
|
||||
out.write('global:\n\n')
|
||||
|
||||
for priv in private:
|
||||
with open(priv) as tmp:
|
||||
out.write(tmp.read())
|
||||
|
||||
out.write('\n\nlocal:\n*;\n\n};')
|
||||
Reference in New Issue
Block a user