diff options
| author | Cristian Iorga <cristian.iorga@intel.com> | 2013-04-08 19:06:33 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-04-10 09:23:18 +0100 |
| commit | 4330e152ab743b2df447221ee953b8a1f8990903 (patch) | |
| tree | 5285d71fdbba0672a55e26fda182a77d6242533e /bitbake/lib/bb/ui/crumbs/builder.py | |
| parent | f32d58076e969d43bf9ffb3592ed2788d1741da8 (diff) | |
| download | poky-4330e152ab743b2df447221ee953b8a1f8990903.tar.gz | |
bitbake: bitbake:hob: use a socks proxy mechanism for git
Instead of a custom git proxy mechanism, Hob now
uses a SOCKS proxy in order to work with external
repos via the oe-git-proxy helper script.
Fixes [YOCTO #4187]
(Bitbake rev: 0b81a2c4a5611b64dbdd40131730a82c149b94a2)
Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Cristian Iorga <ubik3000@gmail.com>
Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/builder.py')
| -rwxr-xr-x | bitbake/lib/bb/ui/crumbs/builder.py | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py index 6f95f5b4ce..b347f6ddf4 100755 --- a/bitbake/lib/bb/ui/crumbs/builder.py +++ b/bitbake/lib/bb/ui/crumbs/builder.py | |||
| @@ -56,7 +56,7 @@ class Configuration: | |||
| 56 | 56 | ||
| 57 | @classmethod | 57 | @classmethod |
| 58 | def parse_proxy_string(cls, proxy): | 58 | def parse_proxy_string(cls, proxy): |
| 59 | pattern = "^\s*((http|https|ftp|git|cvs)://)?((\S+):(\S+)@)?([^\s:]+)(:(\d+))?/?" | 59 | pattern = "^\s*((http|https|ftp|socks|cvs)://)?((\S+):(\S+)@)?([^\s:]+)(:(\d+))?/?" |
| 60 | match = re.search(pattern, proxy) | 60 | match = re.search(pattern, proxy) |
| 61 | if match: | 61 | if match: |
| 62 | return match.group(2), match.group(4), match.group(5), match.group(6), match.group(8) | 62 | return match.group(2), match.group(4), match.group(5), match.group(6), match.group(8) |
| @@ -124,7 +124,7 @@ class Configuration: | |||
| 124 | "http" : [None, None, None, "", ""], # protocol : [prot, user, passwd, host, port] | 124 | "http" : [None, None, None, "", ""], # protocol : [prot, user, passwd, host, port] |
| 125 | "https" : [None, None, None, "", ""], | 125 | "https" : [None, None, None, "", ""], |
| 126 | "ftp" : [None, None, None, "", ""], | 126 | "ftp" : [None, None, None, "", ""], |
| 127 | "git" : [None, None, None, "", ""], | 127 | "socks" : [None, None, None, "", ""], |
| 128 | "cvs" : [None, None, None, "", ""], | 128 | "cvs" : [None, None, None, "", ""], |
| 129 | } | 129 | } |
| 130 | 130 | ||
| @@ -181,13 +181,13 @@ class Configuration: | |||
| 181 | self.default_task = params["default_task"] | 181 | self.default_task = params["default_task"] |
| 182 | 182 | ||
| 183 | # proxy settings | 183 | # proxy settings |
| 184 | self.enable_proxy = params["http_proxy"] != "" or params["https_proxy"] != "" or params["ftp_proxy"] != "" \ | 184 | self.enable_proxy = params["http_proxy"] != "" or params["https_proxy"] != "" \ |
| 185 | or params["git_proxy_host"] != "" or params["git_proxy_port"] != "" \ | 185 | or params["ftp_proxy"] != "" or params["socks_proxy"] != "" \ |
| 186 | or params["cvs_proxy_host"] != "" or params["cvs_proxy_port"] != "" | 186 | or params["cvs_proxy_host"] != "" or params["cvs_proxy_port"] != "" |
| 187 | self.split_proxy("http", params["http_proxy"]) | 187 | self.split_proxy("http", params["http_proxy"]) |
| 188 | self.split_proxy("https", params["https_proxy"]) | 188 | self.split_proxy("https", params["https_proxy"]) |
| 189 | self.split_proxy("ftp", params["ftp_proxy"]) | 189 | self.split_proxy("ftp", params["ftp_proxy"]) |
| 190 | self.split_proxy("git", params["git_proxy_host"] + ":" + params["git_proxy_port"]) | 190 | self.split_proxy("socks", params["socks_proxy"]) |
| 191 | self.split_proxy("cvs", params["cvs_proxy_host"] + ":" + params["cvs_proxy_port"]) | 191 | self.split_proxy("cvs", params["cvs_proxy_host"] + ":" + params["cvs_proxy_port"]) |
| 192 | 192 | ||
| 193 | def load(self, template): | 193 | def load(self, template): |
| @@ -215,7 +215,7 @@ class Configuration: | |||
| 215 | self.split_proxy("http", template.getVar("http_proxy")) | 215 | self.split_proxy("http", template.getVar("http_proxy")) |
| 216 | self.split_proxy("https", template.getVar("https_proxy")) | 216 | self.split_proxy("https", template.getVar("https_proxy")) |
| 217 | self.split_proxy("ftp", template.getVar("ftp_proxy")) | 217 | self.split_proxy("ftp", template.getVar("ftp_proxy")) |
| 218 | self.split_proxy("git", template.getVar("GIT_PROXY_HOST") + ":" + template.getVar("GIT_PROXY_PORT")) | 218 | self.split_proxy("socks", template.getVar("all_proxy")) |
| 219 | self.split_proxy("cvs", template.getVar("CVS_PROXY_HOST") + ":" + template.getVar("CVS_PROXY_PORT")) | 219 | self.split_proxy("cvs", template.getVar("CVS_PROXY_HOST") + ":" + template.getVar("CVS_PROXY_PORT")) |
| 220 | 220 | ||
| 221 | def save(self, handler, template, defaults=False): | 221 | def save(self, handler, template, defaults=False): |
| @@ -258,8 +258,7 @@ class Configuration: | |||
| 258 | template.setVar("http_proxy", self.combine_proxy("http")) | 258 | template.setVar("http_proxy", self.combine_proxy("http")) |
| 259 | template.setVar("https_proxy", self.combine_proxy("https")) | 259 | template.setVar("https_proxy", self.combine_proxy("https")) |
| 260 | template.setVar("ftp_proxy", self.combine_proxy("ftp")) | 260 | template.setVar("ftp_proxy", self.combine_proxy("ftp")) |
| 261 | template.setVar("GIT_PROXY_HOST", self.combine_host_only("git")) | 261 | template.setVar("all_proxy", self.combine_proxy("socks")) |
| 262 | template.setVar("GIT_PROXY_PORT", self.combine_port_only("git")) | ||
| 263 | template.setVar("CVS_PROXY_HOST", self.combine_host_only("cvs")) | 262 | template.setVar("CVS_PROXY_HOST", self.combine_host_only("cvs")) |
| 264 | template.setVar("CVS_PROXY_PORT", self.combine_port_only("cvs")) | 263 | template.setVar("CVS_PROXY_PORT", self.combine_port_only("cvs")) |
| 265 | 264 | ||
| @@ -274,8 +273,8 @@ class Configuration: | |||
| 274 | (self.lconf_version, self.extra_setting, self.toolchain_build, self.image_fstypes, self.selected_image) | 273 | (self.lconf_version, self.extra_setting, self.toolchain_build, self.image_fstypes, self.selected_image) |
| 275 | s += "DEPENDS: '%s', IMAGE_INSTALL: '%s', enable_proxy: '%s', use_same_proxy: '%s', http_proxy: '%s', " % \ | 274 | s += "DEPENDS: '%s', IMAGE_INSTALL: '%s', enable_proxy: '%s', use_same_proxy: '%s', http_proxy: '%s', " % \ |
| 276 | (self.selected_recipes, self.user_selected_packages, self.enable_proxy, self.same_proxy, self.combine_proxy("http")) | 275 | (self.selected_recipes, self.user_selected_packages, self.enable_proxy, self.same_proxy, self.combine_proxy("http")) |
| 277 | s += "https_proxy: '%s', ftp_proxy: '%s', GIT_PROXY_HOST: '%s', GIT_PROXY_PORT: '%s', CVS_PROXY_HOST: '%s', CVS_PROXY_PORT: '%s'" % \ | 276 | s += "https_proxy: '%s', ftp_proxy: '%s', all_proxy: '%s', CVS_PROXY_HOST: '%s', CVS_PROXY_PORT: '%s'" % \ |
| 278 | (self.combine_proxy("https"), self.combine_proxy("ftp"),self.combine_host_only("git"), self.combine_port_only("git"), | 277 | (self.combine_proxy("https"), self.combine_proxy("ftp"), self.combine_proxy("socks"), |
| 279 | self.combine_host_only("cvs"), self.combine_port_only("cvs")) | 278 | self.combine_host_only("cvs"), self.combine_port_only("cvs")) |
| 280 | return s | 279 | return s |
| 281 | 280 | ||
| @@ -755,13 +754,13 @@ class Builder(gtk.Window): | |||
| 755 | self.handler.set_http_proxy(self.configuration.combine_proxy("http")) | 754 | self.handler.set_http_proxy(self.configuration.combine_proxy("http")) |
| 756 | self.handler.set_https_proxy(self.configuration.combine_proxy("https")) | 755 | self.handler.set_https_proxy(self.configuration.combine_proxy("https")) |
| 757 | self.handler.set_ftp_proxy(self.configuration.combine_proxy("ftp")) | 756 | self.handler.set_ftp_proxy(self.configuration.combine_proxy("ftp")) |
| 758 | self.handler.set_git_proxy(self.configuration.combine_host_only("git"), self.configuration.combine_port_only("git")) | 757 | self.handler.set_socks_proxy(self.configuration.combine_proxy("socks")) |
| 759 | self.handler.set_cvs_proxy(self.configuration.combine_host_only("cvs"), self.configuration.combine_port_only("cvs")) | 758 | self.handler.set_cvs_proxy(self.configuration.combine_host_only("cvs"), self.configuration.combine_port_only("cvs")) |
| 760 | elif self.configuration.enable_proxy == False: | 759 | elif self.configuration.enable_proxy == False: |
| 761 | self.handler.set_http_proxy("") | 760 | self.handler.set_http_proxy("") |
| 762 | self.handler.set_https_proxy("") | 761 | self.handler.set_https_proxy("") |
| 763 | self.handler.set_ftp_proxy("") | 762 | self.handler.set_ftp_proxy("") |
| 764 | self.handler.set_git_proxy("", "") | 763 | self.handler.set_socks_proxy("") |
| 765 | self.handler.set_cvs_proxy("", "") | 764 | self.handler.set_cvs_proxy("", "") |
| 766 | 765 | ||
| 767 | def set_user_config_extra(self): | 766 | def set_user_config_extra(self): |
