aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJani Välimaa <wally@mageia.org>2013-07-29 18:50:43 +0000
committerJani Välimaa <wally@mageia.org>2013-07-29 18:50:43 +0000
commit8fe15d9e46d4e56db659df212fb3c7751322d292 (patch)
treefb0d5fc28e13b32cab66d06454000e10bd517e35
parenta147a57edf383d1f7f030f9afb211775d77f8449 (diff)
downloadrpm-setup-8fe15d9e46d4e56db659df212fb3c7751322d292.tar
rpm-setup-8fe15d9e46d4e56db659df212fb3c7751322d292.tar.gz
rpm-setup-8fe15d9e46d4e56db659df212fb3c7751322d292.tar.bz2
rpm-setup-8fe15d9e46d4e56db659df212fb3c7751322d292.tar.xz
rpm-setup-8fe15d9e46d4e56db659df212fb3c7751322d292.zip
sync 'find javascript requires' code with SUSE to find versioned requires
-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