aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgi-find-deps.sh.in12
1 files 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