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

This commit is contained in:
Philip 2017-10-24 08:26:44 -04:00
commit 95e3b7650c
4 changed files with 47 additions and 15 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 ### Bump version here
set( CALAMARES_VERSION_MAJOR 3 ) set( CALAMARES_VERSION_MAJOR 3 )
set( CALAMARES_VERSION_MINOR 1 ) set( CALAMARES_VERSION_MINOR 1 )
set( CALAMARES_VERSION_PATCH 6 ) set( CALAMARES_VERSION_PATCH 7 )
set( CALAMARES_VERSION_RC 0 ) set( CALAMARES_VERSION_RC 0 )
set( CALAMARES_VERSION ${CALAMARES_VERSION_MAJOR}.${CALAMARES_VERSION_MINOR}.${CALAMARES_VERSION_PATCH} ) set( CALAMARES_VERSION ${CALAMARES_VERSION_MAJOR}.${CALAMARES_VERSION_MINOR}.${CALAMARES_VERSION_PATCH} )

View File

@ -266,7 +266,13 @@ def install_grub(efi_directory, fw_type):
"64": os.path.join(install_efi_directory_firmware, "64": os.path.join(install_efi_directory_firmware,
efi_bootloader_id, efi_bootloader_id,
"grubx64.efi")} "grubx64.efi")}
shutil.copy2(efi_file_source[efi_bitness], install_efi_boot_directory)
efi_file_target = {"32": os.path.join(install_efi_boot_directory,
"bootia32.efi"),
"64": os.path.join(install_efi_boot_directory,
"bootx64.efi")}
shutil.copy2(efi_file_source[efi_bitness], efi_file_target[efi_bitness])
else: else:
print("Bootloader: grub (bios)") print("Bootloader: grub (bios)")
if libcalamares.globalstorage.value("bootLoader") is None: if libcalamares.globalstorage.value("bootLoader") is None:

View File

@ -126,18 +126,26 @@ NetInstallViewStep::onLeave()
cDebug() << "Leaving netinstall, adding packages to be installed" cDebug() << "Leaving netinstall, adding packages to be installed"
<< "to global storage"; << "to global storage";
QMap<QString, QVariant> packagesWithOperation;
QList<PackageTreeItem::ItemData> packages = m_widget->selectedPackages(); QList<PackageTreeItem::ItemData> packages = m_widget->selectedPackages();
QVariantList installPackages; QVariantList installPackages;
QVariantList tryInstallPackages; QVariantList tryInstallPackages;
cDebug() << "Processing"; QVariantList packageOperations;
cDebug() << "Processing" << packages.length() << "packages from netinstall.";
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
@ -145,14 +153,24 @@ NetInstallViewStep::onLeave()
} }
if ( !installPackages.empty() ) if ( !installPackages.empty() )
packagesWithOperation.insert( "install", QVariant( installPackages ) ); {
QMap<QString, QVariant> op;
op.insert( "install", QVariant( installPackages ) );
packageOperations.append(op);
cDebug() << " .." << installPackages.length() << "critical packages.";
}
if ( !tryInstallPackages.empty() ) if ( !tryInstallPackages.empty() )
packagesWithOperation.insert( "try_install", QVariant( tryInstallPackages ) ); {
QMap<QString, QVariant> op;
op.insert( "try_install", QVariant( tryInstallPackages ) );
packageOperations.append(op);
cDebug() << " .." << tryInstallPackages.length() << "non-critical packages.";
}
if ( !packagesWithOperation.isEmpty() ) if ( !packageOperations.isEmpty() )
{ {
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage(); Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
gs->insert( "packageOperations", QVariant( packagesWithOperation ) ); gs->insert( "packageOperations", QVariant( packageOperations ) );
} }
} }

View File

@ -344,10 +344,18 @@ def subst_locale(plist):
def run_operations(pkgman, entry): def run_operations(pkgman, entry):
""" """
Call package manager with given parameters. Call package manager with suitable parameters for the given
package actions.
:param pkgman: :param pkgman: PackageManager
:param entry: This is the manager that does the actual work.
:param entry: dict
Keys are the actions -- e.g. "install" -- to take, and the values
are the (list of) packages to apply the action to. The actions are
not iterated in a specific order, so it is recommended to use only
one action per dictionary. The list of packages may be package
names (strings) or package information dictionaries with pre-
and post-scripts.
""" """
global group_packages, completed_packages, mode_packages global group_packages, completed_packages, mode_packages