From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Thu, 7 Jul 2016 12:21:44 -0600 Subject: [U-Boot] [PATCH 08/11] buildman: Avoid overwriting existing toolchain entries In-Reply-To: <1467580467-19186-9-git-send-email-sjg@chromium.org> References: <1467580467-19186-1-git-send-email-sjg@chromium.org> <1467580467-19186-9-git-send-email-sjg@chromium.org> Message-ID: <577E9DB8.60501@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 07/03/2016 03:14 PM, Simon Glass wrote: > The current code for setting up the toolchain config always writes the new > paths to an item called 'toolchain'. This means that it will overwrite any > existing toolchain item with the same name. In practice, this means that: > > buildman --fetch-arch all > > will fetch all toolchains, but only the path of the final one will be added > to the config. This normally works out OK, since most toolchains are the > same version (e.g. gcc 4.9) and will be found on the same path. But it is > not correct and toolchains for archs which don't use the same version will > not function as expected. > > Adjust the code to use unique names for each toolchain path entry. > diff --git a/tools/buildman/bsettings.py b/tools/buildman/bsettings.py > +def GetItemsAsDict(section): > + """Get the items from a section of the config. > + > + Args: > + section: name of section to retrieve > + > + Returns: > + Dict: > + key: name of item > + value: value of item > + """ > + try: > + items = {} > + for item in settings.items(section): > + items[item[0]] = item[1] Aren't those last 3 lines equivalent to: items = dict(settings.items(section))