diff options
author | Frazer Clews <frazer.clews@codethink.co.uk> | 2020-01-16 17:11:19 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-01-19 13:31:05 +0000 |
commit | fa5524890e86d353ee7d2194ccdd6c84e9bd2d31 (patch) | |
tree | f3d46ddbd5dd2b772a727b04303bb97b8ae43b9b /bitbake/lib/bb/fetch2 | |
parent | 0ac5174c7d39a3e49893df0d517d47bec1935555 (diff) | |
download | poky-fa5524890e86d353ee7d2194ccdd6c84e9bd2d31.tar.gz |
bitbake: lib: amend code to use proper singleton comparisons where possible
amend the code to handle singleton comparisons properly so it only checks
if they only refer to the same object or not, and not bother
comparing the values.
(Bitbake rev: b809a6812aa15a8a9af97bc382cc4b19571e6bfc)
Signed-off-by: Frazer Clews <frazer.clews@codethink.co.uk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r-- | bitbake/lib/bb/fetch2/__init__.py | 4 | ||||
-rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/fetch2/osc.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/fetch2/perforce.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/fetch2/ssh.py | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index 731c160892..18a6819d5d 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py | |||
@@ -1081,7 +1081,7 @@ def try_mirrors(fetch, d, origud, mirrors, check = False): | |||
1081 | 1081 | ||
1082 | for index, uri in enumerate(uris): | 1082 | for index, uri in enumerate(uris): |
1083 | ret = try_mirror_url(fetch, origud, uds[index], ld, check) | 1083 | ret = try_mirror_url(fetch, origud, uds[index], ld, check) |
1084 | if ret != False: | 1084 | if ret: |
1085 | return ret | 1085 | return ret |
1086 | return None | 1086 | return None |
1087 | 1087 | ||
@@ -1351,7 +1351,7 @@ class FetchMethod(object): | |||
1351 | """ | 1351 | """ |
1352 | 1352 | ||
1353 | # We cannot compute checksums for directories | 1353 | # We cannot compute checksums for directories |
1354 | if os.path.isdir(urldata.localpath) == True: | 1354 | if os.path.isdir(urldata.localpath): |
1355 | return False | 1355 | return False |
1356 | if urldata.localpath.find("*") != -1: | 1356 | if urldata.localpath.find("*") != -1: |
1357 | return False | 1357 | return False |
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index fa41b078f1..fe0a384af2 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
@@ -671,7 +671,7 @@ class Git(FetchMethod): | |||
671 | 671 | ||
672 | # search for version in the line | 672 | # search for version in the line |
673 | tag = tagregex.search(tag_head) | 673 | tag = tagregex.search(tag_head) |
674 | if tag == None: | 674 | if tag is None: |
675 | continue | 675 | continue |
676 | 676 | ||
677 | tag = tag.group('pver') | 677 | tag = tag.group('pver') |
diff --git a/bitbake/lib/bb/fetch2/osc.py b/bitbake/lib/bb/fetch2/osc.py index f55db6f791..8f091efd02 100644 --- a/bitbake/lib/bb/fetch2/osc.py +++ b/bitbake/lib/bb/fetch2/osc.py | |||
@@ -41,7 +41,7 @@ class Osc(FetchMethod): | |||
41 | else: | 41 | else: |
42 | pv = d.getVar("PV", False) | 42 | pv = d.getVar("PV", False) |
43 | rev = bb.fetch2.srcrev_internal_helper(ud, d) | 43 | rev = bb.fetch2.srcrev_internal_helper(ud, d) |
44 | if rev and rev != True: | 44 | if rev: |
45 | ud.revision = rev | 45 | ud.revision = rev |
46 | else: | 46 | else: |
47 | ud.revision = "" | 47 | ud.revision = "" |
diff --git a/bitbake/lib/bb/fetch2/perforce.py b/bitbake/lib/bb/fetch2/perforce.py index b2ac11ecab..f57c2a4f52 100644 --- a/bitbake/lib/bb/fetch2/perforce.py +++ b/bitbake/lib/bb/fetch2/perforce.py | |||
@@ -104,7 +104,7 @@ class Perforce(FetchMethod): | |||
104 | if command == 'changes': | 104 | if command == 'changes': |
105 | p4cmd = '%s%s changes -m 1 //%s' % (ud.basecmd, p4opt, pathnrev) | 105 | p4cmd = '%s%s changes -m 1 //%s' % (ud.basecmd, p4opt, pathnrev) |
106 | elif command == 'print': | 106 | elif command == 'print': |
107 | if depot_filename != None: | 107 | if depot_filename is not None: |
108 | p4cmd = '%s%s print -o "p4/%s" "%s"' % (ud.basecmd, p4opt, filename, depot_filename) | 108 | p4cmd = '%s%s print -o "p4/%s" "%s"' % (ud.basecmd, p4opt, filename, depot_filename) |
109 | else: | 109 | else: |
110 | raise FetchError('No depot file name provided to p4 %s' % command, ud.url) | 110 | raise FetchError('No depot file name provided to p4 %s' % command, ud.url) |
diff --git a/bitbake/lib/bb/fetch2/ssh.py b/bitbake/lib/bb/fetch2/ssh.py index 34debe399b..5e982ecf38 100644 --- a/bitbake/lib/bb/fetch2/ssh.py +++ b/bitbake/lib/bb/fetch2/ssh.py | |||
@@ -58,7 +58,7 @@ class SSH(FetchMethod): | |||
58 | '''Class to fetch a module or modules via Secure Shell''' | 58 | '''Class to fetch a module or modules via Secure Shell''' |
59 | 59 | ||
60 | def supports(self, urldata, d): | 60 | def supports(self, urldata, d): |
61 | return __pattern__.match(urldata.url) != None | 61 | return __pattern__.match(urldata.url) is not None |
62 | 62 | ||
63 | def supports_checksum(self, urldata): | 63 | def supports_checksum(self, urldata): |
64 | return False | 64 | return False |