From patchwork Tue Mar 17 17:31:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaaira Gupta X-Patchwork-Id: 3142 Return-Path: Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 34A4F62923 for ; Tue, 17 Mar 2020 18:32:29 +0100 (CET) Received: by mail-pl1-x641.google.com with SMTP id m1so1718202pll.6 for ; Tue, 17 Mar 2020 10:32:29 -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=hEIj/Skc1FVs8whHa+MH9fSiE8OXQz904mLGlCZLCvo=; b=EOVyr6KppWJnX40+5t0q/xcMuTgz9CcblrF9GhrTDFBFyXCFoS+Qe5qbuuDj03EyKt 7mmd0oNaBO+BkUBSiQWjZCjf/L5hTKplI82/kM1TCjWVj3bbEGRWsFaHNVQW44GjryzN XFI2qyn9pfR9xEdwc39phg+ZaMrscCML6xSHyrMMtLYWrmcLfsKlGRgFz0nojX9xRPKV yDjnd43AwR06hEC0RfU9q0xUM0aHpP2W1EVw5xrC1oXdzuVdYe5w8IQmsWea9Mn2mcXo nWjUpSRiQOxHGbMaw+t0ExpRG6HKep1s2x5vwU+1RczGX7wMDbzrvJ7KknlgjNXcpE2+ jD+g== 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=hEIj/Skc1FVs8whHa+MH9fSiE8OXQz904mLGlCZLCvo=; b=ZWiyXJizfER1sa/Bhd/uPt2kCVQWLhhTSOGsGuqLZxGmhzmi0bSmhCKbSnqAUa1sSl 2WWU499RGT6h5oub6Uqym6bJljPqiwWBKF8NlnXCt31Jyj+TLPNUqCUubdqUCzqtE2zv XBaLllcy3Ols4fmOwpYshR0Vj0NeMaO4JBLa7PVvyGrLWA7wZ+hp5kH0AeebS9NuA6mC z58X+OfU1wl75jAaJAYJeB95mAcjIEd0OXYERoOBO/qyL6YVbQ+okCgfpPRtVSULpU/A bmuF+3LldBnRVpyjFj3JWuIe+AWQ0xV2k5cQZFB9VpC78VvI6M/iCdOEgQn7dHhKexBa Fybw== X-Gm-Message-State: ANhLgQ3o8U7gFcCp4p3Dh3kvlD2jiwkSGai5/KMP8YOoPfcuZQ13Fx9S hoqUWhQ/UmMC5B2ENt4oC3+zeJEZQ3o= X-Google-Smtp-Source: ADFU+vt319Y2agoaTDvNI27xetX0RPgWWMPnIZdGgx8yw0mS9iObh+xvdrD/58y5q342Oay/SBh40w== X-Received: by 2002:a17:90a:5801:: with SMTP id h1mr286869pji.121.1584466347750; Tue, 17 Mar 2020 10:32:27 -0700 (PDT) Received: from kaaira-HP-Pavilion-Notebook ([103.113.213.153]) by smtp.gmail.com with ESMTPSA id z16sm3825126pfr.138.2020.03.17.10.32.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Mar 2020 10:32:27 -0700 (PDT) From: Kaaira Gupta To: libcamera-devel@lists.libcamera.org, kieran.bingham@ideasonboard.com, Helen Koike , Vaishali Thakkar Cc: Kaaira Gupta Date: Tue, 17 Mar 2020 23:01:43 +0530 Message-Id: <20200317173145.18226-3-kgupta@es.iitr.ac.in> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200317173145.18226-1-kgupta@es.iitr.ac.in> References: <20200317173145.18226-1-kgupta@es.iitr.ac.in> Subject: [libcamera-devel] [PATCH LIBCAMERA 2/4] 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: Tue, 17 Mar 2020 17:32:29 -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 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/libcamera/ipa_proxy.cpp b/src/libcamera/ipa_proxy.cpp index e04117c..363d034 100644 --- a/src/libcamera/ipa_proxy.cpp +++ b/src/libcamera/ipa_proxy.cpp @@ -75,13 +75,8 @@ 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, ":")){ @@ -93,6 +88,12 @@ std::string IPAProxy::resolvePath(const std::string &file) const return proxyPath; } } + + /*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(); }