Skip to contentSkip to conversation

utils.bbclass: restore previous implementation of explode_deps()

PATCH In review Andreas Oberritter 3 participants 8 messages Feb 11, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 utils.bbclass: restore previous implementation of explode_deps()

* explode_deps() changed its behavior to omit version information when the function was removed from OE in favor of BitBake's implementation in March 2010. Since then, packages didn't contain versioned runtime dependencies.

See commit 89b7e433719f43f1c36c76cb8856d559014e99bc

* This patch restores the previous implementation of explode_deps(), thus fixing the generation of versioned runtime dependencies.

* Reimplementing explode_deps() using bb.utils.explode_dep_versions() didn't work, because it choked upon parsing inline python code, e.g. on update-modules_1.0.bb's RDEPENDS_${PN} field.

---
 classes/utils.bbclass |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
classes/utils.bbclass +15 -1
index 2fa6204..eea084a 100644
@@ -423,7 +423,21 @@ def check_app_exists(app, d):
 	return bool(which(path, app))
 
 def explode_deps(s):
-	return bb.utils.explode_deps(s)
+	r = []
+	l = s.split()
+	flag = False
+	for i in l:
+		if i[0] == '(':
+			flag = True
+			j = []
+		if flag:
+			j.append(i)
+			if i.endswith(')'):
+				flag = False
+				r[-1] += ' ' + ' '.join(j)
+		else:
+			r.append(i)
+	return r
 
 def base_set_filespath(path, d):
 	bb.note("base_set_filespath usage is deprecated, %s should be fixed" % d.getVar("P", 1))
Signature · 1 line
1.7.2.3
#1 lore raw

PATCH 2/4 package.bbclass: remove superfluous whitespace characters from RDEPENDS

---
 classes/package.bbclass |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
classes/package.bbclass +2 -2
index 678ffa9..ce7ff86 100644
@@ -517,7 +517,7 @@ python populate_packages () {
 						break
 			if found == False:
 				bb.note("%s contains dangling symlink to %s" % (pkg, l))
-		bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d)
+		bb.data.setVar('RDEPENDS_' + pkg, " ".join(rdepends), d)
 }
 populate_packages[dirs] = "${D}"
 
@@ -897,7 +897,7 @@ python read_shlibdeps () {
 				fd.close()
 				for l in lines:
 					rdepends.append(l.rstrip())
-		bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d)
+		bb.data.setVar('RDEPENDS_' + pkg, " ".join(rdepends), d)
 }
 
 python package_depchains() {
Signature · 1 line
1.7.2.3
#3 lore raw

PATCH 3/4 package_ipk.bbclass: use common function to write relationship fields

In reply to Andreas Oberritter

* A function write_dep_field() was added to do_package_ipk() to ensure explode_deps is called for every field and to simplify the code.

* The following statement was removed from do_package_ipk():

if not '-locale-' and not '-dbg' and not '-dev' in pkgname:
rdepends.append('%s-locale*' % pkgname)

It was added in November 2008, but can never evaluate to true.

See commit a045dfacf6f2541e0f410d9d109581f181303756

---
 classes/package_ipk.bbclass |   34 ++++++++++++----------------------
 1 files changed, 12 insertions(+), 22 deletions(-)
classes/package_ipk.bbclass +12 -22
index a68d208..28aadc2 100644
@@ -250,28 +250,18 @@ python do_package_ipk () {
 
 		bb.build.exec_func("mapping_rename_hook", localdata)
 
-		rdepends = explode_deps(bb.data.getVar("RDEPENDS", localdata, 1) or "")
-		rrecommends = explode_deps(bb.data.getVar("RRECOMMENDS", localdata, 1) or "")
-		rsuggests = (bb.data.getVar("RSUGGESTS", localdata, 1) or "").split()
-		rprovides = (bb.data.getVar("RPROVIDES", localdata, 1) or "").split()
-		rreplaces = (bb.data.getVar("RREPLACES", localdata, 1) or "").split()
-		rconflicts = (bb.data.getVar("RCONFLICTS", localdata, 1) or "").split()
-
-		if not '-locale-' and not '-dbg' and not '-dev' in pkgname:
-			rdepends.append('%s-locale*' % pkgname)
-
-		if rdepends:
-			ctrlfile.write("Depends: %s\n" % ", ".join(rdepends))
-		if rsuggests:
-			ctrlfile.write("Suggests: %s\n" % ", ".join(rsuggests))
-		if rrecommends:
-			ctrlfile.write("Recommends: %s\n" % ", ".join(rrecommends))
-		if rprovides:
-			ctrlfile.write("Provides: %s\n" % ", ".join(rprovides))
-		if rreplaces:
-			ctrlfile.write("Replaces: %s\n" % ", ".join(rreplaces))
-		if rconflicts:
-			ctrlfile.write("Conflicts: %s\n" % ", ".join(rconflicts))
+		def write_dep_field(varname, outstring):
+			var = bb.data.getVar(varname, localdata, True)
+			if var:
+				ctrlfile.write('%s: %s\n' % (outstring, ", ".join(explode_deps(var))))
+
+		write_dep_field('RDEPENDS', 'Depends')
+		write_dep_field('RSUGGESTS', 'Suggests')
+		write_dep_field('RRECOMMENDS', 'Recommends')
+		write_dep_field('RPROVIDES', 'Provides')
+		write_dep_field('RREPLACES', 'Replaces')
+		write_dep_field('RCONFLICTS', 'Conflicts')
+
 		src_uri = bb.data.getVar("SRC_URI", localdata, 1) or d.getVar("FILE", True)
 		src_uri = re.sub("\s+", " ", src_uri)
 		ctrlfile.write("Source: %s\n" % " ".join(src_uri.split()))
Signature · 1 line
1.7.2.3
Acked-by on v1 3/4
#4 lore raw

Re: [PATCH 3/4] package_ipk.bbclass: use common function to write relationship fields

Quoted 9 lines · Andreas Oberritter

* A function write_dep_field() was added to do_package_ipk() to ensure explode_deps is called for every field and to simplify the code.

* The following statement was removed from do_package_ipk():

 if not '-locale-' and not '-dbg' and not '-dev' in pkgname:
     rdepends.append('%s-locale*' % pkgname)

Quoted 6 lines

 It was added in November 2008, but can never evaluate to true.

 See commit a045dfacf6f2541e0f410d9d109581f181303756

Signature · 3 lines
Otavio Salvador                             O.S. Systems
E-mail: [email protected]  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
#5 lore raw

PATCH 4/4 gitpkgv.bbclass: rename git_drop_tag_prefix to fix conflict

In reply to Andreas Oberritter

* fixes ERROR: Error Method already seen: git_drop_tag_prefix in 'gitver.bbclass' now in 'gitpkgv.bbclass'

---
 classes/gitpkgv.bbclass |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
classes/gitpkgv.bbclass +2 -2
index d4b8287..bedceb9 100644
@@ -40,7 +40,7 @@
 GITPKGV = "${@get_git_pkgv(d, False)}"
 GITPKGVTAG = "${@get_git_pkgv(d, True)}"
 
-def git_drop_tag_prefix(version):
+def gitpkgv_drop_tag_prefix(version):
     import re
     if re.match("v\d", version):
         return version[1:]
@@ -71,7 +71,7 @@ def get_git_pkgv(d, use_tags):
 
 			if use_tags:
 				try:
-					ver = git_drop_tag_prefix(bb.fetch.runfetchcmd("git describe %s 2>/dev/null" % rev, d, quiet=True).strip())
+					ver = gitpkgv_drop_tag_prefix(bb.fetch.runfetchcmd("git describe %s 2>/dev/null" % rev, d, quiet=True).strip())
 				except Exception:
 					ver = "0.0-%s-g%s" % (commits, rev[:7])
 			else:
Signature · 1 line
1.7.2.3
Acked-by on v1 4/4
#6 lore raw

Re: [PATCH 4/4] gitpkgv.bbclass: rename git_drop_tag_prefix to fix conflict

Quoted 5 lines · Andreas Oberritter

* fixes ERROR: Error Method already seen: git_drop_tag_prefix in 'gitver.bbclass' now in 'gitpkgv.bbclass'

Signature · 3 lines
Otavio Salvador                             O.S. Systems
E-mail: [email protected]  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
Acked-by on v1 1/4
#7 lore raw
In reply to Andreas Oberritter
Quoted 10 lines · Andreas Oberritter

* explode_deps() changed its behavior to omit version information when the function was removed from OE in favor of BitBake's implementation in March 2010. Since then, packages didn't contain versioned runtime dependencies.

 See commit 89b7e433719f43f1c36c76cb8856d559014e99bc

* This patch restores the previous implementation of explode_deps(), thus fixing the generation of versioned runtime dependencies.

Quoted 8 lines

* Reimplementing explode_deps() using bb.utils.explode_dep_versions() didn't work, because it choked upon parsing inline python code, e.g. on update-modules_1.0.bb

's RDEPENDS_${PN} field.

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics