diff options
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/buildmanager.py | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/buildmanager.py b/bitbake/lib/bb/ui/crumbs/buildmanager.py index b5a4dae0de..e858d75e4c 100644 --- a/bitbake/lib/bb/ui/crumbs/buildmanager.py +++ b/bitbake/lib/bb/ui/crumbs/buildmanager.py | |||
@@ -76,31 +76,30 @@ class BuildConfiguration: | |||
76 | # file format. | 76 | # file format. |
77 | @staticmethod | 77 | @staticmethod |
78 | def load_from_file (filename): | 78 | def load_from_file (filename): |
79 | f = open (filename, "r") | ||
80 | 79 | ||
81 | conf = BuildConfiguration() | 80 | conf = BuildConfiguration() |
82 | for line in f.readlines(): | 81 | with open(filename, "r") as f: |
83 | data = line.split (";")[1] | 82 | for line in f: |
84 | if (line.startswith ("metadata-url;")): | 83 | data = line.split (";")[1] |
85 | conf.metadata_url = data.strip() | 84 | if (line.startswith ("metadata-url;")): |
86 | continue | 85 | conf.metadata_url = data.strip() |
87 | if (line.startswith ("url;")): | 86 | continue |
88 | conf.urls += [data.strip()] | 87 | if (line.startswith ("url;")): |
89 | continue | 88 | conf.urls += [data.strip()] |
90 | if (line.startswith ("extra-url;")): | 89 | continue |
91 | conf.extra_urls += [data.strip()] | 90 | if (line.startswith ("extra-url;")): |
92 | continue | 91 | conf.extra_urls += [data.strip()] |
93 | if (line.startswith ("machine;")): | 92 | continue |
94 | conf.machine = data.strip() | 93 | if (line.startswith ("machine;")): |
95 | continue | 94 | conf.machine = data.strip() |
96 | if (line.startswith ("distribution;")): | 95 | continue |
97 | conf.distro = data.strip() | 96 | if (line.startswith ("distribution;")): |
98 | continue | 97 | conf.distro = data.strip() |
99 | if (line.startswith ("image;")): | 98 | continue |
100 | conf.image = data.strip() | 99 | if (line.startswith ("image;")): |
101 | continue | 100 | conf.image = data.strip() |
101 | continue | ||
102 | 102 | ||
103 | f.close () | ||
104 | return conf | 103 | return conf |
105 | 104 | ||
106 | # Serialise to a file. This is part of the build process and we use this | 105 | # Serialise to a file. This is part of the build process and we use this |