From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 9E13F108F for ; Mon, 23 Jan 2017 13:11:36 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP; 23 Jan 2017 04:11:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,274,1477983600"; d="scan'208";a="925622326" Received: from sivswdev01.ir.intel.com (HELO localhost.localdomain) ([10.237.217.45]) by orsmga003.jf.intel.com with ESMTP; 23 Jan 2017 04:11:34 -0800 From: Bruce Richardson To: Thomas Monjalon Cc: dev@dpdk.org, Bruce Richardson Date: Mon, 23 Jan 2017 12:11:28 +0000 Message-Id: <1485173488-346-1-git-send-email-bruce.richardson@intel.com> X-Mailer: git-send-email 1.7.0.7 Subject: [dpdk-dev] [PATCH] buildtools: allow symlinks within a source directory X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2017 12:11:37 -0000 When creating the symlinks for header files to the include folder, the relpath script dereferenced all symlinks. This made it impossible to have file A.h renamed to B.h and then symlinked back to its original name. This is useful to be able to do when refactoring or reworking a library. Change this so that we just use the dirname of the path from readlink, we can use the basename as it was originally, even if it was a symlink. Signed-off-by: Bruce Richardson --- buildtools/relpath.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildtools/relpath.sh b/buildtools/relpath.sh index 4ff4671..139b781 100755 --- a/buildtools/relpath.sh +++ b/buildtools/relpath.sh @@ -44,7 +44,7 @@ if [ $# -ne 2 ]; then fi # get the real absolute path, derefencing symlinks -ABS1=$(readlink -f $1) +ABS1="$(dirname $(readlink -f $1))/$(basename $1)" ABS2=$(readlink -f $2) # remove leading slash -- 2.9.3