Message ID | 1430816409-6773-1-git-send-email-olivier.matz@6wind.com (mailing list archive) |
---|---|
State | Accepted, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 1F377C70E; Tue, 5 May 2015 11:00:21 +0200 (CEST) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by dpdk.org (Postfix) with ESMTP id 03921C6DE for <dev@dpdk.org>; Tue, 5 May 2015 11:00:20 +0200 (CEST) Received: by wiun10 with SMTP id n10so137655047wiu.1 for <dev@dpdk.org>; Tue, 05 May 2015 02:00:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2eNcvVroLiuRyOlPb17lFYEW0wWqmiXvDmxa4yW+eZs=; b=GLo7bYnHLir3IBfbiLg8rYbaeNBrRB7ic0OABeJ9wp6X8UzOMBbSgUGl9mARt80aVC tLvFvOwyVwR4sp954X1VFDLPxc/+00Oz/f8+YjzckX9+Gr2geZEwect0hU22hFUx7nzE SSLb8hYHmRNKWhlmeCtBiplWUGnGCrPEBGZ50Xn1pWJtCoXrDAQpHxfRrWN9ywsCV8r/ M0+oBFmxj9E6Jo0DPSmUq97h6aEww/bZenqdHzXV/JevhsqVvGU2qkQk3PhCML2SMcbe G1+xjhsn06TYlOMmvIXFHEeIQ0jKlCyP+9KvoDihYCQWIrbUwf5xVTjD/p30vlLSH3Di Bc8g== X-Gm-Message-State: ALoCoQnXRFgzdjcF7sFqL2usxWNLCThMfW2bTfiOtOvHMa+tJSg670MV1k4H16Iv4NM/GGGHTvoy X-Received: by 10.180.102.164 with SMTP id fp4mr2049858wib.67.1430816419647; Tue, 05 May 2015 02:00:19 -0700 (PDT) Received: from glumotte.dev.6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id ex2sm24484659wjd.28.2015.05.05.02.00.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 May 2015 02:00:18 -0700 (PDT) From: Olivier Matz <olivier.matz@6wind.com> To: dev@dpdk.org Date: Tue, 5 May 2015 11:00:09 +0200 Message-Id: <1430816409-6773-1-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <55476C37.8050702@netinsight.net> References: <55476C37.8050702@netinsight.net> Subject: [dpdk-dev] [PATCH] scripts: fix relpath.sh output when build dir is a symlink X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Olivier Matz
May 5, 2015, 9 a.m. UTC
The script relpath.sh return the relative path of the first directory
from the second directory. It is used to generate relative symlinks,
which can be useful if the build directory is embedded in the dpdk
directory: the whole dpdk can be moved without breaking the links,
which is helpful for an installation.
In case the build directory is a symlink, the script was not generating
the proper relative path. Fix this by calling "readlink -f" on the
arguments.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
scripts/relpath.sh | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
Comments
Hi Simon, On 05/05/2015 11:00 AM, Olivier Matz wrote: > The script relpath.sh return the relative path of the first directory > from the second directory. It is used to generate relative symlinks, > which can be useful if the build directory is embedded in the dpdk > directory: the whole dpdk can be moved without breaking the links, > which is helpful for an installation. > > In case the build directory is a symlink, the script was not generating > the proper relative path. Fix this by calling "readlink -f" on the > arguments. > > Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Can you have a try with this patch? Regards, Olivier
On 2015-05-05 11:00, Olivier MATZ wrote: > On 05/05/2015 11:00 AM, Olivier Matz wrote: >> The script relpath.sh return the relative path of the first directory >> from the second directory. It is used to generate relative symlinks, >> which can be useful if the build directory is embedded in the dpdk >> directory: the whole dpdk can be moved without breaking the links, >> which is helpful for an installation. >> >> In case the build directory is a symlink, the script was not generating >> the proper relative path. Fix this by calling "readlink -f" on the >> arguments. > > Can you have a try with this patch? Yes, this fixes my build issue, thanks! Verified-by: Simon Kagstrom <simon.kagstrom@netinsight.net> // Simon
2015-05-05 11:14, Simon Kågström: > On 2015-05-05 11:00, Olivier MATZ wrote: > > On 05/05/2015 11:00 AM, Olivier Matz wrote: > >> The script relpath.sh return the relative path of the first directory > >> from the second directory. It is used to generate relative symlinks, > >> which can be useful if the build directory is embedded in the dpdk > >> directory: the whole dpdk can be moved without breaking the links, > >> which is helpful for an installation. > >> > >> In case the build directory is a symlink, the script was not generating > >> the proper relative path. Fix this by calling "readlink -f" on the > >> arguments. > > > > Can you have a try with this patch? > > Yes, this fixes my build issue, thanks! > > Verified-by: Simon Kagstrom <simon.kagstrom@netinsight.net> Applied, thanks
diff --git a/scripts/relpath.sh b/scripts/relpath.sh index 00030e5..7d2f48f 100755 --- a/scripts/relpath.sh +++ b/scripts/relpath.sh @@ -43,8 +43,13 @@ if [ $# -ne 2 ]; then exit 1 fi -REL1=${1#/} -REL2=${2#/} +# get the real absolute path, derefencing symlinks +ABS1=$(readlink -f $1) +ABS2=$(readlink -f $2) + +# remove leading slash +REL1=${ABS1#/} +REL2=${ABS2#/} left1=${REL1%%/*} right1=${REL1#*/}