[Pkg-gnupg-commit] [gpgme] 164/412: python: Fix stripping deprecated functionality.
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Thu Sep 22 21:26:39 UTC 2016
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch master
in repository gpgme.
commit 8426304b67a0b0a5630db500abf740b0e0b9e43c
Author: Justus Winter <justus at g10code.com>
Date: Wed Jun 8 16:51:35 2016 +0200
python: Fix stripping deprecated functionality.
* lang/python/Makefile.am (gpgme.h): Add script as input.
* lang/python/gpgme-h-clean.py (deprec_func): Also match struct
members.
(line_break): Fix matching on struct members.
Signed-off-by: Justus Winter <justus at g10code.com>
---
lang/python/Makefile.am | 2 +-
lang/python/gpgme-h-clean.py | 9 +++++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/lang/python/Makefile.am b/lang/python/Makefile.am
index 18f77bb..a9b39e7 100644
--- a/lang/python/Makefile.am
+++ b/lang/python/Makefile.am
@@ -20,7 +20,7 @@ EXTRA_DIST = README.rst
SUBDIRS = tests
# Cleanup gpgme.h from deprecated functions and typedefs.
-gpgme.h: ../../src/gpgme.h
+gpgme.h: ../../src/gpgme.h $(srcdir)/gpgme-h-clean.py
$(PYTHON) $(srcdir)/gpgme-h-clean.py $< >$@
# For VPATH builds we need to copy some files because Python's
diff --git a/lang/python/gpgme-h-clean.py b/lang/python/gpgme-h-clean.py
index 261e7b6..b7052ff 100755
--- a/lang/python/gpgme-h-clean.py
+++ b/lang/python/gpgme-h-clean.py
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
+
+# Copyright (C) 2016 g10 Code GmbH
# Copyright (C) 2004,2008 Igor Belyi <belyi at users.sourceforge.net>
#
# This library is free software; you can redistribute it and/or
@@ -21,8 +23,11 @@ if len(sys.argv) < 2:
sys.stderr.write("Usage: %s gpgme.h\n" % sys.argv[0])
sys.exit(1)
-deprec_func=re.compile('^(.*typedef.*|.*\(.*\))\s*_GPGME_DEPRECATED;\s*',re.S)
-line_break=re.compile(';|\\$|\\x0c|^\s*#');
+deprec_func = re.compile(r'^(.*typedef.*|.*\(.*\)|[^#]+\s+.+)'
+ + r'\s*_GPGME_DEPRECATED(_OUTSIDE_GPGME)?;\s*',
+ re.S)
+line_break = re.compile(';|\\$|\\x0c|^\s*#|{');
+
try:
gpgme = open(sys.argv[1])
tmp = gpgme.readline()
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gpgme.git
More information about the Pkg-gnupg-commit
mailing list