All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Steve Sakoman" <steve@sakoman.com>
To: openembedded-core@lists.openembedded.org
Subject: [OE-core][dunfell 16/20] scripts/lib/recipetool/create.py: fix regex strings
Date: Fri, 17 Jul 2020 04:37:21 -1000	[thread overview]
Message-ID: <f8a5db7a6072ddb1be96405fc8b44f595275206d.1594996441.git.steve@sakoman.com> (raw)
In-Reply-To: <cover.1594996440.git.steve@sakoman.com>

From: Tim Orling <timothy.t.orling@linux.intel.com>

Python now expects regex strings to be prepended with r.
Silence pylint/autopep8 and similar warnings by identifying
these regex patterns as... regex patterns.

Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 0eae98a369d80340e48dc690d09a1364cde97973)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 scripts/lib/recipetool/create.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 8d78c5b6f9..566c75369a 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -66,7 +66,7 @@ class RecipeHandler(object):
         libdir = d.getVar('libdir')
         base_libdir = d.getVar('base_libdir')
         libpaths = list(set([base_libdir, libdir]))
-        libname_re = re.compile('^lib(.+)\.so.*$')
+        libname_re = re.compile(r'^lib(.+)\.so.*$')
         pkglibmap = {}
         for lib, item in shlib_providers.items():
             for path, pkg in item.items():
@@ -428,7 +428,7 @@ def create_recipe(args):
 
     if scriptutils.is_src_url(source):
         # Warn about github archive URLs
-        if re.match('https?://github.com/[^/]+/[^/]+/archive/.+(\.tar\..*|\.zip)$', source):
+        if re.match(r'https?://github.com/[^/]+/[^/]+/archive/.+(\.tar\..*|\.zip)$', source):
             logger.warning('github archive files are not guaranteed to be stable and may be re-generated over time. If the latter occurs, the checksums will likely change and the recipe will fail at do_fetch. It is recommended that you point to an actual commit or tag in the repository instead (using the repository URL in conjunction with the -S/--srcrev option).')
         # Fetch a URL
         fetchuri = reformat_git_uri(urldefrag(source)[0])
@@ -830,7 +830,7 @@ def create_recipe(args):
         elif line.startswith('PV = '):
             if realpv:
                 # Replace the first part of the PV value
-                line = re.sub('"[^+]*\+', '"%s+' % realpv, line)
+                line = re.sub(r'"[^+]*\+', '"%s+' % realpv, line)
         lines_before.append(line)
 
     if args.also_native:
@@ -1066,8 +1066,8 @@ def crunch_license(licfile):
     import oe.utils
 
     # Note: these are carefully constructed!
-    license_title_re = re.compile('^\(?(#+ *)?(The )?.{1,10} [Ll]icen[sc]e( \(.{1,10}\))?\)?:?$')
-    license_statement_re = re.compile('^(This (project|software) is( free software)? (released|licen[sc]ed)|(Released|Licen[cs]ed)) under the .{1,10} [Ll]icen[sc]e:?$')
+    license_title_re = re.compile(r'^\(?(#+ *)?(The )?.{1,10} [Ll]icen[sc]e( \(.{1,10}\))?\)?:?$')
+    license_statement_re = re.compile(r'^(This (project|software) is( free software)? (released|licen[sc]ed)|(Released|Licen[cs]ed)) under the .{1,10} [Ll]icen[sc]e:?$')
     copyright_re = re.compile('^(#+)? *Copyright .*$')
 
     crunched_md5sums = {}
-- 
2.17.1


  parent reply	other threads:[~2020-07-17 14:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17 14:37 [OE-core][dunfell 00/20] Patch review Steve Sakoman
2020-07-17 14:37 ` [OE-core][dunfell 01/20] insane: consolidate skipping of temporary do_package files Steve Sakoman
2020-07-17 14:37 ` [OE-core][dunfell 02/20] linux-firmware: fix the wrong file path for ibt-misc Steve Sakoman
2020-07-17 14:37 ` [OE-core][dunfell 03/20] linux-firmware: move ibt-misc to the end of ibt packages Steve Sakoman
2020-07-17 14:37 ` [OE-core][dunfell 04/20] bison: fix Argument list too long error Steve Sakoman
2020-07-17 14:37 ` [OE-core][dunfell 05/20] avahi: Fix typo in recipe Steve Sakoman
2020-07-17 14:37 ` [OE-core][dunfell 06/20] oeqa/selftest/sstatetests: Avoid polluting DL_DIR Steve Sakoman
2020-07-17 14:37 ` [OE-core][dunfell 07/20] subversion: extend for nativesdk Steve Sakoman
2020-07-17 14:37 ` [OE-core][dunfell 08/20] serf: " Steve Sakoman
2020-07-17 14:37 ` [OE-core][dunfell 09/20] u-boot: fix condition to allow use of *.cfg Steve Sakoman
2020-07-17 14:37 ` [OE-core][dunfell 10/20] go: Disbale CGO for riscv64 Steve Sakoman
2020-07-17 14:37 ` [OE-core][dunfell 11/20] go-dep: Fix build on riscv64 Steve Sakoman
2020-07-17 14:37 ` [OE-core][dunfell 12/20] ptest: append to FILES Steve Sakoman
2020-07-17 14:37 ` [OE-core][dunfell 13/20] nativesdk: clear MACHINE_FEATURES Steve Sakoman
2020-07-17 14:37 ` [OE-core][dunfell 14/20] nativesdk: Set the CXXFLAGS to the BUILDSDK_CXXFLAGS Steve Sakoman
2020-07-17 14:37 ` [OE-core][dunfell 15/20] lib/oe/recipeutils.py: add AUTHOR; BBCLASSEXTEND Steve Sakoman
2020-07-17 14:37 ` Steve Sakoman [this message]
2020-07-17 14:37 ` [OE-core][dunfell 17/20] babeltrace: correct the git SRC_URI Steve Sakoman
2020-07-17 14:37 ` [OE-core][dunfell 18/20] qemurunner: Ensure pid location is deterministic Steve Sakoman
2020-07-17 14:37 ` [OE-core][dunfell 19/20] qemurunner: Add extra debug info when qemu fails to start Steve Sakoman
2020-07-17 14:37 ` [OE-core][dunfell 20/20] oeqa/utils/qemurunner: Fix missing pid file tracebacks Steve Sakoman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f8a5db7a6072ddb1be96405fc8b44f595275206d.1594996441.git.steve@sakoman.com \
    --to=steve@sakoman.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.