summaryrefslogtreecommitdiffstats
path: root/meta/classes/base.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r--meta/classes/base.bbclass92
1 files changed, 48 insertions, 44 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 299bf7bee2..d8853e5464 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -666,52 +666,56 @@ python read_subpackage_metadata () {
666 bb.data.setVar(key, sdata[key], d) 666 bb.data.setVar(key, sdata[key], d)
667} 667}
668 668
669python __anonymous () { 669def base_after_parse_two(d):
670 import exceptions 670 import bb
671 need_host = bb.data.getVar('COMPATIBLE_HOST', d, 1) 671 import exceptions
672 if need_host: 672 need_host = bb.data.getVar('COMPATIBLE_HOST', d, 1)
673 import re 673 if need_host:
674 this_host = bb.data.getVar('HOST_SYS', d, 1) 674 import re
675 if not re.match(need_host, this_host): 675 this_host = bb.data.getVar('HOST_SYS', d, 1)
676 raise bb.parse.SkipPackage("incompatible with host %s" % this_host) 676 if not re.match(need_host, this_host):
677 677 raise bb.parse.SkipPackage("incompatible with host %s" % this_host)
678 need_machine = bb.data.getVar('COMPATIBLE_MACHINE', d, 1) 678
679 if need_machine: 679 need_machine = bb.data.getVar('COMPATIBLE_MACHINE', d, 1)
680 import re 680 if need_machine:
681 this_machine = bb.data.getVar('MACHINE', d, 1) 681 import re
682 if this_machine and not re.match(need_machine, this_machine): 682 this_machine = bb.data.getVar('MACHINE', d, 1)
683 raise bb.parse.SkipPackage("incompatible with machine %s" % this_machine) 683 if this_machine and not re.match(need_machine, this_machine):
684 684 raise bb.parse.SkipPackage("incompatible with machine %s" % this_machine)
685 pn = bb.data.getVar('PN', d, 1) 685
686 686 pn = bb.data.getVar('PN', d, 1)
687 srcdate = bb.data.getVar('SRCDATE_%s' % pn, d, 1) 687
688 if srcdate != None: 688 srcdate = bb.data.getVar('SRCDATE_%s' % pn, d, 1)
689 bb.data.setVar('SRCDATE', srcdate, d) 689 if srcdate != None:
690 690 bb.data.setVar('SRCDATE', srcdate, d)
691 use_nls = bb.data.getVar('USE_NLS_%s' % pn, d, 1) 691
692 if use_nls != None: 692 use_nls = bb.data.getVar('USE_NLS_%s' % pn, d, 1)
693 bb.data.setVar('USE_NLS', use_nls, d) 693 if use_nls != None:
694} 694 bb.data.setVar('USE_NLS', use_nls, d)
695
696def base_after_parse(d):
697 import bb, os
698 mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1)
699 old_arch = bb.data.getVar('PACKAGE_ARCH', d, 1)
700 if (old_arch == mach_arch):
701 # Nothing to do
702 return
703 if (bb.data.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH', d, 1) == '0'):
704 return
705 paths = []
706 for p in [ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}" ]:
707 paths.append(bb.data.expand(os.path.join(p, mach_arch), d))
708 for s in bb.data.getVar('SRC_URI', d, 1).split():
709 local = bb.data.expand(bb.fetch.localpath(s, d), d)
710 for mp in paths:
711 if local.startswith(mp):
712 #bb.note("overriding PACKAGE_ARCH from %s to %s" % (old_arch, mach_arch))
713 bb.data.setVar('PACKAGE_ARCH', mach_arch, d)
714 return
695 715
696python () { 716python () {
697 import bb, os 717 base_after_parse_two(d)
698 mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1) 718 base_after_parse(d)
699 old_arch = bb.data.getVar('PACKAGE_ARCH', d, 1)
700 if (old_arch == mach_arch):
701 # Nothing to do
702 return
703 if (bb.data.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH', d, 1) == '0'):
704 return
705 paths = []
706 for p in [ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}" ]:
707 paths.append(bb.data.expand(os.path.join(p, mach_arch), d))
708 for s in bb.data.getVar('SRC_URI', d, 1).split():
709 local = bb.data.expand(bb.fetch.localpath(s, d), d)
710 for mp in paths:
711 if local.startswith(mp):
712# bb.note("overriding PACKAGE_ARCH from %s to %s" % (old_arch, mach_arch))
713 bb.data.setVar('PACKAGE_ARCH', mach_arch, d)
714 return
715} 719}
716 720
717# Patch handling 721# Patch handling