From 6fd938259babc5f016a1b6b315b1b826d3a1bbb8 Mon Sep 17 00:00:00 2001 From: Dario Berzano Date: Thu, 22 Nov 2018 16:18:22 +0100 Subject: [PATCH] Make `init` clones relocatable if using symlinks Complements #554. --- alibuild_helpers/init.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alibuild_helpers/init.py b/alibuild_helpers/init.py index bfd87423..658bc2df 100644 --- a/alibuild_helpers/init.py +++ b/alibuild_helpers/init.py @@ -98,8 +98,8 @@ def doInit(args): # Make it point relatively to the mirrors for relocation: as per Git specifics, the path has to # be relative to the repository's `.git` directory. Don't do it if no common path is found - repoObjects = os.path.join(os.path.abspath(dest), ".git", "objects") - refObjects = os.path.join(os.path.abspath(args.referenceSources), + repoObjects = os.path.join(os.path.realpath(dest), ".git", "objects") + refObjects = os.path.join(os.path.realpath(args.referenceSources), spec["package"].lower(), "objects") repoAltConf = os.path.join(repoObjects, "info", "alternates") if len(os.path.commonprefix([repoObjects, refObjects])) > 1: