Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 914a773a authored by Alexander Koskovich's avatar Alexander Koskovich Committed by Jan Altensen
Browse files

core: Fix host_init_verifier for devices with overriding services

Previous commit e5f05202 did not fully solve this, the build can still
fail if the non-overriden definition gets parsed _after_ the overriden
one.

Also change an error return to just a log warning, was running into
services failing out at this part when it should just ignore it and
move on.

Test: m dist
Change-Id: I038e2aab67ef627c5865c78337cee9a268c78255
parent d8e680dc
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -203,11 +203,13 @@ 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 && !service_->is_override()) {
        if (svc->interfaces().count(fullname) > 0) {
            if (!svc->is_override() && !service_->is_override()) {
                return Error() << "Interface '" << fullname << "' redefined in " << service_->name()
                               << " but is already defined by " << svc->name();
            }
        }
    }

    service_->interfaces_.insert(fullname);

@@ -700,8 +702,9 @@ Result<void> ServiceParser::EndSection() {
    Service* old_service = service_list_->FindService(service_->name());
    if (old_service) {
        if (!service_->is_override()) {
            return Error() << "ignored duplicate definition of service '" << service_->name()
            LOG(WARNING) << "ignored duplicate definition of service '" << service_->name()
                         << "'";
            return {};
        }

        if (StartsWith(filename_, "/apex/") && !old_service->is_updatable()) {