Merge branch '3.1.x-stable' of https://github.com/calamares/calamares into 3.1.x-stable

This commit is contained in:
Philip 2017-12-07 16:46:22 -05:00
commit d213924beb
6 changed files with 44 additions and 22 deletions

View File

@ -166,7 +166,7 @@ set( CALAMARES_TRANSLATION_LANGUAGES ar ast bg ca cs_CZ da de el en en_GB es_MX
### Bump version here
set( CALAMARES_VERSION_MAJOR 3 )
set( CALAMARES_VERSION_MINOR 1 )
set( CALAMARES_VERSION_PATCH 9 )
set( CALAMARES_VERSION_PATCH 10 )
set( CALAMARES_VERSION_RC 0 )
set( CALAMARES_VERSION ${CALAMARES_VERSION_MAJOR}.${CALAMARES_VERSION_MINOR}.${CALAMARES_VERSION_PATCH} )

View File

@ -233,7 +233,7 @@ Helper::~Helper()
{}
boost::python::object
boost::python::dict
Helper::createCleanNamespace()
{
// To make sure we run each script with a clean namespace, we only fetch the

View File

@ -51,7 +51,7 @@ public:
explicit Helper( QObject* parent = nullptr );
virtual ~Helper();
boost::python::object createCleanNamespace();
boost::python::dict createCleanNamespace();
QString handleLastError();

View File

@ -296,7 +296,7 @@ PythonJob::exec()
try
{
bp::object scriptNamespace = helper()->createCleanNamespace();
bp::dict scriptNamespace = helper()->createCleanNamespace();
bp::object calamaresModule = bp::import( "libcalamares" );
bp::dict calamaresNamespace = bp::extract< bp::dict >( calamaresModule.attr( "__dict__" ) );
@ -310,7 +310,7 @@ PythonJob::exec()
scriptNamespace );
bp::object entryPoint = scriptNamespace[ "run" ];
bp::object prettyNameFunc = bp::getattr(scriptNamespace, "pretty_name", bp::object());
bp::object prettyNameFunc = scriptNamespace.get("pretty_name", bp::object());
cDebug() << "Job file" << scriptFI.absoluteFilePath();
if ( !prettyNameFunc.is_none() )

View File

@ -55,8 +55,12 @@ def _change_mode(mode):
def pretty_name():
if not group_packages:
if (total_packages > 0):
# Outside the context of an operation
s = _("Processing packages (%(count)d / %(total)d)")
else:
s = _("Install packages.")
elif mode_packages is INSTALL:
s = _n("Installing one package.",
"Installing %(num)d packages.", group_packages)
@ -422,6 +426,11 @@ def run():
else:
return "Bad backend", "backend=\"{}\"".format(backend)
skip_this = libcalamares.job.configuration.get("skip_if_no_internet", False)
if skip_this and not libcalamares.globalstorage.value("hasInternet"):
libcalamares.utils.debug( "WARNING: packages installation has been skipped: no internet" )
return None
update_db = libcalamares.job.configuration.get("update_db", False)
if update_db and libcalamares.globalstorage.value("hasInternet"):
pkgman.update_db()

View File

@ -14,9 +14,20 @@
#
backend: dummy
# If set to true, a package-manager specific update procedure
# is run first (only if there is internet) to update the list
# of packages and dependencies.
# Often package installation needs an internet connection.
# Since you may allow system installation without a connection
# and want to offer **optional** package installation, it's
# possible to have no internet, yet have this packages module
# enabled in settings.
#
# You can skip the whole module when there is no internet
# by setting *skip_if_no_internet* to true.
#
# You can run a package-manager specific update procedure
# before installing packages (for instance, to update the
# list of packages and dependencies); this is done only if there
# is an internet connection. Set *update_db* to true to do so.
skip_if_no_internet: false
update_db: true
#
@ -29,9 +40,10 @@ update_db: true
# packages that need to be installed or removed can run before
# this one. Distro developers may want to install locale packages
# or remove drivers not needed on the installed system.
# This job will populate a list of dictionaries in the global
# storage called "packageOperations" and it is processed
# after the static list in the job configuration.
# Such a job would populate a list of dictionaries in the global
# storage called "packageOperations" and that list is processed
# after the static list in the job configuration (i.e. the list
# that is in this configuration file).
#
# Allowed package operations are:
# - install, try_install: will call the package manager to
@ -49,7 +61,7 @@ update_db: true
# while try_remove carries on. Packages may be listed as
# (localized) names.
#
# There are two formats for naming packages: as a name # or as package-data,
# There are two formats for naming packages: as a name or as package-data,
# which is an object notation providing package-name, as well as pre- and
# post-install scripts.
#
@ -74,15 +86,16 @@ update_db: true
#
# - if the system locale is English (generally US English; en_GB is a valid
# localization), then the package is not installed at all,
# - otherwise LOCALE is replaced by the Bcp47 name of the selected system
# locale, e.g. nl_BE.
# - otherwise $LOCALE or ${LOCALE} is replaced by the Bcp47 name of the selected
# system locale, e.g. nl_BE. Note that just plain LOCALE will not be replaced,
# so foo-LOCALE will be unchanged, while foo-$LOCALE will be changed.
#
# The following installs localizations for vi, if they are relevant; if
# there is no localization, installation continues normally.
#
# - install
# - vi-LOCALE
# - package: vi-LOCALE
# - vi-$LOCALE
# - package: vi-${LOCALE}
# pre-script: touch /tmp/installing-vi
# post-script: rm -f /tmp/installing-vi
#