aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Oberritter <obi@opendreambox.org>2011-02-11 20:51:42 +0000
committerMartin Jansa <Martin.Jansa@gmail.com>2011-04-22 16:41:55 +0200
commit5ec95b9a12527693f18537db953433628510fbc7 (patch)
tree8d1fe7e34a6d6740e3b30319adc1869228d57487
parent7df2e6c19a165ed7972b1856f1de9e289d32725d (diff)
downloadopenembedded-5ec95b9a12527693f18537db953433628510fbc7.zip
openembedded-5ec95b9a12527693f18537db953433628510fbc7.tar.gz
openembedded-5ec95b9a12527693f18537db953433628510fbc7.tar.bz2
package_ipk.bbclass: use common function to write relationship fields
* 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 Signed-off-by: Andreas Oberritter <obi@opendreambox.org> Acked-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Tom Rini <tom_rini@mentor.com>
-rw-r--r--classes/package_ipk.bbclass34
1 files changed, 12 insertions, 22 deletions
diff --git a/classes/package_ipk.bbclass b/classes/package_ipk.bbclass
index 5d388da..c6544af 100644
--- a/classes/package_ipk.bbclass
+++ b/classes/package_ipk.bbclass
@@ -249,28 +249,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()))