1
0

Accepting request 1098102 from home:Vogtinator:branches:KDE:Qt5

- Bump version to 1.2
- qmldirreqprov.sh:
  * Fix parsing of "depends"
  * Add support for "optional plugin"
- qml.req: Handle imports without minor version requirement

OBS-URL: https://build.opensuse.org/request/show/1098102
OBS-URL: https://build.opensuse.org/package/show/KDE:Qt5/qml-autoreqprov?expand=0&rev=9
This commit is contained in:
Christophe Marin 2023-07-11 11:36:28 +00:00 committed by Git OBS Bridge
parent 4932618b1a
commit 33f37c4590
4 changed files with 19 additions and 4 deletions

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Tue Jul 11 09:04:16 UTC 2023 - Fabian Vogt <fabian@ritter-vogt.de>
- 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 <fabian@ritter-vogt.de>

View File

@ -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

View File

@ -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]; }')

View File

@ -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?