Merge branch '3.1.x-stable' (netinstall fixes)

This commit is contained in:
Adriaan de Groot 2017-10-23 11:53:30 -04:00
commit c15db95046
2 changed files with 26 additions and 10 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 5 )
set( CALAMARES_VERSION_PATCH 6 )
set( CALAMARES_VERSION_RC 0 )
set( CALAMARES_VERSION ${CALAMARES_VERSION_MAJOR}.${CALAMARES_VERSION_MINOR}.${CALAMARES_VERSION_PATCH} )

View File

@ -126,18 +126,26 @@ NetInstallViewStep::onLeave()
cDebug() << "Leaving netinstall, adding packages to be installed"
<< "to global storage";
QMap<QString, QVariant> packagesWithOperation;
QList<PackageTreeItem::ItemData> packages = m_widget->selectedPackages();
QVariantList installPackages;
QVariantList tryInstallPackages;
QVariantList packageOperations;
cDebug() << "Processing";
for ( auto package : packages )
{
QMap<QString, QVariant> details;
details.insert( "pre-script", package.preScript );
details.insert( "package", package.packageName );
details.insert( "post-script", package.postScript );
QVariant details( package.packageName );
// If it's a package with a pre- or post-script, replace
// with the more complicated datastructure.
if (!package.preScript.isEmpty() || !package.postScript.isEmpty())
{
QMap<QString, QVariant> sdetails;
sdetails.insert( "pre-script", package.preScript );
sdetails.insert( "package", package.packageName );
sdetails.insert( "post-script", package.postScript );
details = sdetails;
}
if ( package.isCritical )
installPackages.append( details );
else
@ -145,14 +153,22 @@ NetInstallViewStep::onLeave()
}
if ( !installPackages.empty() )
packagesWithOperation.insert( "install", QVariant( installPackages ) );
{
QMap<QString, QVariant> op;
op.insert( "install", QVariant( installPackages ) );
packageOperations.append(op);
}
if ( !tryInstallPackages.empty() )
packagesWithOperation.insert( "try_install", QVariant( tryInstallPackages ) );
{
QMap<QString, QVariant> op;
op.insert( "try_install", QVariant( tryInstallPackages ) );
packageOperations.append(op);
}
if ( !packagesWithOperation.isEmpty() )
if ( !packageOperations.isEmpty() )
{
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
gs->insert( "packageOperations", QVariant( packagesWithOperation ) );
gs->insert( "packageOperations", QVariant( packageOperations ) );
}
}