summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-03-03 10:41:41 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-03-05 10:22:36 -0800
commitd01dadfb87cfd2284b3e849d35a35fe5df0239c4 (patch)
tree10d3685054f38592b0c1a39452c0e65bc47b945b
parenta439d32dd843d10a9f65cc858b02422fac7deb50 (diff)
downloadpoky-d01dadfb87cfd2284b3e849d35a35fe5df0239c4.tar.gz
meta/classes: Convert to use appendVar and appendVarFlags
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/base.bbclass36
-rw-r--r--meta/classes/package.bbclass16
-rw-r--r--meta/classes/package_deb.bbclass6
-rw-r--r--meta/classes/package_ipk.bbclass6
-rw-r--r--meta/classes/package_rpm.bbclass6
-rw-r--r--meta/classes/sstate.bbclass8
-rw-r--r--meta/classes/toolchain-scripts.bbclass4
7 files changed, 24 insertions, 58 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 39d3e78e9b..cab56deb39 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -308,9 +308,7 @@ python () {
308 if not appends: 308 if not appends:
309 return 309 return
310 varname = bb.data.expand(varname, d) 310 varname = bb.data.expand(varname, d)
311 content = d.getVar(varname, False) or "" 311 d.appendVar(varname, " " + " ".join(appends))
312 content = content + " " + " ".join(appends)
313 d.setVar(varname, content)
314 312
315 extradeps = [] 313 extradeps = []
316 extrardeps = [] 314 extrardeps = []
@@ -363,14 +361,10 @@ python () {
363 if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('cross', d): 361 if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('cross', d):
364 d.setVarFlag('do_configure', 'umask', 022) 362 d.setVarFlag('do_configure', 'umask', 022)
365 d.setVarFlag('do_compile', 'umask', 022) 363 d.setVarFlag('do_compile', 'umask', 022)
366 deps = (d.getVarFlag('do_install', 'depends') or "").split() 364 d.appendVarFlag('do_install', 'depends', ' virtual/fakeroot-native:do_populate_sysroot')
367 deps.append('virtual/fakeroot-native:do_populate_sysroot')
368 d.setVarFlag('do_install', 'depends', " ".join(deps))
369 d.setVarFlag('do_install', 'fakeroot', 1) 365 d.setVarFlag('do_install', 'fakeroot', 1)
370 d.setVarFlag('do_install', 'umask', 022) 366 d.setVarFlag('do_install', 'umask', 022)
371 deps = (d.getVarFlag('do_package', 'depends') or "").split() 367 d.appendVarFlag('do_package', 'depends', ' virtual/fakeroot-native:do_populate_sysroot')
372 deps.append('virtual/fakeroot-native:do_populate_sysroot')
373 d.setVarFlag('do_package', 'depends', " ".join(deps))
374 d.setVarFlag('do_package', 'fakeroot', 1) 368 d.setVarFlag('do_package', 'fakeroot', 1)
375 d.setVarFlag('do_package', 'umask', 022) 369 d.setVarFlag('do_package', 'umask', 022)
376 d.setVarFlag('do_package_setscene', 'fakeroot', 1) 370 d.setVarFlag('do_package_setscene', 'fakeroot', 1)
@@ -408,40 +402,28 @@ python () {
408 srcuri = d.getVar('SRC_URI', 1) 402 srcuri = d.getVar('SRC_URI', 1)
409 # Svn packages should DEPEND on subversion-native 403 # Svn packages should DEPEND on subversion-native
410 if "svn://" in srcuri: 404 if "svn://" in srcuri:
411 depends = d.getVarFlag('do_fetch', 'depends') or "" 405 d.appendVarFlag('do_fetch', 'depends', ' subversion-native:do_populate_sysroot')
412 depends = depends + " subversion-native:do_populate_sysroot"
413 d.setVarFlag('do_fetch', 'depends', depends)
414 406
415 # Git packages should DEPEND on git-native 407 # Git packages should DEPEND on git-native
416 if "git://" in srcuri: 408 if "git://" in srcuri:
417 depends = d.getVarFlag('do_fetch', 'depends') or "" 409 d.appendVarFlag('do_fetch', 'depends', ' git-native:do_populate_sysroot')
418 depends = depends + " git-native:do_populate_sysroot"
419 d.setVarFlag('do_fetch', 'depends', depends)
420 410
421 # Mercurial packages should DEPEND on mercurial-native 411 # Mercurial packages should DEPEND on mercurial-native
422 elif "hg://" in srcuri: 412 elif "hg://" in srcuri:
423 depends = d.getVarFlag('do_fetch', 'depends') or "" 413 d.appendVarFlag('do_fetch', 'depends', ' mercurial-native:do_populate_sysroot')
424 depends = depends + " mercurial-native:do_populate_sysroot"
425 d.setVarFlag('do_fetch', 'depends', depends)
426 414
427 # OSC packages should DEPEND on osc-native 415 # OSC packages should DEPEND on osc-native
428 elif "osc://" in srcuri: 416 elif "osc://" in srcuri:
429 depends = d.getVarFlag('do_fetch', 'depends') or "" 417 d.appendVarFlag('do_fetch', 'depends', ' osc-native:do_populate_sysroot')
430 depends = depends + " osc-native:do_populate_sysroot"
431 d.setVarFlag('do_fetch', 'depends', depends)
432 418
433 # *.xz should depends on xz-native for unpacking 419 # *.xz should depends on xz-native for unpacking
434 # Not endswith because of "*.patch.xz;patch=1". Need bb.decodeurl in future 420 # Not endswith because of "*.patch.xz;patch=1". Need bb.decodeurl in future
435 if '.xz' in srcuri: 421 if '.xz' in srcuri:
436 depends = d.getVarFlag('do_unpack', 'depends') or "" 422 d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot')
437 depends = depends + " xz-native:do_populate_sysroot"
438 d.setVarFlag('do_unpack', 'depends', depends)
439 423
440 # unzip-native should already be staged before unpacking ZIP recipes 424 # unzip-native should already be staged before unpacking ZIP recipes
441 if ".zip" in srcuri: 425 if ".zip" in srcuri:
442 depends = d.getVarFlag('do_unpack', 'depends') or "" 426 d.appendVarFlag('do_unpack', 'depends', ' unzip-native:do_populate_sysroot')
443 depends = depends + " unzip-native:do_populate_sysroot"
444 d.setVarFlag('do_unpack', 'depends', depends)
445 427
446 # 'multimachine' handling 428 # 'multimachine' handling
447 mach_arch = d.getVar('MACHINE_ARCH', 1) 429 mach_arch = d.getVar('MACHINE_ARCH', 1)
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 91c4c6ee12..4ed6972a7c 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -153,12 +153,7 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst
153 the_files.append(aux_files_pattern_verbatim % m.group(1)) 153 the_files.append(aux_files_pattern_verbatim % m.group(1))
154 d.setVar('FILES_' + pkg, " ".join(the_files)) 154 d.setVar('FILES_' + pkg, " ".join(the_files))
155 if extra_depends != '': 155 if extra_depends != '':
156 the_depends = d.getVar('RDEPENDS_' + pkg, True) 156 d.appendVar('RDEPENDS_' + pkg, ' ' + extra_depends)
157 if the_depends:
158 the_depends = '%s %s' % (the_depends, extra_depends)
159 else:
160 the_depends = extra_depends
161 d.setVar('RDEPENDS_' + pkg, the_depends)
162 d.setVar('DESCRIPTION_' + pkg, description % on) 157 d.setVar('DESCRIPTION_' + pkg, description % on)
163 if postinst: 158 if postinst:
164 d.setVar('pkg_postinst_' + pkg, postinst) 159 d.setVar('pkg_postinst_' + pkg, postinst)
@@ -175,15 +170,14 @@ PACKAGE_DEPENDS += "file-native"
175 170
176python () { 171python () {
177 if d.getVar('PACKAGES', True) != '': 172 if d.getVar('PACKAGES', True) != '':
178 deps = d.getVarFlag('do_package', 'depends') or "" 173 deps = ""
179 for dep in (d.getVar('PACKAGE_DEPENDS', True) or "").split(): 174 for dep in (d.getVar('PACKAGE_DEPENDS', True) or "").split():
180 deps += " %s:do_populate_sysroot" % dep 175 deps += " %s:do_populate_sysroot" % dep
181 d.setVarFlag('do_package', 'depends', deps) 176 d.appendVarFlag('do_package', 'depends', deps)
182 177
183 deps = (d.getVarFlag('do_package', 'deptask') or "").split()
184 # shlibs requires any DEPENDS to have already packaged for the *.list files 178 # shlibs requires any DEPENDS to have already packaged for the *.list files
185 deps.append("do_package") 179 d.appendVarFlag('do_package', 'deptask', " do_package")
186 d.setVarFlag('do_package', 'deptask', " ".join(deps)) 180
187 elif not bb.data.inherits_class('image', d): 181 elif not bb.data.inherits_class('image', d):
188 d.setVar("PACKAGERDEPTASK", "") 182 d.setVar("PACKAGERDEPTASK", "")
189} 183}
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index fc28ee1e2d..8721fd2121 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -406,10 +406,8 @@ addtask do_package_write_deb_setscene
406 406
407python () { 407python () {
408 if d.getVar('PACKAGES', True) != '': 408 if d.getVar('PACKAGES', True) != '':
409 deps = (d.getVarFlag('do_package_write_deb', 'depends') or "").split() 409 deps = ' dpkg-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot'
410 deps.append('dpkg-native:do_populate_sysroot') 410 d.appendVarFlag('do_package_write_deb', 'depends', deps)
411 deps.append('virtual/fakeroot-native:do_populate_sysroot')
412 d.setVarFlag('do_package_write_deb', 'depends', " ".join(deps))
413 d.setVarFlag('do_package_write_deb', 'fakeroot', "1") 411 d.setVarFlag('do_package_write_deb', 'fakeroot', "1")
414 d.setVarFlag('do_package_write_deb_setscene', 'fakeroot', "1") 412 d.setVarFlag('do_package_write_deb_setscene', 'fakeroot', "1")
415 413
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index 36dedb9c61..e9d1ddcdbc 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -442,10 +442,8 @@ addtask do_package_write_ipk_setscene
442 442
443python () { 443python () {
444 if d.getVar('PACKAGES', True) != '': 444 if d.getVar('PACKAGES', True) != '':
445 deps = (d.getVarFlag('do_package_write_ipk', 'depends') or "").split() 445 deps = ' opkg-utils-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot'
446 deps.append('opkg-utils-native:do_populate_sysroot') 446 d.appendVarFlag('do_package_write_ipk', 'depends', deps)
447 deps.append('virtual/fakeroot-native:do_populate_sysroot')
448 d.setVarFlag('do_package_write_ipk', 'depends', " ".join(deps))
449 d.setVarFlag('do_package_write_ipk', 'fakeroot', "1") 447 d.setVarFlag('do_package_write_ipk', 'fakeroot', "1")
450 d.setVarFlag('do_package_write_ipk_setscene', 'fakeroot', "1") 448 d.setVarFlag('do_package_write_ipk_setscene', 'fakeroot', "1")
451} 449}
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index a813c8b59c..a264712f9e 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -1025,10 +1025,8 @@ python do_package_rpm () {
1025 1025
1026python () { 1026python () {
1027 if d.getVar('PACKAGES', True) != '': 1027 if d.getVar('PACKAGES', True) != '':
1028 deps = (d.getVarFlag('do_package_write_rpm', 'depends') or "").split() 1028 deps = ' rpm-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot'
1029 deps.append('rpm-native:do_populate_sysroot') 1029 d.appendVarFlag('do_package_write_rpm', 'depends', deps)
1030 deps.append('virtual/fakeroot-native:do_populate_sysroot')
1031 d.setVarFlag('do_package_write_rpm', 'depends', " ".join(deps))
1032 d.setVarFlag('do_package_write_rpm', 'fakeroot', 1) 1030 d.setVarFlag('do_package_write_rpm', 'fakeroot', 1)
1033 d.setVarFlag('do_package_write_rpm_setscene', 'fakeroot', 1) 1031 d.setVarFlag('do_package_write_rpm_setscene', 'fakeroot', 1)
1034} 1032}
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index d20b62a66e..b1cdf0f838 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -46,12 +46,8 @@ python () {
46 namemap = [] 46 namemap = []
47 for task in unique_tasks: 47 for task in unique_tasks:
48 namemap.append(d.getVarFlag(task, 'sstate-name')) 48 namemap.append(d.getVarFlag(task, 'sstate-name'))
49 funcs = d.getVarFlag(task, 'prefuncs') or "" 49 d.prependVarFlag(task, 'prefuncs', "sstate_task_prefunc ")
50 funcs = "sstate_task_prefunc " + funcs 50 d.appendVarFlag(task, 'postfuncs', " sstate_task_postfunc")
51 d.setVarFlag(task, 'prefuncs', funcs)
52 funcs = d.getVarFlag(task, 'postfuncs') or ""
53 funcs = funcs + " sstate_task_postfunc"
54 d.setVarFlag(task, 'postfuncs', funcs)
55 d.setVar('SSTATETASKNAMES', " ".join(namemap)) 51 d.setVar('SSTATETASKNAMES', " ".join(namemap))
56} 52}
57 53
diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass
index 6ca85d90ee..711efd39ab 100644
--- a/meta/classes/toolchain-scripts.bbclass
+++ b/meta/classes/toolchain-scripts.bbclass
@@ -143,10 +143,10 @@ toolchain_create_sdk_version () {
143toolchain_create_sdk_version[vardepsexclude] = "DATETIME" 143toolchain_create_sdk_version[vardepsexclude] = "DATETIME"
144 144
145python __anonymous () { 145python __anonymous () {
146 deps = d.getVarFlag('do_configure', 'depends') or "" 146 deps = ""
147 for dep in (d.getVar('TOOLCHAIN_NEED_CONFIGSITE_CACHE', True) or "").split(): 147 for dep in (d.getVar('TOOLCHAIN_NEED_CONFIGSITE_CACHE', True) or "").split():
148 deps += " %s:do_populate_sysroot" % dep 148 deps += " %s:do_populate_sysroot" % dep
149 if d.getVar('TCLIBC', True) is "uclibc": 149 if d.getVar('TCLIBC', True) is "uclibc":
150 deps += "uclibc:do_populate_sysroot" 150 deps += "uclibc:do_populate_sysroot"
151 d.setVarFlag('do_configure', 'depends', deps) 151 d.appendVarFlag('do_configure', 'depends', deps)
152} 152}