From 0a0f3dd2b6291989c7b7fe74dfab3a0b913c0a43 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 24 Sep 2021 13:48:27 +0200 Subject: [PATCH 01/10] Changes: hot-fix release --- CHANGES | 9 +++++++++ CMakeLists.txt | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index c91e99299..97f8bd4c7 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,15 @@ 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.44.1 (2021-09-24) # + +This release contains contributions from (alphabetically by first name): + - Anke Boersma + +This is a hotfix for a typo -- not a syntax error -- that affects the +*initcpiocfg* module. Reported and fixed by Anke. + + # 3.2.44 (2021-09-24) # This release contains contributions from (alphabetically by first name): diff --git a/CMakeLists.txt b/CMakeLists.txt index b391cfeb2..01ae160d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,7 @@ # TODO:3.3: Require CMake 3.12 cmake_minimum_required( VERSION 3.3 FATAL_ERROR ) project( CALAMARES - VERSION 3.2.44 + VERSION 3.2.44.1 LANGUAGES C CXX ) From 723da94e755509687fc168639d4c0afdf621b14a Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 24 Sep 2021 13:48:35 +0200 Subject: [PATCH 02/10] i18n: source texts --- lang/calamares_en.ts | 50 ++++++------ lang/python.pot | 189 +++++++++++++++++++------------------------ 2 files changed, 108 insertions(+), 131 deletions(-) diff --git a/lang/calamares_en.ts b/lang/calamares_en.ts index 884498c2c..5575b6964 100644 --- a/lang/calamares_en.ts +++ b/lang/calamares_en.ts @@ -171,7 +171,7 @@ Calamares::JobThread - + Done Done @@ -320,17 +320,17 @@ &Close - + Install Log Paste URL Install Log Paste URL - + The upload was unsuccessful. No web-paste was done. The upload was unsuccessful. No web-paste was done. - + Install log posted to %1 @@ -1926,35 +1926,35 @@ The installer will quit and all changes will be lost. LuksBootKeyFileJob - + Configuring LUKS key file. Configuring LUKS key file. - - + + No partitions are defined. No partitions are defined. - - - + + + Encrypted rootfs setup error Encrypted rootfs setup error - + Root partition %1 is LUKS but no passphrase has been set. Root partition %1 is LUKS but no passphrase has been set. - + Could not create LUKS key file for root partition %1. Could not create LUKS key file for root partition %1. - + Could not configure LUKS key file on partition %1. Could not configure LUKS key file on partition %1. @@ -2929,14 +2929,14 @@ The installer will quit and all changes will be lost. ProcessResult - + There was no output from the command. There was no output from the command. - + Output: @@ -2945,52 +2945,52 @@ Output: - + External command crashed. External command crashed. - + Command <i>%1</i> crashed. Command <i>%1</i> crashed. - + External command failed to start. External command failed to start. - + Command <i>%1</i> failed to start. Command <i>%1</i> failed to start. - + Internal error when starting command. Internal error when starting command. - + Bad parameters for process job call. Bad parameters for process job call. - + External command failed to finish. External command failed to finish. - + Command <i>%1</i> failed to finish in %2 seconds. Command <i>%1</i> failed to finish in %2 seconds. - + External command finished with errors. External command finished with errors. - + Command <i>%1</i> finished with exit code %2. Command <i>%1</i> finished with exit code %2. diff --git a/lang/python.pot b/lang/python.pot index 335a89206..9520a6d6b 100644 --- a/lang/python.pot +++ b/lang/python.pot @@ -2,32 +2,32 @@ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. -# +# #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-08 13:31+0200\n" +"POT-Creation-Date: 2021-09-22 11:02+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" +"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: \n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" #: src/modules/grubcfg/main.py:28 msgid "Configure GRUB." -msgstr "Configure GRUB." +msgstr "" #: src/modules/mount/main.py:30 msgid "Mounting partitions." -msgstr "Mounting partitions." +msgstr "" -#: src/modules/mount/main.py:144 src/modules/initcpiocfg/main.py:197 -#: src/modules/initcpiocfg/main.py:201 +#: src/modules/mount/main.py:144 src/modules/initcpiocfg/main.py:227 +#: src/modules/initcpiocfg/main.py:231 #: src/modules/luksopenswaphookcfg/main.py:86 #: src/modules/luksopenswaphookcfg/main.py:90 src/modules/rawfs/main.py:164 #: src/modules/initramfscfg/main.py:85 src/modules/initramfscfg/main.py:89 @@ -36,372 +36,349 @@ msgstr "Mounting partitions." #: src/modules/fstab/main.py:361 src/modules/fstab/main.py:388 #: src/modules/localecfg/main.py:135 src/modules/networkcfg/main.py:42 msgid "Configuration Error" -msgstr "Configuration Error" +msgstr "" -#: src/modules/mount/main.py:145 src/modules/initcpiocfg/main.py:198 +#: src/modules/mount/main.py:145 src/modules/initcpiocfg/main.py:228 #: src/modules/luksopenswaphookcfg/main.py:87 src/modules/rawfs/main.py:165 #: src/modules/initramfscfg/main.py:86 src/modules/openrcdmcryptcfg/main.py:73 #: src/modules/fstab/main.py:356 msgid "No partitions are defined for
{!s}
to use." -msgstr "No partitions are defined for
{!s}
to use." +msgstr "" #: src/modules/services-systemd/main.py:26 msgid "Configure systemd services" -msgstr "Configure systemd services" +msgstr "" #: src/modules/services-systemd/main.py:59 #: src/modules/services-openrc/main.py:93 msgid "Cannot modify service" -msgstr "Cannot modify service" +msgstr "" #: src/modules/services-systemd/main.py:60 msgid "" "systemctl {arg!s} call in chroot returned error code {num!s}." msgstr "" -"systemctl {arg!s} call in chroot returned error code {num!s}." #: src/modules/services-systemd/main.py:63 #: src/modules/services-systemd/main.py:67 msgid "Cannot enable systemd service {name!s}." -msgstr "Cannot enable systemd service {name!s}." +msgstr "" #: src/modules/services-systemd/main.py:65 msgid "Cannot enable systemd target {name!s}." -msgstr "Cannot enable systemd target {name!s}." +msgstr "" #: src/modules/services-systemd/main.py:69 msgid "Cannot disable systemd target {name!s}." -msgstr "Cannot disable systemd target {name!s}." +msgstr "" #: src/modules/services-systemd/main.py:71 msgid "Cannot mask systemd unit {name!s}." -msgstr "Cannot mask systemd unit {name!s}." +msgstr "" #: src/modules/services-systemd/main.py:73 msgid "" -"Unknown systemd commands {command!s} and " -"{suffix!s} for unit {name!s}." +"Unknown systemd commands {command!s} and {suffix!s} for unit {name!s}." msgstr "" -"Unknown systemd commands {command!s} and " -"{suffix!s} for unit {name!s}." #: src/modules/umount/main.py:31 msgid "Unmount file systems." -msgstr "Unmount file systems." +msgstr "" #: src/modules/unpackfs/main.py:35 msgid "Filling up filesystems." -msgstr "Filling up filesystems." +msgstr "" #: src/modules/unpackfs/main.py:255 msgid "rsync failed with error code {}." -msgstr "rsync failed with error code {}." +msgstr "" #: src/modules/unpackfs/main.py:300 msgid "Unpacking image {}/{}, file {}/{}" -msgstr "Unpacking image {}/{}, file {}/{}" +msgstr "" #: src/modules/unpackfs/main.py:315 msgid "Starting to unpack {}" -msgstr "Starting to unpack {}" +msgstr "" #: src/modules/unpackfs/main.py:324 src/modules/unpackfs/main.py:464 msgid "Failed to unpack image \"{}\"" -msgstr "Failed to unpack image \"{}\"" +msgstr "" #: src/modules/unpackfs/main.py:431 msgid "No mount point for root partition" -msgstr "No mount point for root partition" +msgstr "" #: src/modules/unpackfs/main.py:432 msgid "globalstorage does not contain a \"rootMountPoint\" key, doing nothing" -msgstr "globalstorage does not contain a \"rootMountPoint\" key, doing nothing" +msgstr "" #: src/modules/unpackfs/main.py:437 msgid "Bad mount point for root partition" -msgstr "Bad mount point for root partition" +msgstr "" #: src/modules/unpackfs/main.py:438 msgid "rootMountPoint is \"{}\", which does not exist, doing nothing" -msgstr "rootMountPoint is \"{}\", which does not exist, doing nothing" +msgstr "" #: src/modules/unpackfs/main.py:454 src/modules/unpackfs/main.py:458 #: src/modules/unpackfs/main.py:478 msgid "Bad unsquash configuration" -msgstr "Bad unsquash configuration" +msgstr "" #: src/modules/unpackfs/main.py:455 msgid "The filesystem for \"{}\" ({}) is not supported by your current kernel" -msgstr "The filesystem for \"{}\" ({}) is not supported by your current kernel" +msgstr "" #: src/modules/unpackfs/main.py:459 msgid "The source filesystem \"{}\" does not exist" -msgstr "The source filesystem \"{}\" does not exist" +msgstr "" #: src/modules/unpackfs/main.py:465 msgid "" "Failed to find unsquashfs, make sure you have the squashfs-tools package " "installed" msgstr "" -"Failed to find unsquashfs, make sure you have the squashfs-tools package " -"installed" #: src/modules/unpackfs/main.py:479 msgid "The destination \"{}\" in the target system is not a directory" -msgstr "The destination \"{}\" in the target system is not a directory" +msgstr "" #: src/modules/displaymanager/main.py:526 msgid "Cannot write KDM configuration file" -msgstr "Cannot write KDM configuration file" +msgstr "" #: src/modules/displaymanager/main.py:527 msgid "KDM config file {!s} does not exist" -msgstr "KDM config file {!s} does not exist" +msgstr "" #: src/modules/displaymanager/main.py:588 msgid "Cannot write LXDM configuration file" -msgstr "Cannot write LXDM configuration file" +msgstr "" #: src/modules/displaymanager/main.py:589 msgid "LXDM config file {!s} does not exist" -msgstr "LXDM config file {!s} does not exist" +msgstr "" #: src/modules/displaymanager/main.py:672 msgid "Cannot write LightDM configuration file" -msgstr "Cannot write LightDM configuration file" +msgstr "" #: src/modules/displaymanager/main.py:673 msgid "LightDM config file {!s} does not exist" -msgstr "LightDM config file {!s} does not exist" +msgstr "" #: src/modules/displaymanager/main.py:747 msgid "Cannot configure LightDM" -msgstr "Cannot configure LightDM" +msgstr "" #: src/modules/displaymanager/main.py:748 msgid "No LightDM greeter installed." -msgstr "No LightDM greeter installed." +msgstr "" #: src/modules/displaymanager/main.py:779 msgid "Cannot write SLIM configuration file" -msgstr "Cannot write SLIM configuration file" +msgstr "" #: src/modules/displaymanager/main.py:780 msgid "SLIM config file {!s} does not exist" -msgstr "SLIM config file {!s} does not exist" +msgstr "" #: src/modules/displaymanager/main.py:906 msgid "No display managers selected for the displaymanager module." -msgstr "No display managers selected for the displaymanager module." +msgstr "" #: src/modules/displaymanager/main.py:907 msgid "" "The displaymanagers list is empty or undefined in both globalstorage and " "displaymanager.conf." msgstr "" -"The displaymanagers list is empty or undefined in both globalstorage and " -"displaymanager.conf." #: src/modules/displaymanager/main.py:989 msgid "Display manager configuration was incomplete" -msgstr "Display manager configuration was incomplete" +msgstr "" #: src/modules/initcpiocfg/main.py:28 msgid "Configuring mkinitcpio." -msgstr "Configuring mkinitcpio." +msgstr "" -#: src/modules/initcpiocfg/main.py:202 +#: src/modules/initcpiocfg/main.py:232 #: src/modules/luksopenswaphookcfg/main.py:91 #: src/modules/initramfscfg/main.py:90 src/modules/openrcdmcryptcfg/main.py:77 #: src/modules/fstab/main.py:362 src/modules/localecfg/main.py:136 #: src/modules/networkcfg/main.py:43 msgid "No root mount point is given for
{!s}
to use." -msgstr "No root mount point is given for
{!s}
to use." +msgstr "" #: src/modules/luksopenswaphookcfg/main.py:26 msgid "Configuring encrypted swap." -msgstr "Configuring encrypted swap." +msgstr "" #: src/modules/rawfs/main.py:26 msgid "Installing data." -msgstr "Installing data." +msgstr "" #: src/modules/services-openrc/main.py:29 msgid "Configure OpenRC services" -msgstr "Configure OpenRC services" +msgstr "" #: src/modules/services-openrc/main.py:57 msgid "Cannot add service {name!s} to run-level {level!s}." -msgstr "Cannot add service {name!s} to run-level {level!s}." +msgstr "" #: src/modules/services-openrc/main.py:59 msgid "Cannot remove service {name!s} from run-level {level!s}." -msgstr "Cannot remove service {name!s} from run-level {level!s}." +msgstr "" #: src/modules/services-openrc/main.py:61 msgid "" "Unknown service-action {arg!s} for service {name!s} in run-" "level {level!s}." msgstr "" -"Unknown service-action {arg!s} for service {name!s} in run-" -"level {level!s}." #: src/modules/services-openrc/main.py:94 msgid "" "rc-update {arg!s} call in chroot returned error code {num!s}." msgstr "" -"rc-update {arg!s} call in chroot returned error code {num!s}." #: src/modules/services-openrc/main.py:101 msgid "Target runlevel does not exist" -msgstr "Target runlevel does not exist" +msgstr "" #: src/modules/services-openrc/main.py:102 msgid "" "The path for runlevel {level!s} is {path!s}, which does not " "exist." msgstr "" -"The path for runlevel {level!s} is {path!s}, which does not " -"exist." #: src/modules/services-openrc/main.py:110 msgid "Target service does not exist" -msgstr "Target service does not exist" +msgstr "" #: src/modules/services-openrc/main.py:111 msgid "" -"The path for service {name!s} is {path!s}, which does not " -"exist." +"The path for service {name!s} is {path!s}, which does not exist." msgstr "" -"The path for service {name!s} is {path!s}, which does not " -"exist." #: src/modules/plymouthcfg/main.py:27 msgid "Configure Plymouth theme" -msgstr "Configure Plymouth theme" +msgstr "" #: src/modules/packages/main.py:50 src/modules/packages/main.py:59 #: src/modules/packages/main.py:69 msgid "Install packages." -msgstr "Install packages." +msgstr "" #: src/modules/packages/main.py:57 #, python-format msgid "Processing packages (%(count)d / %(total)d)" -msgstr "Processing packages (%(count)d / %(total)d)" +msgstr "" #: src/modules/packages/main.py:62 #, python-format msgid "Installing one package." msgid_plural "Installing %(num)d packages." -msgstr[0] "Installing one package." -msgstr[1] "Installing %(num)d packages." +msgstr[0] "" +msgstr[1] "" #: src/modules/packages/main.py:65 #, python-format msgid "Removing one package." msgid_plural "Removing %(num)d packages." -msgstr[0] "Removing one package." -msgstr[1] "Removing %(num)d packages." +msgstr[0] "" +msgstr[1] "" #: src/modules/packages/main.py:638 src/modules/packages/main.py:650 #: src/modules/packages/main.py:678 msgid "Package Manager error" -msgstr "Package Manager error" +msgstr "" #: src/modules/packages/main.py:639 msgid "" "The package manager could not prepare updates. The command
{!s}
" "returned error code {!s}." msgstr "" -"The package manager could not prepare updates. The command
{!s}
" -"returned error code {!s}." #: src/modules/packages/main.py:651 msgid "" -"The package manager could not update the system. The command
{!s}
" -" returned error code {!s}." +"The package manager could not update the system. The command
{!s}
" +"returned error code {!s}." msgstr "" -"The package manager could not update the system. The command
{!s}
" -" returned error code {!s}." #: src/modules/packages/main.py:679 msgid "" "The package manager could not make changes to the installed system. The " "command
{!s}
returned error code {!s}." msgstr "" -"The package manager could not make changes to the installed system. The " -"command
{!s}
returned error code {!s}." #: src/modules/bootloader/main.py:43 msgid "Install bootloader." -msgstr "Install bootloader." +msgstr "" #: src/modules/bootloader/main.py:508 msgid "Bootloader installation error" -msgstr "Bootloader installation error" +msgstr "" #: src/modules/bootloader/main.py:509 msgid "" -"The bootloader could not be installed. The installation command " -"
{!s}
returned error code {!s}." +"The bootloader could not be installed. The installation command
{!s} returned error code {!s}."
 msgstr ""
-"The bootloader could not be installed. The installation command "
-"
{!s}
returned error code {!s}." #: src/modules/hwclock/main.py:26 msgid "Setting hardware clock." -msgstr "Setting hardware clock." +msgstr "" #: src/modules/mkinitfs/main.py:27 msgid "Creating initramfs with mkinitfs." -msgstr "Creating initramfs with mkinitfs." +msgstr "" #: src/modules/mkinitfs/main.py:49 msgid "Failed to run mkinitfs on the target" -msgstr "Failed to run mkinitfs on the target" +msgstr "" #: src/modules/mkinitfs/main.py:50 src/modules/dracut/main.py:50 msgid "The exit code was {}" -msgstr "The exit code was {}" +msgstr "" #: src/modules/dracut/main.py:27 msgid "Creating initramfs with dracut." -msgstr "Creating initramfs with dracut." +msgstr "" #: src/modules/dracut/main.py:49 msgid "Failed to run dracut on the target" -msgstr "Failed to run dracut on the target" +msgstr "" #: src/modules/initramfscfg/main.py:32 msgid "Configuring initramfs." -msgstr "Configuring initramfs." +msgstr "" #: src/modules/openrcdmcryptcfg/main.py:26 msgid "Configuring OpenRC dmcrypt service." -msgstr "Configuring OpenRC dmcrypt service." +msgstr "" #: src/modules/fstab/main.py:29 msgid "Writing fstab." -msgstr "Writing fstab." +msgstr "" #: src/modules/fstab/main.py:389 msgid "No
{!s}
configuration is given for
{!s}
to use." -msgstr "No
{!s}
configuration is given for
{!s}
to use." +msgstr "" #: src/modules/dummypython/main.py:35 msgid "Dummy python job." -msgstr "Dummy python job." +msgstr "" #: src/modules/dummypython/main.py:37 src/modules/dummypython/main.py:93 #: src/modules/dummypython/main.py:94 msgid "Dummy python step {}" -msgstr "Dummy python step {}" +msgstr "" #: src/modules/localecfg/main.py:30 msgid "Configuring locales." -msgstr "Configuring locales." +msgstr "" #: src/modules/networkcfg/main.py:29 msgid "Saving network configuration." -msgstr "Saving network configuration." +msgstr "" From 590f16370ca764385a2e89e369681c419dc30326 Mon Sep 17 00:00:00 2001 From: corey lang Date: Mon, 27 Sep 2021 01:04:52 -0500 Subject: [PATCH 03/10] [networkcfg] fix replace_username() undefined variables --- src/modules/networkcfg/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/networkcfg/main.py b/src/modules/networkcfg/main.py index 4dc6cbbf7..0ee47c1aa 100644 --- a/src/modules/networkcfg/main.py +++ b/src/modules/networkcfg/main.py @@ -73,12 +73,12 @@ def replace_username(nm_config_filename, live_user, target_user): if not os.path.exists(nm_config_filename): return - with open(target_network, "r") as network_conf: + with open(nm_config_filename, "r") as network_conf: text = network_conf.readlines() live_permissions = 'permissions=user:{}:;'.format(live_user) - target_permissions = 'permissions=user:{}:;\n'.format(user) - with open(target_network, "w") as network_conf: + target_permissions = 'permissions=user:{}:;\n'.format(target_user) + with open(nm_config_filename, "w") as network_conf: for line in text: if live_permissions in line: line = target_permissions From c4034d944bb6484a85fcb2ddc613f75c1d51eaf9 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 27 Sep 2021 13:08:22 +0200 Subject: [PATCH 04/10] Changes: pre-release housekeeping --- CHANGES | 9 +++++++++ CMakeLists.txt | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 97f8bd4c7..a9afa18f1 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,15 @@ 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.44.2 (2021-09-27) # + +This release contains contributions from (alphabetically by first name): + - + +This is a hotfix for a typo -- not a syntax error -- that affects the +*networkcfg* module. Reported and fixed by . + + # 3.2.44.1 (2021-09-24) # This release contains contributions from (alphabetically by first name): diff --git a/CMakeLists.txt b/CMakeLists.txt index 01ae160d9..58a06db81 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,7 @@ # TODO:3.3: Require CMake 3.12 cmake_minimum_required( VERSION 3.3 FATAL_ERROR ) project( CALAMARES - VERSION 3.2.44.1 + VERSION 3.2.44.2 LANGUAGES C CXX ) From 657a36310bb8e7199ad5ac897160469c5df16f13 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 27 Sep 2021 13:18:12 +0200 Subject: [PATCH 05/10] [libcalamares] Log the Python pre-script a little better - Make clear that the @ is a string-location, and how long the pre-script is (although in practice, it will be either null and 0, or the values set in the loadmodule executable). --- src/libcalamares/PythonJob.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libcalamares/PythonJob.cpp b/src/libcalamares/PythonJob.cpp index 1a4683c29..201f56a15 100644 --- a/src/libcalamares/PythonJob.cpp +++ b/src/libcalamares/PythonJob.cpp @@ -330,7 +330,8 @@ void PythonJob::setInjectedPreScript( const char* preScript ) { s_preScript = preScript; - cDebug() << "Python pre-script set to" << Logger::Pointer( preScript ); + cDebug() << "Python pre-script set to string" << Logger::Pointer( preScript ) << "length" + << ( preScript ? strlen( preScript ) : 0 ); } } // namespace Calamares From de9e6a7d7086b2d4859ac6fa869afd19ab337969 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 27 Sep 2021 13:27:36 +0200 Subject: [PATCH 06/10] [calamares] Log module-searching in the test-application --- src/calamares/testmain.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/calamares/testmain.cpp b/src/calamares/testmain.cpp index 6d75a4fbb..35cddfce8 100644 --- a/src/calamares/testmain.cpp +++ b/src/calamares/testmain.cpp @@ -143,8 +143,7 @@ handle_args( QCoreApplication& a ) parser.value( langOption ), parser.value( brandOption ), parser.isSet( slideshowOption ) || parser.isSet( uiOption ), - pythonInjection - }; + pythonInjection }; } } @@ -299,7 +298,8 @@ load_module( const ModuleConfig& moduleConfig ) bool ok = false; QVariantMap descriptor; - for ( const QString& prefix : QStringList { "./", "src/modules/", "modules/" } ) + QStringList moduleDirectories { "./", "src/modules/", "modules/" }; + for ( const QString& prefix : qAsConst( moduleDirectories ) ) { // Could be a complete path, eg. src/modules/dummycpp/module.desc fi = QFileInfo( prefix + moduleName ); @@ -330,7 +330,7 @@ load_module( const ModuleConfig& moduleConfig ) if ( !ok ) { - cWarning() << "No suitable module descriptor found."; + cWarning() << "No suitable module descriptor found in" << Logger::DebugList( moduleDirectories ); return nullptr; } @@ -461,7 +461,7 @@ main( int argc, char* argv[] ) #ifdef WITH_PYTHON if ( module.m_pythonInjection ) { - Calamares::PythonJob::setInjectedPreScript(pythonPreScript); + Calamares::PythonJob::setInjectedPreScript( pythonPreScript ); } #endif #ifdef WITH_QML From 058e6cbcda1104455c7e0f777e0170f9eedd483a Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 27 Sep 2021 13:34:08 +0200 Subject: [PATCH 07/10] [calamares] Log failed module-load in test-application --- src/calamares/testmain.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/calamares/testmain.cpp b/src/calamares/testmain.cpp index 35cddfce8..c0258eb54 100644 --- a/src/calamares/testmain.cpp +++ b/src/calamares/testmain.cpp @@ -325,6 +325,17 @@ load_module( const ModuleConfig& moduleConfig ) { break; } + else + { + if ( !fi.exists() ) + { + cDebug() << "Expected a descriptor file" << fi.path(); + } + else + { + cDebug() << "Read descriptor" << fi.path() << "and it was empty."; + } + } } } From 7cda1d2edde0e3e0e4c682adf8028588b2aee23c Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 27 Sep 2021 13:39:27 +0200 Subject: [PATCH 08/10] [calamares] Test-loader tries loading from install-dir, too --- src/calamares/testmain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calamares/testmain.cpp b/src/calamares/testmain.cpp index c0258eb54..1d6971e80 100644 --- a/src/calamares/testmain.cpp +++ b/src/calamares/testmain.cpp @@ -298,7 +298,7 @@ load_module( const ModuleConfig& moduleConfig ) bool ok = false; QVariantMap descriptor; - QStringList moduleDirectories { "./", "src/modules/", "modules/" }; + QStringList moduleDirectories { "./", "src/modules/", "modules/", CMAKE_INSTALL_FULL_LIBDIR "/calamares/modules/" }; for ( const QString& prefix : qAsConst( moduleDirectories ) ) { // Could be a complete path, eg. src/modules/dummycpp/module.desc From 815bb62ae520d24923b6cc1aed8c1340117f508f Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 27 Sep 2021 14:26:43 +0200 Subject: [PATCH 09/10] [calamares] Fix test-application command-line-args - use C++11 uniform-initialization - while here, remove space from name of --global option --- src/calamares/testmain.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/calamares/testmain.cpp b/src/calamares/testmain.cpp index 1d6971e80..9d0189031 100644 --- a/src/calamares/testmain.cpp +++ b/src/calamares/testmain.cpp @@ -71,22 +71,20 @@ handle_args( QCoreApplication& a ) { QCommandLineOption debugLevelOption( QStringLiteral( "D" ), "Verbose output for debugging purposes (0-8), ignored.", "level" ); - QCommandLineOption globalOption( QStringList() << QStringLiteral( "g" ) << QStringLiteral( "global " ), + QCommandLineOption globalOption( { QStringLiteral( "g" ), QStringLiteral( "global" ) }, QStringLiteral( "Global settings document" ), "global.yaml" ); - QCommandLineOption jobOption( QStringList() << QStringLiteral( "j" ) << QStringLiteral( "job" ), - QStringLiteral( "Job settings document" ), - "job.yaml" ); - QCommandLineOption langOption( QStringList() << QStringLiteral( "l" ) << QStringLiteral( "language" ), + QCommandLineOption jobOption( + { QStringLiteral( "j" ), QStringLiteral( "job" ) }, QStringLiteral( "Job settings document" ), "job.yaml" ); + QCommandLineOption langOption( { QStringLiteral( "l" ), QStringLiteral( "language" ) }, QStringLiteral( "Language (global)" ), "languagecode" ); - QCommandLineOption brandOption( QStringList() << QStringLiteral( "b" ) << QStringLiteral( "branding" ), + QCommandLineOption brandOption( { QStringLiteral( "b" ), QStringLiteral( "branding" ) }, QStringLiteral( "Branding directory" ), "path/to/branding.desc", "src/branding/default/branding.desc" ); - QCommandLineOption uiOption( QStringList() << QStringLiteral( "U" ) << QStringLiteral( "ui" ), - QStringLiteral( "Enable UI" ) ); - QCommandLineOption slideshowOption( QStringList() << QStringLiteral( "s" ) << QStringLiteral( "slideshow" ), + QCommandLineOption uiOption( { QStringLiteral( "U" ), QStringLiteral( "ui" ) }, QStringLiteral( "Enable UI" ) ); + QCommandLineOption slideshowOption( { QStringLiteral( "s" ), QStringLiteral( "slideshow" ) }, QStringLiteral( "Run slideshow module" ) ); QCommandLineParser parser; parser.setApplicationDescription( "Calamares module tester" ); @@ -101,7 +99,7 @@ handle_args( QCoreApplication& a ) parser.addOption( uiOption ); parser.addOption( slideshowOption ); #ifdef WITH_PYTHON - QCommandLineOption pythonOption( QStringList() << QStringLiteral( "P" ) << QStringLiteral( "no-injected-python" ), + QCommandLineOption pythonOption( { QStringLiteral( "P" ), QStringLiteral( "no-injected-python" ) }, QStringLiteral( "Do not disable potentially-harmful Python commands" ) ); parser.addOption( pythonOption ); #endif From f197acf8e00d20db25f267604685898dc0547daa Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 27 Sep 2021 17:27:42 +0200 Subject: [PATCH 10/10] CI: add stubs for libcalamares bits, to help pylint --- ci/libcalamares/__init__.py | 9 +++++++++ ci/libcalamares/globalstorage.py | 9 +++++++++ ci/libcalamares/utils.py | 15 +++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 ci/libcalamares/__init__.py create mode 100644 ci/libcalamares/globalstorage.py create mode 100644 ci/libcalamares/utils.py diff --git a/ci/libcalamares/__init__.py b/ci/libcalamares/__init__.py new file mode 100644 index 000000000..11bf0ffe2 --- /dev/null +++ b/ci/libcalamares/__init__.py @@ -0,0 +1,9 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +# +# Stubs for part of the Python API from libcalamares +# (although the **actual** API is presented through +# Boost::Python, not as a bare C-extension) so that +# pylint doesn't complain about libcalamares internals. + +pass diff --git a/ci/libcalamares/globalstorage.py b/ci/libcalamares/globalstorage.py new file mode 100644 index 000000000..3c2acb870 --- /dev/null +++ b/ci/libcalamares/globalstorage.py @@ -0,0 +1,9 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +# +# Stubs for part of the Python API from libcalamares +# (although the **actual** API is presented through +# Boost::Python, not as a bare C-extension) so that +# pylint doesn't complain about libcalamares internals. + +def value(_): return 1 diff --git a/ci/libcalamares/utils.py b/ci/libcalamares/utils.py new file mode 100644 index 000000000..1d423893b --- /dev/null +++ b/ci/libcalamares/utils.py @@ -0,0 +1,15 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +# +# Stubs for part of the Python API from libcalamares +# (although the **actual** API is presented through +# Boost::Python, not as a bare C-extension) so that +# pylint doesn't complain about libcalamares internals. + +def debug(_): pass + +def warning(_): pass + +def gettext_path(): pass + +def gettext_languages(): pass