From 48bc13bd44345ba2f63d59df85e2fc5391a6a2a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jani=20V=C3=A4limaa?= Date: Sat, 6 Jul 2013 20:58:36 +0000 Subject: handle 'gi.require_version("Gtk", "3.0")' type requires (from SUSE) --- gi-find-deps.sh.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gi-find-deps.sh.in b/gi-find-deps.sh.in index a377d5f..999882a 100755 --- a/gi-find-deps.sh.in +++ b/gi-find-deps.sh.in @@ -45,6 +45,7 @@ function find_requires { # - in python: # . from gi.repository import foo [Unversioned requirement of 'foo'] # . from gi.repository import foo-1.0 [versioned requirement] +# . gi.require_version('Gtk', '3.0') (To specify a version.. there is still an import needed) # . And we do not stumble over: # from gi.repository import foo as _bar # from gi.repository import foo, bar @@ -54,7 +55,6 @@ function find_requires { # . The imports can be listed on one line, and we catch them. # Forms currently not detected: # - js: imports.gi.versions.Gtk = '3.0'; -# - py: gi.require_version('Gtk', '3.0') while read file; do case $file in @@ -70,6 +70,10 @@ while read file; do print_req_prov echo "python-gi >= 2.90.2" done + for module in $(grep -h -P -o "(gi\.require_version\(['\"][^'\"]+['\"],\s*['\"][^'\"]+['\"]\))" $file | sed -e 's:gi.require_version::' -e "s:[()\"' ]::g" -e 's:,:-:'); do + split_name_version $module + print_req_prov + done ;; *.typelib) for module in $(@RPMVENDORDIR@/g-ir-extract-deps $file | tr '|' ' '); do -- cgit v1.2.1