[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,6 +231,7 @@ PackageModel::setupModelData( const YAML::Node& data, PackageTreeItem* parent )
|
|||||||
item->setCritical(
|
item->setCritical(
|
||||||
CalamaresUtils::yamlToVariant( itemDefinition["critical"] ).toBool() );
|
CalamaresUtils::yamlToVariant( itemDefinition["critical"] ).toBool() );
|
||||||
|
|
||||||
|
if ( itemDefinition["packages"] )
|
||||||
for ( YAML::const_iterator packageIt = itemDefinition["packages"].begin();
|
for ( YAML::const_iterator packageIt = itemDefinition["packages"].begin();
|
||||||
packageIt != itemDefinition["packages"].end(); ++packageIt )
|
packageIt != itemDefinition["packages"].end(); ++packageIt )
|
||||||
item->appendChild(
|
item->appendChild(
|
||||||
|
@ -4,7 +4,8 @@
|
|||||||
# === This file is part of Calamares - <http://github.com/calamares> ===
|
# === This file is part of Calamares - <http://github.com/calamares> ===
|
||||||
#
|
#
|
||||||
# Copyright 2014, Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
|
# 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
|
# Calamares is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -97,7 +98,7 @@ class PackageManager:
|
|||||||
if self.backend == "packagekit":
|
if self.backend == "packagekit":
|
||||||
check_target_env_call(["pkcon", "refresh"])
|
check_target_env_call(["pkcon", "refresh"])
|
||||||
elif self.backend == "zypp":
|
elif self.backend == "zypp":
|
||||||
check_target_env_call(["zypper", "update"])
|
check_target_env_call(["zypper", "--non-interactive", "update"])
|
||||||
elif self.backend == "urpmi":
|
elif self.backend == "urpmi":
|
||||||
check_target_env_call(["urpmi.update", "-a"])
|
check_target_env_call(["urpmi.update", "-a"])
|
||||||
elif self.backend == "apt":
|
elif self.backend == "apt":
|
||||||
@ -137,34 +138,37 @@ def run_operations(pkgman, entry):
|
|||||||
for key in entry.keys():
|
for key in entry.keys():
|
||||||
entry[key] = subst_locale(entry[key])
|
entry[key] = subst_locale(entry[key])
|
||||||
if key == "install":
|
if key == "install":
|
||||||
if isinstance(entry[key], list):
|
if isinstance(package, str):
|
||||||
|
pkgman.install(entry[key])
|
||||||
|
else:
|
||||||
for package in entry[key]:
|
for package in entry[key]:
|
||||||
pkgman.run(package["pre-script"])
|
pkgman.run(package["pre-script"])
|
||||||
pkgman.install([package["package"]])
|
pkgman.install([package["package"]])
|
||||||
pkgman.run(package["post-script"])
|
pkgman.run(package["post-script"])
|
||||||
else:
|
|
||||||
pkgman.install(entry[key])
|
|
||||||
elif key == "try_install":
|
elif key == "try_install":
|
||||||
if isinstance(entry[key], list):
|
# 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]:
|
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:
|
try:
|
||||||
pkgman.run(package["pre-script"])
|
pkgman.run(package["pre-script"])
|
||||||
pkgman.install([package["package"]])
|
pkgman.install([package["package"]])
|
||||||
pkgman.run(package["post-script"])
|
pkgman.run(package["post-script"])
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
libcalamares.utils.debug("WARNING: could not install packages {}".format(package["package"]))
|
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":
|
elif key == "remove":
|
||||||
pkgman.remove(entry[key])
|
pkgman.remove(entry[key])
|
||||||
elif key == "try_remove":
|
elif key == "try_remove":
|
||||||
|
for package in entry[key]:
|
||||||
try:
|
try:
|
||||||
pkgman.remove(entry[key])
|
pkgman.remove([package])
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
libcalamares.utils.debug("WARNING: could not remove packages {}".format(", ".join(entry[key])))
|
libcalamares.utils.debug("WARNING: could not remove package {}".format(package))
|
||||||
elif key == "localInstall":
|
elif key == "localInstall":
|
||||||
pkgman.install(entry[key], from_local=True)
|
pkgman.install(entry[key], from_local=True)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user