Skip to main content
ALT Linux Bugzilla
– Attachment 22357 Details for
Bug 60845
gir-python.req ignores gi.require_version(): typelib requires are unversioned (GTK3 apps get satisfied by GTK4)
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
gir-python.req: versioned typelib() from gi.require_version(); skiplist matches the name
gir-python-req-require-version.patch (text/plain), 1.72 KB, created by
Vitaly Lipatov
on 2026-10-07 19:05:11 MSK
(
hide
)
Description:
gir-python.req: versioned typelib() from gi.require_version(); skiplist matches the name
Filename:
MIME Type:
Creator:
Vitaly Lipatov
Created:
2026-10-07 19:05:11 MSK
Size:
1.72 KB
patch
obsolete
>--- a/usr/lib/rpm/gir-python.req >+++ b/usr/lib/rpm/gir-python.req >@@ -21,9 +21,18 @@ > . /usr/lib/rpm/rpm-build-gir.functions > keyword=".*from[[:space:]]*gi.repository[[:space:]]*import" > >+# print "Name Version" pairs from gi.require_version("Name", "Version") calls >+PyGiVersions() >+{ >+ grep -E -o "require_version[[:space:]]*\\([[:space:]]*[\"'][A-Za-z0-9_]+[\"'][[:space:]]*,[[:space:]]*[\"'][0-9.]+[\"']" "$1" | >+ sed -e "s/^require_version[[:space:]]*([[:space:]]*[\"']\\([A-Za-z0-9_]*\\)[\"'][[:space:]]*,[[:space:]]*[\"']\\([0-9.]*\\)[\"']/\\1 \\2/" | >+ sort -u >+} >+ > PyGiReq() > { >- local f="$1" out=; shift >+ local f="$1" out= versions=; shift >+ versions="$(PyGiVersions "$f")" || versions= > out="$(cat "$f" | grep -E -o "$keyword[[:space:]]*[A-Za-z0-9 ,]*" | sed -e ' > s:'"$keyword"'\([A-Za-z ,]*\):\1: > s: as .*:: >@@ -47,7 +56,14 @@ > if [ $1 = Peas ]; then > echo "libpeas-python3-loader" > fi >- echo "typelib($1)" >+ # use the version from gi.require_version() if it is unambiguous >+ local ver >+ ver="$(printf '%s\n' "$versions" | sed -n "s/^$1 //p")" >+ if [ -n "$ver" ] && [ "$(printf '%s\n' "$ver" | wc -l)" = 1 ]; then >+ echo "typelib($1) = $ver" >+ else >+ echo "typelib($1)" >+ fi > done > done > >--- a/usr/lib/rpm/rpm-build-gir.functions >+++ b/usr/lib/rpm/rpm-build-gir.functions >@@ -25,7 +25,9 @@ > while read req; do > if [ -n "${RPM_TYPELIB_REQ_SKIPLIST-}" ]; then > for skip in $RPM_TYPELIB_REQ_SKIPLIST; do >- if [ -z "${req##$skip}" ]; then >+ # versioned reqs look like "typelib(Foo) = 1.0": match the name too >+ name="${req%% *}" >+ if [ -z "${req##$skip}" ] || [ -z "${name##$skip}" ]; then > Debug "skipped $req due to RPM_TYPELIB_REQ_SKIPLIST pattern $skip" > continue 2 > fi
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 60845
: 22357