summaryrefslogtreecommitdiffstats
path: root/scripts/oe-pkgdata-browser
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/oe-pkgdata-browser')
-rwxr-xr-xscripts/oe-pkgdata-browser13
1 files changed, 10 insertions, 3 deletions
diff --git a/scripts/oe-pkgdata-browser b/scripts/oe-pkgdata-browser
index 8d223185a4..c152c82b25 100755
--- a/scripts/oe-pkgdata-browser
+++ b/scripts/oe-pkgdata-browser
@@ -1,4 +1,9 @@
1#! /usr/bin/env python3 1#! /usr/bin/env python3
2#
3# Copyright OpenEmbedded Contributors
4#
5# SPDX-License-Identifier: MIT
6#
2 7
3import os, sys, enum, ast 8import os, sys, enum, ast
4 9
@@ -49,11 +54,11 @@ def load(filename, suffix=None):
49 from configparser import ConfigParser 54 from configparser import ConfigParser
50 from itertools import chain 55 from itertools import chain
51 56
52 parser = ConfigParser() 57 parser = ConfigParser(delimiters=('='))
53 if suffix: 58 if suffix:
54 parser.optionxform = lambda option: option.replace("_" + suffix, "") 59 parser.optionxform = lambda option: option.replace(":" + suffix, "")
55 with open(filename) as lines: 60 with open(filename) as lines:
56 lines = chain(("[fake]",), lines) 61 lines = chain(("[fake]",), (line.replace(": ", " = ", 1) for line in lines))
57 parser.read_file(lines) 62 parser.read_file(lines)
58 63
59 # TODO extract the data and put it into a real dict so we can transform some 64 # TODO extract the data and put it into a real dict so we can transform some
@@ -236,6 +241,8 @@ class PkgUi():
236 update_deps("RPROVIDES", "Provides: ", self.provides_label, clickable=False) 241 update_deps("RPROVIDES", "Provides: ", self.provides_label, clickable=False)
237 242
238 def load_recipes(self): 243 def load_recipes(self):
244 if not os.path.exists(pkgdata):
245 sys.exit("Error: Please ensure %s exists by generating packages before using this tool." % pkgdata)
239 for recipe in sorted(os.listdir(pkgdata)): 246 for recipe in sorted(os.listdir(pkgdata)):
240 if os.path.isfile(os.path.join(pkgdata, recipe)): 247 if os.path.isfile(os.path.join(pkgdata, recipe)):
241 self.recipe_iters[recipe] = self.recipe_store.append([recipe]) 248 self.recipe_iters[recipe] = self.recipe_store.append([recipe])