From patchwork Sat Feb 10 13:15:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 39154 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 BAF39C4829A for ; Sat, 10 Feb 2024 13:17:41 +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.13253.1707571060164353623 for ; Sat, 10 Feb 2024 05:17:40 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RA+yu7Vr; spf=pass (domain: gmail.com, ip: 209.85.208.51, mailfrom: adrian.freihofer@gmail.com) Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-557dcb0f870so2509369a12.2 for ; Sat, 10 Feb 2024 05:17:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707571058; x=1708175858; darn=lists.openembedded.org; 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=bnQhLxw+yNMEQmtOkEbRwEjPHfeGOzi68EDWJzOgaho=; b=RA+yu7VrwggyciR/BdpnA2R4S74syeM8jxIzo7TbjhSypGcMf2wwG0K00+Yphby91i qKu1Z3bsDHjJ82brrKCY82PpGxCEdbDUtftRy4u7bfO+mrVg1asvulRLadV3zgwDAp1O TWLeZ2hDzXEsCzreMoDV6d/tiPLoehSpyDUv6J5aPxd94VWEhPP4x5KQsNsm+MAYjJ4t 2EKlRLDOvyh7sr8tkHL5b41+XlOPX9hRY9tSWuqJscHkcOtx8sKgbd7QGVdbumP0J40T 6/gpzrr6jP0RQqrKwPcX+Ph/hv8+yqGca5kH6dO/lsaEkuhUAGxPQqe26Bzl4cwyj50b Q32A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707571058; x=1708175858; 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=bnQhLxw+yNMEQmtOkEbRwEjPHfeGOzi68EDWJzOgaho=; b=JaIJn9Z3EftikDEj9taZBwBOO0OyYqWTohrUPDdidsYQL3/s42lpvAoJa+WO3heLhJ 2vhgW2Dq3Lc1nG8V1G5ailqZ/hxtGwfdpI9t7CpkmfyCPjDzWziYrD5+tOOnFIJrKVI1 hWd6//88XFGch/aXj/PTbMYenIIccjw83NY3JucGmDZAqlQg5innnD0P6li0d82JWFBb /KuhA94sm2GJ6GYEFN/hUo61VsJIRn0KzALWfJco3/qHbldPmtfI5f2MBvm3w+UFzo7G SHdCmLPc35g5h33m6jeEFUUcqGuLqkYZaaJDmOK8IvciZ95d0R9h8iZGrFEh65EREfEY VCJw== X-Gm-Message-State: AOJu0YwAZbZLLDJwJFIjmZT3pLkEngWTcSaBGMsyDrZmk+4qZvUTGaL7 1IXqvo5IA1qH0adsLe+BrgDu9SNwS8JNFX1m+Z1e8yTLmH29MXPcWolF66MU X-Google-Smtp-Source: AGHT+IGEFqbB2res1QVCpvwI/wj0bYOA+uDTLUYqVXEIK3oAggueHMfLPBVRxjtF536BzMKz1sE94w== X-Received: by 2002:a17:906:57d5:b0:a3c:3b07:28f0 with SMTP id u21-20020a17090657d500b00a3c3b0728f0mr740891ejr.45.1707571058196; Sat, 10 Feb 2024 05:17:38 -0800 (PST) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id hu20-20020a170907a09400b00a3bd0742a94sm1793064ejc.9.2024.02.10.05.17.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 05:17:37 -0800 (PST) From: Adrian Freihofer X-Google-Original-From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 1/7] oeqa/selftest/oelib/buildhistory: git default branch Date: Sat, 10 Feb 2024 14:15:53 +0100 Message-ID: <20240210131727.342583-2-adrian.freihofer@siemens.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240210131727.342583-1-adrian.freihofer@siemens.com> References: <20240210131727.342583-1-adrian.freihofer@siemens.com> 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 ; Sat, 10 Feb 2024 13:17:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/195265 On hosts with git defaulting to main branch the following exception occures: File .../buildhistory.py", line 99, in test_compare_dict_blobs_default blob1 = self.repo.heads.master.commit.tree.blobs[0] ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/git/util.py", line 1114, in __getattr__ return list.__getattribute__(self, attr) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'IterableList' object has no attribute 'master' Support main and master branch for these test cases. Note: setting the default branch with --initial-branch requires git version 2.28 or later. Some of the still supported host distros do not provide this feature yet. Signed-off-by: Adrian Freihofer --- .../oeqa/selftest/cases/oelib/buildhistory.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py b/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py index c3c15d83c0f..042ccdd2b48 100644 --- a/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py +++ b/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py @@ -30,6 +30,16 @@ class TestBlobParsing(OESelftestTestCase): import shutil shutil.rmtree(self.repo_path) + @property + def heads_default(self): + """ + Support repos defaulting to master or to main branch + """ + try: + return self.repo.heads.main + except AttributeError: + return self.repo.heads.master + def commit_vars(self, to_add={}, to_remove = [], msg="A commit message"): if len(to_add) == 0 and len(to_remove) == 0: return @@ -67,10 +77,10 @@ class TestBlobParsing(OESelftestTestCase): changesmap = { "foo-2" : ("2", "8"), "bar" : ("","4"), "bar-2" : ("","5")} self.commit_vars(to_add = { "foo" : "1", "foo-2" : "2", "foo-3" : "3" }) - blob1 = self.repo.heads.master.commit.tree.blobs[0] + blob1 = self.heads_default.commit.tree.blobs[0] self.commit_vars(to_add = { "foo-2" : "8", "bar" : "4", "bar-2" : "5" }) - blob2 = self.repo.heads.master.commit.tree.blobs[0] + blob2 = self.heads_default.commit.tree.blobs[0] change_records = compare_dict_blobs(os.path.join(self.repo_path, self.test_file), blob1, blob2, False, False) @@ -86,10 +96,10 @@ class TestBlobParsing(OESelftestTestCase): defaultmap = { x : ("default", "1") for x in ["PKG", "PKGE", "PKGV", "PKGR"]} self.commit_vars(to_add = { "foo" : "1" }) - blob1 = self.repo.heads.master.commit.tree.blobs[0] + blob1 = self.heads_default.commit.tree.blobs[0] self.commit_vars(to_add = { "PKG" : "1", "PKGE" : "1", "PKGV" : "1", "PKGR" : "1" }) - blob2 = self.repo.heads.master.commit.tree.blobs[0] + blob2 = self.heads_default.commit.tree.blobs[0] change_records = compare_dict_blobs(os.path.join(self.repo_path, self.test_file), blob1, blob2, False, False) From patchwork Sat Feb 10 13:15:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 39155 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 C961FC48260 for ; Sat, 10 Feb 2024 13:17:41 +0000 (UTC) Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) by mx.groups.io with SMTP id smtpd.web11.13254.1707571061011648316 for ; Sat, 10 Feb 2024 05:17:41 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PXV3XRij; spf=pass (domain: gmail.com, ip: 209.85.208.43, mailfrom: adrian.freihofer@gmail.com) Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-560037b6975so2037003a12.2 for ; Sat, 10 Feb 2024 05:17:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707571059; x=1708175859; darn=lists.openembedded.org; 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=P3XrAxcdMl31guSRoakDHxZm3cOa2wMib4uu+cit44M=; b=PXV3XRij4MEEQ2zsgmGQRwnTwktfLOSVH47eFc0kMAJ6+QCgF/ftlLU5vRdzKIaCqq ZZx9V+O6Qb5/aWor40Ryc7hzQgKUKGjFHil+qY9WZ8hovgRsh5ny8lN7AZQ+iBjU2FQZ oQTObR5/zscF2k2ze1CtW/fgz6ulhyOoZm0MfQqf96J6KUe8A0CgtFG1eCYNTrtKS47t YQzYPQxuQZaQv8SURoflKVfCGGXg+dpZ4rYubOAJ9hhqLOTw4BpcAIPklCZziiWhuDZQ SJbfocJgjRg8CFQcsE9UD14gIOHPo/pMUdA7xBstZKSkNeV3qEZDOFhHdLff0vPO1KcH mAZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707571059; x=1708175859; 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=P3XrAxcdMl31guSRoakDHxZm3cOa2wMib4uu+cit44M=; b=EFIajo2N+60i/zs8CS+RcTto5UzC+B0EOniGYidVWWNzkN8Kro+Tkzl6GsR/NSmbiS REv8ka4nlVNa70la5rAxsNXujQxNzKk8fNW8IQ7gL6JlBVN+425jZ0TtalJ1l0iyKIEm W4liJoUfJFc6wIS7ovbHAFWRHnKa4FzY44w67aLL+TfW3Hu/Mn3p3s+H1vyW1lE3IQHm SSNNVFfQ6H1CM0IrfX/u/1Pp1RgLJcXpeamFn50yEc+y9Gct6zMlFPHTwYb39nuuEUUS ORvcvHwA7xlvYXPo0RG0KSwqSD+y7zFV2vX/LMWJUUZ1Q92s+WoRE+Mozm5cU3iieqLI mKww== X-Gm-Message-State: AOJu0Yw/CW2C10G4ooxPlcwkvul7ZhnVtZHqUEiLYrN1KHoNsD3c9AkA 6uyw4/khHlkh4IUtlxYGK45PzqID6dU6/Qs4ba6422MBKwAHLuX23E4Sg2+M X-Google-Smtp-Source: AGHT+IFsYzJiXLnbhuQjPUpELU2dUg/8dHjYaJvZNe4xnypNDtkurniUOBePD/vAjLCi1VKtZ1SfOw== X-Received: by 2002:a17:906:eb0e:b0:a3c:44c2:6f85 with SMTP id mb14-20020a170906eb0e00b00a3c44c26f85mr713677ejb.59.1707571058850; Sat, 10 Feb 2024 05:17:38 -0800 (PST) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id hu20-20020a170907a09400b00a3bd0742a94sm1793064ejc.9.2024.02.10.05.17.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 05:17:38 -0800 (PST) From: Adrian Freihofer X-Google-Original-From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 2/7] scripts: python 3.12 regex Date: Sat, 10 Feb 2024 14:15:54 +0100 Message-ID: <20240210131727.342583-3-adrian.freihofer@siemens.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240210131727.342583-1-adrian.freihofer@siemens.com> References: <20240210131727.342583-1-adrian.freihofer@siemens.com> 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 ; Sat, 10 Feb 2024 13:17:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/195266 All the regexes throw a warning like this: WARNING: scripts/lib/recipetool/create_buildsys.py:140: SyntaxWarning: invalid escape sequence '\s' proj_re = re.compile('project\s*\(([^)]*)\)', re.IGNORECASE) Python 3 interprets string literals as Unicode strings, and therefore \s is treated as an escaped Unicode character which is not correct. Declaring the RegEx pattern as a raw string instead of unicode is required for Python 3. Signed-off-by: Adrian Freihofer --- scripts/combo-layer | 2 +- scripts/contrib/bbvars.py | 6 ++-- scripts/contrib/convert-overrides.py | 8 ++--- scripts/lib/checklayer/__init__.py | 4 +-- scripts/lib/recipetool/create.py | 12 +++---- scripts/lib/recipetool/create_buildsys.py | 38 +++++++++++------------ scripts/oe-check-sstate | 2 +- scripts/oe-pkgdata-util | 2 +- scripts/opkg-query-helper.py | 2 +- scripts/patchtest-get-branch | 2 +- 10 files changed, 39 insertions(+), 39 deletions(-) diff --git a/scripts/combo-layer b/scripts/combo-layer index 2312cef9ac1..4a715914aff 100755 --- a/scripts/combo-layer +++ b/scripts/combo-layer @@ -483,7 +483,7 @@ def check_repo_clean(repodir): exit if repo is dirty """ output=runcmd("git status --porcelain", repodir) - r = re.compile('\?\? patch-.*/') + r = re.compile(r'\?\? patch-.*/') dirtyout = [item for item in output.splitlines() if not r.match(item)] if dirtyout: logger.error("git repo %s is dirty, please fix it first", repodir) diff --git a/scripts/contrib/bbvars.py b/scripts/contrib/bbvars.py index 090133600b6..a9cdf082ab9 100755 --- a/scripts/contrib/bbvars.py +++ b/scripts/contrib/bbvars.py @@ -36,8 +36,8 @@ def bbvar_is_documented(var, documented_vars): def collect_documented_vars(docfiles): ''' Walk the docfiles and collect the documented variables ''' documented_vars = [] - prog = re.compile(".*($|[^A-Z_])') + prog = re.compile(r".*($|[^A-Z_])') for d in docfiles: with open(d) as f: documented_vars += var_prog.findall(f.read()) @@ -45,7 +45,7 @@ def collect_documented_vars(docfiles): return documented_vars def bbvar_doctag(var, docconf): - prog = re.compile('^%s\[doc\] *= *"(.*)"' % (var)) + prog = re.compile(r'^%s\[doc\] *= *"(.*)"' % (var)) if docconf == "": return "?" diff --git a/scripts/contrib/convert-overrides.py b/scripts/contrib/convert-overrides.py index 1939757f1bc..c69acb4095a 100755 --- a/scripts/contrib/convert-overrides.py +++ b/scripts/contrib/convert-overrides.py @@ -81,19 +81,19 @@ skip_ext = [".html", ".patch", ".m4", ".diff"] + args.skip_ext vars_re = {} for exp in vars: - vars_re[exp] = (re.compile('((^|[#\'"\s\-\+])[A-Za-z0-9_\-:${}\.]+)_' + exp), r"\1:" + exp) + vars_re[exp] = (re.compile(r'((^|[#\'"\s\-\+])[A-Za-z0-9_\-:${}\.]+)_' + exp), r"\1:" + exp) shortvars_re = {} for exp in shortvars: - shortvars_re[exp] = (re.compile('((^|[#\'"\s\-\+])[A-Za-z0-9_\-:${}\.]+)_' + exp + '([\(\'"\s:])'), r"\1:" + exp + r"\3") + shortvars_re[exp] = (re.compile(r'((^|[#\'"\s\-\+])[A-Za-z0-9_\-:${}\.]+)_' + exp + r'([\(\'"\s:])'), r"\1:" + exp + r"\3") package_re = {} for exp in packagevars: - package_re[exp] = (re.compile('(^|[#\'"\s\-\+]+)' + exp + '_' + '([$a-z"\'\s%\[<{\\\*].)'), r"\1" + exp + r":\2") + package_re[exp] = (re.compile(r'(^|[#\'"\s\-\+]+)' + exp + r'_' + r'([$a-z"\'\s%\[<{\\\*].)'), r"\1" + exp + r":\2") # Other substitutions to make subs = { - 'r = re.compile("([^:]+):\s*(.*)")' : 'r = re.compile("(^.+?):\s+(.*)")', + 'r = re.compile(r"([^:]+):\s*(.*)")' : 'r = re.compile(r"(^.+?):\s+(.*)")', "val = d.getVar('%s_%s' % (var, pkg))" : "val = d.getVar('%s:%s' % (var, pkg))", "f.write('%s_%s: %s\\n' % (var, pkg, encode(val)))" : "f.write('%s:%s: %s\\n' % (var, pkg, encode(val)))", "d.getVar('%s_%s' % (scriptlet_name, pkg))" : "d.getVar('%s:%s' % (scriptlet_name, pkg))", diff --git a/scripts/lib/checklayer/__init__.py b/scripts/lib/checklayer/__init__.py index 8271ed7fe3b..62ecdfe3906 100644 --- a/scripts/lib/checklayer/__init__.py +++ b/scripts/lib/checklayer/__init__.py @@ -324,8 +324,8 @@ def get_signatures(builddir, failsafe=False, machine=None, extravars=None): else: raise - sig_regex = re.compile("^(?P.*:.*):(?P.*) .$") - tune_regex = re.compile("(^|\s)SIGGEN_LOCKEDSIGS_t-(?P\S*)\s*=\s*") + sig_regex = re.compile(r"^(?P.*:.*):(?P.*) .$") + tune_regex = re.compile(r"(^|\s)SIGGEN_LOCKEDSIGS_t-(?P\S*)\s*=\s*") current_tune = None with open(sigs_file, 'r') as f: for line in f.readlines(): diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py index d2997cc2420..8e9ff38db6c 100644 --- a/scripts/lib/recipetool/create.py +++ b/scripts/lib/recipetool/create.py @@ -1166,12 +1166,12 @@ def crunch_license(licfile): # Note: these are carefully constructed! license_title_re = re.compile(r'^#*\(? *(This is )?([Tt]he )?.{0,15} ?[Ll]icen[sc]e( \(.{1,10}\))?\)?[:\.]? ?#*$') license_statement_re = re.compile(r'^((This (project|software)|.{1,10}) is( free software)? (released|licen[sc]ed)|(Released|Licen[cs]ed)) under the .{1,10} [Ll]icen[sc]e:?$') - copyright_re = re.compile('^ *[#\*]* *(Modified work |MIT LICENSED )?Copyright ?(\([cC]\))? .*$') - disclaimer_re = re.compile('^ *\*? ?All [Rr]ights [Rr]eserved\.$') - email_re = re.compile('^.*<[\w\.-]*@[\w\.\-]*>$') - header_re = re.compile('^(\/\**!?)? ?[\-=\*]* ?(\*\/)?$') - tag_re = re.compile('^ *@?\(?([Ll]icense|MIT)\)?$') - url_re = re.compile('^ *[#\*]* *https?:\/\/[\w\.\/\-]+$') + copyright_re = re.compile(r'^ *[#\*]* *(Modified work |MIT LICENSED )?Copyright ?(\([cC]\))? .*$') + disclaimer_re = re.compile(r'^ *\*? ?All [Rr]ights [Rr]eserved\.$') + email_re = re.compile(r'^.*<[\w\.-]*@[\w\.\-]*>$') + header_re = re.compile(r'^(\/\**!?)? ?[\-=\*]* ?(\*\/)?$') + tag_re = re.compile(r'^ *@?\(?([Ll]icense|MIT)\)?$') + url_re = re.compile(r'^ *[#\*]* *https?:\/\/[\w\.\/\-]+$') lictext = [] with open(licfile, 'r', errors='surrogateescape') as f: diff --git a/scripts/lib/recipetool/create_buildsys.py b/scripts/lib/recipetool/create_buildsys.py index d4b194f5679..ec9d510e233 100644 --- a/scripts/lib/recipetool/create_buildsys.py +++ b/scripts/lib/recipetool/create_buildsys.py @@ -137,15 +137,15 @@ class CmakeRecipeHandler(RecipeHandler): deps = [] unmappedpkgs = [] - proj_re = re.compile('project\s*\(([^)]*)\)', re.IGNORECASE) - pkgcm_re = re.compile('pkg_check_modules\s*\(\s*[a-zA-Z0-9-_]+\s*(REQUIRED)?\s+([^)\s]+)\s*\)', re.IGNORECASE) - pkgsm_re = re.compile('pkg_search_module\s*\(\s*[a-zA-Z0-9-_]+\s*(REQUIRED)?((\s+[^)\s]+)+)\s*\)', re.IGNORECASE) - findpackage_re = re.compile('find_package\s*\(\s*([a-zA-Z0-9-_]+)\s*.*', re.IGNORECASE) - findlibrary_re = re.compile('find_library\s*\(\s*[a-zA-Z0-9-_]+\s*(NAMES\s+)?([a-zA-Z0-9-_ ]+)\s*.*') - checklib_re = re.compile('check_library_exists\s*\(\s*([^\s)]+)\s*.*', re.IGNORECASE) - include_re = re.compile('include\s*\(\s*([^)\s]*)\s*\)', re.IGNORECASE) - subdir_re = re.compile('add_subdirectory\s*\(\s*([^)\s]*)\s*([^)\s]*)\s*\)', re.IGNORECASE) - dep_re = re.compile('([^ ><=]+)( *[<>=]+ *[^ ><=]+)?') + proj_re = re.compile(r'project\s*\(([^)]*)\)', re.IGNORECASE) + pkgcm_re = re.compile(r'pkg_check_modules\s*\(\s*[a-zA-Z0-9-_]+\s*(REQUIRED)?\s+([^)\s]+)\s*\)', re.IGNORECASE) + pkgsm_re = re.compile(r'pkg_search_module\s*\(\s*[a-zA-Z0-9-_]+\s*(REQUIRED)?((\s+[^)\s]+)+)\s*\)', re.IGNORECASE) + findpackage_re = re.compile(r'find_package\s*\(\s*([a-zA-Z0-9-_]+)\s*.*', re.IGNORECASE) + findlibrary_re = re.compile(r'find_library\s*\(\s*[a-zA-Z0-9-_]+\s*(NAMES\s+)?([a-zA-Z0-9-_ ]+)\s*.*') + checklib_re = re.compile(r'check_library_exists\s*\(\s*([^\s)]+)\s*.*', re.IGNORECASE) + include_re = re.compile(r'include\s*\(\s*([^)\s]*)\s*\)', re.IGNORECASE) + subdir_re = re.compile(r'add_subdirectory\s*\(\s*([^)\s]*)\s*([^)\s]*)\s*\)', re.IGNORECASE) + dep_re = re.compile(r'([^ ><=]+)( *[<>=]+ *[^ ><=]+)?') def find_cmake_package(pkg): RecipeHandler.load_devel_filemap(tinfoil.config_data) @@ -423,16 +423,16 @@ class AutotoolsRecipeHandler(RecipeHandler): 'makeinfo': 'texinfo', } - pkg_re = re.compile('PKG_CHECK_MODULES\(\s*\[?[a-zA-Z0-9_]*\]?,\s*\[?([^,\]]*)\]?[),].*') - pkgce_re = re.compile('PKG_CHECK_EXISTS\(\s*\[?([^,\]]*)\]?[),].*') - lib_re = re.compile('AC_CHECK_LIB\(\s*\[?([^,\]]*)\]?,.*') - libx_re = re.compile('AX_CHECK_LIBRARY\(\s*\[?[^,\]]*\]?,\s*\[?([^,\]]*)\]?,\s*\[?([a-zA-Z0-9-]*)\]?,.*') - progs_re = re.compile('_PROGS?\(\s*\[?[a-zA-Z0-9_]*\]?,\s*\[?([^,\]]*)\]?[),].*') - dep_re = re.compile('([^ ><=]+)( [<>=]+ [^ ><=]+)?') - ac_init_re = re.compile('AC_INIT\(\s*([^,]+),\s*([^,]+)[,)].*') - am_init_re = re.compile('AM_INIT_AUTOMAKE\(\s*([^,]+),\s*([^,]+)[,)].*') - define_re = re.compile('\s*(m4_)?define\(\s*([^,]+),\s*([^,]+)\)') - version_re = re.compile('([0-9.]+)') + pkg_re = re.compile(r'PKG_CHECK_MODULES\(\s*\[?[a-zA-Z0-9_]*\]?,\s*\[?([^,\]]*)\]?[),].*') + pkgce_re = re.compile(r'PKG_CHECK_EXISTS\(\s*\[?([^,\]]*)\]?[),].*') + lib_re = re.compile(r'AC_CHECK_LIB\(\s*\[?([^,\]]*)\]?,.*') + libx_re = re.compile(r'AX_CHECK_LIBRARY\(\s*\[?[^,\]]*\]?,\s*\[?([^,\]]*)\]?,\s*\[?([a-zA-Z0-9-]*)\]?,.*') + progs_re = re.compile(r'_PROGS?\(\s*\[?[a-zA-Z0-9_]*\]?,\s*\[?([^,\]]*)\]?[),].*') + dep_re = re.compile(r'([^ ><=]+)( [<>=]+ [^ ><=]+)?') + ac_init_re = re.compile(r'AC_INIT\(\s*([^,]+),\s*([^,]+)[,)].*') + am_init_re = re.compile(r'AM_INIT_AUTOMAKE\(\s*([^,]+),\s*([^,]+)[,)].*') + define_re = re.compile(r'\s*(m4_)?define\(\s*([^,]+),\s*([^,]+)\)') + version_re = re.compile(r'([0-9.]+)') defines = {} def subst_defines(value): diff --git a/scripts/oe-check-sstate b/scripts/oe-check-sstate index 4187e774581..0d171c44632 100755 --- a/scripts/oe-check-sstate +++ b/scripts/oe-check-sstate @@ -53,7 +53,7 @@ def check(args): cmd = ['bitbake', '--dry-run', '--runall=build'] + args.target output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, env=env) - task_re = re.compile('NOTE: Running setscene task [0-9]+ of [0-9]+ \(([^)]+)\)') + task_re = re.compile(r'NOTE: Running setscene task [0-9]+ of [0-9]+ \(([^)]+)\)') tasks = [] for line in output.decode('utf-8').splitlines(): res = task_re.match(line) diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util index 7412cc1f477..44ae40549ae 100755 --- a/scripts/oe-pkgdata-util +++ b/scripts/oe-pkgdata-util @@ -296,7 +296,7 @@ def package_info(args): extra = '' for line in f: for var in vars: - m = re.match(var + '(?::\S+)?:\s*(.+?)\s*$', line) + m = re.match(var + r'(?::\S+)?:\s*(.+?)\s*$', line) if m: vals[var] = m.group(1) pkg_version = vals['PKGV'] or '' diff --git a/scripts/opkg-query-helper.py b/scripts/opkg-query-helper.py index bc3ab43823a..084d9ef6845 100755 --- a/scripts/opkg-query-helper.py +++ b/scripts/opkg-query-helper.py @@ -29,7 +29,7 @@ for arg in sys.argv[1:]: args.append(arg) # Regex for removing version specs after dependency items -verregex = re.compile(' \([=<>]* [^ )]*\)') +verregex = re.compile(r' \([=<>]* [^ )]*\)') pkg = "" ver = "" diff --git a/scripts/patchtest-get-branch b/scripts/patchtest-get-branch index b5fb2b0f04d..c6e242f8b68 100755 --- a/scripts/patchtest-get-branch +++ b/scripts/patchtest-get-branch @@ -16,7 +16,7 @@ import argparse import re import git -re_prefix = re.compile("(\[.*\])", re.DOTALL) +re_prefix = re.compile(r"(\[.*\])", re.DOTALL) def get_branch(filepath_repo, filepath_mbox, default_branch): branch = None From patchwork Sat Feb 10 13:15:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 39157 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 A9A00C4829F for ; Sat, 10 Feb 2024 13:17:51 +0000 (UTC) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) by mx.groups.io with SMTP id smtpd.web11.13256.1707571062101626031 for ; Sat, 10 Feb 2024 05:17:42 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=QnoMn7/k; spf=pass (domain: gmail.com, ip: 209.85.208.170, mailfrom: adrian.freihofer@gmail.com) Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2d0d799b55cso23675321fa.0 for ; Sat, 10 Feb 2024 05:17:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707571059; x=1708175859; darn=lists.openembedded.org; 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=ssydrgK8pU3ak8xwbtLbq1Fj+EJVpCtOL+AElnez6M8=; b=QnoMn7/k1lK/WKXHy8aEEWJ9wUGv0xYzHEh458Ogqp9te0xMKq5IIcQnP243KfoRMg MiL1CM4nnGH9+zA5/OXa4qRXFeIctKboe/EVO/Il1s7qqiAgVazdaMaxvHQ9dLweQKUf ZLq/U0ZfCW8bqEt9epVxgti26HOPuT+xvuzPkmKkHAOS1/MmZSb1B4Jid0dIm/UIcwPq yyeOVBwmNPYMX1sAQAvXjGFEFSPk8uDrjm6b5VKJsKFS2qVKNky0dz3ET6ze93BCLXYB jhsVsq/G4JjDm9umQ0jCETpFlNz1uDOXKGnn11XBEdTQz5Gaea+qRkL522Q+7oBPs8ov kSsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707571059; x=1708175859; 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=ssydrgK8pU3ak8xwbtLbq1Fj+EJVpCtOL+AElnez6M8=; b=PstAhCX2KzVI+URusEJAli0ikTH96CVzrxeL+VzVQOxpYm4VQQGg7TM5ueNq8swin3 p839QlOg6HT8YQG5LAeVEPx+K0f9hJMh4mWcXVBvJjV3tn0CfH/llkWYv0ynSAYQxOOP OC1RsawF8jmaTCWouCFHyoThSCgismFdDmbIkIlRfV3tkcuHeEYZSzcVh1csjjObRDsG Bu0reDh5E6GVqVzp/tQm/+SDiYlTWAeOvVrAnXl8XlhK32tiL9dIn9IBFE5lXIA9A0Li KMjwwMV9Nkr5rAHOrNCK0s6zwKQWoHvLF2SgQbWrwaDv0F7yVf8DlJyMcevobanSWKow rIvQ== X-Gm-Message-State: AOJu0YzVWCDPGIjLGuX/9A94EFuljcYijLaXrfEB+UbUH4WSlW+omh5Q GfvoixGmFq5ERaPvcgp8wnF8bY9V99XAfwHt4OhE8O/F+8F9IzpPLKQDgAiC X-Google-Smtp-Source: AGHT+IH05xvM5zOaxKinjDX4QNsukvrDAKzE5oTZ3qzNHFHd0aYeNldfjgXL/6aSqrMpnzI3WDgMcQ== X-Received: by 2002:a05:6512:2395:b0:511:7b86:6d3b with SMTP id c21-20020a056512239500b005117b866d3bmr1886139lfv.59.1707571059450; Sat, 10 Feb 2024 05:17:39 -0800 (PST) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id hu20-20020a170907a09400b00a3bd0742a94sm1793064ejc.9.2024.02.10.05.17.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 05:17:39 -0800 (PST) From: Adrian Freihofer X-Google-Original-From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 3/7] bitbake/lib/bs4/tests/test_tree.py: python 3.12 regex Date: Sat, 10 Feb 2024 14:15:55 +0100 Message-ID: <20240210131727.342583-4-adrian.freihofer@siemens.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240210131727.342583-1-adrian.freihofer@siemens.com> References: <20240210131727.342583-1-adrian.freihofer@siemens.com> 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 ; Sat, 10 Feb 2024 13:17:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/195267 Python 3 interprets string literals as Unicode strings, and therefore \s is treated as an escaped Unicode character which is not correct. Declaring the RegEx pattern as a raw string instead of unicode is required for Python 3. Signed-off-by: Adrian Freihofer --- bitbake/lib/bs4/tests/test_tree.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitbake/lib/bs4/tests/test_tree.py b/bitbake/lib/bs4/tests/test_tree.py index 8e5c66426e8..cf0f1abe0cc 100644 --- a/bitbake/lib/bs4/tests/test_tree.py +++ b/bitbake/lib/bs4/tests/test_tree.py @@ -585,7 +585,7 @@ class SiblingTest(TreeTest): ''' # All that whitespace looks good but makes the tests more # difficult. Get rid of it. - markup = re.compile("\n\s*").sub("", markup) + markup = re.compile(r"\n\s*").sub("", markup) self.tree = self.soup(markup) From patchwork Sat Feb 10 13:15:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 39156 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 90665C4829A for ; Sat, 10 Feb 2024 13:17:51 +0000 (UTC) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) by mx.groups.io with SMTP id smtpd.web11.13257.1707571062323171847 for ; Sat, 10 Feb 2024 05:17:42 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=L0AzfPnt; spf=pass (domain: gmail.com, ip: 209.85.167.45, mailfrom: adrian.freihofer@gmail.com) Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-5116ec49365so1975079e87.3 for ; Sat, 10 Feb 2024 05:17:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707571060; x=1708175860; darn=lists.openembedded.org; 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=fqXZKF+uS1LYoa25oER+ar6zRmq+VL5/ihwLhd8biSY=; b=L0AzfPntE94N1jZAgGmsjSz9lN53cpstvhlNR9w4yIZGmIRwPhgu1rmfJKwu3mQvcp H1y+30Qz2RbNIBkwlekAumGyxNf1XCyPQWWiTiM0576zjhaXI5G107z8QRBGUjMJfN23 soUK7a+taqzb3h4pb6M3w1a2VnVGACYvB97zX36IUOTHaWaunJdwYKmg+4/6MZApJZfU ztkguuWObn0RERUmI+fy4duT4QrRqZZPEOpGiU4Estlt8t6LkvJwTztJ5OQeC0E2aBES 9JpRZSQwmafwdqMcWQ5KVpGH0+EaEx83fe+KiUiTWNE/naSONV2AxQo+4lYlPHZ6urrH erTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707571060; x=1708175860; 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=fqXZKF+uS1LYoa25oER+ar6zRmq+VL5/ihwLhd8biSY=; b=nIcTklocbcmU5aB30xHFGl7k8yOHvWpXBKWLwGazrWeGkPLlOy2R7nxZAPC+L6nU9R +xErEPWmkSPLx6E5NvrQRaec7DecjEBw0TB87AP2f1XRAY8VGTWhQwwEObcNNS6qhG/p 6rPb+PejhTLcioy8NEh3EhRMXpj0MBgVOHLc+QqKaMpWj0GHvrdJa1fhJM5ufTOKF7fh IvE9c4DRVX3QsMbG7SxYsj/UxWU+QbuF1QUH8aKTtgi+WbXSOXI/jm8NCYsB7A2NGoB5 KWj/HcvOwujeevX2U59saqqkCSvdEnrsCYdmkas1z12igcbcs5A3Nelnm+HqDCpLaBa6 ymYA== X-Gm-Message-State: AOJu0YwwJZCHVfXO+jNhBLb4bc2XGJpt71U2qGkd3Fwt0GJ6AmFNqvo+ oHRDDiLsmyv1/wynDCOnOZbcmzh98Lcjn4PtHsHNasnymG3RIQwtlkOyTQRV X-Google-Smtp-Source: AGHT+IEof2HghLd1/10L3y4E3Io6EegSF9WaTvUg29qyUf0oowSYYjsMg6a3snu8rKMttBbFAFnECA== X-Received: by 2002:a05:6512:214e:b0:511:82ab:9c88 with SMTP id s14-20020a056512214e00b0051182ab9c88mr656731lfr.68.1707571060057; Sat, 10 Feb 2024 05:17:40 -0800 (PST) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id hu20-20020a170907a09400b00a3bd0742a94sm1793064ejc.9.2024.02.10.05.17.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 05:17:39 -0800 (PST) From: Adrian Freihofer X-Google-Original-From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 4/7] feature-microblaze-versions.inc: python 3.12 regex Date: Sat, 10 Feb 2024 14:15:56 +0100 Message-ID: <20240210131727.342583-5-adrian.freihofer@siemens.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240210131727.342583-1-adrian.freihofer@siemens.com> References: <20240210131727.342583-1-adrian.freihofer@siemens.com> 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 ; Sat, 10 Feb 2024 13:17:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/195268 Python 3 interprets string literals as Unicode strings, and therefore \s is treated as an escaped Unicode character which is not correct. Declaring the RegEx pattern as a raw string instead of unicode is required for Python 3. Signed-off-by: Adrian Freihofer feature-microblaze-versions.inc# --- .../machine/include/microblaze/feature-microblaze-versions.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/conf/machine/include/microblaze/feature-microblaze-versions.inc b/meta/conf/machine/include/microblaze/feature-microblaze-versions.inc index 5c37f49abb7..658e87b8cdb 100644 --- a/meta/conf/machine/include/microblaze/feature-microblaze-versions.inc +++ b/meta/conf/machine/include/microblaze/feature-microblaze-versions.inc @@ -16,7 +16,7 @@ def microblaze_current_version(d, gcc = False): # find the current version, and convert it to major/minor integers version = None for t in (d.getVar("TUNE_FEATURES") or "").split(): - m = re.search("^v(\d+)\.(\d+)", t) + m = re.search(r"^v(\d+)\.(\d+)", t) if m: version = int(m.group(1)), int(m.group(2)) break From patchwork Sat Feb 10 13:15:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 39160 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 A99D0C48260 for ; Sat, 10 Feb 2024 13:17:51 +0000 (UTC) Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by mx.groups.io with SMTP id smtpd.web11.13258.1707571062561263229 for ; Sat, 10 Feb 2024 05:17:42 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WG77U4Tt; spf=pass (domain: gmail.com, ip: 209.85.218.47, mailfrom: adrian.freihofer@gmail.com) Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a26ed1e05c7so244634966b.2 for ; Sat, 10 Feb 2024 05:17:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707571061; x=1708175861; darn=lists.openembedded.org; 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=3N+g7vT0ABTx8/gxZxBS/XbecktzjossJ3rJkbP+LaY=; b=WG77U4TtghK0hR68L37sc2PCVSutn1sIdS/w+w/5ongU44ByO/ch2F9ZZwPeXCfjLB xpIPaozB7Vl2LE23HdzM3VaPXOZxcCaSULsJlnNWess/eSURzMRTQdbEwyQf6d4RuH2y 0AARa/bDf/biBZkUbWpJH81KvvhFUl3Zslk/lWQwuyZXw1Nd9P1j54WhBR7CA8hB/tj+ s+JjMvp5S1tT0jUEPA7NGPf+n0fW1HB4Fg8ExBs65qyJ1wPmRRuoCCbsbRNITc2l+WwY VwXLpHVyhSfAztYol6JmSozQAhrOjkHyhF110HuNXTAvGLhoY7yMOuaB/dCDOUZSNYnP roZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707571061; x=1708175861; 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=3N+g7vT0ABTx8/gxZxBS/XbecktzjossJ3rJkbP+LaY=; b=KHf5G/9KWFRnprxytKxsxq73pysKJaCUo3jNEyEqB9NucWe7ejlACrNKOgUYiQZ+e7 s+ICB6G3vqr8UFJNSCAy/XucYEIRwOT0e9BDnYXPYicjBjkSyIwy3P/wXVXwiPB+v96g htTKGjBBndQP4TgrcblrI0cG/pbaTEUycjgBjW8DkfrUZNtMxVXXg6G5zNPE6ZXVMNzg ahD0vOS7fYEU/iNDNdtUO2OUE8ZSF7na9PoUti+uf0bCF6+s8L/CJ9XCDiTTqmLx+qOT e4UjBuCmCwJqpEVkdk0UjuQBGCpgDr957XIsDTWTc0G6/0iXnZekvN5FFeK6uWSPyYFg rbnA== X-Gm-Message-State: AOJu0YwpJ0E2xmERX3CAOEdC1eGKkGlsIVjhTFJS8+vlXrPl5OPJoLVP +YrLZa+uO/7z7SYydVoR7TDbp4WdDpe9E+jxjzHUZm7ZezOIbZDNi7gO9v3s X-Google-Smtp-Source: AGHT+IFDXy9VdJiZVy37abhAoRXqNTGQVxSypm53z1QIuL2USNUbxGB2TUX7vjC4KqZsnbogyhHvcg== X-Received: by 2002:a17:906:1b12:b0:a3c:efb:5a08 with SMTP id o18-20020a1709061b1200b00a3c0efb5a08mr1271902ejg.63.1707571060774; Sat, 10 Feb 2024 05:17:40 -0800 (PST) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id hu20-20020a170907a09400b00a3bd0742a94sm1793064ejc.9.2024.02.10.05.17.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 05:17:40 -0800 (PST) From: Adrian Freihofer X-Google-Original-From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 5/7] meta/lib/oeqa: python 3.12 regex Date: Sat, 10 Feb 2024 14:15:57 +0100 Message-ID: <20240210131727.342583-6-adrian.freihofer@siemens.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240210131727.342583-1-adrian.freihofer@siemens.com> References: <20240210131727.342583-1-adrian.freihofer@siemens.com> 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 ; Sat, 10 Feb 2024 13:17:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/195269 Python 3 interprets string literals as Unicode strings, and therefore \s is treated as an escaped Unicode character which is not correct. Declaring the RegEx pattern as a raw string instead of unicode is required for Python 3. Signed-off-by: Adrian Freihofer --- meta/lib/oeqa/oetest.py | 2 +- meta/lib/oeqa/selftest/cases/bblayers.py | 2 +- meta/lib/oeqa/selftest/cases/fitimage.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py index cf417db0d42..bcb6a878c7a 100644 --- a/meta/lib/oeqa/oetest.py +++ b/meta/lib/oeqa/oetest.py @@ -241,7 +241,7 @@ class TestContext(object): modules = [] for test in self.testslist: - if re.search("\w+\.\w+\.test_\S+", test): + if re.search(r"\w+\.\w+\.test_\S+", test): test = '.'.join(t.split('.')[:3]) module = pkgutil.get_loader(test) modules.append(module) diff --git a/meta/lib/oeqa/selftest/cases/bblayers.py b/meta/lib/oeqa/selftest/cases/bblayers.py index 8faa0602348..2475a79468f 100644 --- a/meta/lib/oeqa/selftest/cases/bblayers.py +++ b/meta/lib/oeqa/selftest/cases/bblayers.py @@ -54,7 +54,7 @@ class BitbakeLayers(OESelftestTestCase): bb_file = os.path.join(testoutdir, recipe_path, recipe_file) self.assertTrue(os.path.isfile(bb_file), msg = "Cannot find xcursor-transparent-theme_0.1.1.bb in the test_bitbakelayers_flatten local dir.") contents = ftools.read_file(bb_file) - find_in_contents = re.search("##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents) + find_in_contents = re.search(r"##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents) self.assertTrue(find_in_contents, msg = "Flattening layers did not work. bitbake-layers flatten output: %s" % result.output) def test_bitbakelayers_add_remove(self): diff --git a/meta/lib/oeqa/selftest/cases/fitimage.py b/meta/lib/oeqa/selftest/cases/fitimage.py index 9383d0c4db1..347c0653776 100644 --- a/meta/lib/oeqa/selftest/cases/fitimage.py +++ b/meta/lib/oeqa/selftest/cases/fitimage.py @@ -204,7 +204,7 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart comment'" signed_sections = {} for line in result.output.splitlines(): if line.startswith((' Configuration', ' Image')): - in_signed = re.search('\((.*)\)', line).groups()[0] + in_signed = re.search(r'\((.*)\)', line).groups()[0] elif re.match('^ *', line) in (' ', ''): in_signed = None elif in_signed: @@ -525,7 +525,7 @@ UBOOT_FIT_HASH_ALG = "sha256" signed_sections = {} for line in result.output.splitlines(): if line.startswith((' Image')): - in_signed = re.search('\((.*)\)', line).groups()[0] + in_signed = re.search(r'\((.*)\)', line).groups()[0] elif re.match(' \w', line): in_signed = None elif in_signed: @@ -680,7 +680,7 @@ FIT_SIGN_INDIVIDUAL = "1" signed_sections = {} for line in result.output.splitlines(): if line.startswith((' Image')): - in_signed = re.search('\((.*)\)', line).groups()[0] + in_signed = re.search(r'\((.*)\)', line).groups()[0] elif re.match(' \w', line): in_signed = None elif in_signed: From patchwork Sat Feb 10 13:15:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 39158 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 BFA10C4829C for ; Sat, 10 Feb 2024 13:17:51 +0000 (UTC) Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by mx.groups.io with SMTP id smtpd.web10.13391.1707571063738192848 for ; Sat, 10 Feb 2024 05:17:44 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=T9Pxmnc/; spf=pass (domain: gmail.com, ip: 209.85.167.54, mailfrom: adrian.freihofer@gmail.com) Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-5114fa38434so2056505e87.0 for ; Sat, 10 Feb 2024 05:17:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707571062; x=1708175862; darn=lists.openembedded.org; 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=a6juzTFPnjVf8ArwXtHxcjzKBrUCZjXX3ZLwTS6S59I=; b=T9Pxmnc/vyEzweBP2cW2GQrgO0LROivhhByngprsiNzZduidBY6wS4Kc0E0Io/MMDx fdjamkwnbkckAjoU6EzmgWgtxKwOuYG5+YpddM9NzOmybjNw2F/TNMbNUPq9QJRttpiX ML7qTJVdtH7My1ECplbqihYV7OICNK5mXQdCxF4+x8w84QntFH4OXjhg6CYrP2T7+vao wcq8JPNyN9cf3ASJkLt9luUuHqsusZaoEtgDmJ8DSM+6F5y0RTi/MSYw75EKkrgWLooq 5BAbTq2hR4MkSzQTxPLAuo5xis9zJDBc1yKOlop/p1UraO8fbMHaEgY+mKDBdQHAcVio /Pbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707571062; x=1708175862; 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=a6juzTFPnjVf8ArwXtHxcjzKBrUCZjXX3ZLwTS6S59I=; b=SQd36ytg0prvCJdLPPcOIOg22RBVWjPM1PQzXDoSvibtaPiFimjiNzzsbaWAUtohza 7DM9wFu/flxpx4YmvQPmQ3Bz8iUXL+YnyqHGA9FrY+aggbGaFipA5ph3Rn1t4lKp2aF4 O0tuZwd2cpSA9gbJZuNbH35y1FOIksuEy7QIOwjEOrWjOmaHp0hQEC4QV9a5TFKq8Ud1 6ctCsMCoLBnqVAnWNJ2KQ0xw3zRpS8lOooG4ElgUL+Nfnh+fqtkU/8seqtk//pPtnwqK aiDcz535CcbBtUD7kGjEq2YmlcQX6DC1XwZ/PNABH/+B0X1OOlazlNWf6UMx7N4KBBFI papQ== X-Gm-Message-State: AOJu0YxMavDE27na4rVXxhtRbA2GQrVpQaCPmeAZLigB0DKZQqRTcahl DowVNYqY0ty1A4XNi03659vTuZEmEZY2rQUt91zquPiPCehBeQEh5zo88FSM X-Google-Smtp-Source: AGHT+IGE/GwTvVbNvYH5hQCbAgga0rMpoVNougMfhXq+M1U3gnwFoarwFCSaTPXmTuLFi5FYztTeAw== X-Received: by 2002:ac2:5e24:0:b0:511:7c0c:f94a with SMTP id o4-20020ac25e24000000b005117c0cf94amr1223356lfg.16.1707571061581; Sat, 10 Feb 2024 05:17:41 -0800 (PST) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id hu20-20020a170907a09400b00a3bd0742a94sm1793064ejc.9.2024.02.10.05.17.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 05:17:41 -0800 (PST) From: Adrian Freihofer X-Google-Original-From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 6/7] meta/lib/patchtest: python 3.12 regex Date: Sat, 10 Feb 2024 14:15:58 +0100 Message-ID: <20240210131727.342583-7-adrian.freihofer@siemens.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240210131727.342583-1-adrian.freihofer@siemens.com> References: <20240210131727.342583-1-adrian.freihofer@siemens.com> 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 ; Sat, 10 Feb 2024 13:17:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/195270 Python 3 interprets string literals as Unicode strings, and therefore \s is treated as an escaped Unicode character which is not correct. Declaring the RegEx pattern as a raw string instead of unicode is required for Python 3. Signed-off-by: Adrian Freihofer --- meta/lib/patchtest/tests/base.py | 4 ++-- meta/lib/patchtest/utils.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/meta/lib/patchtest/tests/base.py b/meta/lib/patchtest/tests/base.py index aecbbc4aae5..424e61b5be2 100644 --- a/meta/lib/patchtest/tests/base.py +++ b/meta/lib/patchtest/tests/base.py @@ -34,8 +34,8 @@ class PatchtestOEError(Exception): class Base(unittest.TestCase): # if unit test fails, fail message will throw at least the following JSON: {"id": } - endcommit_messages_regex = re.compile('\(From \w+-\w+ rev:|(? X-Patchwork-Id: 39159 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 C9374C48BC0 for ; Sat, 10 Feb 2024 13:17:51 +0000 (UTC) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by mx.groups.io with SMTP id smtpd.web11.13259.1707571064414052640 for ; Sat, 10 Feb 2024 05:17:44 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=I/2/eQNZ; spf=pass (domain: gmail.com, ip: 209.85.167.50, mailfrom: adrian.freihofer@gmail.com) Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-51165a488baso2411117e87.2 for ; Sat, 10 Feb 2024 05:17:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707571062; x=1708175862; darn=lists.openembedded.org; 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=6oEVpXRvt6Rc5UK+ZMYfcRJ5rmTXM0d0YCUFpGkI/50=; b=I/2/eQNZDg5hw/n/hyxHV6Bo8duLygPPo4Fm5Xwg/h5G7UzGV5Vtp9qBiviKMi5Q9E FwhiUAgHktFzfQZlo+EdVa9BjPBcsTW/EN5bZwHdOgNCdxf6Awp4KyF6zc9jo9P49+uW GgyrptNSmSRErquWtRaszrrvjugUbepRSv4yh4nuxfVi6fWAwJxpTLuKDdQhwTJtD3mU 8FeEeaFWzT2HSEAEJ6cC9/vP24Ysg+1+e/71hglC6fEMPOG8vHmhxlTd5wAY6jKCICB0 op5+pfBfno3Rdw4VNeyrw1YdNO21eKekP2YKVwTwKNnZGoatHNQoNMSan1BBs6DNOqFp iMCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707571062; x=1708175862; 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=6oEVpXRvt6Rc5UK+ZMYfcRJ5rmTXM0d0YCUFpGkI/50=; b=OEKJ2/pwKCvELn6Y8pwXIUozG4jtI4I5S8HvGg2CkKFTNHiwAmoj5lNt2QbP3k1lbA JMEFWN3JpVV1LN2eq9UAauZ80jejVKNPEL2dbgJ2M4PlNhVRN9KtZf46eJ8SU9/9VmEE R8THjyP//nuBoLi/cNA1o+UHvqt8bts9pY0jT1NGSLsu51S7zfBszdn4HbGHXjEM1pZC c0Lus9kTjLOKocatIAt7NwMhpFpu6XE2tfl8L6dp+D0Pj0wuMSg4iS0QNPn7UKDbvcUZ ck3wiQW8YrSC9ywsNFQqj1sSuWXhMmzE44HgmKnTaom9qmv5765EHEYUGx4pDBFwE5WG Ihzg== X-Gm-Message-State: AOJu0Yx3llC09IBg2Vw/aGmXyOhGoqPa9z31eb0c3r2JZTdpBBoum1Ow F9HzHFeutRfAuz09xZbBGnEpj+tuWauvF72hP0vp35ZhD24plkjCkyAGpURa X-Google-Smtp-Source: AGHT+IFK5tt4sp31Dmn/Gkjh1/5DTDHsNfnyAtT73mE37hGqs7NlyF2vm0NK9d95Km6JcHs7udgefQ== X-Received: by 2002:a19:6501:0:b0:511:636f:ac29 with SMTP id z1-20020a196501000000b00511636fac29mr943753lfb.64.1707571062208; Sat, 10 Feb 2024 05:17:42 -0800 (PST) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id hu20-20020a170907a09400b00a3bd0742a94sm1793064ejc.9.2024.02.10.05.17.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 05:17:41 -0800 (PST) From: Adrian Freihofer X-Google-Original-From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 7/7] meta/recipes: python 3.12 regex Date: Sat, 10 Feb 2024 14:15:59 +0100 Message-ID: <20240210131727.342583-8-adrian.freihofer@siemens.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240210131727.342583-1-adrian.freihofer@siemens.com> References: <20240210131727.342583-1-adrian.freihofer@siemens.com> 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 ; Sat, 10 Feb 2024 13:17:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/195271 Python 3 interprets string literals as Unicode strings, and therefore \s is treated as an escaped Unicode character which is not correct. Declaring the RegEx pattern as a raw string instead of unicode is required for Python 3. Signed-off-by: Adrian Freihofer --- meta/recipes-kernel/perf/perf/sort-pmuevents.py | 8 ++++---- meta/recipes-rt/rt-tests/files/rt_bmark.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/meta/recipes-kernel/perf/perf/sort-pmuevents.py b/meta/recipes-kernel/perf/perf/sort-pmuevents.py index 0362f2d8fab..0a87e553ab8 100755 --- a/meta/recipes-kernel/perf/perf/sort-pmuevents.py +++ b/meta/recipes-kernel/perf/perf/sort-pmuevents.py @@ -36,10 +36,10 @@ with open(infile, 'r') as file: preamble_regex = re.compile( '^(.*?)^(struct|const struct|static struct|static const struct)', re.MULTILINE | re.DOTALL ) preamble = re.search( preamble_regex, data ) -struct_block_regex = re.compile( '^(struct|const struct|static struct|static const struct).*?(\w+) (.*?)\[\] = {(.*?)^};', re.MULTILINE | re.DOTALL ) -field_regex = re.compile( '{.*?},', re.MULTILINE | re.DOTALL ) -cpuid_regex = re.compile( '\.cpuid = (.*?),', re.MULTILINE | re.DOTALL ) -name_regex = re.compile( '\.name = (.*?),', re.MULTILINE | re.DOTALL ) +struct_block_regex = re.compile(r'^(struct|const struct|static struct|static const struct).*?(\w+) (.*?)\[\] = {(.*?)^};', re.MULTILINE | re.DOTALL ) +field_regex = re.compile(r'{.*?},', re.MULTILINE | re.DOTALL ) +cpuid_regex = re.compile(r'\.cpuid = (.*?),', re.MULTILINE | re.DOTALL ) +name_regex = re.compile(r'\.name = (.*?),', re.MULTILINE | re.DOTALL ) # create a dictionary structure to store all the structs, their # types and then their fields. diff --git a/meta/recipes-rt/rt-tests/files/rt_bmark.py b/meta/recipes-rt/rt-tests/files/rt_bmark.py index 3b84447a0fd..2a4eed412f0 100755 --- a/meta/recipes-rt/rt-tests/files/rt_bmark.py +++ b/meta/recipes-rt/rt-tests/files/rt_bmark.py @@ -265,7 +265,7 @@ cmd = ("cyclictest", "-d", str(interval_delta), "-l", str(loop_count) ) -rex = re.compile(b"C:\s*(\d+).*Min:\s*(\d+).*Avg:\s*(\d+).*Max:\s*(\d+)") +rex = re.compile(r"C:\s*(\d+).*Min:\s*(\d+).*Avg:\s*(\d+).*Max:\s*(\d+)") def run_cyclictest_once(): res = subprocess.check_output(cmd)