|
|
@ -332,7 +332,10 @@ def subst_locale(plist):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
locale = libcalamares.globalstorage.value("locale")
|
|
|
|
locale = libcalamares.globalstorage.value("locale")
|
|
|
|
if not locale:
|
|
|
|
if not locale:
|
|
|
|
return plist
|
|
|
|
# It is possible to skip the locale-setting entirely.
|
|
|
|
|
|
|
|
# Then pretend it is "en", so that {LOCALE}-decorated
|
|
|
|
|
|
|
|
# package names are removed from the list.
|
|
|
|
|
|
|
|
locale = "en"
|
|
|
|
|
|
|
|
|
|
|
|
ret = []
|
|
|
|
ret = []
|
|
|
|
for packagedata in plist:
|
|
|
|
for packagedata in plist:
|
|
|
@ -378,20 +381,20 @@ def run_operations(pkgman, entry):
|
|
|
|
global group_packages, completed_packages, mode_packages
|
|
|
|
global group_packages, completed_packages, mode_packages
|
|
|
|
|
|
|
|
|
|
|
|
for key in entry.keys():
|
|
|
|
for key in entry.keys():
|
|
|
|
entry[key] = subst_locale(entry[key])
|
|
|
|
package_list = subst_locale(entry[key])
|
|
|
|
group_packages = len(entry[key])
|
|
|
|
group_packages = len(package_list)
|
|
|
|
if key == "install":
|
|
|
|
if key == "install":
|
|
|
|
_change_mode(INSTALL)
|
|
|
|
_change_mode(INSTALL)
|
|
|
|
if all([isinstance(x, str) for x in entry[key]]):
|
|
|
|
if all([isinstance(x, str) for x in package_list]):
|
|
|
|
pkgman.install(entry[key])
|
|
|
|
pkgman.install(package_list)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
for package in entry[key]:
|
|
|
|
for package in package_list:
|
|
|
|
pkgman.install_package(package)
|
|
|
|
pkgman.install_package(package)
|
|
|
|
elif key == "try_install":
|
|
|
|
elif key == "try_install":
|
|
|
|
_change_mode(INSTALL)
|
|
|
|
_change_mode(INSTALL)
|
|
|
|
# we make a separate package manager call for each package so a
|
|
|
|
# we make a separate package manager call for each package so a
|
|
|
|
# single failing package won't stop all of them
|
|
|
|
# single failing package won't stop all of them
|
|
|
|
for package in entry[key]:
|
|
|
|
for package in package_list:
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
pkgman.install_package(package)
|
|
|
|
pkgman.install_package(package)
|
|
|
|
except subprocess.CalledProcessError:
|
|
|
|
except subprocess.CalledProcessError:
|
|
|
@ -400,10 +403,10 @@ def run_operations(pkgman, entry):
|
|
|
|
libcalamares.utils.warning(warn_text)
|
|
|
|
libcalamares.utils.warning(warn_text)
|
|
|
|
elif key == "remove":
|
|
|
|
elif key == "remove":
|
|
|
|
_change_mode(REMOVE)
|
|
|
|
_change_mode(REMOVE)
|
|
|
|
pkgman.remove(entry[key])
|
|
|
|
pkgman.remove(package_list)
|
|
|
|
elif key == "try_remove":
|
|
|
|
elif key == "try_remove":
|
|
|
|
_change_mode(REMOVE)
|
|
|
|
_change_mode(REMOVE)
|
|
|
|
for package in entry[key]:
|
|
|
|
for package in package_list:
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
pkgman.remove([package])
|
|
|
|
pkgman.remove([package])
|
|
|
|
except subprocess.CalledProcessError:
|
|
|
|
except subprocess.CalledProcessError:
|
|
|
@ -412,9 +415,9 @@ def run_operations(pkgman, entry):
|
|
|
|
libcalamares.utils.warning(warn_text)
|
|
|
|
libcalamares.utils.warning(warn_text)
|
|
|
|
elif key == "localInstall":
|
|
|
|
elif key == "localInstall":
|
|
|
|
_change_mode(INSTALL)
|
|
|
|
_change_mode(INSTALL)
|
|
|
|
pkgman.install(entry[key], from_local=True)
|
|
|
|
pkgman.install(package_list, from_local=True)
|
|
|
|
|
|
|
|
|
|
|
|
completed_packages += len(entry[key])
|
|
|
|
completed_packages += len(package_list)
|
|
|
|
libcalamares.job.setprogress(completed_packages * 1.0 / total_packages)
|
|
|
|
libcalamares.job.setprogress(completed_packages * 1.0 / total_packages)
|
|
|
|
libcalamares.utils.debug(pretty_name())
|
|
|
|
libcalamares.utils.debug(pretty_name())
|
|
|
|
|
|
|
|
|
|
|
@ -458,7 +461,7 @@ def run():
|
|
|
|
completed_packages = 0
|
|
|
|
completed_packages = 0
|
|
|
|
for op in operations:
|
|
|
|
for op in operations:
|
|
|
|
for packagelist in op.values():
|
|
|
|
for packagelist in op.values():
|
|
|
|
total_packages += len(packagelist)
|
|
|
|
total_packages += len(subst_locale(packagelist))
|
|
|
|
|
|
|
|
|
|
|
|
if not total_packages:
|
|
|
|
if not total_packages:
|
|
|
|
# Avoids potential divide-by-zero in progress reporting
|
|
|
|
# Avoids potential divide-by-zero in progress reporting
|
|
|
|