diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2008-10-31 14:38:11 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2008-10-31 14:38:11 +0000 |
commit | 921cbb2626f0b6acdca4cbe528b9b5fe757bad6a (patch) | |
tree | 1f499f8a46d87ce6e11019a077b6b0cca4ee95b3 | |
parent | b1046ef7439aa1acee6f6bbbdd0cfb97f34bf824 (diff) | |
download | poky-921cbb2626f0b6acdca4cbe528b9b5fe757bad6a.tar.gz |
base.bbclass: Fix the git config file writing code
-rw-r--r-- | meta/classes/base.bbclass | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 4ce18f0f0c..a9ad1a0793 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass | |||
@@ -731,23 +731,24 @@ def generate_git_config(e): | |||
731 | from bb import data | 731 | from bb import data |
732 | 732 | ||
733 | if data.getVar('GIT_CORE_CONFIG', e.data, True): | 733 | if data.getVar('GIT_CORE_CONFIG', e.data, True): |
734 | gitconfig_path = "${STAGING_DIR_HOST}/usr/etc/gitconfig" | 734 | gitconfig_path = bb.data.expand("${STAGING_DIR_NATTIVE}/usr/etc/gitconfig", e.data) |
735 | proxy_command = "gitproxy = %s" % data.getVar('GIT_PROXY_COMMAND', e.data, True) | 735 | proxy_command = " gitproxy = %s\n" % data.getVar('GIT_PROXY_COMMAND', e.data, True) |
736 | 736 | ||
737 | bb.mkdirhier("${STAGING_DIR_HOST}/usr/etc/") | 737 | bb.mkdirhier(bb.data.expand("${STAGING_DIR_NATTIVE}/usr/etc/", e.data)) |
738 | if (os.path.exists(gitconfig_path)): | 738 | if (os.path.exists(gitconfig_path)): |
739 | os.remove(gitconfig_path) | 739 | os.remove(gitconfig_path) |
740 | 740 | ||
741 | f = open(gitconfig_path, 'w') | 741 | f = open(gitconfig_path, 'w') |
742 | f.write("[core]\n") | 742 | f.write("[core]\n") |
743 | f.write(proxy_command) | ||
744 | |||
745 | ignore_count = 1 | 743 | ignore_count = 1 |
746 | ignore_host = data.getVar('GIT_PROXY_IGNORE_1', e.data, True) | 744 | ignore_host = " gitproxy = non for %s" % data.getVar('GIT_PROXY_IGNORE_1', e.data, True) |
747 | while (ignore_host): | 745 | while (ignore_host): |
748 | f.write(ignore_host) | 746 | f.write(ignore_host) |
749 | ignore_count += 1 | 747 | ignore_count += 1 |
750 | ignore_host = data.getVar('GIT_PROXY_IGNORE_%s' % ignore_count, e.data, True) | 748 | ignore_host = " gitproxy = non for %s\n" % data.getVar('GIT_PROXY_IGNORE_%s' % ignore_count, e.data, True) |
749 | f.write(proxy_command) | ||
750 | f.close | ||
751 | |||
751 | 752 | ||
752 | METADATA_REVISION ?= "${@base_get_metadata_monotone_revision(d)}" | 753 | METADATA_REVISION ?= "${@base_get_metadata_monotone_revision(d)}" |
753 | 754 | ||