summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui
diff options
context:
space:
mode:
authorCristian Iorga <cristian.iorga@intel.com>2013-04-08 19:06:33 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-04-10 09:23:18 +0100
commit4330e152ab743b2df447221ee953b8a1f8990903 (patch)
tree5285d71fdbba0672a55e26fda182a77d6242533e /bitbake/lib/bb/ui
parentf32d58076e969d43bf9ffb3592ed2788d1741da8 (diff)
downloadpoky-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')
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/builder.py23
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig/simplesettingsdialog.py32
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobeventhandler.py9
3 files changed, 30 insertions, 34 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):
diff --git a/bitbake/lib/bb/ui/crumbs/hig/simplesettingsdialog.py b/bitbake/lib/bb/ui/crumbs/hig/simplesettingsdialog.py
index 8ac82ed7df..c1bd45f432 100644
--- a/bitbake/lib/bb/ui/crumbs/hig/simplesettingsdialog.py
+++ b/bitbake/lib/bb/ui/crumbs/hig/simplesettingsdialog.py
@@ -161,13 +161,13 @@ class SimpleSettingsDialog (CrumbsDialog, SettingsUIHelper):
161 self.ftp_proxy_port.set_sensitive(self.configuration.enable_proxy and (not self.configuration.same_proxy)) 161 self.ftp_proxy_port.set_sensitive(self.configuration.enable_proxy and (not self.configuration.same_proxy))
162 self.ftp_proxy_details.set_sensitive(self.configuration.enable_proxy and (not self.configuration.same_proxy)) 162 self.ftp_proxy_details.set_sensitive(self.configuration.enable_proxy and (not self.configuration.same_proxy))
163 163
164 self.git_proxy.set_text(self.configuration.combine_host_only("git")) 164 self.socks_proxy.set_text(self.configuration.combine_host_only("socks"))
165 self.git_proxy.set_editable(self.configuration.enable_proxy and (not self.configuration.same_proxy)) 165 self.socks_proxy.set_editable(self.configuration.enable_proxy and (not self.configuration.same_proxy))
166 self.git_proxy.set_sensitive(self.configuration.enable_proxy and (not self.configuration.same_proxy)) 166 self.socks_proxy.set_sensitive(self.configuration.enable_proxy and (not self.configuration.same_proxy))
167 self.git_proxy_port.set_text(self.configuration.combine_port_only("git")) 167 self.socks_proxy_port.set_text(self.configuration.combine_port_only("socks"))
168 self.git_proxy_port.set_editable(self.configuration.enable_proxy and (not self.configuration.same_proxy)) 168 self.socks_proxy_port.set_editable(self.configuration.enable_proxy and (not self.configuration.same_proxy))
169 self.git_proxy_port.set_sensitive(self.configuration.enable_proxy and (not self.configuration.same_proxy)) 169 self.socks_proxy_port.set_sensitive(self.configuration.enable_proxy and (not self.configuration.same_proxy))
170 self.git_proxy_details.set_sensitive(self.configuration.enable_proxy and (not self.configuration.same_proxy)) 170 self.socks_proxy_details.set_sensitive(self.configuration.enable_proxy and (not self.configuration.same_proxy))
171 171
172 self.cvs_proxy.set_text(self.configuration.combine_host_only("cvs")) 172 self.cvs_proxy.set_text(self.configuration.combine_host_only("cvs"))
173 self.cvs_proxy.set_editable(self.configuration.enable_proxy and (not self.configuration.same_proxy)) 173 self.cvs_proxy.set_editable(self.configuration.enable_proxy and (not self.configuration.same_proxy))
@@ -201,12 +201,12 @@ class SimpleSettingsDialog (CrumbsDialog, SettingsUIHelper):
201 if self.configuration.same_proxy: 201 if self.configuration.same_proxy:
202 self.configuration.split_proxy("https", self.http_proxy.get_text() + ":" + self.http_proxy_port.get_text()) 202 self.configuration.split_proxy("https", self.http_proxy.get_text() + ":" + self.http_proxy_port.get_text())
203 self.configuration.split_proxy("ftp", self.http_proxy.get_text() + ":" + self.http_proxy_port.get_text()) 203 self.configuration.split_proxy("ftp", self.http_proxy.get_text() + ":" + self.http_proxy_port.get_text())
204 self.configuration.split_proxy("git", self.http_proxy.get_text() + ":" + self.http_proxy_port.get_text()) 204 self.configuration.split_proxy("socks", self.http_proxy.get_text() + ":" + self.http_proxy_port.get_text())
205 self.configuration.split_proxy("cvs", self.http_proxy.get_text() + ":" + self.http_proxy_port.get_text()) 205 self.configuration.split_proxy("cvs", self.http_proxy.get_text() + ":" + self.http_proxy_port.get_text())
206 else: 206 else:
207 self.configuration.split_proxy("https", self.https_proxy.get_text() + ":" + self.https_proxy_port.get_text()) 207 self.configuration.split_proxy("https", self.https_proxy.get_text() + ":" + self.https_proxy_port.get_text())
208 self.configuration.split_proxy("ftp", self.ftp_proxy.get_text() + ":" + self.ftp_proxy_port.get_text()) 208 self.configuration.split_proxy("ftp", self.ftp_proxy.get_text() + ":" + self.ftp_proxy_port.get_text())
209 self.configuration.split_proxy("git", self.git_proxy.get_text() + ":" + self.git_proxy_port.get_text()) 209 self.configuration.split_proxy("socks", self.socks_proxy.get_text() + ":" + self.socks_proxy_port.get_text())
210 self.configuration.split_proxy("cvs", self.cvs_proxy.get_text() + ":" + self.cvs_proxy_port.get_text()) 210 self.configuration.split_proxy("cvs", self.cvs_proxy.get_text() + ":" + self.cvs_proxy_port.get_text())
211 211
212 def response_cb(self, dialog, response_id): 212 def response_cb(self, dialog, response_id):
@@ -555,13 +555,13 @@ class SimpleSettingsDialog (CrumbsDialog, SettingsUIHelper):
555 self.handler.set_http_proxy(self.configuration.combine_proxy("http")) 555 self.handler.set_http_proxy(self.configuration.combine_proxy("http"))
556 self.handler.set_https_proxy(self.configuration.combine_proxy("https")) 556 self.handler.set_https_proxy(self.configuration.combine_proxy("https"))
557 self.handler.set_ftp_proxy(self.configuration.combine_proxy("ftp")) 557 self.handler.set_ftp_proxy(self.configuration.combine_proxy("ftp"))
558 self.handler.set_git_proxy(self.configuration.combine_host_only("git"), self.configuration.combine_port_only("git")) 558 self.handler.set_socks_proxy(self.configuration.combine_proxy("socks"))
559 self.handler.set_cvs_proxy(self.configuration.combine_host_only("cvs"), self.configuration.combine_port_only("cvs")) 559 self.handler.set_cvs_proxy(self.configuration.combine_host_only("cvs"), self.configuration.combine_port_only("cvs"))
560 elif self.configuration.enable_proxy == False: 560 elif self.configuration.enable_proxy == False:
561 self.handler.set_http_proxy("") 561 self.handler.set_http_proxy("")
562 self.handler.set_https_proxy("") 562 self.handler.set_https_proxy("")
563 self.handler.set_ftp_proxy("") 563 self.handler.set_ftp_proxy("")
564 self.handler.set_git_proxy("", "") 564 self.handler.set_socks_proxy("")
565 self.handler.set_cvs_proxy("", "") 565 self.handler.set_cvs_proxy("", "")
566 self.proxy_test_ran = True 566 self.proxy_test_ran = True
567 self.proxy_test_running = True 567 self.proxy_test_running = True
@@ -673,11 +673,11 @@ class SimpleSettingsDialog (CrumbsDialog, SettingsUIHelper):
673 self.same_proxy_addresses.append(self.ftp_proxy) 673 self.same_proxy_addresses.append(self.ftp_proxy)
674 self.same_proxy_ports.append(self.ftp_proxy_port) 674 self.same_proxy_ports.append(self.ftp_proxy_port)
675 675
676 self.git_proxy, self.git_proxy_port, self.git_proxy_details = self.gen_proxy_entry_widget( 676 self.socks_proxy, self.socks_proxy_port, self.socks_proxy_details = self.gen_proxy_entry_widget(
677 "git", self, True, 3) 677 "socks", self, True, 3)
678 proxy_test_focus += [self.git_proxy, self.git_proxy_port] 678 proxy_test_focus += [self.socks_proxy, self.socks_proxy_port]
679 self.same_proxy_addresses.append(self.git_proxy) 679 self.same_proxy_addresses.append(self.socks_proxy)
680 self.same_proxy_ports.append(self.git_proxy_port) 680 self.same_proxy_ports.append(self.socks_proxy_port)
681 681
682 self.cvs_proxy, self.cvs_proxy_port, self.cvs_proxy_details = self.gen_proxy_entry_widget( 682 self.cvs_proxy, self.cvs_proxy_port, self.cvs_proxy_details = self.gen_proxy_entry_widget(
683 "cvs", self, True, 4) 683 "cvs", self, True, 4)
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index c33fb74100..d060bc0b42 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -367,9 +367,8 @@ class HobHandler(gobject.GObject):
367 def set_ftp_proxy(self, ftp_proxy): 367 def set_ftp_proxy(self, ftp_proxy):
368 self.runCommand(["setVariable", "ftp_proxy", ftp_proxy]) 368 self.runCommand(["setVariable", "ftp_proxy", ftp_proxy])
369 369
370 def set_git_proxy(self, host, port): 370 def set_socks_proxy(self, socks_proxy):
371 self.runCommand(["setVariable", "GIT_PROXY_HOST", host]) 371 self.runCommand(["setVariable", "all_proxy", socks_proxy])
372 self.runCommand(["setVariable", "GIT_PROXY_PORT", port])
373 372
374 def set_cvs_proxy(self, host, port): 373 def set_cvs_proxy(self, host, port):
375 self.runCommand(["setVariable", "CVS_PROXY_HOST", host]) 374 self.runCommand(["setVariable", "CVS_PROXY_HOST", host])
@@ -565,9 +564,7 @@ class HobHandler(gobject.GObject):
565 564
566 params["default_task"] = self.runCommand(["getVariable", "BB_DEFAULT_TASK"]) or "build" 565 params["default_task"] = self.runCommand(["getVariable", "BB_DEFAULT_TASK"]) or "build"
567 566
568 params["git_proxy_host"] = self.runCommand(["getVariable", "GIT_PROXY_HOST"]) or "" 567 params["socks_proxy"] = self.runCommand(["getVariable", "all_proxy"]) or ""
569 params["git_proxy_port"] = self.runCommand(["getVariable", "GIT_PROXY_PORT"]) or ""
570
571 params["http_proxy"] = self.runCommand(["getVariable", "http_proxy"]) or "" 568 params["http_proxy"] = self.runCommand(["getVariable", "http_proxy"]) or ""
572 params["ftp_proxy"] = self.runCommand(["getVariable", "ftp_proxy"]) or "" 569 params["ftp_proxy"] = self.runCommand(["getVariable", "ftp_proxy"]) or ""
573 params["https_proxy"] = self.runCommand(["getVariable", "https_proxy"]) or "" 570 params["https_proxy"] = self.runCommand(["getVariable", "https_proxy"]) or ""