From patchwork Wed Mar 18 00:10:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaaira Gupta X-Patchwork-Id: 3148 Return-Path: Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3B5CC60422 for ; Wed, 18 Mar 2020 01:10:36 +0100 (CET) Received: by mail-pj1-x1043.google.com with SMTP id ck23so454892pjb.4 for ; Tue, 17 Mar 2020 17:10:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=es-iitr-ac-in.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rdfoQjGn5hqOOYCxvBAN9ITJhTDA0Hwl1+8XEz2sZtE=; b=Ey2kh95b46jwmxxTfJZizM8cxetL4I0jD1fjKedlJp+xgS6vfMbMBOeuXp6k7LGkc4 16ugtd/9kCPdclTd6ePY9QScHH2J1hoG9c3bla7XxojeKcwNGZcVNg9UmqWitEf/q8Ga UhxTOep+D6JxxtKBuNyCnWBm0xaB66FFuGUkjHGisosDIP1UVoWgdp7xikz85fgdIEmj 3AKLuD/j03WILygNt2UUkn7HCPzEJ+kZGjpyCxwMDSoMxslJRET3lrCcSe+NY4lkWWu3 shpJBsJbfhEc/UgvlV55A0iRzoNVtZVmQWRL0utuVUSb5G5dMkXlW0ecmuJwcgtPd/iv zowg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rdfoQjGn5hqOOYCxvBAN9ITJhTDA0Hwl1+8XEz2sZtE=; b=VKopbuKlJ8SM6H5j8VWKvWSp35fUL8M9o5OzYMRRcQXFq8N5nOMb7J3t8FDhTacZ0Z 4yF8v+E93arm6AS8z4wj5d2yIGwQKSDw2lbslQXY6QS8lPz5ZDR1lbQjIdJyjmuoIN7V qbtscJV+wVzsz+CoB3pO3ak58zcIzXD/BIVSLJpoggbDYjiYXzWIus2cVySnpjB+vJ3n rB0+KmsQ8KgbTBfc/cR8nv4zlfMpZz36NWMU3J4Q+Q/y9+MbZxa0YnyA60SQR76mFi0a P8JKF7/UrjG1bI2r7mRUPK4BMPHRA/GoXmxtwQLYdm3XKH+EvsqfOKQ3FMmTmVX3FTZI SwnQ== X-Gm-Message-State: ANhLgQ0RwkDOAI99JuJn1iNtmaZZFl6DurWgHowvTjmy/eu2poKHdk12 5BqSb5eYBZNnusxqvT8ciIr0j0gMr+U= X-Google-Smtp-Source: ADFU+vvCYlslo98xu0DXPf+BzJMjban9kMLVaZf5DYdUd/TaSRm03T8hmFWSjTys2IH/FL9umDjxAg== X-Received: by 2002:a17:90a:fa96:: with SMTP id cu22mr1690974pjb.187.1584490234650; Tue, 17 Mar 2020 17:10:34 -0700 (PDT) Received: from kaaira-HP-Pavilion-Notebook ([103.113.213.153]) by smtp.gmail.com with ESMTPSA id w11sm4102523pfn.4.2020.03.17.17.10.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Mar 2020 17:10:34 -0700 (PDT) From: Kaaira Gupta To: kieran.bingham@ideasonboard.com, libcamera-devel@lists.libcamera.org, Helen Koike , Vaishali Thakkar Cc: Kaaira Gupta Date: Wed, 18 Mar 2020 05:40:05 +0530 Message-Id: <20200318001009.32512-3-kgupta@es.iitr.ac.in> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200318001009.32512-1-kgupta@es.iitr.ac.in> References: <20200318001009.32512-1-kgupta@es.iitr.ac.in> Subject: [libcamera-devel] [PATCH LIBCAMERA v2 2/6] libcamera: ipa_proxy: rearrange proxies precedence X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2020 00:10:36 -0000 User environment path in LIBCAMERA_IPA_PROXY_PATH should take precedence over system loading locations. Change precedence accordingly Signed-off-by: Kaaira Gupta --- src/libcamera/ipa_proxy.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libcamera/ipa_proxy.cpp b/src/libcamera/ipa_proxy.cpp index c7347c8..b409e1d 100644 --- a/src/libcamera/ipa_proxy.cpp +++ b/src/libcamera/ipa_proxy.cpp @@ -75,13 +75,9 @@ IPAProxy::~IPAProxy() */ std::string IPAProxy::resolvePath(const std::string &file) const { - /* Try finding the exec target from the install directory first */ std::string proxyFile = "/" + file; - std::string proxyPath = std::string(IPA_PROXY_DIR) + proxyFile; - if (!access(proxyPath.c_str(), X_OK)) - return proxyPath; - /* No exec target in install directory; check env variable. */ + /* Check env variable first. */ const char *execPaths = utils::secure_getenv("LIBCAMERA_IPA_PROXY_PATH"); if (execPaths) { for (const auto &dir : utils::split(execPaths, ":")) { @@ -95,6 +91,11 @@ std::string IPAProxy::resolvePath(const std::string &file) const } } + /* Try finding the exec target from the install directory. */ + std::string proxyPath = std::string(IPA_PROXY_DIR) + proxyFile; + if (!access(proxyPath.c_str(), X_OK)) + return proxyPath; + return std::string(); }