Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ def install_packages(self, packages):
pkg_cmd.append('--nogpgcheck')
elif self.pkg_man == 'zypper':
pkg_cmd.append('--no-gpg-checks')
pkg_cmd.append('--gpg-auto-import-keys')
args.append(" ".join(pkg_cmd + [ 'install', '-y'] + packages))
cmd(["buildah","run"] + args)

Expand All @@ -271,6 +272,28 @@ def install_package_groups(self, package_groups):
pkg_cmd.append('--nogpgcheck')
args.append(" ".join(pkg_cmd + [f'"{pg}"' for pg in package_groups]))
cmd(["buildah","run"] + args)

def install_modules(self, modules):
# check if there are modules groups to install
if len(modules) == 0:
logging.warn("PACKAGE MODULES: no modules passed to install\n")
return
logging.info(f"MODULES: Running these module commands for {self.cname}")
args = [self.cname, '--', 'bash', '-c']
pkg_cmd = [self.pkg_man]
for mod_cmd, mod_list in modules.items():
logging.info(mod_cmd + ": " + " ".join(mod_list))
for mod_cmd, mod_list in modules.items():
if self.pkg_man == "zypper":
logging.warn("zypper does not support package groups")
return
elif self.pkg_man == "dnf":
pkg_cmd.append("module")
pkg_cmd.append(mod_cmd)
pkg_cmd.append("-y")
pkg_cmd.append("--nogpgcheck")
args.append(" ".join(pkg_cmd + mod_list))
cmd(["buildah", "run"] + args)

def remove_packages(self, remove_packages):
# check if there are packages to remove
Expand Down
1 change: 1 addition & 0 deletions src/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def buildah_handler(line):
# Packages
inst.install_scratch_packages(packages, repo_dest, proxy)
else:
inst.install_modules(modules)
inst.install_package_groups(package_groups)
inst.install_packages(packages)
# Remove Packages
Expand Down