From 1c7d6584a7811b7785ae5c1e378f14b5ba0971cf Mon Sep 17 00:00:00 2001 From: takeshi_hoshina Date: Mon, 2 Nov 2020 11:07:33 +0900 Subject: basesystem-jj recipes --- external/poky/bitbake/lib/bb/remotedata.py | 61 +++--------------------------- 1 file changed, 5 insertions(+), 56 deletions(-) (limited to 'external/poky/bitbake/lib/bb/remotedata.py') diff --git a/external/poky/bitbake/lib/bb/remotedata.py b/external/poky/bitbake/lib/bb/remotedata.py index 68ecffc1..6c9864dd 100644 --- a/external/poky/bitbake/lib/bb/remotedata.py +++ b/external/poky/bitbake/lib/bb/remotedata.py @@ -6,18 +6,8 @@ Provides support for using a datastore from the bitbake client # Copyright (C) 2016 Intel Corporation # -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as -# published by the Free Software Foundation. +# SPDX-License-Identifier: GPL-2.0-only # -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. import bb.data @@ -27,16 +17,16 @@ class RemoteDatastores: self.cooker = cooker self.datastores = {} self.locked = [] + self.datastores[0] = self.cooker.data self.nextindex = 1 def __len__(self): return len(self.datastores) def __getitem__(self, key): - if key is None: - return self.cooker.data - else: - return self.datastores[key] + # Cooker could have changed its datastore from under us + self.datastores[0] = self.cooker.data + return self.datastores[key] def items(self): return self.datastores.items() @@ -73,44 +63,3 @@ class RemoteDatastores: raise Exception('Tried to release locked datastore %d' % idx) del self.datastores[idx] - def receive_datastore(self, remote_data): - """Receive a datastore object sent from the client (as prepared by transmit_datastore())""" - dct = dict(remote_data) - d = bb.data_smart.DataSmart() - d.dict = dct - while True: - if '_remote_data' in dct: - dsindex = dct['_remote_data']['_content'] - del dct['_remote_data'] - if dsindex is None: - dct['_data'] = self.cooker.data.dict - else: - dct['_data'] = self.datastores[dsindex].dict - break - elif '_data' in dct: - idct = dict(dct['_data']) - dct['_data'] = idct - dct = idct - else: - break - return d - - @staticmethod - def transmit_datastore(d): - """Prepare a datastore object for sending over IPC from the client end""" - # FIXME content might be a dict, need to turn that into a list as well - def copy_dicts(dct): - if '_remote_data' in dct: - dsindex = dct['_remote_data']['_content'].dsindex - newdct = dct.copy() - newdct['_remote_data'] = {'_content': dsindex} - return list(newdct.items()) - elif '_data' in dct: - newdct = dct.copy() - newdata = copy_dicts(dct['_data']) - if newdata: - newdct['_data'] = newdata - return list(newdct.items()) - return None - main_dict = copy_dicts(d.dict) - return main_dict -- cgit 1.2.3-korg