mirror of
https://git.yoctoproject.org/poky
synced 2026-09-19 18:49:32 +02:00
base.bbclass: Fix the git config file writing code
This commit is contained in:
@@ -731,23 +731,24 @@ def generate_git_config(e):
|
|||||||
from bb import data
|
from bb import data
|
||||||
|
|
||||||
if data.getVar('GIT_CORE_CONFIG', e.data, True):
|
if data.getVar('GIT_CORE_CONFIG', e.data, True):
|
||||||
gitconfig_path = "${STAGING_DIR_HOST}/usr/etc/gitconfig"
|
gitconfig_path = bb.data.expand("${STAGING_DIR_NATTIVE}/usr/etc/gitconfig", e.data)
|
||||||
proxy_command = "gitproxy = %s" % data.getVar('GIT_PROXY_COMMAND', e.data, True)
|
proxy_command = " gitproxy = %s\n" % data.getVar('GIT_PROXY_COMMAND', e.data, True)
|
||||||
|
|
||||||
bb.mkdirhier("${STAGING_DIR_HOST}/usr/etc/")
|
bb.mkdirhier(bb.data.expand("${STAGING_DIR_NATTIVE}/usr/etc/", e.data))
|
||||||
if (os.path.exists(gitconfig_path)):
|
if (os.path.exists(gitconfig_path)):
|
||||||
os.remove(gitconfig_path)
|
os.remove(gitconfig_path)
|
||||||
|
|
||||||
f = open(gitconfig_path, 'w')
|
f = open(gitconfig_path, 'w')
|
||||||
f.write("[core]\n")
|
f.write("[core]\n")
|
||||||
f.write(proxy_command)
|
|
||||||
|
|
||||||
ignore_count = 1
|
ignore_count = 1
|
||||||
ignore_host = data.getVar('GIT_PROXY_IGNORE_1', e.data, True)
|
ignore_host = " gitproxy = non for %s" % data.getVar('GIT_PROXY_IGNORE_1', e.data, True)
|
||||||
while (ignore_host):
|
while (ignore_host):
|
||||||
f.write(ignore_host)
|
f.write(ignore_host)
|
||||||
ignore_count += 1
|
ignore_count += 1
|
||||||
ignore_host = data.getVar('GIT_PROXY_IGNORE_%s' % ignore_count, e.data, True)
|
ignore_host = " gitproxy = non for %s\n" % data.getVar('GIT_PROXY_IGNORE_%s' % ignore_count, e.data, True)
|
||||||
|
f.write(proxy_command)
|
||||||
|
f.close
|
||||||
|
|
||||||
|
|
||||||
METADATA_REVISION ?= "${@base_get_metadata_monotone_revision(d)}"
|
METADATA_REVISION ?= "${@base_get_metadata_monotone_revision(d)}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user