From patchwork Wed Aug 2 07:24:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 28299 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E055C001DF for ; Wed, 2 Aug 2023 07:24:47 +0000 (UTC) Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) by mx.groups.io with SMTP id smtpd.web11.9046.1690961083028594357 for ; Wed, 02 Aug 2023 00:24:43 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20221208 header.b=d1Alimwo; spf=pass (domain: gmail.com, ip: 209.85.208.51, mailfrom: alex.kanavin@gmail.com) Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-51e28cac164so1274301a12.1 for ; Wed, 02 Aug 2023 00:24:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690961081; x=1691565881; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=lG0LfdeJMx9zfPCNFEza95BQzqMAXcJd7ruyxUxXhpk=; b=d1AlimwouBUTJpQT6ij7NDSK4503QW0BAhiRpT2Bpw+2MkMl7q+r3U4QmfEGs0WTDC +blt/WPNeD6RocheK/Lod/R4z4sBnDrSeBUOtxK/XcnvRnL65Eulk8t8TxnosJoweTbD M1T8Rv2n9r1cFm5tUrl2gqFTZhw3LlyASoxJ8tQ2yjm4d/lN/HUzO/yFCn3mqhxw8rhQ i8x8iQTVvPya9SetxWtTgunuslUkv6qq49ZlHJNQ/DsoQqoTolALR5I3dFhOlWNx3uEA Yfxgdp2Ml9di74h/ZiNIn7z6J+UL143Qvt+9RiurRRQwV+VI7hxitiJPrYdVCl7ZkKcv ns9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690961081; x=1691565881; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lG0LfdeJMx9zfPCNFEza95BQzqMAXcJd7ruyxUxXhpk=; b=YTlowMlo0p1HDexupiiYYyA+V4/kKmt9e1wfrZDI/SyY8Brfa1sQ1o3cBgnoIJ3MLE om+kzBZZW0WBvLwR7y6mcm/hsxOug+JaP/rkGYvNlysjBGXNTXb7Nn3mpOY4L4KmywdZ C69JGTXiel/+N8sX3U4Z8noEXuyIUiiZ6do2R2hZf3WKs7sEcYTSJGWJtLj9VkRgjj05 3I0NXdeqTxS7b8F/SX9jc3pTrppnkIkyB5sAG6d8NyjOwDnYyBErpPH/zMxGXT49FUYN Ps8dtaZz/m/G1W6I9+hkhgzDVlLbzpttzOIVfgiVMYa6LhE7WtOrS3R02VNoS/m5iBU8 /Dvg== X-Gm-Message-State: ABy/qLaiIppqiBaKzoMRJg5asLa0Q6yN9fFIxQIMNOoDKQLzj6QxiYMs q997FD+1qnFcQ1XFa05W5iX9bkg7x0c= X-Google-Smtp-Source: APBJJlGx2etUUnSU9kstmRXNcJKHf56r4E0y+kOYk1Za5Ier7sUcpKZvsDGVd1lPEe/RBQD/dGWlnQ== X-Received: by 2002:a05:6402:358f:b0:51d:b184:efd with SMTP id y15-20020a056402358f00b0051db1840efdmr5772576edc.20.1690961081250; Wed, 02 Aug 2023 00:24:41 -0700 (PDT) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id q25-20020a056402033900b0052286e8dee1sm8022013edw.76.2023.08.02.00.24.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Aug 2023 00:24:40 -0700 (PDT) From: Alexander Kanavin X-Google-Original-From: Alexander Kanavin To: openembedded-core@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH 1/2] devtool/upgrade: raise an error if extracting source produces more than one directory Date: Wed, 2 Aug 2023 09:24:35 +0200 Message-Id: <20230802072436.1020900-1-alex@linutronix.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 02 Aug 2023 07:24:47 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/185378 This can happen if running unpack task produces unrelated files and directories (e.g. if recipe_qa or other tasks run); in this case it's better to stop, rather than allow devtool to continue and error out much later with a message that has nothing to do with where the problem originated. The idea here was to handle tarballs that don't contain a top level directory and thus the source tree is one level up; this basically never happens, and if it does we should find a less brittle way to handle such tarballs. Signed-off-by: Alexander Kanavin Tested-by: Tim Orling --- scripts/lib/devtool/upgrade.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py index 6c4a62b5584..e015a85982c 100644 --- a/scripts/lib/devtool/upgrade.py +++ b/scripts/lib/devtool/upgrade.py @@ -35,6 +35,8 @@ def _get_srctree(tmpdir): dirs = scriptutils.filter_src_subdirs(tmpdir) if len(dirs) == 1: srctree = os.path.join(tmpdir, dirs[0]) + else: + raise DevtoolError("Cannot determine where the source tree is after unpacking in {}: {}".format(tmpdir,dirs)) return srctree def _copy_source_code(orig, dest): From patchwork Wed Aug 2 07:24:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 28300 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F620C41513 for ; Wed, 2 Aug 2023 07:24:47 +0000 (UTC) Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) by mx.groups.io with SMTP id smtpd.web10.9206.1690961083850974739 for ; Wed, 02 Aug 2023 00:24:44 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20221208 header.b=qOpc9wbB; spf=pass (domain: gmail.com, ip: 209.85.208.46, mailfrom: alex.kanavin@gmail.com) Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-5221f3affe4so8752894a12.0 for ; Wed, 02 Aug 2023 00:24:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690961082; x=1691565882; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=z2SxVA7S9soWrP8hC6jqhcBT3v3B3tZw7haHOwUnJb4=; b=qOpc9wbBwaVl0jnZyeuhhSxXPkQSztXHzZYnReQjSILCewOIwhBESChTahcuqYrmBa dlk7hrg+uRDJeOyoYv9XkmZsM1szqotgj52r39UAYcRadHALvSeXsTiMs4OPGPsTWo4T jxiKCaernA2xFZa/XCIH2xuORWMBuVDMptxhH1Dp1jLlBxA7OqMadNz6DwwpO2944Pdy I+ANWqVyP8hp7FsmO+25qZIaxerV1owRIP56nProQbq55GYUdLBWDXEaG3C1js69rrTP o9j4/aFSaXDRYnA1J917hKE3avIHbVKGTzmAXuEbeKrTvcxd2RSrY9MLe302EWxoh1PY mufA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690961082; x=1691565882; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z2SxVA7S9soWrP8hC6jqhcBT3v3B3tZw7haHOwUnJb4=; b=MaWqAUFlJ051Z5Sk5NLC9oJj6XXTLnUev1ufxJTXx6BwV8JJOeFEgs4AqlLi75vSVj Zcy0OdfQAxnjSAzBQvDICFPyXArhev6/zdSai6AJDnzHLPzQ/znHiNsS2BlfWwpnczPV RtYgAboFScQBQ8vEPota/ysIc1eLgM4qDfgXfN6MFtRywXRETBvLpbtxqCwC15LfVPDa Lz6kSkyKtWE+jOy8AsFDg02z34Wxb97s09gHbj0X2tFgHLDUYij0XPW6B8B/FCK/Lsra e9kp4YPoyrue0hETwlnj20rVicmSaIfR+cevqWxwkxXwpyQK3TOuQf2vC0odhQwkaxV8 9ynQ== X-Gm-Message-State: ABy/qLavwSxG8dadnFYcCCHPhW3viThIR8mX8V3hTcJOzOuJhPADK8iq t3snauAp7fntxrq/4DyTnAWWTOAJT6Y= X-Google-Smtp-Source: APBJJlEoOniEVlCzGC3mrxiR9buWI6RSVWDTMAR2OXcldrk0esMBJIvSpIMSa9DiGtv0Asy1F/ibig== X-Received: by 2002:aa7:d748:0:b0:518:6a99:cac3 with SMTP id a8-20020aa7d748000000b005186a99cac3mr4691670eds.31.1690961081787; Wed, 02 Aug 2023 00:24:41 -0700 (PDT) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id q25-20020a056402033900b0052286e8dee1sm8022013edw.76.2023.08.02.00.24.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Aug 2023 00:24:41 -0700 (PDT) From: Alexander Kanavin X-Google-Original-From: Alexander Kanavin To: openembedded-core@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH 2/2] scripts/lib/scriptutils.py: add recipe_qa artifacts to exclusion list in filter_src_subdirs() Date: Wed, 2 Aug 2023 09:24:36 +0200 Message-Id: <20230802072436.1020900-2-alex@linutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230802072436.1020900-1-alex@linutronix.de> References: <20230802072436.1020900-1-alex@linutronix.de> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 02 Aug 2023 07:24:47 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/185379 With newly added recipe_qa task, the function needs to filter out its output as well. The issue wouldn't appear in selftest because it's triggered by buildhistory and selftest disables that. Signed-off-by: Alexander Kanavin Tested-by: Tim Orling --- scripts/lib/scriptutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lib/scriptutils.py b/scripts/lib/scriptutils.py index f7c1bd9e4e2..f433106c9a8 100644 --- a/scripts/lib/scriptutils.py +++ b/scripts/lib/scriptutils.py @@ -277,6 +277,6 @@ def filter_src_subdirs(pth): Used by devtool and recipetool. """ dirlist = os.listdir(pth) - filterout = ['git.indirectionsymlink', 'source-date-epoch'] + filterout = ['git.indirectionsymlink', 'source-date-epoch', 'sstate-install-recipe_qa'] dirlist = [x for x in dirlist if x not in filterout] return dirlist