diff options
author | Joshua Lock <josh@linux.intel.com> | 2008-10-30 17:42:01 +0000 |
---|---|---|
committer | Joshua Lock <josh@linux.intel.com> | 2008-10-30 17:52:32 +0000 |
commit | d514eeeaec77c8ba3a4993ad7705e7a857c52dec (patch) | |
tree | 901ce1d59fdb5cbaf26b08b4e373d8d4ef2cc212 /meta/classes | |
parent | 4b93bb317546131f63afb2fb971a572708110c5a (diff) | |
download | openembedded-core-d514eeeaec77c8ba3a4993ad7705e7a857c52dec.tar.gz openembedded-core-d514eeeaec77c8ba3a4993ad7705e7a857c52dec.tar.bz2 openembedded-core-d514eeeaec77c8ba3a4993ad7705e7a857c52dec.zip |
base.bbclass: Additional git proxy support.
Add to the git proxy support so that the proxy configuration can be propogated to the git config (etc/gitconfig in staging).
Add support for ignored hosts in the git proxy.
Examples in site.conf.sample
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/base.bbclass | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index c6e19c1501..623bd79666 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass @@ -725,6 +725,28 @@ def base_get_metadata_svn_revision(d): pass return revision +def generate_git_config(e): + from bb import data + + if data.getVar('GIT_CORE_CONFIG', e.data, True): + gitconfig_path = "${STAGING_DIR_HOST}/usr/etc/gitconfig" + proxy_command = "gitproxy = %s" % data.getVar('GIT_PROXY_COMMAND', e.data, True) + + bb.mkdirhier("${STAGING_DIR_HOST}/usr/etc/") + if (os.path.exists(gitconfig_path)): + os.remove(gitconfig_path) + + f = open(gitconfig_path, 'w') + f.write("[core]\n") + f.write(proxy_command) + + ignore_count = 1 + ignore_host = data.getVar('GIT_PROXY_IGNORE_1', e.data, True) + while (ignore_host): + f.write(ignore_host) + ignore_count += 1 + ignore_host = data.getVar('GIT_PROXY_IGNORE_%s' % ignore_count) + METADATA_REVISION ?= "${@base_get_metadata_monotone_revision(d)}" addhandler base_eventhandler @@ -787,6 +809,9 @@ python base_eventhandler() { os.system('rm -f '+ dir) os.system('touch ' + e.stampPrefix[fn] + '.needclean') + if name == "ConfigParsed": + generate_git_config(e) + if not data in e.__dict__: return NotHandled |