From fe17f970c9a7a37cd96a5a6c22a18167a336ff78 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Wed, 22 Jun 2016 09:20:40 -0700 Subject: [PATCH] Switch installpkg default to --required Previous versions of lorax assumed that installpkg was optional, and would continue on if the PKGGLOB didn't match anything. But the majority of the packages are required so this allows the boot.iso to be built with missing packages that are hard to track down. It makes more sense to make the PKGGLOB required and to flag the few exceptions to this with --optional. --- src/pylorax/ltmpl.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/pylorax/ltmpl.py b/src/pylorax/ltmpl.py index 87fb6f52..3b4c4857 100644 --- a/src/pylorax/ltmpl.py +++ b/src/pylorax/ltmpl.py @@ -524,14 +524,20 @@ class LoraxTemplateRunner(object): def installpkg(self, *pkgs): ''' - installpkg [--required] [--except PKGGLOB [--except PKGGLOB ...]] PKGGLOB [PKGGLOB ...] + installpkg [--required|--optional] [--except PKGGLOB [--except PKGGLOB ...]] PKGGLOB [PKGGLOB ...] Request installation of all packages matching the given globs. Note that this is just a *request* - nothing is *actually* installed until the 'run_pkg_transaction' command is given. + + --required is now the default. If the PKGGLOB can be missing pass --optional ''' - required = False - if pkgs[0] == '--required': + if pkgs[0] == '--optional': pkgs = pkgs[1:] + required = False + elif pkgs[0] == '--required': + pkgs = pkgs[1:] + required = True + else: required = True excludes = []