Skip to contentSkip to conversation

packagedata.py : Fix RDEPENDS Version issue with AUTOINC

PATCH Sreejith Ravi 1 participant 1 message Oct 28, 2024 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi Richard,

New patch has been created on
https://patchwork.yoctoproject.org/project/oe-core/patch/[email protected]/
This will update AUTOINC in the pkgdata instead of do_package_write_ipk. Please review and let me know your comments.

Cheers
Sreejith

Quoted 114 lines · Sreejith Ravi via lists.openembedded.org

Currently, RDEPENDS for -staticdev and -dev is set using EXTENDPKGV in meta/conf/bitbake.conf:
----------------------------------
EXTENDPKGV ?= "${EXTENDPKGEVER}${PKGV}-${PKGR}" DEV_PKG_DEPENDENCY = "${PN} (= ${EXTENDPKGV})" RDEPENDS:${PN}-staticdev = "${PN}-dev (= ${EXTENDPKGV})"
----------------------------------

During the do_package task, AUTOINC is replaced in PKGV
(via package_setup_pkgv), which is used for creating the package name. However, Yocto sets RDEPENDS with PKGV during the recipe parsing stage, resulting in the RDEPENDS field in the IPK control data containing AUTOINC.

As the IPK name is generated with the updated PKGV, but the version in RDEPENDS still uses AUTOINC, this mismatch leads to installation failures.

Example: libnsl
install libnsl-staticdev throws the error, nothing provides libnsl-dev = 1.2.0+gitAUTOINC+4a062cf418-r0
----------------------------------
IPKs available:
libnsl2_1.2.0+git0+4a062cf418-r0_armv7at2hf-neon.ipk libnsl-src_1.2.0+git0+4a062cf418-r0_armv7at2hf-neon.ipk libnsl-dbg_1.2.0+git0+4a062cf418-r0_armv7at2hf-neon.ipk libnsl-staticdev_1.2.0+git0+4a062cf418-r0_armv7at2hf-neon.ipk libnsl-dev_1.2.0+git0+4a062cf418-r0_armv7at2hf-neon.ipk

control data: libnsl-staticdev
Package: libnsl-staticdev
Version: 1.2.0+git0+4a062cf418-r0
----
----
Depends: libnsl-dev (= 1.2.0+gitAUTOINC+4a062cf418-r0)
Provides: libnsl2-staticdev
Source: libnsl2_git.bb

control data: libnsl-dev
Package: libnsl-dev
Version: 1.2.0+git0+4a062cf418-r0
----
----
Depends: libnsl2 (= 1.2.0+gitAUTOINC+4a062cf418-r0), libtirpc-dev
Recommends: gcc-runtime-dev, glibc-dev, libtirpc-dev
Provides: libnsl2-dev
Source: libnsl2_git.bb
----------------------------------

This patch fixes the RDEPENDS versions set using EXTENDPKGV in the -dev and -staticdev packages. It replaces AUTOINC before generating the package control data.

Updated control data:
----------------------------------
Package: libnsl-dev
Version: 1.2.0+git0+4a062cf418-r0
----
----
Depends: libnsl2 (= 1.2.0+git0+4a062cf418-r0), libtirpc-dev
Recommends: gcc-runtime-dev, glibc-dev, libtirpc-dev
Provides: libnsl2-dev
Source: libnsl2_git.bb

Package: libnsl-staticdev
Version: 1.2.0+git0+4a062cf418-r0
----
----
Depends: libnsl-dev (= 1.2.0+git0+4a062cf418-r0)
Provides: libnsl2-staticdev
Source: libnsl2_git.bb
----------------------------------

---
 meta/classes-global/package.bbclass | 9 +++++++++
 1 file changed, 9 insertions(+)
meta/classes-global/package.bbclass +3 -0
index 6cd8c0140f..066a7ff835 100644
@@ -325,6 +325,15 @@ python package_setup_pkgv() {
     # Adjust pkgv as necessary...
     if 'AUTOINC' in pkgv:
         d.setVar("PKGV", pkgv.replace("AUTOINC", "${PRSERV_PV_AUTOINC}"))
+
+    # Adjust dependencies that are statically set with EXTENDPKGV
+    vars =

["RDEPENDS","RPROVIDES","RRECOMMENDS","RSUGGESTS","RREPLACES","RCONFLICTS"]

meta/classes-global/package.bbclass +6 -0
+    packages = d.getVar('PACKAGES').split()
+    for var in vars:
+        for pkg in packages:
+            val = d.getVar("%s_%s"%(var,pkg))
+            if val and 'AUTOINC' in val:
+                d.setVar("%s_%s"%(var,pkg), val.replace("AUTOINC",

"${PRSERV_PV_AUTOINC}"))
}

--
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#206299):
https://lists.openembedded.org/g/openembedded-core/message/206299
Mute This Topic: https://lists.openembedded.org/mt/109187668/8634312
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-