From 4204309872da5cb401cbb2729d9e2d4869a87f42 Mon Sep 17 00:00:00 2001 From: takeshi_hoshina Date: Thu, 22 Oct 2020 14:58:56 +0900 Subject: agl-basesystem 0.1 --- external/poky/bitbake/bin/bitbake-worker | 8 +++++--- external/poky/bitbake/lib/bb/cookerdata.py | 6 +++++- external/poky/bitbake/lib/bb/fetch2/__init__.py | 7 ++++--- external/poky/bitbake/lib/bb/runqueue.py | 2 +- external/poky/bitbake/lib/bb/tests/fetch.py | 4 ++-- external/poky/bitbake/lib/bb/utils.py | 2 +- 6 files changed, 18 insertions(+), 11 deletions(-) (limited to 'external/poky/bitbake') diff --git a/external/poky/bitbake/bin/bitbake-worker b/external/poky/bitbake/bin/bitbake-worker index e925054b..0e669054 100755 --- a/external/poky/bitbake/bin/bitbake-worker +++ b/external/poky/bitbake/bin/bitbake-worker @@ -192,9 +192,6 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, append global worker_pipe_lock pipein.close() - signal.signal(signal.SIGTERM, sigterm_handler) - # Let SIGHUP exit as SIGTERM - signal.signal(signal.SIGHUP, sigterm_handler) bb.utils.signal_on_parent_exit("SIGTERM") # Save out the PID so that the event can include it the @@ -209,6 +206,11 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, append # This ensures signals sent to the controlling terminal like Ctrl+C # don't stop the child processes. os.setsid() + + signal.signal(signal.SIGTERM, sigterm_handler) + # Let SIGHUP exit as SIGTERM + signal.signal(signal.SIGHUP, sigterm_handler) + # No stdin newsi = os.open(os.devnull, os.O_RDWR) os.dup2(newsi, sys.stdin.fileno()) diff --git a/external/poky/bitbake/lib/bb/cookerdata.py b/external/poky/bitbake/lib/bb/cookerdata.py index 5df66e61..d9887c71 100644 --- a/external/poky/bitbake/lib/bb/cookerdata.py +++ b/external/poky/bitbake/lib/bb/cookerdata.py @@ -26,6 +26,7 @@ import logging import os import re import sys +import hashlib from functools import wraps import bb from bb import data @@ -279,6 +280,7 @@ class CookerDataBuilder(object): self.mcdata = {} def parseBaseConfiguration(self): + data_hash = hashlib.sha256() try: bb.parse.init_parser(self.basedata) self.data = self.parseConfigurationFiles(self.prefiles, self.postfiles) @@ -302,7 +304,7 @@ class CookerDataBuilder(object): bb.event.fire(bb.event.ConfigParsed(), self.data) bb.parse.init_parser(self.data) - self.data_hash = self.data.get_hash() + data_hash.update(self.data.get_hash().encode('utf-8')) self.mcdata[''] = self.data multiconfig = (self.data.getVar("BBMULTICONFIG") or "").split() @@ -310,9 +312,11 @@ class CookerDataBuilder(object): mcdata = self.parseConfigurationFiles(self.prefiles, self.postfiles, config) bb.event.fire(bb.event.ConfigParsed(), mcdata) self.mcdata[config] = mcdata + data_hash.update(mcdata.get_hash().encode('utf-8')) if multiconfig: bb.event.fire(bb.event.MultiConfigParsed(self.mcdata), self.data) + self.data_hash = data_hash.hexdigest() except (SyntaxError, bb.BBHandledException): raise bb.BBHandledException except bb.data_smart.ExpansionError as e: diff --git a/external/poky/bitbake/lib/bb/fetch2/__init__.py b/external/poky/bitbake/lib/bb/fetch2/__init__.py index 709372e1..03e56471 100644 --- a/external/poky/bitbake/lib/bb/fetch2/__init__.py +++ b/external/poky/bitbake/lib/bb/fetch2/__init__.py @@ -966,7 +966,8 @@ def rename_bad_checksum(ud, suffix): new_localpath = "%s_bad-checksum_%s" % (ud.localpath, suffix) bb.warn("Renaming %s to %s" % (ud.localpath, new_localpath)) - bb.utils.movefile(ud.localpath, new_localpath) + if not bb.utils.movefile(ud.localpath, new_localpath): + bb.warn("Renaming %s to %s failed, grep movefile in log.do_fetch to see why" % (ud.localpath, new_localpath)) def try_mirror_url(fetch, origud, ud, ld, check = False): @@ -1596,7 +1597,7 @@ class Fetch(object): fn = d.getVar('FILE') mc = d.getVar('__BBMULTICONFIG') or "" if cache and fn and mc + fn in urldata_cache: - self.ud = urldata_cache[mc + fn] + self.ud = urldata_cache[mc + fn + str(id(d))] for url in urls: if url not in self.ud: @@ -1608,7 +1609,7 @@ class Fetch(object): pass if fn and cache: - urldata_cache[mc + fn] = self.ud + urldata_cache[mc + fn + str(id(d))] = self.ud def localpath(self, url): if url not in self.urls: diff --git a/external/poky/bitbake/lib/bb/runqueue.py b/external/poky/bitbake/lib/bb/runqueue.py index 383c1832..0f2fdcee 100644 --- a/external/poky/bitbake/lib/bb/runqueue.py +++ b/external/poky/bitbake/lib/bb/runqueue.py @@ -2109,8 +2109,8 @@ class RunQueueExecuteTasks(RunQueueExecute): deps = self.rqdata.runtaskentries[revdep].depends provides = self.rqdata.dataCaches[mc].fn_provides[taskfn] taskhash = self.rqdata.runtaskentries[revdep].hash - taskdepdata[revdep] = [pn, taskname, fn, deps, provides, taskhash] deps = self.filtermcdeps(task, deps) + taskdepdata[revdep] = [pn, taskname, fn, deps, provides, taskhash] for revdep2 in deps: if revdep2 not in taskdepdata: additional.append(revdep2) diff --git a/external/poky/bitbake/lib/bb/tests/fetch.py b/external/poky/bitbake/lib/bb/tests/fetch.py index 9c71207f..57376c44 100644 --- a/external/poky/bitbake/lib/bb/tests/fetch.py +++ b/external/poky/bitbake/lib/bb/tests/fetch.py @@ -1128,8 +1128,8 @@ class FetchLatestVersionTest(FetcherTest): # packages with valid UPSTREAM_CHECK_URI and UPSTREAM_CHECK_REGEX ("cups", "http://www.cups.org/software/1.7.2/cups-1.7.2-source.tar.bz2", "https://github.com/apple/cups/releases", "(?Pcups\-)(?P((\d+[\.\-_]*)+))\-source\.tar\.gz") : "2.0.0", - ("db", "http://download.oracle.com/berkeley-db/db-5.3.21.tar.gz", "http://www.oracle.com/technetwork/products/berkeleydb/downloads/index-082944.html", "http://download.oracle.com/otn/berkeley-db/(?Pdb-)(?P((\d+[\.\-_]*)+))\.tar\.gz") - : "6.1.19", + ("db", "http://download.oracle.com/berkeley-db/db-5.3.21.tar.gz", "http://ftp.debian.org/debian/pool/main/d/db5.3/", "(?Pdb5\.3_)(?P\d+(\.\d+)+).+\.orig\.tar\.xz") + : "5.3.10", } @skipIfNoNetwork() diff --git a/external/poky/bitbake/lib/bb/utils.py b/external/poky/bitbake/lib/bb/utils.py index 215c18cf..f5bd816c 100644 --- a/external/poky/bitbake/lib/bb/utils.py +++ b/external/poky/bitbake/lib/bb/utils.py @@ -796,7 +796,7 @@ def movefile(src, dest, newmtime = None, sstat = None): os.rename(src, destpath) renamefailed = 0 except Exception as e: - if e[0] != errno.EXDEV: + if e.errno != errno.EXDEV: # Some random error. print("movefile: Failed to move", src, "to", dest, e) return None -- cgit 1.2.3-korg