aboutsummaryrefslogtreecommitdiff
path: root/utils/checkpackagelib/lib_mk.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils/checkpackagelib/lib_mk.py')
-rw-r--r--utils/checkpackagelib/lib_mk.py60
1 files changed, 30 insertions, 30 deletions
diff --git a/utils/checkpackagelib/lib_mk.py b/utils/checkpackagelib/lib_mk.py
index a0caf84636..45e37e4598 100644
--- a/utils/checkpackagelib/lib_mk.py
+++ b/utils/checkpackagelib/lib_mk.py
@@ -20,12 +20,12 @@ end_conditional = ["endif"]
class Indent(_CheckFunction):
- COMMENT = re.compile("^\s*#")
- CONDITIONAL = re.compile("^\s*({})\s".format("|".join(start_conditional + end_conditional)))
+ COMMENT = re.compile(r"^\s*#")
+ CONDITIONAL = re.compile(r"^\s*({})\s".format("|".join(start_conditional + end_conditional)))
ENDS_WITH_BACKSLASH = re.compile(r"^[^#].*\\$")
- END_DEFINE = re.compile("^\s*endef\s")
- MAKEFILE_TARGET = re.compile("^[^# \t]+:\s")
- START_DEFINE = re.compile("^\s*define\s")
+ END_DEFINE = re.compile(r"^\s*endef\s")
+ MAKEFILE_TARGET = re.compile(r"^[^# \t]+:\s")
+ START_DEFINE = re.compile(r"^\s*define\s")
def before(self):
self.define = False
@@ -76,17 +76,17 @@ class Indent(_CheckFunction):
class OverriddenVariable(_CheckFunction):
- CONCATENATING = re.compile("^([A-Z0-9_]+)\s*(\+|:|)=\s*\$\(\\1\)")
- END_CONDITIONAL = re.compile("^\s*({})".format("|".join(end_conditional)))
+ CONCATENATING = re.compile(r"^([A-Z0-9_]+)\s*(\+|:|)=\s*\$\(\\1\)")
+ END_CONDITIONAL = re.compile(r"^\s*({})".format("|".join(end_conditional)))
OVERRIDING_ASSIGNMENTS = [':=', "="]
- START_CONDITIONAL = re.compile("^\s*({})".format("|".join(start_conditional)))
- VARIABLE = re.compile("^([A-Z0-9_]+)\s*((\+|:|)=)")
- USUALLY_OVERRIDDEN = re.compile("^[A-Z0-9_]+({})".format("|".join([
- "_ARCH\s*=\s*",
- "_CPU\s*=\s*",
- "_SITE\s*=\s*",
- "_SOURCE\s*=\s*",
- "_VERSION\s*=\s*"])))
+ START_CONDITIONAL = re.compile(r"^\s*({})".format("|".join(start_conditional)))
+ VARIABLE = re.compile(r"^([A-Z0-9_]+)\s*((\+|:|)=)")
+ USUALLY_OVERRIDDEN = re.compile(r"^[A-Z0-9_]+({})".format("|".join([
+ r"_ARCH\s*=\s*",
+ r"_CPU\s*=\s*",
+ r"_SITE\s*=\s*",
+ r"_SOURCE\s*=\s*",
+ r"_VERSION\s*=\s*"])))
def before(self):
self.conditional = 0
@@ -174,7 +174,7 @@ class RemoveDefaultPackageSourceVariable(_CheckFunction):
package_upper = package.replace("-", "_").upper()
self.package = package
self.FIND_SOURCE = re.compile(
- "^{}_SOURCE\s*=\s*{}-\$\({}_VERSION\)\.tar\.gz"
+ r"^{}_SOURCE\s*=\s*{}-\$\({}_VERSION\)\.tar\.gz"
.format(package_upper, package, package_upper))
def check_line(self, lineno, text):
@@ -222,7 +222,7 @@ class TrailingBackslash(_CheckFunction):
class TypoInPackageVariable(_CheckFunction):
- ALLOWED = re.compile("|".join([
+ ALLOWED = re.compile(r"|".join([
"ACLOCAL_DIR",
"ACLOCAL_HOST_DIR",
"ACLOCAL_PATH",
@@ -241,7 +241,7 @@ class TypoInPackageVariable(_CheckFunction):
"TARGET_FINALIZE_HOOKS",
"TARGETS_ROOTFS",
"XTENSA_CORE_NAME"]))
- VARIABLE = re.compile("^([A-Z0-9_]+_[A-Z0-9_]+)\s*(\+|)=")
+ VARIABLE = re.compile(r"^([A-Z0-9_]+_[A-Z0-9_]+)\s*(\+|)=")
def before(self):
package, _ = os.path.splitext(os.path.basename(self.filename))
@@ -251,9 +251,9 @@ class TypoInPackageVariable(_CheckFunction):
# linux extensions do not use LINUX_EXT_ prefix for variables
package = package.replace("LINUX_EXT_", "")
self.package = package
- self.REGEX = re.compile("^(HOST_|ROOTFS_)?({}_[A-Z0-9_]+)".format(package))
+ self.REGEX = re.compile(r"^(HOST_|ROOTFS_)?({}_[A-Z0-9_]+)".format(package))
self.FIND_VIRTUAL = re.compile(
- "^{}_PROVIDES\s*(\+|)=\s*(.*)".format(package))
+ r"^{}_PROVIDES\s*(\+|)=\s*(.*)".format(package))
self.virtual = []
def check_line(self, lineno, text):
@@ -281,16 +281,16 @@ class TypoInPackageVariable(_CheckFunction):
class UselessFlag(_CheckFunction):
- DEFAULT_AUTOTOOLS_FLAG = re.compile("^.*{}".format("|".join([
- "_AUTORECONF\s*=\s*NO",
- "_LIBTOOL_PATCH\s*=\s*YES"])))
- DEFAULT_GENERIC_FLAG = re.compile("^.*{}".format("|".join([
- "_INSTALL_IMAGES\s*=\s*NO",
- "_INSTALL_REDISTRIBUTE\s*=\s*YES",
- "_INSTALL_STAGING\s*=\s*NO",
- "_INSTALL_TARGET\s*=\s*YES"])))
- END_CONDITIONAL = re.compile("^\s*({})".format("|".join(end_conditional)))
- START_CONDITIONAL = re.compile("^\s*({})".format("|".join(start_conditional)))
+ DEFAULT_AUTOTOOLS_FLAG = re.compile(r"^.*{}".format("|".join([
+ r"_AUTORECONF\s*=\s*NO",
+ r"_LIBTOOL_PATCH\s*=\s*YES"])))
+ DEFAULT_GENERIC_FLAG = re.compile(r"^.*{}".format("|".join([
+ r"_INSTALL_IMAGES\s*=\s*NO",
+ r"_INSTALL_REDISTRIBUTE\s*=\s*YES",
+ r"_INSTALL_STAGING\s*=\s*NO",
+ r"_INSTALL_TARGET\s*=\s*YES"])))
+ END_CONDITIONAL = re.compile(r"^\s*({})".format("|".join(end_conditional)))
+ START_CONDITIONAL = re.compile(r"^\s*({})".format("|".join(start_conditional)))
def before(self):
self.conditional = 0