diff --git a/qml-autoreqprov.changes b/qml-autoreqprov.changes index 785db45..3970516 100644 --- a/qml-autoreqprov.changes +++ b/qml-autoreqprov.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Tue Jul 11 09:04:16 UTC 2023 - Fabian Vogt + +- Bump version to 1.2 +- qmldirreqprov.sh: + * Fix parsing of "depends" + * Add support for "optional plugin" +- qml.req: Handle imports without minor version requirement + ------------------------------------------------------------------- Tue Oct 19 18:45:25 UTC 2021 - Fabian Vogt diff --git a/qml-autoreqprov.spec b/qml-autoreqprov.spec index 1b8e9e8..f0346a5 100644 --- a/qml-autoreqprov.spec +++ b/qml-autoreqprov.spec @@ -1,7 +1,7 @@ # # spec file for package qml-autoreqprov # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: qml-autoreqprov -Version: 1.1 +Version: 1.2 Release: 0 Summary: Automatic dependency generator for QML files and modules License: GPL-3.0-or-later diff --git a/qml.req b/qml.req index 1c3a207..c2de624 100644 --- a/qml.req +++ b/qml.req @@ -53,6 +53,11 @@ foundDependency() { # TODO: Get exit status of qmlimportscanner while read import min; do + # For imports without minor version like "import org.kde.kirigami 2", + # the minor version is reported as 255. Treat that as 0 instead. + if [ $min -eq 255 ]; then + min=0 + fi foundDependency "qt${qtver}qmlimport(${import})" "$min" done < <(grep -vE '/designer/.*\.qml' | xargs -r "$importscanner" -qmlFiles | jq -r '.[] | select(.type == "module") | .name + " " + .version' | gawk 'match($2, /^([0-9]+)\.([0-9]+)$/, ver) { printf "%s.%d %d\n", $1, ver[1], ver[2]; }') diff --git a/qmldirreqprov.sh b/qmldirreqprov.sh index fd119df..24be46d 100644 --- a/qmldirreqprov.sh +++ b/qmldirreqprov.sh @@ -54,7 +54,8 @@ while read file; do fi if [[ $requires ]]; then - gawk '$1 == depends && match($2, /^([0-9]+)\.([0-9]+)$/, ver) { printf "qt'${qtver}'qmlimport(%s.%d) >= %d", $2, ver[1], ver[2]; }' "$file" + # TODO: Handle "auto" as version. This could generate versionless qmlimport(Foo.Bar.2) for each exported major version. + gawk '$1 == "depends" && match($3, /^([0-9]+)\.([0-9]+)$/, ver) { printf "qt'${qtver}'qmlimport(%s.%d) >= %d\n", $2, ver[1], ver[2]; }' "$file" fi if [[ $provides ]]; then @@ -76,7 +77,7 @@ while read file; do fi plugins+=("${location}/${pluginname}") - done < <(awk '$1 == "plugin" { printf "lib%s.so %s\n", $2, $3; }' "$file") + done < <(awk '$1 == "plugin" { printf "lib%s.so %s\n", $2, $3; } $1 == "optional" && $2 == "plugin" { printf "lib%s.so %s\n", $3, $4; }' "$file") if [ ${#plugins[@]} -eq 0 ]; then # No plugins?