[netinstall] corrected packages module features so that they are up to date
This commit is contained in:
parent
3725c46a3c
commit
d8bd2b22a7
@ -147,7 +147,7 @@ NetInstallViewStep::onLeave()
|
|||||||
if ( !installPackages.empty() )
|
if ( !installPackages.empty() )
|
||||||
packagesWithOperation.insert( "install", QVariant( installPackages ) );
|
packagesWithOperation.insert( "install", QVariant( installPackages ) );
|
||||||
if ( !tryInstallPackages.empty() )
|
if ( !tryInstallPackages.empty() )
|
||||||
packagesWithOperation.insert( "try-install", QVariant( tryInstallPackages ) );
|
packagesWithOperation.insert( "try_install", QVariant( tryInstallPackages ) );
|
||||||
|
|
||||||
if ( !packagesWithOperation.isEmpty() )
|
if ( !packagesWithOperation.isEmpty() )
|
||||||
{
|
{
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
# === 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>
|
||||||
#
|
#
|
||||||
# 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
|
||||||
@ -21,7 +22,7 @@
|
|||||||
import subprocess
|
import subprocess
|
||||||
import libcalamares
|
import libcalamares
|
||||||
from libcalamares.utils import check_target_env_call, target_env_call
|
from libcalamares.utils import check_target_env_call, target_env_call
|
||||||
|
from string import Template
|
||||||
|
|
||||||
class PackageManager:
|
class PackageManager:
|
||||||
""" Package manager class.
|
""" Package manager class.
|
||||||
@ -98,9 +99,7 @@ class PackageManager:
|
|||||||
elif self.backend == "zypp":
|
elif self.backend == "zypp":
|
||||||
check_target_env_call(["zypper", "update"])
|
check_target_env_call(["zypper", "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": check_target_env_call(["apt-get", "update"])
|
||||||
elif self.backend == "apt":
|
|
||||||
check_target_env_call(["apt-get", "update"])
|
|
||||||
elif self.backend == "pacman":
|
elif self.backend == "pacman":
|
||||||
check_target_env_call(["pacman", "-Sy"])
|
check_target_env_call(["pacman", "-Sy"])
|
||||||
elif self.backend == "portage":
|
elif self.backend == "portage":
|
||||||
@ -108,10 +107,20 @@ class PackageManager:
|
|||||||
elif self.backend == "entropy":
|
elif self.backend == "entropy":
|
||||||
check_target_env_call(["equo", "update"])
|
check_target_env_call(["equo", "update"])
|
||||||
|
|
||||||
def run(self, script):
|
|
||||||
if script != "":
|
|
||||||
check_target_env_call(script.split(" "))
|
|
||||||
|
|
||||||
|
def subst_locale(list):
|
||||||
|
ret = []
|
||||||
|
locale = libcalamares.globalstorage.value("locale")
|
||||||
|
if locale:
|
||||||
|
for e in list:
|
||||||
|
if locale != "en":
|
||||||
|
entry = Template(e)
|
||||||
|
ret.append(entry.safe_substitute(LOCALE=locale))
|
||||||
|
elif 'LOCALE' not in e:
|
||||||
|
ret.append(e)
|
||||||
|
else:
|
||||||
|
ret = list
|
||||||
|
return ret
|
||||||
|
|
||||||
def run_operations(pkgman, entry):
|
def run_operations(pkgman, entry):
|
||||||
""" Call package manager with given parameters.
|
""" Call package manager with given parameters.
|
||||||
@ -120,7 +129,14 @@ def run_operations(pkgman, entry):
|
|||||||
:param entry:
|
:param entry:
|
||||||
"""
|
"""
|
||||||
for key in entry.keys():
|
for key in entry.keys():
|
||||||
|
entry[key] = subst_locale(entry[key])
|
||||||
if key == "install":
|
if key == "install":
|
||||||
|
if isinstance(entry[key], list):
|
||||||
|
for package in entry[key]:
|
||||||
|
pkgman.run(package["pre-script"])
|
||||||
|
pkgman.install([package["package"]])
|
||||||
|
pkgman.run(package["post-script"])
|
||||||
|
else:
|
||||||
pkgman.install(entry[key])
|
pkgman.install(entry[key])
|
||||||
elif key == "try_install":
|
elif key == "try_install":
|
||||||
if isinstance(entry[key], list):
|
if isinstance(entry[key], list):
|
||||||
|
Loading…
Reference in New Issue
Block a user