mirror of
https://git.yoctoproject.org/poky-contrib
synced 2025-05-09 08:02:36 +08:00

Where there isn't a copyright statement, add one to make it explicit. Also drop editor config lines where they were present and add license identifiers as MIT if there isn't one. (From OE-Core rev: deb3ccec53e0bd63bc4235cf2b0d3fc781687361) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
31 lines
711 B
Python
Executable File
31 lines
711 B
Python
Executable File
#!/usr/bin/env python3
|
|
#
|
|
# Copyright OpenEmbedded Contributors
|
|
#
|
|
# SPDX-License-Identifier: MIT
|
|
#
|
|
# Wrapper around 'git' that doesn't think we are root
|
|
|
|
import os
|
|
import shutil
|
|
import sys
|
|
|
|
os.environ['PSEUDO_UNLOAD'] = '1'
|
|
|
|
# calculate path to the real 'git'
|
|
path = os.environ['PATH']
|
|
# we need to remove our path but also any other copy of this script which
|
|
# may be present, e.g. eSDK.
|
|
replacements = [os.path.dirname(sys.argv[0])]
|
|
for p in path.split(":"):
|
|
if p.endswith("/scripts"):
|
|
replacements.append(p)
|
|
for r in replacements:
|
|
path = path.replace(r, '/ignoreme')
|
|
real_git = shutil.which('git', path=path)
|
|
|
|
if len(sys.argv) == 1:
|
|
os.execl(real_git, 'git')
|
|
|
|
os.execv(real_git, sys.argv)
|