From patchwork Wed Mar 18 11:58:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaaira Gupta X-Patchwork-Id: 3164 Return-Path: Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B23DA60419 for ; Wed, 18 Mar 2020 12:59:18 +0100 (CET) Received: by mail-pg1-x541.google.com with SMTP id 7so13573798pgr.2 for ; Wed, 18 Mar 2020 04:59:18 -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=U4mgLJKKTss/QeKt+ZeZQNKSqkOq1Bo+q4ARsafwKOmEIBgv1xscvEmunYWmAsEXJC 32IUnj/pQ6pgD2S6QmdarbwWp7bCKZbNOXviyjLdi0jLSAoPv3LHcP1LMqGSaagZAm40 uPlwxdvBd1hppYgAF/GnT99eatuJW2kgsEREfDsE5jByUsVprgZ8ceUWM6gk3mGbTqFb TM92rlxRe8UcplkEKlpYHCS/NMvWa0SM4IptzMX4OgTOcwM6FPkCEwXJs96skKPy/Rvm TLsr8RNSfkjwQxUR3sdWrhsA1POZt9V0aw6j5fvF/aU2Gqcai3iELxgQBfoacP7BoOFt nXpw== 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=LaivrbllxBG30DqnRuG5zisyDszY9pmaRNzuMquuz8Xm4G2JgW/+Jdu0SHc4Ftlsu6 8gIgyF1UDSPnEKbqaIvU5JM5P0uFz8cJP0XUR4euLcx4cBu2ix+fcOheUIgCgxkYv3hD wTToj1AiURn8xg3VTWl1LdADFWTJrrfxLi51A0QPOgECD4hQ//sOPdJ/hlsep0X8FqyX KqIM8haVRefjd3dlESGOfSSe3BsYBuMLuecI82irZbwAh7qZbzLjrLwZZRs3dPE5hOjF B9E0pBKjhX51hF05v7tqDtn9cFvAs6Ta546l8t7Mxu24OY7uMijH6McOaA05luFcISa9 /rDQ== X-Gm-Message-State: ANhLgQ1ILhFASZzMaTrbhkBOAXfFa4I8KtT06lcUJ8iCKN7tcgaS27mv NNMBSNUZn6UkKyf0V7encoKLiA== X-Google-Smtp-Source: ADFU+vsM8m9D1kccTl9URjP4XBkRY4fifT7+vai8XGdZbW58ArRroxp+dYQR9/+sTubk5zSx7eHrQQ== X-Received: by 2002:aa7:8f22:: with SMTP id y2mr4072001pfr.300.1584532757300; Wed, 18 Mar 2020 04:59:17 -0700 (PDT) Received: from kaaira-HP-Pavilion-Notebook ([103.113.213.153]) by smtp.gmail.com with ESMTPSA id i11sm2378519pje.30.2020.03.18.04.59.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Mar 2020 04:59:16 -0700 (PDT) From: Kaaira Gupta To: Helen Koike , Vaishali Thakkar , kieran.bingham@ideasonboard.com, libcamera-devel@lists.libcamera.org Cc: Kaaira Gupta Date: Wed, 18 Mar 2020 17:28:42 +0530 Message-Id: <20200318115846.7975-3-kgupta@es.iitr.ac.in> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200318115846.7975-1-kgupta@es.iitr.ac.in> References: <20200318115846.7975-1-kgupta@es.iitr.ac.in> Subject: [libcamera-devel] [PATCH LIBCAMERA v3 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 11:59:18 -0000 User environment path in LIBCAMERA_IPA_PROXY_PATH should take precedence over system loading locations. Change precedence accordingly Signed-off-by: Kaaira Gupta Reviewed-by: Kieran Bingham --- 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(); }