From f995e0a4f5a60f4a1b80449d8eb7f64d0efebfef Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Sat, 31 Mar 2007 20:15:44 +0000 Subject: classes/base.bbclass: Add checksum.py code to verify md5/sha256 sums on do_fetch This code uses the checksum.py from contrib/qa/checksum to verify md5sum and sha256 on do_fetch task. This code would even allow to checksum certain local patches. --- classes/base.bbclass | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) (limited to 'classes/base.bbclass') diff --git a/classes/base.bbclass b/classes/base.bbclass index 53139e19fa..1f1766cf11 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -10,6 +10,60 @@ def base_path_join(a, *p): path += '/' + b return path +# for MD5/SHA handling +def base_chk_load_parser(config_path): + import ConfigParser, os + parser = ConfigParser.ConfigParser() + if not len(parser.read(config_path)) == 1: + raise Exception("Can not open the '%s'" % config_path) + + return parser + +def base_chk_file(parser, pn, pv, src_uri, localpath): + import os + # Try PN-PV-SRC_URI first and then try PN-SRC_URI + # we rely on the get method to create errors + pn_pv_src = "%s-%s-%s" % (pn,pv,src_uri) + pn_src = "%s-%s" % (pn,src_uri) + if parser.has_section(pn_pv_src): + md5 = parser.get(pn_pv_src, "md5") + sha256 = parser.get(pn_pv_src, "sha256") + elif parser.has_section(pn_src): + md5 = parser.get(pn_src, "md5") + sha256 = parser.get(pn_src, "sha256") + else: + return False + #raise Exception("Can not find a section for '%s' '%s' and '%s'" % (pn,pv,src_uri)) + + # md5 and sha256 should be valid now + if not os.path.exists(localpath): + raise Exception("The path does not exist '%s'" % localpath) + + + # call md5(sum) and shasum + try: + md5pipe = os.popen('md5sum ' + localpath) + md5data = (md5pipe.readline().split() or [ "" ])[0] + md5pipe.close() + except OSError: + raise Exception("Executing md5sum failed") + + try: + shapipe = os.popen('shasum -a256 -p ' + localpath) + shadata = (shapipe.readline().split() or [ "" ])[0] + shapipe.close() + except OSError: + raise Exception("Executing shasum failed") + + if not md5 == md5data: + raise Exception("MD5 Sums do not match. Wanted: '%s' Got: '%s'" % (md5, md5data)) + + if not sha256 == shadata: + raise Exception("SHA256 Sums do not match. Wanted: '%s' Got: '%s'" % (sha256, shadata)) + + return True + + def base_dep_prepend(d): import bb; # @@ -402,6 +456,41 @@ python base_do_fetch() { except bb.fetch.FetchError: (type, value, traceback) = sys.exc_info() raise bb.build.FuncFailed("Fetch failed: %s" % value) + except bb.fetch.MD5SumError: + (type, value, traceback) = sys.exc_info() + raise bb.build.FuncFailed("MD5 failed: %s" % value) + except: + (type, value, traceback) = sys.exc_info() + raise bb.build.FuncFailed("Unknown fetch Error: %s" % value) + + + # Verify the SHA and MD5 sums we have in OE and check what do + # in + check_sum = bb.which(bb.data.getVar('BBPATH', d, True), "conf/checksums.ini") + if not check_sum: + bb.note("No conf/checksums.ini found, not checking checksums") + return + + try: + parser = base_chk_load_parser(ckeck_sum) + except: + bb.note("Creating the CheckSum parser failed") + return + + pv = bb.data.getVar('PV', d, True) + pn = bb.data.getVar('PN', d, True) + + # Check each URI + for url in src_uri.split(): + localpath = bb.fetch.localpath(url,localdata) + (type,host,path,_,_,_) = bb.decodeurl(url) + print type, host, path + uri = "%s://%s%s" % (type,host,path) + try: + if not base_chk_file(parser, pn, pv,uri, localpath): + bb.note("%s-%s-%s has no section, not checking URI" % pn,pv,uri) + except Exception, e: + raise bb.func.FuncFailed("Checksum of '%s' failed", uri) } addtask fetchall after do_fetch -- cgit v1.2.3 From 8e2d1b42f56902f87817efed2a8df169d31014a4 Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Sat, 31 Mar 2007 20:31:20 +0000 Subject: classes/base.bbclass: Make the checksum code work and test it with file-native conf/checksums.ini: Provide an example on how this can be used --- classes/base.bbclass | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'classes/base.bbclass') diff --git a/classes/base.bbclass b/classes/base.bbclass index 1f1766cf11..880295fc30 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -12,15 +12,16 @@ def base_path_join(a, *p): # for MD5/SHA handling def base_chk_load_parser(config_path): - import ConfigParser, os + import ConfigParser, os, bb parser = ConfigParser.ConfigParser() if not len(parser.read(config_path)) == 1: + bb.note("Can not open the '%s' ini file" % config_path) raise Exception("Can not open the '%s'" % config_path) return parser def base_chk_file(parser, pn, pv, src_uri, localpath): - import os + import os, bb # Try PN-PV-SRC_URI first and then try PN-SRC_URI # we rely on the get method to create errors pn_pv_src = "%s-%s-%s" % (pn,pv,src_uri) @@ -37,6 +38,7 @@ def base_chk_file(parser, pn, pv, src_uri, localpath): # md5 and sha256 should be valid now if not os.path.exists(localpath): + bb.note("The locapath does not exist '%s'" % localpath) raise Exception("The path does not exist '%s'" % localpath) @@ -56,9 +58,11 @@ def base_chk_file(parser, pn, pv, src_uri, localpath): raise Exception("Executing shasum failed") if not md5 == md5data: + bb.note("The MD5Sums did not match. Wanted: '%s' and Got: '%s'" % (md5,md5data)) raise Exception("MD5 Sums do not match. Wanted: '%s' Got: '%s'" % (md5, md5data)) if not sha256 == shadata: + bb.note("The SHA256 Sums do not match. Wanted: '%s' Got: '%s'" % (sha256,shadata)) raise Exception("SHA256 Sums do not match. Wanted: '%s' Got: '%s'" % (sha256, shadata)) return True @@ -472,7 +476,7 @@ python base_do_fetch() { return try: - parser = base_chk_load_parser(ckeck_sum) + parser = base_chk_load_parser(check_sum) except: bb.note("Creating the CheckSum parser failed") return @@ -484,13 +488,12 @@ python base_do_fetch() { for url in src_uri.split(): localpath = bb.fetch.localpath(url,localdata) (type,host,path,_,_,_) = bb.decodeurl(url) - print type, host, path uri = "%s://%s%s" % (type,host,path) try: - if not base_chk_file(parser, pn, pv,uri, localpath): - bb.note("%s-%s-%s has no section, not checking URI" % pn,pv,uri) - except Exception, e: - raise bb.func.FuncFailed("Checksum of '%s' failed", uri) + if not base_chk_file(parser, pn, pv,uri, localpath): + bb.note("%s-%s-%s has no section, not checking URI" % (pn,pv,uri)) + except Exception: + raise bb.build.FuncFailed("Checksum of '%s' failed" % uri) } addtask fetchall after do_fetch -- cgit v1.2.3 From afc9dea14ffb67902060f32fda79290727b74bec Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Sun, 1 Apr 2007 13:20:07 +0000 Subject: classes/base.bbclass: [ftp://ftp.trolltech.com/qt/source/qtopia-core-4.3.0beta.tar.gz] is good enough src_uri as section/groups are unique enough as well. Most of the time (almost always) scoping PN (or PN+PV) is not necessary and in this case the SRC_URI is good enough. Richard thank you for saying the obvious --- classes/base.bbclass | 3 +++ 1 file changed, 3 insertions(+) (limited to 'classes/base.bbclass') diff --git a/classes/base.bbclass b/classes/base.bbclass index 880295fc30..2ea5251609 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -32,6 +32,9 @@ def base_chk_file(parser, pn, pv, src_uri, localpath): elif parser.has_section(pn_src): md5 = parser.get(pn_src, "md5") sha256 = parser.get(pn_src, "sha256") + elif parser.has_section(src_uri): + md5 = parser.get(src_uri, "md5") + sha256 = parser.get(src_uri, "sha256") else: return False #raise Exception("Can not find a section for '%s' '%s' and '%s'" % (pn,pv,src_uri)) -- cgit v1.2.3 From 7870e6d52d38140b0789176e98aa658f8e52ed5a Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Sun, 1 Apr 2007 21:42:48 +0000 Subject: base.bbclass, sanity.bbclass: use sha256sum instead of shasum -a256 --- classes/base.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes/base.bbclass') diff --git a/classes/base.bbclass b/classes/base.bbclass index 2ea5251609..6f8196cf80 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -54,7 +54,7 @@ def base_chk_file(parser, pn, pv, src_uri, localpath): raise Exception("Executing md5sum failed") try: - shapipe = os.popen('shasum -a256 -p ' + localpath) + shapipe = os.popen('sha256sum -b ' + localpath) shadata = (shapipe.readline().split() or [ "" ])[0] shapipe.close() except OSError: -- cgit v1.2.3 From 745c67ffc5c79fe08cd5460ded6317d17517799a Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Mon, 2 Apr 2007 20:42:15 +0000 Subject: classes/base.bbclass: place shasum-native as the first package to build classes/base.bbclass: Make sure shasum-native does not depend on quilt classes/sanity.bbclass: No need to require sha256sum as we use oe_sha256sum packages/shasum: Change the name, make the -native version not have any deps --- classes/base.bbclass | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'classes/base.bbclass') diff --git a/classes/base.bbclass b/classes/base.bbclass index 6f8196cf80..6011790ebe 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -20,7 +20,7 @@ def base_chk_load_parser(config_path): return parser -def base_chk_file(parser, pn, pv, src_uri, localpath): +def base_chk_file(parser, pn, pv, src_uri, localpath, data): import os, bb # Try PN-PV-SRC_URI first and then try PN-SRC_URI # we rely on the get method to create errors @@ -54,7 +54,7 @@ def base_chk_file(parser, pn, pv, src_uri, localpath): raise Exception("Executing md5sum failed") try: - shapipe = os.popen('sha256sum -b ' + localpath) + shapipe = os.popen('PATH=%s oe_sha256sum %s' % (bb.data.getVar('PATH', data, True), localpath)) shadata = (shapipe.readline().split() or [ "" ])[0] shapipe.close() except OSError: @@ -78,16 +78,22 @@ def base_dep_prepend(d): # the case where host == build == target, for now we don't work in # that case though. # - deps = "" + if bb.data.getVar('PN', d, True) == "shasum-native": + deps = "" + else: + deps = "shasum-native " + + # INHIBIT_PATCH_TOOL don't apply the patch tool dependency + inhibit_patch = (bb.data.getVar("INHIBIT_PATCH_TOOL", d, True) == "1") or False # INHIBIT_DEFAULT_DEPS doesn't apply to the patch command. Whether or not # we need that built is the responsibility of the patch function / class, not # the application. patchdeps = bb.data.getVar("PATCHTOOL", d, 1) - if patchdeps: + if patchdeps and not inhibit_patch: patchdeps = "%s-native" % patchdeps if not patchdeps in bb.data.getVar("PROVIDES", d, 1): - deps = patchdeps + deps += patchdeps if not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d): if (bb.data.getVar('HOST_SYS', d, 1) != @@ -439,6 +445,7 @@ python base_do_mrproper() { addtask fetch do_fetch[dirs] = "${DL_DIR}" +do_fetch[depends] = "shasum-native:do_populate_staging" python base_do_fetch() { import sys @@ -493,7 +500,7 @@ python base_do_fetch() { (type,host,path,_,_,_) = bb.decodeurl(url) uri = "%s://%s%s" % (type,host,path) try: - if not base_chk_file(parser, pn, pv,uri, localpath): + if not base_chk_file(parser, pn, pv,uri, localpath, d): bb.note("%s-%s-%s has no section, not checking URI" % (pn,pv,uri)) except Exception: raise bb.build.FuncFailed("Checksum of '%s' failed" % uri) -- cgit v1.2.3 From 632770e8d2beca177f1e492f5940c0a66a84bb09 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 9 Apr 2007 22:16:40 +0000 Subject: base.bbclass: Merge two after parse functions --- classes/base.bbclass | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'classes/base.bbclass') diff --git a/classes/base.bbclass b/classes/base.bbclass index 6011790ebe..aa693cd4c6 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -798,9 +798,9 @@ python read_subpackage_metadata () { bb.data.setVar(key, sdata[key], d) } -def base_after_parse_two(d): - import bb - import exceptions +def base_after_parse(d): + import bb, os, exceptions + source_mirror_fetch = bb.data.getVar('SOURCE_MIRROR_FETCH', d, 0) if not source_mirror_fetch: need_host = bb.data.getVar('COMPATIBLE_HOST', d, 1) @@ -828,9 +828,6 @@ def base_after_parse_two(d): if use_nls != None: bb.data.setVar('USE_NLS', use_nls, d) -def base_after_parse(d): - import bb, os - # Make sure MACHINE *isn't* exported bb.data.delVarFlag('MACHINE', 'export', d) bb.data.setVarFlag('MACHINE', 'unexport', 1, d) @@ -855,7 +852,6 @@ def base_after_parse(d): python () { - base_after_parse_two(d) base_after_parse(d) } -- cgit v1.2.3 From 1a7cff6077b770083062952ef6f6f7517bfd2c07 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 18 Apr 2007 21:22:03 +0000 Subject: classes: Add support for intertask dependencies to be specified, needed for correct operation with bitbake 1.8.x. Old behaviour is maintained in a special legacy anonymous function in base.bbclass. The patch is an improved version of the one discussed on the mailing list. --- classes/base.bbclass | 66 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 19 deletions(-) (limited to 'classes/base.bbclass') diff --git a/classes/base.bbclass b/classes/base.bbclass index aa693cd4c6..d78bd3cec3 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -78,22 +78,9 @@ def base_dep_prepend(d): # the case where host == build == target, for now we don't work in # that case though. # + deps = "shasum-native " if bb.data.getVar('PN', d, True) == "shasum-native": deps = "" - else: - deps = "shasum-native " - - # INHIBIT_PATCH_TOOL don't apply the patch tool dependency - inhibit_patch = (bb.data.getVar("INHIBIT_PATCH_TOOL", d, True) == "1") or False - - # INHIBIT_DEFAULT_DEPS doesn't apply to the patch command. Whether or not - # we need that built is the responsibility of the patch function / class, not - # the application. - patchdeps = bb.data.getVar("PATCHTOOL", d, 1) - if patchdeps and not inhibit_patch: - patchdeps = "%s-native" % patchdeps - if not patchdeps in bb.data.getVar("PROVIDES", d, 1): - deps += patchdeps if not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d): if (bb.data.getVar('HOST_SYS', d, 1) != @@ -819,11 +806,6 @@ def base_after_parse(d): pn = bb.data.getVar('PN', d, 1) - # OBSOLETE in bitbake 1.7.4 - srcdate = bb.data.getVar('SRCDATE_%s' % pn, d, 1) - if srcdate != None: - bb.data.setVar('SRCDATE', srcdate, d) - use_nls = bb.data.getVar('USE_NLS_%s' % pn, d, 1) if use_nls != None: bb.data.setVar('USE_NLS', use_nls, d) @@ -850,8 +832,54 @@ def base_after_parse(d): bb.data.setVar('PACKAGE_ARCH', mach_arch, d) return +# +# Various backwards compatibility stuff to be removed +# when we switch to bitbake 1.8.2+ as a minimum version +# +def base_oldbitbake_workarounds(d): + import bb + from bb import __version__ + from distutils.version import LooseVersion + + if (LooseVersion(__version__) > "1.8.0"): + return + + pn = bb.data.getVar('PN', d, True) + srcdate = bb.data.getVar('SRCDATE_%s' % pn, d, True) + if srcdate != None: + bb.data.setVar('SRCDATE', srcdate, d) + depends = bb.data.getVar('DEPENDS', d, False) + patchdeps = bb.data.getVar("PATCHTOOL", d, True) + if patchdeps: + patchdeps = "%s-native " % patchdeps + if not patchdeps in bb.data.getVar("PROVIDES", d, True): + depends = patchdeps + depends + if bb.data.inherits_class('rootfs_ipk', d): + depends = "ipkg-native ipkg-utils-native fakeroot-native " + depends + if bb.data.inherits_class('rootfs_deb', d): + depends = "dpkg-native apt-native fakeroot-native " + depends + if bb.data.inherits_class('image', d): + depends = "makedevs-native " + depends + for type in (bb.data.getVar('IMAGE_FSTYPES', d, True) or "").split(): + deps = bb.data.getVar('IMAGE_DEPENDS_%s' % type, d) or "" + if deps: + depends = depends + " %s" % deps + for dep in (bb.data.getVar('EXTRA_IMAGEDEPENDS', d, True) or "").split(): + depends = depends + " %s" % dep + + packages = bb.data.getVar('PACKAGES', d, True) + if packages != '': + if bb.data.inherits_class('package_ipk', d): + depends = "ipkg-utils-native " + depends + if bb.data.inherits_class('package_deb', d): + depends = "dpkg-native " + depends + if bb.data.inherits_class('package', d): + depends = "${PACKAGE_DEPENDS} fakeroot-native" + depends + + bb.data.setVar('DEPENDS', depends, d) python () { + base_oldbitbake_workarounds(d) base_after_parse(d) } -- cgit v1.2.3 From ff81f5be6bc505a8597da1cd6b2ddf4e205eadf9 Mon Sep 17 00:00:00 2001 From: Martin Dietze Date: Thu, 19 Apr 2007 10:29:58 +0000 Subject: base.bbclass: fixed bug #2082 (Checksum doesn't expand "localpath" with "localdata") as proposed by bug reporter --- classes/base.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'classes/base.bbclass') diff --git a/classes/base.bbclass b/classes/base.bbclass index d78bd3cec3..1dd3a488b3 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -41,7 +41,7 @@ def base_chk_file(parser, pn, pv, src_uri, localpath, data): # md5 and sha256 should be valid now if not os.path.exists(localpath): - bb.note("The locapath does not exist '%s'" % localpath) + bb.note("The localpath does not exist '%s'" % localpath) raise Exception("The path does not exist '%s'" % localpath) @@ -483,7 +483,7 @@ python base_do_fetch() { # Check each URI for url in src_uri.split(): - localpath = bb.fetch.localpath(url,localdata) + localpath = bb.data.expand(bb.fetch.localpath(url, localdata), localdata) (type,host,path,_,_,_) = bb.decodeurl(url) uri = "%s://%s%s" % (type,host,path) try: -- cgit v1.2.3 From ed8a6dd0ff4503b51e1eb2bf94cec518f2ba0fe2 Mon Sep 17 00:00:00 2001 From: Thomas Kunze Date: Tue, 24 Apr 2007 20:15:45 +0000 Subject: base.bbclass: fix depency problem, closes #2137 (and some others) --- classes/base.bbclass | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'classes/base.bbclass') diff --git a/classes/base.bbclass b/classes/base.bbclass index 1dd3a488b3..36ccbd6438 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -804,6 +804,8 @@ def base_after_parse(d): if this_machine and not re.match(need_machine, this_machine): raise bb.parse.SkipPackage("incompatible with machine %s" % this_machine) + + pn = bb.data.getVar('PN', d, 1) use_nls = bb.data.getVar('USE_NLS_%s' % pn, d, 1) @@ -874,7 +876,7 @@ def base_oldbitbake_workarounds(d): if bb.data.inherits_class('package_deb', d): depends = "dpkg-native " + depends if bb.data.inherits_class('package', d): - depends = "${PACKAGE_DEPENDS} fakeroot-native" + depends + depends = "${PACKAGE_DEPENDS} fakeroot-native " + depends bb.data.setVar('DEPENDS', depends, d) -- cgit v1.2.3 From e085d81e48df8bdeec11ff552245a40dfa008889 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Thu, 26 Apr 2007 10:57:45 +0000 Subject: base.bbclass: add back a snipped of obsolete code to fix SRCDATES problems, seems to fix #2133 --- classes/base.bbclass | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'classes/base.bbclass') diff --git a/classes/base.bbclass b/classes/base.bbclass index 36ccbd6438..9752a1116c 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -807,6 +807,10 @@ def base_after_parse(d): pn = bb.data.getVar('PN', d, 1) + # OBSOLETE in bitbake 1.7.4 + srcdate = bb.data.getVar('SRCDATE_%s' % pn, d, 1) + if srcdate != None: + bb.data.setVar('SRCDATE', srcdate, d) use_nls = bb.data.getVar('USE_NLS_%s' % pn, d, 1) if use_nls != None: -- cgit v1.2.3 From 57df5bd6b9573d8c9b28e4c0f2d9615fdc390fcc Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Thu, 12 Jul 2007 20:08:32 +0000 Subject: =?UTF-8?q?classes/base.bbclass:=20Fallback=20to=20archive.apache.?= =?UTF-8?q?org=20for=20older=20versions=20(Patch=20from=20Jan=20'Shoragan'?= =?UTF-8?q?=20L=C3=BCbbe)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/base.bbclass | 1 + 1 file changed, 1 insertion(+) (limited to 'classes/base.bbclass') diff --git a/classes/base.bbclass b/classes/base.bbclass index 9752a1116c..d0083bdc54 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -953,6 +953,7 @@ ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://ftp.tux.org/pub/sites/vic ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://gd.tuwien.ac.at/utils/admin-tools/lsof/ ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://sunsite.ualberta.ca/pub/Mirror/lsof/ ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://the.wiretapped.net/pub/security/host-security/lsof/ +http://www.apache.org/dist http://archive.apache.org/dist } -- cgit v1.2.3 From 9e69cc753ec5d5a1a8d702356fad0e6e43ff6323 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sun, 29 Jul 2007 17:59:51 +0000 Subject: base.bbclass: Only take the slow path if SRC_URI_OVERRIDES_PACKAGE_ARCH is actually set to something --- classes/base.bbclass | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'classes/base.bbclass') diff --git a/classes/base.bbclass b/classes/base.bbclass index d0083bdc54..fec7622f18 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -825,8 +825,11 @@ def base_after_parse(d): if (old_arch == mach_arch): # Nothing to do return - if (bb.data.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH', d, 1) == '0'): + override = bb.data.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH', d, 1) + + if not override or override == '0': return + paths = [] for p in [ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}" ]: paths.append(bb.data.expand(os.path.join(p, mach_arch), d)) -- cgit v1.2.3 From 0adc9ee1289b5437b6386a44060117a8a5207f01 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 31 Jul 2007 15:57:04 +0000 Subject: base.bbclass: Remove warnings for older bitbake users --- classes/base.bbclass | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'classes/base.bbclass') diff --git a/classes/base.bbclass b/classes/base.bbclass index fec7622f18..5381d43e7b 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -892,6 +892,13 @@ python () { base_after_parse(d) } +# Remove me when we switch to bitbake 1.8.8 +def base_get_srcrev(d): + import bb + + if bb.fetch.get_srcrev: + return bb.fetch.get_srcrev(d) + return "NOT IMPLEMENTED" # Patch handling inherit patch -- cgit v1.2.3 From b9baf075d1e3d7d3334a6582f81f6ceb3492815e Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 1 Aug 2007 23:13:49 +0000 Subject: base.bbclass: Fix base_get_srcrev() --- classes/base.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes/base.bbclass') diff --git a/classes/base.bbclass b/classes/base.bbclass index 5381d43e7b..a81263a12a 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -896,7 +896,7 @@ python () { def base_get_srcrev(d): import bb - if bb.fetch.get_srcrev: + if hasattr(bb.fetch, "get_srcrev"): return bb.fetch.get_srcrev(d) return "NOT IMPLEMENTED" -- cgit v1.2.3 From 54060c2fe137390a12bd54d56f67c2999c06c64d Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 3 Aug 2007 16:49:23 +0000 Subject: base.bbclass: Add dependency on git-native for git packages --- classes/base.bbclass | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'classes/base.bbclass') diff --git a/classes/base.bbclass b/classes/base.bbclass index a81263a12a..45a0282265 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -820,6 +820,14 @@ def base_after_parse(d): bb.data.delVarFlag('MACHINE', 'export', d) bb.data.setVarFlag('MACHINE', 'unexport', 1, d) + # Git packages should DEPEND on git-native + srcuri = bb.data.getVar('SRC_URI', d, 1) + if "git://" in srcuri: + depends = bb.data.getVarFlag('do_fetch', 'depends', d) or "" + depends = depends + " git-native:do_populate_staging" + bb.data.setVarFlag('do_fetch', 'depends', depends, d) + + mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1) old_arch = bb.data.getVar('PACKAGE_ARCH', d, 1) if (old_arch == mach_arch): -- cgit v1.2.3 From 525301d9a28061d71fb7e013759f3e5a185d2b46 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 8 Aug 2007 21:42:19 +0000 Subject: base.bbclass: Tweaks from Poky (extra comment, lib handling bugfix to not clobber a variable name and unset DISTRO (to unbreak setting DISTRO as an environment variable) --- classes/base.bbclass | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'classes/base.bbclass') diff --git a/classes/base.bbclass b/classes/base.bbclass index 45a0282265..1294e41c65 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -82,6 +82,9 @@ def base_dep_prepend(d): if bb.data.getVar('PN', d, True) == "shasum-native": deps = "" + # INHIBIT_DEFAULT_DEPS doesn't apply to the patch command. Whether or not + # we need that built is the responsibility of the patch function / class, not + # the application. if not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d): if (bb.data.getVar('HOST_SYS', d, 1) != bb.data.getVar('BUILD_SYS', d, 1)): @@ -272,8 +275,12 @@ oe_libinstall() { # If such file doesn't exist, try to cut version suffix if [ ! -f "$lafile" ]; then - libname=`echo "$libname" | sed 's/-[0-9.]*$//'` - lafile=$libname.la + libname1=`echo "$libname" | sed 's/-[0-9.]*$//'` + lafile1=$libname.la + if [ -f "$lafile1" ]; then + libname=$libname1 + lafile=$lafile1 + fi fi if [ -f "$lafile" ]; then @@ -807,6 +814,7 @@ def base_after_parse(d): pn = bb.data.getVar('PN', d, 1) + # OBSOLETE in bitbake 1.7.4 srcdate = bb.data.getVar('SRCDATE_%s' % pn, d, 1) if srcdate != None: @@ -816,9 +824,15 @@ def base_after_parse(d): if use_nls != None: bb.data.setVar('USE_NLS', use_nls, d) - # Make sure MACHINE *isn't* exported + # Make sure MACHINE isn't exported + # (breaks binutils at least) bb.data.delVarFlag('MACHINE', 'export', d) bb.data.setVarFlag('MACHINE', 'unexport', 1, d) + + # Make sure DISTRO isn't exported + # (breaks sysvinit at least) + bb.data.delVarFlag('DISTRO', 'export', d) + bb.data.setVarFlag('DISTRO', 'unexport', 1, d) # Git packages should DEPEND on git-native srcuri = bb.data.getVar('SRC_URI', d, 1) @@ -826,7 +840,6 @@ def base_after_parse(d): depends = bb.data.getVarFlag('do_fetch', 'depends', d) or "" depends = depends + " git-native:do_populate_staging" bb.data.setVarFlag('do_fetch', 'depends', depends, d) - mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1) old_arch = bb.data.getVar('PACKAGE_ARCH', d, 1) -- cgit v1.2.3