[netinstall] made packages optional
A group can now contain only subgroups. Thus packages can be categorized through sub-categories such as Internet->Web Browsers->firefox
This commit is contained in:
parent
a6016c63aa
commit
dd25323a08
@ -231,10 +231,11 @@ PackageModel::setupModelData( const YAML::Node& data, PackageTreeItem* parent )
|
||||
item->setCritical(
|
||||
CalamaresUtils::yamlToVariant( itemDefinition["critical"] ).toBool() );
|
||||
|
||||
for ( YAML::const_iterator packageIt = itemDefinition["packages"].begin();
|
||||
packageIt != itemDefinition["packages"].end(); ++packageIt )
|
||||
item->appendChild(
|
||||
new PackageTreeItem( CalamaresUtils::yamlToVariant( *packageIt ).toString(), item ) );
|
||||
if ( itemDefinition["packages"] )
|
||||
for ( YAML::const_iterator packageIt = itemDefinition["packages"].begin();
|
||||
packageIt != itemDefinition["packages"].end(); ++packageIt )
|
||||
item->appendChild(
|
||||
new PackageTreeItem( CalamaresUtils::yamlToVariant( *packageIt ).toString(), item ) );
|
||||
|
||||
if ( itemDefinition["subgroups"] )
|
||||
setupModelData( itemDefinition["subgroups"], item );
|
||||
|
@ -4,7 +4,8 @@
|
||||
# === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
#
|
||||
# Copyright 2014, Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
|
||||
# Copyright 2016, Kyle Robbertze <kyle@aims.ac.za>
|
||||
# Copyright 2015-2017, Teo Mrnjavac <teo@kde.org>
|
||||
# Copyright 2016-2017, Kyle Robbertze <kyle@aims.ac.za>
|
||||
#
|
||||
# Calamares is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -97,7 +98,7 @@ class PackageManager:
|
||||
if self.backend == "packagekit":
|
||||
check_target_env_call(["pkcon", "refresh"])
|
||||
elif self.backend == "zypp":
|
||||
check_target_env_call(["zypper", "update"])
|
||||
check_target_env_call(["zypper", "--non-interactive", "update"])
|
||||
elif self.backend == "urpmi":
|
||||
check_target_env_call(["urpmi.update", "-a"])
|
||||
elif self.backend == "apt":
|
||||
@ -137,34 +138,37 @@ def run_operations(pkgman, entry):
|
||||
for key in entry.keys():
|
||||
entry[key] = subst_locale(entry[key])
|
||||
if key == "install":
|
||||
if isinstance(entry[key], list):
|
||||
if isinstance(package, str):
|
||||
pkgman.install(entry[key])
|
||||
else:
|
||||
for package in entry[key]:
|
||||
pkgman.run(package["pre-script"])
|
||||
pkgman.install([package["package"]])
|
||||
pkgman.run(package["post-script"])
|
||||
else:
|
||||
pkgman.install(entry[key])
|
||||
elif key == "try_install":
|
||||
if isinstance(entry[key], list):
|
||||
for package in entry[key]:
|
||||
# we make a separate package manager call for each package so a single
|
||||
# failing package won't stop all of them
|
||||
for package in entry[key]:
|
||||
if isinstance(package, str):
|
||||
try:
|
||||
pkgman.install([package])
|
||||
except subprocess.CalledProcessError:
|
||||
libcalamares.utils.debug("WARNING: could not install package {}".format(package))
|
||||
else:
|
||||
try:
|
||||
pkgman.run(package["pre-script"])
|
||||
pkgman.install([package["package"]])
|
||||
pkgman.run(package["post-script"])
|
||||
except subprocess.CalledProcessError:
|
||||
libcalamares.utils.debug("WARNING: could not install packages {}".format(package["package"]))
|
||||
else:
|
||||
try:
|
||||
pkgman.install(entry[key])
|
||||
except subprocess.CalledProcessError:
|
||||
libcalamares.utils.debug("WARNING: could not install packages {}".format(", ".join(entry[key])))
|
||||
elif key == "remove":
|
||||
pkgman.remove(entry[key])
|
||||
elif key == "try_remove":
|
||||
try:
|
||||
pkgman.remove(entry[key])
|
||||
except subprocess.CalledProcessError:
|
||||
libcalamares.utils.debug("WARNING: could not remove packages {}".format(", ".join(entry[key])))
|
||||
for package in entry[key]:
|
||||
try:
|
||||
pkgman.remove([package])
|
||||
except subprocess.CalledProcessError:
|
||||
libcalamares.utils.debug("WARNING: could not remove package {}".format(package))
|
||||
elif key == "localInstall":
|
||||
pkgman.install(entry[key], from_local=True)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user