diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-12-01 13:04:20 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-12-01 13:04:20 +0000 |
commit | 2d82bc7382628c7adf382dd2f82193fd43725c5b (patch) | |
tree | 46a6dea5e4ced4fe1b5788ef6985b4ab4462532c /baserockimport/package.py | |
parent | 31facb65e836be5edfa2f1dba70df1f823e3a079 (diff) | |
download | import-2d82bc7382628c7adf382dd2f82193fd43725c5b.tar.gz |
Fix potential issue where two packages of different kinds share a name
This isn't a perfect fix. If this situation occurs the tool will
generate an invalid stratum and the user will need to rename one of
the chunks. But this is a better than what would have happened before:
one of the chunks would have been silently ignored.
Diffstat (limited to 'baserockimport/package.py')
-rw-r--r-- | baserockimport/package.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/baserockimport/package.py b/baserockimport/package.py index 6095b30..1739292 100644 --- a/baserockimport/package.py +++ b/baserockimport/package.py @@ -48,8 +48,10 @@ class Package(object): def add_required_by(self, item): self.required_by.append('%s-%s' % (item.name, item.version)) - def match(self, name, version): - return (self.name==name and self.version==version) + def match(self, kind, name, version): + return (self.kind == kind and + self.name == name and + self.version == version) # FIXME: these accessors are useless, but I want there to be some way # of making it clear that some of the state of the Package object is |