summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2008-03-03 22:58:30 +0000
committerRichard Purdie <richard@openedhand.com>2008-03-03 22:58:30 +0000
commit1a59c52aec5f98c73541e9475d69cfe705bd978a (patch)
treef7b48525730e45d1d9ba094ac4a497c5464f0a93 /meta
parent39a089a3e7e07945bdf1b36cfc40a982e9adba40 (diff)
downloadpoky-1a59c52aec5f98c73541e9475d69cfe705bd978a.tar.gz
base.bbclass: Sync with OE
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3894 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/base.bbclass61
1 files changed, 38 insertions, 23 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 5067dfbea0..ed0fced858 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -85,7 +85,7 @@ def base_chk_file(parser, pn, pv, src_uri, localpath, data):
85 85
86 86
87def base_dep_prepend(d): 87def base_dep_prepend(d):
88 import bb; 88 import bb
89 # 89 #
90 # Ideally this will check a flag so we will operate properly in 90 # Ideally this will check a flag so we will operate properly in
91 # the case where host == build == target, for now we don't work in 91 # the case where host == build == target, for now we don't work in
@@ -128,6 +128,14 @@ def base_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
128 else: 128 else:
129 return falsevalue 129 return falsevalue
130 130
131def base_version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
132 import bb
133 result = bb.vercmp(bb.data.getVar(variable,d,True), checkvalue)
134 if result <= 0:
135 return truevalue
136 else:
137 return falsevalue
138
131def base_contains(variable, checkvalues, truevalue, falsevalue, d): 139def base_contains(variable, checkvalues, truevalue, falsevalue, d):
132 import bb 140 import bb
133 matches = 0 141 matches = 0
@@ -405,7 +413,6 @@ python do_listtasks() {
405addtask clean 413addtask clean
406do_clean[dirs] = "${TOPDIR}" 414do_clean[dirs] = "${TOPDIR}"
407do_clean[nostamp] = "1" 415do_clean[nostamp] = "1"
408do_clean[bbdepcmd] = ""
409python base_do_clean() { 416python base_do_clean() {
410 """clear the build and temp directories""" 417 """clear the build and temp directories"""
411 dir = bb.data.expand("${WORKDIR}", d) 418 dir = bb.data.expand("${WORKDIR}", d)
@@ -418,27 +425,24 @@ python base_do_clean() {
418 os.system('rm -f '+ dir) 425 os.system('rm -f '+ dir)
419} 426}
420 427
428addtask rebuild after do_${BB_DEFAULT_TASK}
421addtask rebuild 429addtask rebuild
422do_rebuild[dirs] = "${TOPDIR}" 430do_rebuild[dirs] = "${TOPDIR}"
423do_rebuild[nostamp] = "1" 431do_rebuild[nostamp] = "1"
424do_rebuild[bbdepcmd] = ""
425python base_do_rebuild() { 432python base_do_rebuild() {
426 """rebuild a package""" 433 """rebuild a package"""
427 bb.build.exec_task('do_clean', d)
428 bb.build.exec_task('do_' + bb.data.getVar('BB_DEFAULT_TASK', d, 1), d)
429} 434}
430 435
431addtask mrproper 436addtask mrproper
432do_mrproper[dirs] = "${TOPDIR}" 437do_mrproper[dirs] = "${TOPDIR}"
433do_mrproper[nostamp] = "1" 438do_mrproper[nostamp] = "1"
434do_mrproper[bbdepcmd] = ""
435python base_do_mrproper() { 439python base_do_mrproper() {
436 """clear downloaded sources, build and temp directories""" 440 """clear downloaded sources, build and temp directories"""
437 dir = bb.data.expand("${DL_DIR}", d) 441 dir = bb.data.expand("${DL_DIR}", d)
438 if dir == '/': bb.build.FuncFailed("wrong DATADIR") 442 if dir == '/': bb.build.FuncFailed("wrong DATADIR")
439 bb.debug(2, "removing " + dir) 443 bb.debug(2, "removing " + dir)
440 os.system('rm -rf ' + dir) 444 os.system('rm -rf ' + dir)
441 bb.build.exec_task('do_clean', d) 445 bb.build.exec_func('do_clean', d)
442} 446}
443 447
444addtask fetch 448addtask fetch
@@ -532,7 +536,7 @@ def oe_unpack_file(file, data, url = None):
532 cmd = 'tar x --no-same-owner -f %s' % file 536 cmd = 'tar x --no-same-owner -f %s' % file
533 elif file.endswith('.tgz') or file.endswith('.tar.gz') or file.endswith('.tar.Z'): 537 elif file.endswith('.tgz') or file.endswith('.tar.gz') or file.endswith('.tar.Z'):
534 cmd = 'tar xz --no-same-owner -f %s' % file 538 cmd = 'tar xz --no-same-owner -f %s' % file
535 elif file.endswith('.tbz') or file.endswith('.tar.bz2'): 539 elif file.endswith('.tbz') or file.endswith('.tbz2') or file.endswith('.tar.bz2'):
536 cmd = 'bzip2 -dc %s | tar x --no-same-owner -f -' % file 540 cmd = 'bzip2 -dc %s | tar x --no-same-owner -f -' % file
537 elif file.endswith('.gz') or file.endswith('.Z') or file.endswith('.z'): 541 elif file.endswith('.gz') or file.endswith('.Z') or file.endswith('.z'):
538 cmd = 'gzip -dc %s > %s' % (file, efile) 542 cmd = 'gzip -dc %s > %s' % (file, efile)
@@ -673,6 +677,17 @@ python base_eventhandler() {
673 if pesteruser: 677 if pesteruser:
674 bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser)) 678 bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser))
675 679
680 #
681 # Handle removing stamps for 'rebuild' task
682 #
683 if name.startswith("StampUpdate"):
684 for (fn, task) in e.targets:
685 #print "%s %s" % (task, fn)
686 if task == "do_rebuild":
687 dir = "%s.*" % e.stampPrefix[fn]
688 bb.note("Removing stamps: " + dir)
689 os.system('rm -f '+ dir)
690
676 if not data in e.__dict__: 691 if not data in e.__dict__:
677 return NotHandled 692 return NotHandled
678 693
@@ -687,7 +702,6 @@ python base_eventhandler() {
687 702
688addtask configure after do_unpack do_patch 703addtask configure after do_unpack do_patch
689do_configure[dirs] = "${S} ${B}" 704do_configure[dirs] = "${S} ${B}"
690do_configure[bbdepcmd] = "do_populate_staging"
691do_configure[deptask] = "do_populate_staging" 705do_configure[deptask] = "do_populate_staging"
692base_do_configure() { 706base_do_configure() {
693 : 707 :
@@ -695,7 +709,6 @@ base_do_configure() {
695 709
696addtask compile after do_configure 710addtask compile after do_configure
697do_compile[dirs] = "${S} ${B}" 711do_compile[dirs] = "${S} ${B}"
698do_compile[bbdepcmd] = "do_populate_staging"
699base_do_compile() { 712base_do_compile() {
700 if [ -e Makefile -o -e makefile ]; then 713 if [ -e Makefile -o -e makefile ]; then
701 oe_runmake || die "make failed" 714 oe_runmake || die "make failed"
@@ -826,6 +839,20 @@ python read_subpackage_metadata () {
826 bb.data.setVar(key, sdata[key], d) 839 bb.data.setVar(key, sdata[key], d)
827} 840}
828 841
842# Make sure MACHINE isn't exported
843# (breaks binutils at least)
844MACHINE[unexport] = "1"
845
846# Make sure TARGET_ARCH isn't exported
847# (breaks Makefiles using implicit rules, e.g. quilt, as GNU make has this
848# in them, undocumented)
849TARGET_ARCH[unexport] = "1"
850
851# Make sure DISTRO isn't exported
852# (breaks sysvinit at least)
853DISTRO[unexport] = "1"
854
855
829def base_after_parse(d): 856def base_after_parse(d):
830 import bb, os, exceptions 857 import bb, os, exceptions
831 858
@@ -845,8 +872,6 @@ def base_after_parse(d):
845 if this_machine and not re.match(need_machine, this_machine): 872 if this_machine and not re.match(need_machine, this_machine):
846 raise bb.parse.SkipPackage("incompatible with machine %s" % this_machine) 873 raise bb.parse.SkipPackage("incompatible with machine %s" % this_machine)
847 874
848
849
850 pn = bb.data.getVar('PN', d, 1) 875 pn = bb.data.getVar('PN', d, 1)
851 876
852 # OBSOLETE in bitbake 1.7.4 877 # OBSOLETE in bitbake 1.7.4
@@ -858,16 +883,6 @@ def base_after_parse(d):
858 if use_nls != None: 883 if use_nls != None:
859 bb.data.setVar('USE_NLS', use_nls, d) 884 bb.data.setVar('USE_NLS', use_nls, d)
860 885
861 # Make sure MACHINE isn't exported
862 # (breaks binutils at least)
863 bb.data.delVarFlag('MACHINE', 'export', d)
864 bb.data.setVarFlag('MACHINE', 'unexport', 1, d)
865
866 # Make sure DISTRO isn't exported
867 # (breaks sysvinit at least)
868 bb.data.delVarFlag('DISTRO', 'export', d)
869 bb.data.setVarFlag('DISTRO', 'unexport', 1, d)
870
871 # Git packages should DEPEND on git-native 886 # Git packages should DEPEND on git-native
872 srcuri = bb.data.getVar('SRC_URI', d, 1) 887 srcuri = bb.data.getVar('SRC_URI', d, 1)
873 if "git://" in srcuri: 888 if "git://" in srcuri:
@@ -897,7 +912,7 @@ def base_after_parse(d):
897 if len(paths) == 0: 912 if len(paths) == 0:
898 return 913 return
899 914
900 for s in bb.data.getVar('SRC_URI', d, 1).split(): 915 for s in srcuri.split():
901 if not s.startswith("file://"): 916 if not s.startswith("file://"):
902 continue 917 continue
903 local = bb.data.expand(bb.fetch.localpath(s, d), d) 918 local = bb.data.expand(bb.fetch.localpath(s, d), d)