summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-05-06 16:56:03 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-05-12 16:44:06 +0100
commit7868ccd57ab19659b8fa4cec3dfa0a3645c501ea (patch)
tree6a3be4a0bc39df3ab4bc0c716af1b6bb89157b20
parentdb10b2623d582a00af2d0c544d5dd3611d2e0ab5 (diff)
downloadpoky-7868ccd57ab19659b8fa4cec3dfa0a3645c501ea.tar.gz
scripts/git: Ensure we don't have circular references
This is horrible but I'm running out of better ideas. We hit circular reference issues which we were trying to avoid in the core HOSTTOOLS code. When building the eSDK, there can be two copies of the script. Therefore assume git will never be in a directory called scripts. This fixes eSDK build failures. (From OE-Core rev: b9dcaa76b3274ced1e4b9e2ca33f778e8cd50032) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 27de610ac30d4c81352efc794df7e9b1060f7a68) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xscripts/git9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/git b/scripts/git
index 8adf5c9ecb..644055e540 100755
--- a/scripts/git
+++ b/scripts/git
@@ -10,7 +10,14 @@ os.environ['PSEUDO_UNLOAD'] = '1'
10 10
11# calculate path to the real 'git' 11# calculate path to the real 'git'
12path = os.environ['PATH'] 12path = os.environ['PATH']
13path = path.replace(os.path.dirname(sys.argv[0]), '') 13# we need to remove our path but also any other copy of this script which
14# may be present, e.g. eSDK.
15replacements = [os.path.dirname(sys.argv[0])]
16for p in path.split(":"):
17 if p.endswith("/scripts"):
18 replacements.append(p)
19for r in replacements:
20 path = path.replace(r, '/ignoreme')
14real_git = shutil.which('git', path=path) 21real_git = shutil.which('git', path=path)
15 22
16if len(sys.argv) == 1: 23if len(sys.argv) == 1: