init: Skip interface duplicates if service is an override

These aren't actually duplicate interfaces because we
are overriding the service so interfaces in the original
definition will never be used.

Test: Verify 'm dist' works without complaining about
      duplicate interfaces.

Change-Id: Iab5e1d8bb4cb7d5b2608028c3cee73af94c47424
This commit is contained in:
Alexander Koskovich 2022-03-06 15:51:51 -07:00
parent 5acf7ceb93
commit e5f05202c7
No known key found for this signature in database
GPG Key ID: 7DEBC4828C2B4DC8
1 changed files with 1 additions and 1 deletions

View File

@ -202,7 +202,7 @@ Result<void> ServiceParser::ParseInterface(std::vector<std::string>&& args) {
const std::string fullname = interface_name + "/" + instance_name;
for (const auto& svc : *service_list_) {
if (svc->interfaces().count(fullname) > 0) {
if (svc->interfaces().count(fullname) > 0 && !service_->is_override()) {
return Error() << "Interface '" << fullname << "' redefined in " << service_->name()
<< " but is already defined by " << svc->name();
}