forked from platformio/platformio-core
Strict PackageItem comparison
This commit is contained in:
@ -432,9 +432,13 @@ class PackageItem(object):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
if not self.path or not other.path:
|
conds = [
|
||||||
return self.path == other.path
|
os.path.realpath(self.path) == os.path.realpath(other.path)
|
||||||
return os.path.realpath(self.path) == os.path.realpath(other.path)
|
if self.path and other.path
|
||||||
|
else self.path == other.path,
|
||||||
|
self.metadata == other.metadata,
|
||||||
|
]
|
||||||
|
return all(conds)
|
||||||
|
|
||||||
def __hash__(self):
|
def __hash__(self):
|
||||||
return hash(os.path.realpath(self.path))
|
return hash(os.path.realpath(self.path))
|
||||||
|
Reference in New Issue
Block a user