From 300ebaaa037495e9e7f75d171d369e89ed685fec Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 13 Oct 2019 21:12:24 +0200 Subject: [PATCH 1/5] Changes: post-release housekeeping --- CHANGES | 12 ++++++++++++ CMakeLists.txt | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 5ade0ba1b..e5e3c42ba 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,18 @@ contributors are listed. Note that Calamares does not have a historical changelog -- this log starts with version 3.2.0. The release notes on the website will have to do for older versions. +# 3.2.16 (unreleased) # + +This release contains contributions from (alphabetically by first name): + - No other contributors this time around. + +## Core ## + - No changes to core functionality + +## Modules ## + - No changes to module functionality + + # 3.2.15 (2019-10-11) # This release contains contributions from (alphabetically by first name): diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d61ebbc5..ad92c3b62 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,10 +40,10 @@ cmake_minimum_required( VERSION 3.3 FATAL_ERROR ) project( CALAMARES - VERSION 3.2.15 + VERSION 3.2.16 LANGUAGES C CXX ) -set( CALAMARES_VERSION_RC 0 ) # Set to 0 during release cycle, 1 during development +set( CALAMARES_VERSION_RC 1 ) # Set to 0 during release cycle, 1 during development ### OPTIONS # From c4b0511f8d04c9f28fc729a043007e8d9fb0afab Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 21 Oct 2019 18:08:16 +0200 Subject: [PATCH 2/5] [libcalamaresui] Improve debug message for bad dirs - Calamares scans **all** subdirs of the module-directory for a module.desc and complains about those that don't have a module.desc. - For ./calamares -d runs from the build-directory, this leads to a few complaints when some plugins have been ignored (and so no module.desc is generated for them). --- src/libcalamaresui/modulesystem/ModuleManager.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/libcalamaresui/modulesystem/ModuleManager.cpp b/src/libcalamaresui/modulesystem/ModuleManager.cpp index 53cc1fabb..cd8685f44 100644 --- a/src/libcalamaresui/modulesystem/ModuleManager.cpp +++ b/src/libcalamaresui/modulesystem/ModuleManager.cpp @@ -91,17 +91,20 @@ ModuleManager::doInit() bool success = currentDir.cd( subdir ); if ( success ) { + static const char bad_descriptor[] = "ModuleManager potential module descriptor is bad"; QFileInfo descriptorFileInfo( currentDir.absoluteFilePath( QLatin1String( "module.desc" ) ) ); if ( !descriptorFileInfo.exists() ) { - cDebug() << "ModuleManager expected descriptor is missing:" - << descriptorFileInfo.absoluteFilePath(); + cDebug() << bad_descriptor + << descriptorFileInfo.absoluteFilePath() + << "(missing)"; continue; } if ( !descriptorFileInfo.isReadable() ) { - cDebug() << "ModuleManager descriptor file is unreadable:" - << descriptorFileInfo.absoluteFilePath(); + cDebug() << bad_descriptor + << descriptorFileInfo.absoluteFilePath() + << "(unreadable)"; continue; } @@ -109,7 +112,7 @@ ModuleManager::doInit() QVariantMap moduleDescriptorMap = CalamaresUtils::loadYaml( descriptorFileInfo, &ok ); QString moduleName = ok ? moduleDescriptorMap.value( "name" ).toString() : QString(); - if ( ok && ( moduleName == currentDir.dirName() ) + if ( ok && !moduleName.isEmpty() && ( moduleName == currentDir.dirName() ) && !m_availableDescriptorsByModuleName.contains( moduleName ) ) { m_availableDescriptorsByModuleName.insert( moduleName, moduleDescriptorMap ); From a9a12820d8f8ce72d67c2b153cc2b50adf5acddb Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 21 Oct 2019 19:16:15 +0200 Subject: [PATCH 3/5] [libcalamaresui] Log the found-modules - fix up comment because it described an old member variable name - log number of modules found (all the *potential* modules) --- src/libcalamaresui/modulesystem/ModuleManager.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libcalamaresui/modulesystem/ModuleManager.cpp b/src/libcalamaresui/modulesystem/ModuleManager.cpp index cd8685f44..2cfb05d2e 100644 --- a/src/libcalamaresui/modulesystem/ModuleManager.cpp +++ b/src/libcalamaresui/modulesystem/ModuleManager.cpp @@ -131,8 +131,11 @@ ModuleManager::doInit() cDebug() << "ModuleManager module search path does not exist:" << path; } } - // At this point m_availableModules is filled with whatever was found in the - // search paths. + // At this point m_availableDescriptorsByModuleName is filled with + // the modules that were found in the search paths. + cDebug() << "Found" + << m_availableDescriptorsByModuleName.count() << "modules" + << m_moduleDirectoriesByModuleName.count() << "names"; emit initDone(); } From 5ac4f3ec380551e00fcf2513e600a7454a277201 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 21 Oct 2019 19:28:59 +0200 Subject: [PATCH 4/5] [libcalamaresui] Fix up module dependency checking - If a module exists, and has unmet dependencies, then that is only a problem if the module itself is *used*. Merely existing is ok. This triggers on FreeBSD, where partition isn't built, but bootloader depends on partition -- so you can never start Calamares on FreeBSD, because bootloader depends on something non-existent. Relax the check: just warn, and only fail if a non-existent module is used (all those with unmet dependencies are considered non-existent). --- .../modulesystem/ModuleManager.cpp | 23 +++++++++++-------- .../modulesystem/ModuleManager.h | 14 ++++++----- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/libcalamaresui/modulesystem/ModuleManager.cpp b/src/libcalamaresui/modulesystem/ModuleManager.cpp index 2cfb05d2e..33b638e64 100644 --- a/src/libcalamaresui/modulesystem/ModuleManager.cpp +++ b/src/libcalamaresui/modulesystem/ModuleManager.cpp @@ -188,11 +188,15 @@ findCustomInstance( const Settings::InstanceDescriptionList& customInstances, co void ModuleManager::loadModules() { - QStringList failedModules = checkDependencies(); + if (checkDependencies()) + { + cWarning() << "Some installed modules have unmet dependencies."; + } Settings::InstanceDescriptionList customInstances = Settings::instance()->customModuleInstances(); + QStringList failedModules; const auto modulesSequence - = failedModules.isEmpty() ? Settings::instance()->modulesSequence() : Settings::ModuleSequence(); + = Settings::instance()->modulesSequence() ; for ( const auto& modulePhase : modulesSequence ) { ModuleSystem::Action currentAction = modulePhase.first; @@ -270,7 +274,7 @@ ModuleManager::loadModules() continue; } - if ( !checkDependencies( *thisModule ) ) + if ( !checkModuleDependencies( *thisModule ) ) { // Error message is already printed failedModules.append( instanceKey.toString() ); @@ -351,10 +355,10 @@ missingRequiredModules( const QStringList& required, const QMap< QString, QVaria return l; } -QStringList +size_t ModuleManager::checkDependencies() { - QStringList failed; + size_t numberRemoved = 0; bool somethingWasRemovedBecauseOfUnmetDependencies = false; // This goes through the map of available modules, and deletes those whose @@ -373,19 +377,18 @@ ModuleManager::checkDependencies() QString moduleName = it->value( "name" ).toString(); somethingWasRemovedBecauseOfUnmetDependencies = true; m_availableDescriptorsByModuleName.erase( it ); - failed << moduleName; - cWarning() << "Module" << moduleName << "requires modules" << Logger::DebugList( unmet ); - cWarning() << Logger::SubEntry << "but these are not available (listed in settings, or installed)."; + numberRemoved++; + cWarning() << "Module" << moduleName << "requires missing modules" << Logger::DebugList( unmet ); break; } } } while ( somethingWasRemovedBecauseOfUnmetDependencies ); - return failed; + return numberRemoved; } bool -ModuleManager::checkDependencies( const Module& m ) +ModuleManager::checkModuleDependencies( const Module& m ) { bool allRequirementsFound = true; QStringList requiredModules diff --git a/src/libcalamaresui/modulesystem/ModuleManager.h b/src/libcalamaresui/modulesystem/ModuleManager.h index a4f28fab8..7adbb24e2 100644 --- a/src/libcalamaresui/modulesystem/ModuleManager.h +++ b/src/libcalamaresui/modulesystem/ModuleManager.h @@ -106,15 +106,17 @@ private slots: private: /** * Check in a general sense whether the dependencies between - * modules are valid. Returns a list of module names that - * do **not** have their requirements met. + * modules are valid. Returns the number of modules that + * have missing dependencies -- this is **not** a problem + * unless any of those modules are actually used. * - * Returns an empty list on success. + * Returns 0 on success. * * Also modifies m_availableDescriptorsByModuleName to remove - * all the entries that fail. + * all the entries that (so that later, when we try to look + * them up, they are not found). */ - QStringList checkDependencies(); + size_t checkDependencies(); /** * Check for this specific module if its required modules have @@ -122,7 +124,7 @@ private: * * Returns true if the requirements are met. */ - bool checkDependencies( const Module& ); + bool checkModuleDependencies( const Module& ); QMap< QString, QVariantMap > m_availableDescriptorsByModuleName; QMap< QString, QString > m_moduleDirectoriesByModuleName; From b78eacd7a8ae364ad0a5f2a2a661c47b1a5f71d9 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 21 Oct 2019 19:47:58 +0200 Subject: [PATCH 5/5] [libcalamaresui] Set button texts always - if the welcome module wasn't loaded (or loading otherwise failed) then no text was set, leading to confusing screens with buttons with icons but no label. --- src/libcalamaresui/ViewManager.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libcalamaresui/ViewManager.cpp b/src/libcalamaresui/ViewManager.cpp index 6da81e7af..06fd97009 100644 --- a/src/libcalamaresui/ViewManager.cpp +++ b/src/libcalamaresui/ViewManager.cpp @@ -86,9 +86,11 @@ setButtonIcon( QPushButton* button, const QString& name ) * to worry about as well as state. */ static inline QPushButton* -makeButton( QWidget* parent, const QString& name ) +makeButton( QWidget* parent, const QString& name, const QString& label ) { QPushButton* button = new QPushButton( parent ); + button->setObjectName( name ); + button->setText( label ); setButtonIcon( button, name ); return button; } @@ -108,9 +110,9 @@ ViewManager::ViewManager( QObject* parent ) mainLayout->addWidget( m_stack ); // Create buttons and sets an initial icon; the icons may change - m_back = makeButton( m_widget, "go-previous" ); - m_next = makeButton( m_widget, "go-next" ); - m_quit = makeButton( m_widget, "dialog-cancel" ); + m_back = makeButton( m_widget, QStringLiteral( "go-previous" ), tr( "&Back" ) ); + m_next = makeButton( m_widget, QStringLiteral( "go-next" ), tr( "&Next" ) ); + m_quit = makeButton( m_widget, QStringLiteral( "dialog-cancel" ), tr( "&Cancel" ) ); CALAMARES_RETRANSLATE_SLOT( &ViewManager::updateButtonLabels )