]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts/oe-package-browser: Handle no packages being built
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 11 Nov 2021 15:06:06 +0000 (15:06 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 11 Nov 2021 17:04:09 +0000 (17:04 +0000)
Give the user a proper error message if there aren't packages built,
rather than a less friendly traceback.

[YOCTO #14619]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/oe-pkgdata-browser

index e07005b8070c864819b3054b473f29160f4b362d..a3a381923b7e3465f85c30b84bc7ee76c0ab84d9 100755 (executable)
@@ -236,6 +236,8 @@ class PkgUi():
         update_deps("RPROVIDES", "Provides: ", self.provides_label, clickable=False)
 
     def load_recipes(self):
+        if not os.path.exists(pkgdata):
+            sys.exit("Error: Please ensure %s exists by generating packages before using this tool." % pkgdata)
         for recipe in sorted(os.listdir(pkgdata)):
             if os.path.isfile(os.path.join(pkgdata, recipe)):
                 self.recipe_iters[recipe] = self.recipe_store.append([recipe])