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.
This commit is contained in:
Brian C. Lane 2016-06-22 09:20:40 -07:00
parent 8bf144843a
commit fe17f970c9

View File

@ -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 = []