All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Subject: [PATCH] site.conf.sample: Fix broken SOCKS proxy setup and configuration
Date: Thu, 01 Mar 2012 09:44:34 +0000	[thread overview]
Message-ID: <1330595074.30807.4.camel@ted> (raw)

From: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>

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.

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/base.bbclass  |    9 +++++----
 meta/conf/site.conf.sample |   16 ++++++++++++----
 2 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index e80e874..a76fe55 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -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
 
diff --git a/meta/conf/site.conf.sample b/meta/conf/site.conf.sample
index d438298..68d1da9 100644
--- a/meta/conf/site.conf.sample
+++ b/meta/conf/site.conf.sample
@@ -22,17 +22,25 @@ SCONF_VERSION = "1"
 #GIT_PROXY_PORT = "81"
 #export GIT_PROXY_COMMAND = "${COREBASE}/scripts/oe-git-proxy-command"
 
-# GIT_PROXY_IGNORE_* lines define hosts which do not require a proxy to access
+# Set to yes to have a gitconfig generated for handling proxies; you
+# might not want this if you have all that set in your global git
+# configuration. If you don't enable it, the rest of the entries
+# (_PROXY_IGNORE, etc) don't really work that well
 #GIT_CORE_CONFIG = "Yes"
-#GIT_PROXY_IGNORE_1 = "host.server.com"
-#GIT_PROXY_IGNORE_2 = "another.server.com"
+
+# Space separate list of hosts to ignore for GIT proxy
+#GIT_PROXY_IGNORE = "host.server.com another.server.com"
 
 # If SOCKS is available run the following command to comple a simple transport
 # gcc scripts/oe-git-proxy-socks.c -o oe-git-proxy-socks
 # and then share that binary somewhere in PATH, then use the following settings
 #GIT_PROXY_HOST = "proxy.example.com"
 #GIT_PROXY_PORT = "81"
-#export GIT_PROXY_COMMAND = "${COREBASE}/scripts/oe-git-proxy-socks-command"
+
+# GIT_PROXY_COMMAND is used by git to override all proxy settings from
+# configuration files, so we prefix OE_ to avoid breaking havoc on the
+# generated (or local) gitconfig's.
+#OE_GIT_PROXY_COMMAND = "${COREBASE}/scripts/oe-git-proxy-socks-command"
 
 
 # Uncomment this to use a shared download directory





                 reply	other threads:[~2012-03-01  9:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1330595074.30807.4.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=inaky.perez-gonzalez@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.