From 8fe15d9e46d4e56db659df212fb3c7751322d292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jani=20V=C3=A4limaa?= Date: Mon, 29 Jul 2013 18:50:43 +0000 Subject: sync 'find javascript requires' code with SUSE to find versioned requires --- gi-find-deps.sh.in | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gi-find-deps.sh.in b/gi-find-deps.sh.in index 999882a..013a787 100755 --- a/gi-find-deps.sh.in +++ b/gi-find-deps.sh.in @@ -52,14 +52,18 @@ function find_requires { # - in JS: # . imports.gi.foo; [unversioned requirement of 'foo'] # . 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. -# Forms currently not detected: -# - js: imports.gi.versions.Gtk = '3.0'; while read file; do case $file in - *.js) - for module in $(grep -h -P -o "imports\.gi\.([^\s'\";]+)" $file | grep -v "imports\.gi\.version" | sed 's,imports.gi.,,'); do + *.js) + for module in $(grep -h -P -o "imports\.gi\.([^\s'\";]+)" $file | grep -v "imports\.gi\.version" | sed -r -e 's,\s+$,,g' -e 's,imports.gi.,,'); do + split_name_version $module + print_req_prov + done + for module in $(grep -h -P -o "imports\.gi\.versions.([^\s'\";]+)\s*=\s*['\"].+['\"]" $file | \ + sed -e 's:imports.gi.versions.::' -e "s:['\"]::g" -e 's:=:-:' -e 's: ::g'); do split_name_version $module print_req_prov done -- cgit v1.2.1