Dominique Leuenberger 2019-08-19 18:49:05 +00:00 committed by Git OBS Bridge
commit 32bc62ea97
2 changed files with 13 additions and 0 deletions

View File

@ -78,6 +78,12 @@ function python_requires {
} }
function javascript_requires { function javascript_requires {
# parse the new import style in 3.32
for module in $(grep -r -h -A2 'const {' $1 | paste -s -d ' ' | grep '} = imports.gi;' | sed 's/imports.gi;.*/imports.gi;/' | awk -F '[{}]' '{print $(NF>1?NF-1:"")}' | tr ',' '\n' | tr -d ' ' | awk -F ':' '{print $1}'); do
split_name_version $module
print_req_prov
done
# parse the old import style before 3.32
for module in $(grep -h -P -o "imports\.gi\.([^\s'\";]+)" $1 | grep -v "imports\.gi\.version" | sed -r -e 's,\s+$,,g' -e 's,imports.gi.,,'); do for module in $(grep -h -P -o "imports\.gi\.([^\s'\";]+)" $1 | grep -v "imports\.gi\.version" | sed -r -e 's,\s+$,,g' -e 's,imports.gi.,,'); do
split_name_version $module split_name_version $module
print_req_prov print_req_prov
@ -181,6 +187,7 @@ function find_requires {
# . imports.gi.foo; [unversioned requirement of 'foo'] # . imports.gi.foo; [unversioned requirement of 'foo']
# . imports.gi.foo-1.0; [versioned requirement of 'foo'] # . imports.gi.foo-1.0; [versioned requirement of 'foo']
# . imports.gi.versions.Gtk = '3.0'; # . imports.gi.versions.Gtk = '3.0';
# . const { foo, bar } = imports.gi;
# . The imports can be listed on one line, and we catch them. # . The imports can be listed on one line, and we catch them.
while read file; do while read file; do

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Aug 14 09:03:22 UTC 2019 - QK ZHU <qkzhu@suse.com>
- Update gi-find-deps.sh: upate javascript_requires function to parse
the new JS import style (bsc#1140614).
------------------------------------------------------------------- -------------------------------------------------------------------
Sat Jun 15 18:34:15 UTC 2019 - Bjørn Lie <bjorn.lie@gmail.com> Sat Jun 15 18:34:15 UTC 2019 - Bjørn Lie <bjorn.lie@gmail.com>