site.conf.sample: Fix broken SOCKS proxy setup and configuration
authorInaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Thu, 1 Mar 2012 09:44:34 +0000 (09:44 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 1 Mar 2012 16:35:53 +0000 (16:35 +0000)
SOCKS proxy specification with git was using conflicting methods and
thus was failing when mixed SOCKS needs were in place (requiring no
proxy for some hosts and proxy for the rest)

- GIT_PROXY_COMMAND is an environment variable GIT uses to OVERRIDE
  all proxy configuration in ~/.gitconfig or any other gitconfig. By
  using it to configure, it was breaking havoc on site git
  configuration or the one generated by bitbake in tmp/.

  Renamed to OE_GIT_PROXY_COMMAND in meta/conf/site.conf.sample
   (with a doc tidbit on the name chosen), meta/classes/base.bbclass.

- The gitconfig generated by bitbake was wrong. There was a typo error
  (gitproxy vs gitProxy), thus all lines were being ignored. Fixed in
  meta/classes/base.bbclass.

- The gitconfig generated was being placed in
  ${STAGING_DIR_NATIVE}/usr/etc/gitconfig; git was looking for it in
  ${STAGING_DIR_NATIVE}/etc/gitconfig. Fixed that in
  meta/classes/base.bbclass, at the same time creating a
  GIT_CONFIG_PATH variable, since it is also referenced in
  generate_git_config() and have all instances refer to that.

(From OE-Core rev: e579eb7f33462258c8e82a0936d970593614840d)

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/base.bbclass

index e80e874..a76fe55 100644 (file)
@@ -111,16 +111,17 @@ python base_do_unpack() {
             raise bb.build.FuncFailed(e)
 }
 
-GIT_CONFIG = "${STAGING_DIR_NATIVE}/usr/etc/gitconfig"
+GIT_CONFIG_PATH = "${STAGING_DIR_NATIVE}/etc"
+GIT_CONFIG = "${GIT_CONFIG_PATH}/gitconfig"
 
 def generate_git_config(e):
         from bb import data
 
         if data.getVar('GIT_CORE_CONFIG', e.data, True):
                 gitconfig_path = e.data.getVar('GIT_CONFIG', True)
-                proxy_command = "    gitproxy = %s\n" % data.getVar('GIT_PROXY_COMMAND', e.data, True)
+                proxy_command = "    gitProxy = %s\n" % data.getVar('OE_GIT_PROXY_COMMAND', e.data, True)
 
-                bb.mkdirhier(bb.data.expand("${STAGING_DIR_NATIVE}/usr/etc/", e.data))
+                bb.mkdirhier(bb.data.expand("${GIT_CONFIG_PATH}", e.data))
                 if (os.path.exists(gitconfig_path)):
                         os.remove(gitconfig_path)
 
@@ -128,7 +129,7 @@ def generate_git_config(e):
                 f.write("[core]\n")
                 ignore_hosts = data.getVar('GIT_PROXY_IGNORE', e.data, True).split()
                 for ignore_host in ignore_hosts:
-                        f.write("    gitproxy = none for %s\n" % ignore_host)
+                        f.write("    gitProxy = none for %s\n" % ignore_host)
                 f.write(proxy_command)
                 f.close