mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 18:00:35 +00:00
Remove error when adding existing package with same target
This commit is contained in:
parent
cdd372ca3b
commit
c4794ce9f3
1 changed files with 3 additions and 2 deletions
|
@ -34,12 +34,13 @@ class PackageList(object):
|
|||
target = target.format(**self.manifest_vars)
|
||||
package = next((pkg for pkg in self.remote() if pkg.name == name), None)
|
||||
if package is not None:
|
||||
same_target = package.target != target
|
||||
same_target = package.target == target
|
||||
same_target = same_target or package.target is None and target == self.default_target
|
||||
same_target = same_target or package.target == self.default_target and target is None
|
||||
if not same_target:
|
||||
msg = ('The package {name} was already added to the package list, '
|
||||
'but with another target release ({target})').format(name=name, target=package.target)
|
||||
'but with target release `{target}\' instead of `{add_target}\''
|
||||
.format(name=name, target=package.target, add_target=target))
|
||||
raise PackageError(msg)
|
||||
return
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue