1
0

Accepting request 138433 from home:dimstar:branches:GNOME:Factory

This should catch the latest missing version of possible versioned gi requires in python code...

OBS-URL: https://build.opensuse.org/request/show/138433
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gobject-introspection?expand=0&rev=106
This commit is contained in:
Dominique Leuenberger 2012-10-17 20:21:34 +00:00 committed by Git OBS Bridge
parent 988eb164e2
commit dd8573196e
2 changed files with 14 additions and 6 deletions

View File

@ -40,21 +40,19 @@ done
} }
function find_requires { function find_requires {
# FIXME: There are multiple ways gi bindings can be imported. We only catch the 'basic' one
# Currently, we detect: # Currently, we detect:
# - in python: # - in python:
# . from gi.repository import foo [Unversioned requirement of 'foo'] # . from gi.repository import foo [Unversioned requirement of 'foo']
# . from gi.repository import foo-1.0 [versioned requirement] # . 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: # . And we do not stumble over:
# from gi.repository import foo as _bar # from gi.repository import foo as _bar
# from gi.repository import foo, bar # from gi.repository import foo, bar
# - in JS: # - in JS:
# . imports.gi.foo; [unversioned requirement of 'foo'] # . imports.gi.foo; [unversioned requirement of 'foo']
# . imports.gi.goo-1.0; [versioned requirement] # . imports.gi.goo-1.0; [versioned requirement]
# . imports.gi.versions.Gtk = '3.0';
# . The imports can be listed on one line, and we catch them. # . 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 while read file; do
case $file in case $file in
@ -74,6 +72,10 @@ while read file; do
split_name_version $module split_name_version $module
print_req_prov print_req_prov
done 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) *.typelib)
split_name_version $(basename $file | sed 's,.typelib$,,') split_name_version $(basename $file | sed 's,.typelib$,,')

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Oct 16 20:50:56 UTC 2012 - dimstar@opensuse.org
- Extend gi-find-deps.sh to understand gi.require_version in python
code. This was the last know format not yet supported.
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Oct 2 16:13:01 UTC 2012 - dimstar@opensuse.org Tue Oct 2 16:13:01 UTC 2012 - dimstar@opensuse.org