diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-12 08:30:35 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-16 23:32:40 +0100 |
commit | bc8971d122a02ed823acf0758da267dccc584f98 (patch) | |
tree | dd97329507feb611e64fad7f46d97d657f23eae4 /bitbake/bin/bitbake-layers | |
parent | e2f4d9f1ec694768b223decb59a9c768a2da962d (diff) | |
download | poky-bc8971d122a02ed823acf0758da267dccc584f98.tar.gz |
bitbake: bitbake: Convert to python 3 megacommit This needs breaking up into smaller changes.
(Bitbake rev: cf51f19aed208a75d38c14cd585d9b9f115e3ba3)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin/bitbake-layers')
-rwxr-xr-x | bitbake/bin/bitbake-layers | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/bitbake/bin/bitbake-layers b/bitbake/bin/bitbake-layers index 8b17eb0696..9d397e93a2 100755 --- a/bitbake/bin/bitbake-layers +++ b/bitbake/bin/bitbake-layers | |||
@@ -1,4 +1,4 @@ | |||
1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python3 |
2 | 2 | ||
3 | # This script has subcommands which operate against your bitbake layers, either | 3 | # This script has subcommands which operate against your bitbake layers, either |
4 | # displaying useful information, or acting against them. | 4 | # displaying useful information, or acting against them. |
@@ -27,7 +27,7 @@ import fnmatch | |||
27 | from collections import defaultdict | 27 | from collections import defaultdict |
28 | import argparse | 28 | import argparse |
29 | import re | 29 | import re |
30 | import httplib, urlparse, json | 30 | import http.client, urllib.parse, json |
31 | import subprocess | 31 | import subprocess |
32 | 32 | ||
33 | bindir = os.path.dirname(__file__) | 33 | bindir = os.path.dirname(__file__) |
@@ -68,7 +68,7 @@ class Commands(): | |||
68 | self.bblayers = (self.bbhandler.config_data.getVar('BBLAYERS', True) or "").split() | 68 | self.bblayers = (self.bbhandler.config_data.getVar('BBLAYERS', True) or "").split() |
69 | self.bbhandler.prepare(config_only) | 69 | self.bbhandler.prepare(config_only) |
70 | layerconfs = self.bbhandler.config_data.varhistory.get_variable_items_files('BBFILE_COLLECTIONS', self.bbhandler.config_data) | 70 | layerconfs = self.bbhandler.config_data.varhistory.get_variable_items_files('BBFILE_COLLECTIONS', self.bbhandler.config_data) |
71 | self.bbfile_collections = {layer: os.path.dirname(os.path.dirname(path)) for layer, path in layerconfs.iteritems()} | 71 | self.bbfile_collections = {layer: os.path.dirname(os.path.dirname(path)) for layer, path in layerconfs.items()} |
72 | 72 | ||
73 | 73 | ||
74 | def do_show_layers(self, args): | 74 | def do_show_layers(self, args): |
@@ -134,11 +134,11 @@ Removes the specified layer from bblayers.conf | |||
134 | def get_json_data(self, apiurl): | 134 | def get_json_data(self, apiurl): |
135 | proxy_settings = os.environ.get("http_proxy", None) | 135 | proxy_settings = os.environ.get("http_proxy", None) |
136 | conn = None | 136 | conn = None |
137 | _parsedurl = urlparse.urlparse(apiurl) | 137 | _parsedurl = urllib.parse.urlparse(apiurl) |
138 | path = _parsedurl.path | 138 | path = _parsedurl.path |
139 | query = _parsedurl.query | 139 | query = _parsedurl.query |
140 | def parse_url(url): | 140 | def parse_url(url): |
141 | parsedurl = urlparse.urlparse(url) | 141 | parsedurl = urllib.parse.urlparse(url) |
142 | if parsedurl.netloc[0] == '[': | 142 | if parsedurl.netloc[0] == '[': |
143 | host, port = parsedurl.netloc[1:].split(']', 1) | 143 | host, port = parsedurl.netloc[1:].split(']', 1) |
144 | if ':' in port: | 144 | if ':' in port: |
@@ -155,11 +155,11 @@ Removes the specified layer from bblayers.conf | |||
155 | 155 | ||
156 | if proxy_settings is None: | 156 | if proxy_settings is None: |
157 | host, port = parse_url(apiurl) | 157 | host, port = parse_url(apiurl) |
158 | conn = httplib.HTTPConnection(host, port) | 158 | conn = http.client.HTTPConnection(host, port) |
159 | conn.request("GET", path + "?" + query) | 159 | conn.request("GET", path + "?" + query) |
160 | else: | 160 | else: |
161 | host, port = parse_url(proxy_settings) | 161 | host, port = parse_url(proxy_settings) |
162 | conn = httplib.HTTPConnection(host, port) | 162 | conn = http.client.HTTPConnection(host, port) |
163 | conn.request("GET", apiurl) | 163 | conn.request("GET", apiurl) |
164 | 164 | ||
165 | r = conn.getresponse() | 165 | r = conn.getresponse() |
@@ -632,7 +632,7 @@ build results (as the layer priority order has effectively changed). | |||
632 | applied_appends = [] | 632 | applied_appends = [] |
633 | for layer in layers: | 633 | for layer in layers: |
634 | overlayed = [] | 634 | overlayed = [] |
635 | for f in self.bbhandler.cooker.collection.overlayed.iterkeys(): | 635 | for f in self.bbhandler.cooker.collection.overlayed.keys(): |
636 | for of in self.bbhandler.cooker.collection.overlayed[f]: | 636 | for of in self.bbhandler.cooker.collection.overlayed[f]: |
637 | if of.startswith(layer): | 637 | if of.startswith(layer): |
638 | overlayed.append(of) | 638 | overlayed.append(of) |
@@ -777,7 +777,7 @@ Lists recipes with the bbappends that apply to them as subitems. | |||
777 | 777 | ||
778 | def show_appends_for_skipped(self): | 778 | def show_appends_for_skipped(self): |
779 | filenames = [os.path.basename(f) | 779 | filenames = [os.path.basename(f) |
780 | for f in self.bbhandler.cooker.skiplist.iterkeys()] | 780 | for f in self.bbhandler.cooker.skiplist.keys()] |
781 | return self.show_appends_output(filenames, None, " (skipped)") | 781 | return self.show_appends_output(filenames, None, " (skipped)") |
782 | 782 | ||
783 | def show_appends_output(self, filenames, best_filename, name_suffix = ''): | 783 | def show_appends_output(self, filenames, best_filename, name_suffix = ''): |
@@ -1006,6 +1006,7 @@ def main(): | |||
1006 | parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true') | 1006 | parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true') |
1007 | parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true') | 1007 | parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true') |
1008 | subparsers = parser.add_subparsers(title='subcommands', metavar='<subcommand>') | 1008 | subparsers = parser.add_subparsers(title='subcommands', metavar='<subcommand>') |
1009 | subparsers.required = True | ||
1009 | 1010 | ||
1010 | parser_show_layers = add_command('show-layers', cmds.do_show_layers) | 1011 | parser_show_layers = add_command('show-layers', cmds.do_show_layers) |
1011 | 1012 | ||