diff options
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 4 | ||||
-rw-r--r-- | bitbake/lib/bb/fetch2/wget.py | 24 | ||||
-rw-r--r-- | bitbake/lib/bb/monitordisk.py | 12 | ||||
-rw-r--r-- | bitbake/lib/bb/parse/parse_py/BBHandler.py | 18 | ||||
-rw-r--r-- | bitbake/lib/bb/providers.py | 4 | ||||
-rw-r--r-- | bitbake/lib/bb/siggen.py | 2 |
6 files changed, 32 insertions, 32 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 59a2ee8f80..c3c089233b 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
@@ -615,7 +615,7 @@ class Git(FetchMethod): | |||
615 | """ | 615 | """ |
616 | pupver = ('', '') | 616 | pupver = ('', '') |
617 | 617 | ||
618 | tagregex = re.compile(d.getVar('UPSTREAM_CHECK_GITTAGREGEX') or "(?P<pver>([0-9][\.|_]?)+)") | 618 | tagregex = re.compile(d.getVar('UPSTREAM_CHECK_GITTAGREGEX') or r"(?P<pver>([0-9][\.|_]?)+)") |
619 | try: | 619 | try: |
620 | output = self._lsremote(ud, d, "refs/tags/*") | 620 | output = self._lsremote(ud, d, "refs/tags/*") |
621 | except (bb.fetch2.FetchError, bb.fetch2.NetworkAccess) as e: | 621 | except (bb.fetch2.FetchError, bb.fetch2.NetworkAccess) as e: |
@@ -630,7 +630,7 @@ class Git(FetchMethod): | |||
630 | 630 | ||
631 | tag_head = line.split("/")[-1] | 631 | tag_head = line.split("/")[-1] |
632 | # Ignore non-released branches | 632 | # Ignore non-released branches |
633 | m = re.search("(alpha|beta|rc|final)+", tag_head) | 633 | m = re.search(r"(alpha|beta|rc|final)+", tag_head) |
634 | if m: | 634 | if m: |
635 | continue | 635 | continue |
636 | 636 | ||
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py index 1237e56098..e2037511da 100644 --- a/bitbake/lib/bb/fetch2/wget.py +++ b/bitbake/lib/bb/fetch2/wget.py | |||
@@ -481,7 +481,7 @@ class Wget(FetchMethod): | |||
481 | version_dir = ['', '', ''] | 481 | version_dir = ['', '', ''] |
482 | version = ['', '', ''] | 482 | version = ['', '', ''] |
483 | 483 | ||
484 | dirver_regex = re.compile("(?P<pfx>\D*)(?P<ver>(\d+[\.\-_])+(\d+))") | 484 | dirver_regex = re.compile(r"(?P<pfx>\D*)(?P<ver>(\d+[\.\-_])+(\d+))") |
485 | s = dirver_regex.search(dirver) | 485 | s = dirver_regex.search(dirver) |
486 | if s: | 486 | if s: |
487 | version_dir[1] = s.group('ver') | 487 | version_dir[1] = s.group('ver') |
@@ -541,26 +541,26 @@ class Wget(FetchMethod): | |||
541 | gst-fluendo-mp3 | 541 | gst-fluendo-mp3 |
542 | """ | 542 | """ |
543 | # match most patterns which uses "-" as separator to version digits | 543 | # match most patterns which uses "-" as separator to version digits |
544 | pn_prefix1 = "[a-zA-Z][a-zA-Z0-9]*([-_][a-zA-Z]\w+)*\+?[-_]" | 544 | pn_prefix1 = r"[a-zA-Z][a-zA-Z0-9]*([-_][a-zA-Z]\w+)*\+?[-_]" |
545 | # a loose pattern such as for unzip552.tar.gz | 545 | # a loose pattern such as for unzip552.tar.gz |
546 | pn_prefix2 = "[a-zA-Z]+" | 546 | pn_prefix2 = r"[a-zA-Z]+" |
547 | # a loose pattern such as for 80325-quicky-0.4.tar.gz | 547 | # a loose pattern such as for 80325-quicky-0.4.tar.gz |
548 | pn_prefix3 = "[0-9]+[-]?[a-zA-Z]+" | 548 | pn_prefix3 = r"[0-9]+[-]?[a-zA-Z]+" |
549 | # Save the Package Name (pn) Regex for use later | 549 | # Save the Package Name (pn) Regex for use later |
550 | pn_regex = "(%s|%s|%s)" % (pn_prefix1, pn_prefix2, pn_prefix3) | 550 | pn_regex = r"(%s|%s|%s)" % (pn_prefix1, pn_prefix2, pn_prefix3) |
551 | 551 | ||
552 | # match version | 552 | # match version |
553 | pver_regex = "(([A-Z]*\d+[a-zA-Z]*[\.\-_]*)+)" | 553 | pver_regex = r"(([A-Z]*\d+[a-zA-Z]*[\.\-_]*)+)" |
554 | 554 | ||
555 | # match arch | 555 | # match arch |
556 | parch_regex = "-source|_all_" | 556 | parch_regex = "-source|_all_" |
557 | 557 | ||
558 | # src.rpm extension was added only for rpm package. Can be removed if the rpm | 558 | # src.rpm extension was added only for rpm package. Can be removed if the rpm |
559 | # packaged will always be considered as having to be manually upgraded | 559 | # packaged will always be considered as having to be manually upgraded |
560 | psuffix_regex = "(tar\.gz|tgz|tar\.bz2|zip|xz|tar\.lz|rpm|bz2|orig\.tar\.gz|tar\.xz|src\.tar\.gz|src\.tgz|svnr\d+\.tar\.bz2|stable\.tar\.gz|src\.rpm)" | 560 | psuffix_regex = r"(tar\.gz|tgz|tar\.bz2|zip|xz|tar\.lz|rpm|bz2|orig\.tar\.gz|tar\.xz|src\.tar\.gz|src\.tgz|svnr\d+\.tar\.bz2|stable\.tar\.gz|src\.rpm)" |
561 | 561 | ||
562 | # match name, version and archive type of a package | 562 | # match name, version and archive type of a package |
563 | package_regex_comp = re.compile("(?P<name>%s?\.?v?)(?P<pver>%s)(?P<arch>%s)?[\.-](?P<type>%s$)" | 563 | package_regex_comp = re.compile(r"(?P<name>%s?\.?v?)(?P<pver>%s)(?P<arch>%s)?[\.-](?P<type>%s$)" |
564 | % (pn_regex, pver_regex, parch_regex, psuffix_regex)) | 564 | % (pn_regex, pver_regex, parch_regex, psuffix_regex)) |
565 | self.suffix_regex_comp = re.compile(psuffix_regex) | 565 | self.suffix_regex_comp = re.compile(psuffix_regex) |
566 | 566 | ||
@@ -572,7 +572,7 @@ class Wget(FetchMethod): | |||
572 | version = self._parse_path(package_regex_comp, package) | 572 | version = self._parse_path(package_regex_comp, package) |
573 | if version: | 573 | if version: |
574 | package_custom_regex_comp = re.compile( | 574 | package_custom_regex_comp = re.compile( |
575 | "(?P<name>%s)(?P<pver>%s)(?P<arch>%s)?[\.-](?P<type>%s)" % | 575 | r"(?P<name>%s)(?P<pver>%s)(?P<arch>%s)?[\.-](?P<type>%s)" % |
576 | (re.escape(version[0]), pver_regex, parch_regex, psuffix_regex)) | 576 | (re.escape(version[0]), pver_regex, parch_regex, psuffix_regex)) |
577 | else: | 577 | else: |
578 | package_custom_regex_comp = None | 578 | package_custom_regex_comp = None |
@@ -589,7 +589,7 @@ class Wget(FetchMethod): | |||
589 | current_version = ['', d.getVar('PV'), ''] | 589 | current_version = ['', d.getVar('PV'), ''] |
590 | 590 | ||
591 | """possible to have no version in pkg name, such as spectrum-fw""" | 591 | """possible to have no version in pkg name, such as spectrum-fw""" |
592 | if not re.search("\d+", package): | 592 | if not re.search(r"\d+", package): |
593 | current_version[1] = re.sub('_', '.', current_version[1]) | 593 | current_version[1] = re.sub('_', '.', current_version[1]) |
594 | current_version[1] = re.sub('-', '.', current_version[1]) | 594 | current_version[1] = re.sub('-', '.', current_version[1]) |
595 | return (current_version[1], '') | 595 | return (current_version[1], '') |
@@ -607,13 +607,13 @@ class Wget(FetchMethod): | |||
607 | 607 | ||
608 | # search for version matches on folders inside the path, like: | 608 | # search for version matches on folders inside the path, like: |
609 | # "5.7" in http://download.gnome.org/sources/${PN}/5.7/${PN}-${PV}.tar.gz | 609 | # "5.7" in http://download.gnome.org/sources/${PN}/5.7/${PN}-${PV}.tar.gz |
610 | dirver_regex = re.compile("(?P<dirver>[^/]*(\d+\.)*\d+([-_]r\d+)*)/") | 610 | dirver_regex = re.compile(r"(?P<dirver>[^/]*(\d+\.)*\d+([-_]r\d+)*)/") |
611 | m = dirver_regex.search(path) | 611 | m = dirver_regex.search(path) |
612 | if m: | 612 | if m: |
613 | pn = d.getVar('PN') | 613 | pn = d.getVar('PN') |
614 | dirver = m.group('dirver') | 614 | dirver = m.group('dirver') |
615 | 615 | ||
616 | dirver_pn_regex = re.compile("%s\d?" % (re.escape(pn))) | 616 | dirver_pn_regex = re.compile(r"%s\d?" % (re.escape(pn))) |
617 | if not dirver_pn_regex.search(dirver): | 617 | if not dirver_pn_regex.search(dirver): |
618 | return (self._check_latest_version_by_dir(dirver, | 618 | return (self._check_latest_version_by_dir(dirver, |
619 | package, package_regex, current_version, ud, d), '') | 619 | package, package_regex, current_version, ud, d), '') |
diff --git a/bitbake/lib/bb/monitordisk.py b/bitbake/lib/bb/monitordisk.py index 833cd3d344..2ad1e61562 100644 --- a/bitbake/lib/bb/monitordisk.py +++ b/bitbake/lib/bb/monitordisk.py | |||
@@ -28,16 +28,16 @@ def convertGMK(unit): | |||
28 | 28 | ||
29 | """ Convert the space unit G, M, K, the unit is case-insensitive """ | 29 | """ Convert the space unit G, M, K, the unit is case-insensitive """ |
30 | 30 | ||
31 | unitG = re.match('([1-9][0-9]*)[gG]\s?$', unit) | 31 | unitG = re.match(r'([1-9][0-9]*)[gG]\s?$', unit) |
32 | if unitG: | 32 | if unitG: |
33 | return int(unitG.group(1)) * (1024 ** 3) | 33 | return int(unitG.group(1)) * (1024 ** 3) |
34 | unitM = re.match('([1-9][0-9]*)[mM]\s?$', unit) | 34 | unitM = re.match(r'([1-9][0-9]*)[mM]\s?$', unit) |
35 | if unitM: | 35 | if unitM: |
36 | return int(unitM.group(1)) * (1024 ** 2) | 36 | return int(unitM.group(1)) * (1024 ** 2) |
37 | unitK = re.match('([1-9][0-9]*)[kK]\s?$', unit) | 37 | unitK = re.match(r'([1-9][0-9]*)[kK]\s?$', unit) |
38 | if unitK: | 38 | if unitK: |
39 | return int(unitK.group(1)) * 1024 | 39 | return int(unitK.group(1)) * 1024 |
40 | unitN = re.match('([1-9][0-9]*)\s?$', unit) | 40 | unitN = re.match(r'([1-9][0-9]*)\s?$', unit) |
41 | if unitN: | 41 | if unitN: |
42 | return int(unitN.group(1)) | 42 | return int(unitN.group(1)) |
43 | else: | 43 | else: |
@@ -83,7 +83,7 @@ def getDiskData(BBDirs, configuration): | |||
83 | for pathSpaceInode in BBDirs.split(): | 83 | for pathSpaceInode in BBDirs.split(): |
84 | # The input format is: "dir,space,inode", dir is a must, space | 84 | # The input format is: "dir,space,inode", dir is a must, space |
85 | # and inode are optional | 85 | # and inode are optional |
86 | pathSpaceInodeRe = re.match('([^,]*),([^,]*),([^,]*),?(.*)', pathSpaceInode) | 86 | pathSpaceInodeRe = re.match(r'([^,]*),([^,]*),([^,]*),?(.*)', pathSpaceInode) |
87 | if not pathSpaceInodeRe: | 87 | if not pathSpaceInodeRe: |
88 | printErr("Invalid value in BB_DISKMON_DIRS: %s" % pathSpaceInode) | 88 | printErr("Invalid value in BB_DISKMON_DIRS: %s" % pathSpaceInode) |
89 | return None | 89 | return None |
@@ -147,7 +147,7 @@ def getInterval(configuration): | |||
147 | else: | 147 | else: |
148 | # The disk space or inode interval is optional, but it should | 148 | # The disk space or inode interval is optional, but it should |
149 | # have a correct value once it is specified | 149 | # have a correct value once it is specified |
150 | intervalRe = re.match('([^,]*),?\s*(.*)', interval) | 150 | intervalRe = re.match(r'([^,]*),?\s*(.*)', interval) |
151 | if intervalRe: | 151 | if intervalRe: |
152 | intervalSpace = intervalRe.group(1) | 152 | intervalSpace = intervalRe.group(1) |
153 | if intervalSpace: | 153 | if intervalSpace: |
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py index f3bf4aa529..9dba5f2334 100644 --- a/bitbake/lib/bb/parse/parse_py/BBHandler.py +++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py | |||
@@ -38,15 +38,15 @@ from .ConfHandler import include, init | |||
38 | # For compatibility | 38 | # For compatibility |
39 | bb.deprecate_import(__name__, "bb.parse", ["vars_from_file"]) | 39 | bb.deprecate_import(__name__, "bb.parse", ["vars_from_file"]) |
40 | 40 | ||
41 | __func_start_regexp__ = re.compile( r"(((?P<py>python)|(?P<fr>fakeroot))\s*)*(?P<func>[\w\.\-\+\{\}\$]+)?\s*\(\s*\)\s*{$" ) | 41 | __func_start_regexp__ = re.compile(r"(((?P<py>python)|(?P<fr>fakeroot))\s*)*(?P<func>[\w\.\-\+\{\}\$]+)?\s*\(\s*\)\s*{$" ) |
42 | __inherit_regexp__ = re.compile( r"inherit\s+(.+)" ) | 42 | __inherit_regexp__ = re.compile(r"inherit\s+(.+)" ) |
43 | __export_func_regexp__ = re.compile( r"EXPORT_FUNCTIONS\s+(.+)" ) | 43 | __export_func_regexp__ = re.compile(r"EXPORT_FUNCTIONS\s+(.+)" ) |
44 | __addtask_regexp__ = re.compile("addtask\s+(?P<func>\w+)\s*((before\s*(?P<before>((.*(?=after))|(.*))))|(after\s*(?P<after>((.*(?=before))|(.*)))))*") | 44 | __addtask_regexp__ = re.compile(r"addtask\s+(?P<func>\w+)\s*((before\s*(?P<before>((.*(?=after))|(.*))))|(after\s*(?P<after>((.*(?=before))|(.*)))))*") |
45 | __deltask_regexp__ = re.compile("deltask\s+(?P<func>\w+)") | 45 | __deltask_regexp__ = re.compile(r"deltask\s+(?P<func>\w+)") |
46 | __addhandler_regexp__ = re.compile( r"addhandler\s+(.+)" ) | 46 | __addhandler_regexp__ = re.compile(r"addhandler\s+(.+)" ) |
47 | __def_regexp__ = re.compile( r"def\s+(\w+).*:" ) | 47 | __def_regexp__ = re.compile(r"def\s+(\w+).*:" ) |
48 | __python_func_regexp__ = re.compile( r"(\s+.*)|(^$)|(^#)" ) | 48 | __python_func_regexp__ = re.compile(r"(\s+.*)|(^$)|(^#)" ) |
49 | __python_tab_regexp__ = re.compile(" *\t") | 49 | __python_tab_regexp__ = re.compile(r" *\t") |
50 | 50 | ||
51 | __infunc__ = [] | 51 | __infunc__ = [] |
52 | __inpython__ = False | 52 | __inpython__ = False |
diff --git a/bitbake/lib/bb/providers.py b/bitbake/lib/bb/providers.py index c2aa98c065..f496d84d12 100644 --- a/bitbake/lib/bb/providers.py +++ b/bitbake/lib/bb/providers.py | |||
@@ -129,7 +129,7 @@ def findPreferredProvider(pn, cfgData, dataCache, pkg_pn = None, item = None): | |||
129 | preferred_v = cfgData.getVar("PREFERRED_VERSION") | 129 | preferred_v = cfgData.getVar("PREFERRED_VERSION") |
130 | 130 | ||
131 | if preferred_v: | 131 | if preferred_v: |
132 | m = re.match('(\d+:)*(.*)(_.*)*', preferred_v) | 132 | m = re.match(r'(\d+:)*(.*)(_.*)*', preferred_v) |
133 | if m: | 133 | if m: |
134 | if m.group(1): | 134 | if m.group(1): |
135 | preferred_e = m.group(1)[:-1] | 135 | preferred_e = m.group(1)[:-1] |
@@ -384,7 +384,7 @@ def getRuntimeProviders(dataCache, rdepend): | |||
384 | 384 | ||
385 | # Only search dynamic packages if we can't find anything in other variables | 385 | # Only search dynamic packages if we can't find anything in other variables |
386 | for pattern in dataCache.packages_dynamic: | 386 | for pattern in dataCache.packages_dynamic: |
387 | pattern = pattern.replace('+', "\+") | 387 | pattern = pattern.replace(r'+', r"\+") |
388 | if pattern in regexp_cache: | 388 | if pattern in regexp_cache: |
389 | regexp = regexp_cache[pattern] | 389 | regexp = regexp_cache[pattern] |
390 | else: | 390 | else: |
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py index 66aea79355..03aa08bb94 100644 --- a/bitbake/lib/bb/siggen.py +++ b/bitbake/lib/bb/siggen.py | |||
@@ -90,7 +90,7 @@ class SignatureGeneratorBasic(SignatureGenerator): | |||
90 | self.taints = {} | 90 | self.taints = {} |
91 | self.gendeps = {} | 91 | self.gendeps = {} |
92 | self.lookupcache = {} | 92 | self.lookupcache = {} |
93 | self.pkgnameextract = re.compile("(?P<fn>.*)\..*") | 93 | self.pkgnameextract = re.compile(r"(?P<fn>.*)\..*") |
94 | self.basewhitelist = set((data.getVar("BB_HASHBASE_WHITELIST") or "").split()) | 94 | self.basewhitelist = set((data.getVar("BB_HASHBASE_WHITELIST") or "").split()) |
95 | self.taskwhitelist = None | 95 | self.taskwhitelist = None |
96 | self.init_rundepcheck(data) | 96 | self.init_rundepcheck(data) |