Netinstall: optimize structure for packages

- If there's no scripts involved in a package for netinstall, just
   name it without the scripts; this lets the packages module
   optimize to fewer package manager calls.
This commit is contained in:
Adriaan de Groot 2017-10-23 11:15:19 -04:00
parent 4314f2c4ad
commit 58414666c8

View File

@ -135,10 +135,17 @@ NetInstallViewStep::onLeave()
for ( auto package : packages ) for ( auto package : packages )
{ {
QMap<QString, QVariant> details; QVariant details( package.packageName );
details.insert( "pre-script", package.preScript ); // If it's a package with a pre- or post-script, replace
details.insert( "package", package.packageName ); // with the more complicated datastructure.
details.insert( "post-script", package.postScript ); 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 ) if ( package.isCritical )
installPackages.append( details ); installPackages.append( details );
else else