From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it1-f171.google.com (mail-it1-f171.google.com [209.85.166.171]) by mail.openembedded.org (Postfix) with ESMTP id C851660107 for ; Mon, 21 Jan 2019 16:05:19 +0000 (UTC) Received: by mail-it1-f171.google.com with SMTP id c9so15858333itj.1 for ; Mon, 21 Jan 2019 08:05:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MLvNjkRtKpdM4nm/NtuiPC6KYUgIpSnwerV4xTUWzjU=; b=vgShDF8mqd6Fk/yKiq73NvkiYUI7tqBXyvxRIWPMdtQsXAlY7Ilq4BHYwSAYvSPBzr 5PqEOynXs74qt7Tpjg6GDQKRveXTBCJTTSxPFaC/O7JSjLh/RKjrLwM4a05Au60DvINj 0pFw0bOPwC6G6zajzAbyjL3DgDmrjXEldXeWBLb9OTeQR/4TOj34fs82XBqy8FAO2blq Mib5R8grukGrtv5gQs5V7jvkWtLPft8Nnsx+YYTvVRYl12Eq2LDlsF6rlkJViWkFrbUD 4gpyyxpKDbDgRGzU1rA/bTCfRTmZQlqUomu1GBAc9LWiSo/Q7Ihx7IOIUihWPQByPvAj qYWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MLvNjkRtKpdM4nm/NtuiPC6KYUgIpSnwerV4xTUWzjU=; b=n+PJES/edxced2MEtMhbLshjLAA6TOAWn6oz66BZvx3pM9ehdWzNNpUIam1+nbNraf xSHF5f+WDoRswVE+gso5zKejGNpfXB/q+VKjXmrpioaSpBONlnFZNPGkPP++j8VtpSnS Wlu0i/N1xB/t6Z+dcX7SjESnx/tFHCrZc14VDntj4RXWju6E9Vjt+Tg8aigJcoVLnHx/ KPpH/mxyuMsKR9yXESF88BB36/BePDyYGK+X3aH1QEZHx31tMfOngD7WabiICqdMEavG GPkiGmZ0ZP5lnrXcev8JPhenx/WsCZ5n5ZNGB1zAm3ApbZi4vbsk1re7ufAXWxvEa8gn QK3g== X-Gm-Message-State: AJcUukcISzeCmp/DvdUt7Vh5hPAt1xl73Pgan22Zm8FpGnQ9uyNwJrOq LcDMjxYmwigPvuvW8VELx/uMRmxX X-Google-Smtp-Source: ALg8bN4ZVAEdCPXOiLTm96p/VAwUyABed0+SeDTH72SAjZRGqD1PMOVHOlcaUlTAsJ3l3AuxOO2ztg== X-Received: by 2002:a24:1490:: with SMTP id 138mr1476itg.101.1548086720536; Mon, 21 Jan 2019 08:05:20 -0800 (PST) Received: from dargo.lpdev.prtdev.lexmark.com ([192.146.101.90]) by smtp.gmail.com with ESMTPSA id k2sm6430044itk.35.2019.01.21.08.05.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Jan 2019 08:05:19 -0800 (PST) From: Dan Dedrick X-Google-Original-From: Dan Dedrick To: openembedded-core@lists.openembedded.org Date: Mon, 21 Jan 2019 11:05:02 -0500 Message-Id: <20190121160502.64556-1-ddedrick@lexmark.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [PATCH] devtool: remove duplicate overrides X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 16:05:19 -0000 Content-Transfer-Encoding: 8bit DEVTOOL_EXTRA_OVERRIDES only needs one entry for each instance of overrides. Previous to these changes it would find every override to SRC_URI and add it to the list. This would duplicate instances where SRC_URI is modified multiple times with the same override like: SRC_URI_append_foo += "file://0001-foo.patch" SRC_URI_append_foo += "file://0002-bar.patch" A bbappend might also overwrite a SRC_URI override, which would also cause multiple instances to occur. When there are multiple instances of the same override in DEVTOOL_EXTRA_OVERRIDES it causes devtool modify to fail when creating override branches. The failure occurs when attempting to create the same override branch a second time and looks like this: The stack trace of python calls that resulted in this exception/failure was: File: 'exec_python_func() autogenerated', lineno: 2, function: 0001: *** 0002:devtool_post_patch(d) 0003: File: '/build/poky/meta/classes/devtool-source.bbclass', lineno: 202, function: devtool_post_patch 0198: 0199: for override in extra_override_list: 0200: localdata = bb.data.createCopy(d) 0201: if override in default_overrides: *** 0202: bb.process.run('git branch devtool-override-%s %s' % (override, devbranch), cwd=srcsubdir) 0203: else: 0204: # Reset back to the initial commit on a new branch 0205: bb.process.run('git checkout %s -b devtool-override-%s' % (initial_rev, override), cwd=srcsubdir) 0206: # Run do_patch function with the override applied File: '/build/poky/bitbake/lib/bb/process.py', lineno: 178, function: run 0174: if not stderr is None: 0175: stderr = stderr.decode("utf-8") 0176: 0177: if pipe.returncode != 0: *** 0178: raise ExecutionError(cmd, pipe.returncode, stdout, stderr) 0179: return stdout, stderr Exception: bb.process.ExecutionError: Execution of 'git branch devtool-override-foo devtool' failed with exit code 128: fatal: A branch named 'devtool-override-foo' already exists. Signed-off-by: Dan Dedrick --- scripts/lib/devtool/standard.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index d14b7a6543..a45ad36812 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -509,6 +509,11 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works if not 'flag' in event: if event['op'].startswith(('_append[', '_prepend[')): extra_overrides.append(event['op'].split('[')[1].split(']')[0]) + # We want to remove duplicate overrides. If a recipe had multiple + # SRC_URI_override += values it would cause mulitple instances of + # overrides. This doesn't play nicely with things like creating a + # branch for every instance of DEVTOOL_EXTRA_OVERRIDES. + extra_overrides = list(set(extra_overrides)) if extra_overrides: logger.info('SRC_URI contains some conditional appends/prepends - will create branches to represent these') -- 2.20.1