From 8f060a741fa278187973de8e938b8e4fe4374adf Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 27 Feb 2020 11:33:58 +0100 Subject: [PATCH 01/22] [calamares] Default to log-level 1 (not 8) - This bug has been here since f233cac7a17d39038839a12d8223db85c4808f90, where a check for isSet() (of the -D option) was dropped. So since then, Calamares has always been running with full logging (-D8) on. - The recently-added "easter egg" of showing the debug-button when log-level is 8 (to allow debugging-in-production) trips over the default-log-level of 8, so the debug-button is always visible. So, minor bugs in the debugging-setup, combine to show a debug-button when there shouldn't be one. FIXES #1329 --- src/calamares/main.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/calamares/main.cpp b/src/calamares/main.cpp index 670b7a654..2af46119b 100644 --- a/src/calamares/main.cpp +++ b/src/calamares/main.cpp @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2014, Teo Mrnjavac - * Copyright 2017-2018, Adriaan de Groot + * Copyright 2017-2020, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,9 +36,21 @@ #include #include +/** @brief Gets debug-level from -D command-line-option + * + * If unset, use LOGERROR (corresponding to -D1), although + * effectively -D2 is the lowest level you can set for + * logging-to-the-console, and everything always gets + * logged to the session file). + */ static unsigned int debug_level( QCommandLineParser& parser, QCommandLineOption& levelOption ) { + if ( !parser.isSet( levelOption ) ) + { + return Logger::LOGERROR; + } + bool ok = true; int l = parser.value( levelOption ).toInt( &ok ); if ( !ok || ( l < 0 ) ) From 3456aabfce7d24ec7340a389eda23ee53dd8d55a Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 27 Feb 2020 11:59:24 +0100 Subject: [PATCH 02/22] [libcalamares] Expand utility of list-logging - Allow logging any QList type (needs explicit call in usage). - Add a DebugList inheriting from DebugListT to keep existing code that logs QStringLists. - For Calamares 3.3, consider using C++17 and class template deduction. --- src/libcalamares/utils/Logger.h | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/libcalamares/utils/Logger.h b/src/libcalamares/utils/Logger.h index 643b3059b..9163aef07 100644 --- a/src/libcalamares/utils/Logger.h +++ b/src/libcalamares/utils/Logger.h @@ -134,14 +134,32 @@ public: * will produce a single timestamped debug line with continuations. * Each element of the list of strings will be logged on a separate line. */ -struct DebugList +/* TODO: Calamares 3.3, bump requirements to C++17, and rename + * this to DebugList, dropping the convenience-definition + * below. In C++17, class template argument deduction is + * added, so `DebugList( whatever )` determines the right + * type already (also for QStringList). + */ +template < typename T > +struct DebugListT { - explicit DebugList( const QStringList& l ) + using list_t = QList< T >; + + explicit DebugListT( const list_t& l ) : list( l ) { } - const QStringList& list; + const list_t& list; +}; + +///@brief Convenience for QStringList, needs no template parameters +struct DebugList : public DebugListT< QString > +{ + explicit DebugList( const list_t& l ) + : DebugListT( l ) + { + } }; /** @@ -174,9 +192,10 @@ operator<<( QDebug& s, const DebugRow< T, U >& t ) return s; } -/** @brief output operator for DebugList */ +/** @brief output operator for DebugList, assuming operator<< for T exists */ +template < typename T = QString > inline QDebug& -operator<<( QDebug& s, const DebugList& c ) +operator<<( QDebug& s, const DebugListT< T >& c ) { for ( const auto& i : c.list ) { From 136d22188e3c524e62e45eb772f466715b0658e6 Mon Sep 17 00:00:00 2001 From: Bart Ribbers Date: Thu, 27 Feb 2020 12:58:53 +0100 Subject: [PATCH 03/22] [packages] Add apk (Alpine Linux package manager) support --- src/modules/packages/main.py | 18 ++++++++++++++++++ src/modules/packages/packages.conf | 1 + 2 files changed, 19 insertions(+) diff --git a/src/modules/packages/main.py b/src/modules/packages/main.py index 685cea0e5..adca88423 100644 --- a/src/modules/packages/main.py +++ b/src/modules/packages/main.py @@ -364,6 +364,24 @@ class PMPisi(PackageManager): pass +class PMApk(PackageManager): + backend = "apk" + + def install(self, pkgs, from_local=False): + for pkg in pkgs: + check_target_env_call(["apk", "add", pkg]) + + def remove(self, pkgs): + for pkg in pkgs: + check_target_env_call(["apk", "del", pkg]) + + def update_db(self): + check_target_env_call(["apk", "update"]) + + def update_system(self): + check_target_env_call(["apk", "upgrade", "--available"]) + + # Collect all the subclasses of PackageManager defined above, # and index them based on the backend property of each class. backend_managers = [ diff --git a/src/modules/packages/packages.conf b/src/modules/packages/packages.conf index 7b631d79e..032794177 100644 --- a/src/modules/packages/packages.conf +++ b/src/modules/packages/packages.conf @@ -10,6 +10,7 @@ # - pacman - Pacman # - portage - Gentoo package manager # - entropy - Sabayon package manager +# - apk = Alpine Linux package manager # - dummy - Dummy manager, only logs # backend: dummy From f818d4b446419631a61496c8efd4ecbd15fb9251 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 27 Feb 2020 13:20:19 +0100 Subject: [PATCH 04/22] [libcalamares] Log Q_FUNC_INFO as part of debug - Warnings, errors, don't get funcinfo, but regular cDebug() calls do. Other special-cases, like calling Logger::CDebug() constructor explicitly, don't get funcinfo either. FIXES #1328 --- src/calamares/CalamaresApplication.cpp | 20 +++++++++---------- src/libcalamares/JobQueue.cpp | 4 ++-- src/libcalamares/utils/Logger.h | 2 +- .../jobs/CreatePartitionTableJob.cpp | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/calamares/CalamaresApplication.cpp b/src/calamares/CalamaresApplication.cpp index 48e54b76e..234d5d45c 100644 --- a/src/calamares/CalamaresApplication.cpp +++ b/src/calamares/CalamaresApplication.cpp @@ -99,8 +99,8 @@ CalamaresApplication::init() CalamaresApplication::~CalamaresApplication() { - cDebug( Logger::LOGVERBOSE ) << "Shutting down Calamares..."; - cDebug( Logger::LOGVERBOSE ) << Logger::SubEntry << "Finished shutdown."; + Logger::CDebug( Logger::LOGVERBOSE ) << "Shutting down Calamares..."; + Logger::CDebug( Logger::LOGVERBOSE ) << Logger::SubEntry << "Finished shutdown."; } @@ -266,22 +266,22 @@ CalamaresApplication::initModuleManager() } /** @brief centers the widget @p w on (a) screen - * + * * This tries to duplicate the (deprecated) qApp->desktop()->availableGeometry() * placement by iterating over screens and putting Calamares in the first * one where it fits; this is *generally* the primary screen. - * + * * With debugging, it would look something like this (2 screens attached, * primary at +1080+240 because I have a very strange X setup). Before * being mapped, the Calamares window is at +0+0 but does have a size. * The first screen's geometry includes the offset from the origin in * screen coordinates. - * - * Proposed window size: 1024 520 - * Window QRect(0,0 1024x520) - * Screen QRect(1080,240 2560x1440) - * Moving QPoint(1848,700) - * Screen QRect(0,0 1080x1920) + * + * Proposed window size: 1024 520 + * Window QRect(0,0 1024x520) + * Screen QRect(1080,240 2560x1440) + * Moving QPoint(1848,700) + * Screen QRect(0,0 1080x1920) * */ static void diff --git a/src/libcalamares/JobQueue.cpp b/src/libcalamares/JobQueue.cpp index 44382fb91..294bf5a0a 100644 --- a/src/libcalamares/JobQueue.cpp +++ b/src/libcalamares/JobQueue.cpp @@ -125,9 +125,9 @@ private: if ( m_jobIndex < jobCount ) { - cDebug( Logger::LOGVERBOSE ) << "[JOBQUEUE]: Progress for Job[" << m_jobIndex + Logger::CDebug( Logger::LOGVERBOSE ) << "[JOBQUEUE]: Progress for Job[" << m_jobIndex << "]: " << ( jobPercent * 100 ) << "% completed"; - cDebug( Logger::LOGVERBOSE ) << "[JOBQUEUE]: Progress Overall: " << ( cumulativeProgress * 100 ) + Logger::CDebug( Logger::LOGVERBOSE ) << "[JOBQUEUE]: Progress Overall: " << ( cumulativeProgress * 100 ) << "% (accumulated) + " << ( ( ( m_jobWeights.at( m_jobIndex ) ) * jobPercent ) * 100 ) << "% (this job) = " << ( percent * 100 ) << "% (total)"; diff --git a/src/libcalamares/utils/Logger.h b/src/libcalamares/utils/Logger.h index 9163aef07..33954bd37 100644 --- a/src/libcalamares/utils/Logger.h +++ b/src/libcalamares/utils/Logger.h @@ -219,7 +219,7 @@ operator<<( QDebug& s, const DebugMap& t ) } } // namespace Logger -#define cDebug Logger::CDebug +#define cDebug() (Logger::CDebug( Logger::LOGDEBUG ) << Q_FUNC_INFO << Logger::Continuation) #define cWarning() Logger::CDebug( Logger::LOGWARNING ) #define cError() Logger::CDebug( Logger::LOGERROR ) diff --git a/src/modules/partition/jobs/CreatePartitionTableJob.cpp b/src/modules/partition/jobs/CreatePartitionTableJob.cpp index b18f56a04..20a3c7e6a 100644 --- a/src/modules/partition/jobs/CreatePartitionTableJob.cpp +++ b/src/modules/partition/jobs/CreatePartitionTableJob.cpp @@ -69,7 +69,7 @@ CreatePartitionTableJob::prettyStatusMessage() const static inline QDebug& -operator <<( QDebug&& s, PartitionIterator& it ) +operator <<( QDebug& s, PartitionIterator& it ) { s << ( ( *it ) ? ( *it )->deviceNode() : QString( "" ) ); return s; From b0abb99ee1a65120f7089fe789215b7ee4a77d28 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 27 Feb 2020 13:24:23 +0100 Subject: [PATCH 05/22] [libcalamares] Don't log useless FUNC_INFO for Python - When a Python module calls utils.debug(), there's no point in logging the C++ funcinfo that passes the parameters on; don't use cDebug() with its attendant magic. --- src/libcalamares/PythonJobApi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcalamares/PythonJobApi.cpp b/src/libcalamares/PythonJobApi.cpp index 393958664..caa1cb1d2 100644 --- a/src/libcalamares/PythonJobApi.cpp +++ b/src/libcalamares/PythonJobApi.cpp @@ -148,7 +148,7 @@ check_target_env_output( const bp::list& args, const std::string& stdin, int tim void debug( const std::string& s ) { - cDebug() << "[PYTHON JOB]: " << QString::fromStdString( s ); + Logger::CDebug( Logger::LOGDEBUG ) << "[PYTHON JOB]: " << QString::fromStdString( s ); } void From 5e0f182ebc2f2f0e3b4092651be47fac924fc836 Mon Sep 17 00:00:00 2001 From: Calamares CI Date: Thu, 27 Feb 2020 13:36:21 +0100 Subject: [PATCH 06/22] i18n: [calamares] Automatic merge of Transifex translations --- lang/calamares_ko.ts | 49 ++++---- lang/calamares_sv.ts | 273 ++++++++++++++++++++-------------------- lang/calamares_zh_CN.ts | 164 ++++++++++++------------ 3 files changed, 246 insertions(+), 240 deletions(-) diff --git a/lang/calamares_ko.ts b/lang/calamares_ko.ts index d636a723e..009b4a622 100644 --- a/lang/calamares_ko.ts +++ b/lang/calamares_ko.ts @@ -132,7 +132,7 @@ Job failed (%1) - (% 1) 작업 실패 + (%1) 작업 실패 @@ -212,17 +212,17 @@ Loading ... - + 로딩 중 ... QML Step <i>%1</i>. - + QML 단계 <i>%1</i>. Loading failed. - + 로딩하지 못했습니다. @@ -1630,7 +1630,7 @@ The installer will quit and all changes will be lost. Could not configure LUKS key file on partition %1. - + 파티션 %1에 LUKS 키 파일을 설정할 수 없습니다. @@ -1690,52 +1690,52 @@ The installer will quit and all changes will be lost. Office software - + 오피스 소프트웨어 Office package - + 오피스 패키지 Browser software - + 브라우저 소프트웨어 Browser package - + 브라우저 패키지 Web browser - + 웹 브라우저 Kernel - + 커널 Services - + 서비스 Login - + 로그인 Desktop - + 데스크탑 Applications - + 애플리케이션 @@ -1743,7 +1743,7 @@ The installer will quit and all changes will be lost. Notes - + 노트 @@ -2443,7 +2443,7 @@ The installer will quit and all changes will be lost. There are no partitions to install on. - + 설치를 위한 파티션이 없습니다. @@ -3533,7 +3533,8 @@ Output: <h3>%1</h3> <p>These are example release notes.</p> - + <h3>%1</h3> + <p>릴리즈 노트의 예제입니다.</p> @@ -3541,32 +3542,32 @@ Output: <h3>%1 <quote>%2</quote></h3> - + <h3>%1 <quote>%2</quote></h3> About - + Calamares에 대하여 Support - + 지원 Known issues - + 알려진 이슈들 Release notes - + 릴리즈 노트 Donate - + 기부 diff --git a/lang/calamares_sv.ts b/lang/calamares_sv.ts index e640d6986..cf026d064 100644 --- a/lang/calamares_sv.ts +++ b/lang/calamares_sv.ts @@ -153,7 +153,7 @@ Example job (%1) - + Exempel jobb (%1) @@ -212,12 +212,12 @@ Loading ... - + Laddar ... QML Step <i>%1</i>. - + QML steg <i>%1</i>. @@ -327,22 +327,22 @@ &Set up now - + &Installera nu &Set up - + &Installera &Install - + &Installera Setup is complete. Close the setup program. - + Installationen är klar. Du kan avsluta installationsprogrammet. @@ -371,18 +371,18 @@ Alla ändringar kommer att gå förlorade. &Yes - + &Ja &No - + &Nej &Close - + &Stäng @@ -407,7 +407,7 @@ Alla ändringar kommer att gå förlorade. &Done - + &Klar @@ -462,7 +462,7 @@ Alla ändringar kommer att gå förlorade. %1 Setup Program - + %1 Installationsprogram @@ -574,12 +574,12 @@ Alla ändringar kommer att gå förlorade. No Swap - + Ingen Swap Reuse Swap - + Återanvänd Swap @@ -701,7 +701,7 @@ Alla ändringar kommer att gå förlorade. MiB - + MiB @@ -726,7 +726,7 @@ Alla ändringar kommer att gå förlorade. LVM LV name - + LVM LV namn @@ -774,12 +774,12 @@ Alla ändringar kommer att gå förlorade. Create new %2MiB partition on %4 (%3) with file system %1. - + Skapa ny %2MiB partition på %4 (%3) med filsystem %1. Create new <strong>%2MiB</strong> partition on <strong>%4</strong> (%3) with file system <strong>%1</strong>. - + Skapa ny <strong>%2MiB</strong>partition på <strong>%4</strong> (%3) med filsystem <strong>%1</strong>. @@ -1007,7 +1007,7 @@ Alla ändringar kommer att gå förlorade. Write LUKS configuration for Dracut to %1 - + Skriv LUKS konfiguration för Dracut till %1 @@ -1068,7 +1068,7 @@ Alla ändringar kommer att gå förlorade. MiB - + MiB @@ -1096,7 +1096,7 @@ Alla ändringar kommer att gå förlorade. En&crypt system - + Kryptera system @@ -1124,7 +1124,7 @@ Alla ändringar kommer att gå förlorade. Install %1 on <strong>new</strong> %2 system partition. - + Installera %1 på <strong>ny</strong> %2 system partition. @@ -1134,7 +1134,7 @@ Alla ändringar kommer att gå förlorade. Install %2 on %3 system partition <strong>%1</strong>. - + Installera %2 på %3 system partition <strong>%1</strong>. @@ -1233,12 +1233,12 @@ Alla ändringar kommer att gå förlorade. Format partition %1 (file system: %2, size: %3 MiB) on %4. - + Formatera partition %1 (filsystem: %2, storlek: %3 MiB) på %4. Format <strong>%3MiB</strong> partition <strong>%1</strong> with file system <strong>%2</strong>. - + Formatera <strong>%3MiB</strong> partition <strong>%1</strong> med filsystem <strong>%2</strong>. @@ -1256,7 +1256,7 @@ Alla ändringar kommer att gå förlorade. has at least %1 GiB available drive space - + har minst %1 GiB tillgängligt på hårddisken @@ -1266,7 +1266,7 @@ Alla ändringar kommer att gå förlorade. has at least %1 GiB working memory - + har minst %1 GiB arbetsminne @@ -1329,7 +1329,7 @@ Alla ändringar kommer att gå förlorade. Collecting information about your machine. - + Samlar in information om din maskin. @@ -1345,17 +1345,17 @@ Alla ändringar kommer att gå förlorade. Could not create directories <code>%1</code>. - + Kunde inte skapa mappar <code>%1</code>. Could not open file <code>%1</code>. - + Kunde inte öppna fil <code>%1</code>. Could not write to file <code>%1</code>. - + Kunde inte skriva till fil <code>%1</code>. @@ -1363,7 +1363,7 @@ Alla ändringar kommer att gå förlorade. Creating initramfs with mkinitcpio. - + Skapar initramfs med mkinitcpio. @@ -1371,7 +1371,7 @@ Alla ändringar kommer att gå förlorade. Creating initramfs. - + Skapar initramfs. @@ -1454,7 +1454,7 @@ Alla ändringar kommer att gå förlorade. <h1>License Agreement</h1> - + <h1>Licensavtal</h1> @@ -1500,7 +1500,7 @@ Alla ändringar kommer att gå förlorade. URL: %1 - + URL: %1 @@ -1537,22 +1537,22 @@ Alla ändringar kommer att gå förlorade. File: %1 - + Fil: %1 Show the license text - + Visa licens text Open license agreement in browser. - + Öppna licensavtal i en webbläsare. Hide license text - + Dölj licens text @@ -1602,13 +1602,13 @@ Alla ändringar kommer att gå förlorade. Configuring LUKS key file. - + Konfigurerar LUKS nyckel fil. No partitions are defined. - + Inga partitioner är definerade. @@ -1638,12 +1638,12 @@ Alla ändringar kommer att gå förlorade. Generate machine-id. - + Generera maskin-id. Configuration Error - + Konfigurationsfel @@ -1690,12 +1690,12 @@ Alla ändringar kommer att gå förlorade. Office software - + Kontors programvara Office package - + Kontors paket @@ -1710,32 +1710,32 @@ Alla ändringar kommer att gå förlorade. Web browser - + Webbläsare Kernel - + Kärna Services - + Tjänster Login - + Inloggning Desktop - + Skrivbord Applications - + Program @@ -1743,7 +1743,7 @@ Alla ändringar kommer att gå förlorade. Notes - + Anteckningar @@ -1769,7 +1769,7 @@ Alla ändringar kommer att gå förlorade. OEM Configuration - + OEM Konfiguration @@ -1782,17 +1782,17 @@ Alla ändringar kommer att gå förlorade. Password is too short - + Lösenordet är för kort Password is too long - + Lösenordet är för långt Password is too weak - + Lösenordet är för svagt @@ -1802,7 +1802,7 @@ Alla ändringar kommer att gå förlorade. Memory allocation error - + Minnesallokerings fel @@ -1812,7 +1812,7 @@ Alla ändringar kommer att gå förlorade. The password is a palindrome - + Lösenordet är en palindrom @@ -1887,7 +1887,7 @@ Alla ändringar kommer att gå förlorade. The password is too short - + Detta lösenordet är för kort @@ -1937,7 +1937,7 @@ Alla ändringar kommer att gå förlorade. No password supplied - + Inget lösenord angivit @@ -1962,12 +1962,12 @@ Alla ändringar kommer att gå förlorade. Unknown setting - %1 - + Okänd inställning - %1 Unknown setting - + Okänd inställning @@ -1977,27 +1977,27 @@ Alla ändringar kommer att gå förlorade. Bad integer value - + Dåligt heltals värde Setting %1 is not of integer type - + Inställning %1 är inte av heltals typ Setting is not of integer type - + Inställning är inte av heltals typ Setting %1 is not of string type - + Inställning %1 är inte av sträng typ Setting is not of string type - + Inställning %1 är inte av sträng typ @@ -2017,7 +2017,7 @@ Alla ändringar kommer att gå förlorade. Unknown error - + Okänt fel @@ -2035,7 +2035,7 @@ Alla ändringar kommer att gå förlorade. Product Name - + Produktnamn @@ -2045,12 +2045,12 @@ Alla ändringar kommer att gå förlorade. Long Product Description - + Lång produktbeskrivning Package Selection - + Paketval @@ -2063,7 +2063,7 @@ Alla ändringar kommer att gå förlorade. Packages - + Paket @@ -2125,7 +2125,7 @@ Alla ändringar kommer att gå förlorade. login - + inloggning @@ -2135,19 +2135,19 @@ Alla ändringar kommer att gå förlorade. Computer Name - + Datornamn Password - + Lösenord Repeat Password - + Repetera Lösenord @@ -2157,7 +2157,7 @@ Alla ändringar kommer att gå förlorade. Require strong passwords. - + Kräv starkt lösenord. @@ -2285,7 +2285,7 @@ Alla ändringar kommer att gå förlorade. Cre&ate - + Skapa @@ -2300,27 +2300,27 @@ Alla ändringar kommer att gå förlorade. New Volume Group - + Ny volymgrupp Resize Volume Group - + Ändra storlek på volymgrupp Deactivate Volume Group - + Deaktivera volymgrupp Remove Volume Group - + Ta bort volymgrupp I&nstall boot loader on: - + Installera uppstartshanterare på: @@ -2330,7 +2330,7 @@ Alla ändringar kommer att gå förlorade. Can not create new partition - + Kan inte skapa ny partition @@ -2418,7 +2418,7 @@ Alla ändringar kommer att gå förlorade. EFI system partition flag not set - + EFI system partitionsflagga inte satt @@ -2428,7 +2428,7 @@ Alla ändringar kommer att gå förlorade. Boot partition not encrypted - + Boot partition inte krypterad @@ -2491,7 +2491,7 @@ Alla ändringar kommer att gå förlorade. Saving files for later ... - + Sparar filer tills senare ... @@ -2517,17 +2517,19 @@ There was no output from the command. Output: - + +Utdata: + External command crashed. - + Externt kommando kraschade. Command <i>%1</i> crashed. - + Kommando <i>%1</i> kraschade. @@ -2537,7 +2539,7 @@ Output: Command <i>%1</i> failed to start. - + Kommando <i>%1</i> misslyckades med att starta.  @@ -2601,7 +2603,7 @@ Output: swap - + swap @@ -2611,7 +2613,7 @@ Output: (no mount point) - + (ingen monteringspunkt) @@ -2627,7 +2629,7 @@ Output: No product - + Ingen produkt @@ -2640,7 +2642,7 @@ Output: File not found - + Filen hittades inte @@ -2650,7 +2652,7 @@ Output: Could not create new random file <pre>%1</pre>. - + Kunde inte skapa ny slumpmässig fil <pre>%1</pre>. @@ -2757,7 +2759,7 @@ Output: Invalid configuration - + Ogiltig konfiguration @@ -2846,7 +2848,7 @@ Output: Resize Volume Group - + Ändra storlek på volymgrupp @@ -2987,57 +2989,57 @@ Output: Set flags on partition %1. - + Sätt flaggor på partition %1. Set flags on %1MiB %2 partition. - + Sätt flaggor på %1MiB %2 partition. Set flags on new partition. - + Sätt flaggor på ny partition. Clear flags on partition <strong>%1</strong>. - + Rensa flaggor på partition <strong>%1</strong>, Clear flags on %1MiB <strong>%2</strong> partition. - + Rensa flaggor på %1MiB <strong>%2</strong>partition. Flag %1MiB <strong>%2</strong> partition as <strong>%3</strong>. - + Flagga %1MiB <strong>%2</strong>partition som <strong>%3</strong>. Clearing flags on %1MiB <strong>%2</strong> partition. - + Rensa flaggor på %1MiB <strong>%2</strong>partition. Setting flags <strong>%3</strong> on %1MiB <strong>%2</strong> partition. - + Sätter flaggor <strong>%3</strong> på %11MiB <strong>%2</strong>partition. Clear flags on new partition. - + Rensa flaggor på ny partition. Flag partition <strong>%1</strong> as <strong>%2</strong>. - + Flagga partition <strong>%1</strong> som <strong>%2</strong>. Flag new partition as <strong>%1</strong>. - + Flagga ny partition som <strong>%1</strong>. @@ -3090,7 +3092,7 @@ Output: Cannot disable root account. - + Kunde inte inaktivera root konto. @@ -3160,7 +3162,7 @@ Output: %L1 / %L2 slide counter, %1 of %2 (numeric) - + %L1 / %L2 @@ -3212,12 +3214,12 @@ Output: Machine feedback - + Maskin feedback Configuring machine feedback. - + Konfigurerar maskin feedback @@ -3228,12 +3230,12 @@ Output: Could not configure machine feedback correctly, script error %1. - + Kunde inte konfigurera maskin feedback korrekt, script fel %1. Could not configure machine feedback correctly, Calamares error %1. - + Kunde inte konfigurera maskin feedback korrekt, Calamares fel %1. @@ -3284,7 +3286,7 @@ Output: Feedback - + Feedback @@ -3307,17 +3309,17 @@ Output: Your username must start with a lowercase letter or underscore. - + Ditt användarnamn måste börja med en liten bokstav eller ett understreck. Only lowercase letters, numbers, underscore and hyphen are allowed. - + Endast små bokstäver, nummer, understreck och bindestreck är tillåtet. Only letters, numbers, underscore and hyphen are allowed. - + Endast bokstäver, nummer, understreck och bindestreck är tillåtet. @@ -3366,17 +3368,17 @@ Output: List of Physical Volumes - + Lista på fysiska volymer Volume Group Name: - + Volymgrupp namn: Volume Group Type: - + Volymgrupp typ: @@ -3386,22 +3388,22 @@ Output: MiB - + MiB Total Size: - + Total storlek: Used Size: - + Använd storlek: Total Sectors: - + Totala sektorer: @@ -3420,7 +3422,7 @@ Output: Select application and system language - + Välj program och system språk @@ -3430,7 +3432,7 @@ Output: &Donate - + &Donera @@ -3530,7 +3532,8 @@ Output: <h3>%1</h3> <p>These are example release notes.</p> - + <h3>%1</h3> + <p>Detta är exempel versionsinformation. @@ -3538,32 +3541,32 @@ Output: <h3>%1 <quote>%2</quote></h3> - + <h3>%1 <quote>%2</quote></h3> About - + Om Support - + Support Known issues - + Kända problem Release notes - + Versionsinformation Donate - + Donera diff --git a/lang/calamares_zh_CN.ts b/lang/calamares_zh_CN.ts index f2aefd09c..4ab13221f 100644 --- a/lang/calamares_zh_CN.ts +++ b/lang/calamares_zh_CN.ts @@ -6,7 +6,7 @@ The <strong>boot environment</strong> of this system.<br><br>Older x86 systems only support <strong>BIOS</strong>.<br>Modern systems usually use <strong>EFI</strong>, but may also show up as BIOS if started in compatibility mode. - 这个系统的<strong>引导环境</strong>。<br><br>较旧的 x86 系统只支持 <strong>BIOS</strong>。<br>现代的系统则通常使用 <strong>EFI</strong>,但若引导时使用了兼容模式,也可以显示为 BIOS。 + 这个系统的<strong>引导环境</strong>。<br><br>较旧的 x86 系统只支持 <strong>BIOS</strong>。<br>现代的系统则通常使用 <strong>EFI</strong>,但若引导时使用了兼容模式,也可以变为 BIOS。 @@ -138,7 +138,7 @@ Programmed job failure was explicitly requested. - + 出现明确抛出的任务执行失败。 @@ -154,7 +154,7 @@ Example job (%1) - + 示例任务 (%1) @@ -162,12 +162,12 @@ Run command '%1' in target system. - + 在目标系统上执行 '%1'。 Run command '%1'. - + 运行命令 '%1'. @@ -213,17 +213,17 @@ Loading ... - + 正在加载... QML Step <i>%1</i>. - + QML 步骤 <i>%1</i>. Loading failed. - + 加载失败。 @@ -231,21 +231,21 @@ Waiting for %n module(s). - - + + 等待 %n 模块。 (%n second(s)) - - + + (%n 秒) System-requirements checking is complete. - + 已经完成系统需求检查。 @@ -271,7 +271,7 @@ Cancel setup without changing the system. - + 取消安装,保持系统不变。 @@ -281,22 +281,22 @@ Setup Failed - + 安装失败 Would you like to paste the install log to the web? - + 需要将安装日志粘贴到网页吗? Install Log Paste URL - + 安装日志粘贴 URL The upload was unsuccessful. No web-paste was done. - + 上传失败,未完成网页粘贴。 @@ -316,22 +316,22 @@ Continue with installation? - + 继续安装? The %1 setup program is about to make changes to your disk in order to set up %2.<br/><strong>You will not be able to undo these changes.</strong> - + 为了安装%2, %1 安装程序即将对磁盘进行更改。<br/><strong>这些更改无法撤销。</strong> &Set up now - + 现在安装(&S) &Set up - + 安装(&S) @@ -341,12 +341,12 @@ Setup is complete. Close the setup program. - + 安装完成。关闭安装程序。 Cancel setup? - + 取消安装? @@ -357,7 +357,8 @@ Do you really want to cancel the current setup process? The setup program will quit and all changes will be lost. - + 确定要取消当前安装吗? +安装程序将会退出,所有修改都会丢失。 @@ -453,7 +454,8 @@ The installer will quit and all changes will be lost. Install log posted to: %1 - + 安装日志发布到: +%1 @@ -461,7 +463,7 @@ The installer will quit and all changes will be lost. %1 Setup Program - + %1 安装程序 @@ -530,7 +532,7 @@ The installer will quit and all changes will be lost. %1 will be shrunk to %2MiB and a new %3MiB partition will be created for %4. - + %1 将会缩减未 %2MiB,然后为 %4 创建一个 %3MiB 分区。 @@ -573,27 +575,27 @@ The installer will quit and all changes will be lost. No Swap - + 无交换分区 Reuse Swap - + 重用交换分区 Swap (no Hibernate) - + 交换分区(无休眠) Swap (with Hibernate) - + 交换分区(带休眠) Swap to file - + 交换到文件 @@ -773,7 +775,7 @@ The installer will quit and all changes will be lost. Create new %2MiB partition on %4 (%3) with file system %1. - + 在 %4 (%3) 上创建新的 %2MiB 分区,文件系统为 %1. @@ -885,7 +887,7 @@ The installer will quit and all changes will be lost. Create Volume Group - + 创建存储组 @@ -893,7 +895,7 @@ The installer will quit and all changes will be lost. Create new volume group named %1. - + 创建新存储组 %1. @@ -999,7 +1001,7 @@ The installer will quit and all changes will be lost. %1 - (%2) device[name] - (device-node[name]) - + %1 - (%2) @@ -1162,7 +1164,7 @@ The installer will quit and all changes will be lost. <Restart checkbox tooltip> - + <Restart checkbox tooltip> @@ -1210,7 +1212,7 @@ The installer will quit and all changes will be lost. Setup Complete - + 安装完成 @@ -1220,7 +1222,7 @@ The installer will quit and all changes will be lost. The setup of %1 is complete. - + %1 安装完成。 @@ -1500,7 +1502,7 @@ The installer will quit and all changes will be lost. URL: %1 - + URL: %1 @@ -1537,22 +1539,22 @@ The installer will quit and all changes will be lost. File: %1 - + 文件:%1 Show the license text - + 显示协议文本 Open license agreement in browser. - + 在浏览器中打开许可协议。 Hide license text - + 隐藏协议文本 @@ -1602,13 +1604,13 @@ The installer will quit and all changes will be lost. Configuring LUKS key file. - + 配置 LUKS key 文件。 No partitions are defined. - + 未定义分区。 @@ -1643,7 +1645,7 @@ The installer will quit and all changes will be lost. Configuration Error - + 配置错误 @@ -1690,52 +1692,52 @@ The installer will quit and all changes will be lost. Office software - + 办公软件 Office package - + 办公软件包 Browser software - + 浏览器软件 Browser package - + 浏览器安装包 Web browser - + 网页浏览器 Kernel - + 内核 Services - + 服务 Login - + 登录 Desktop - + 桌面 Applications - + 应用程序 @@ -1743,7 +1745,7 @@ The installer will quit and all changes will be lost. Notes - + 备注 @@ -1751,7 +1753,7 @@ The installer will quit and all changes will be lost. Ba&tch: - + 批量(&T): @@ -1769,7 +1771,7 @@ The installer will quit and all changes will be lost. OEM Configuration - + OEM 配置 @@ -2022,7 +2024,7 @@ The installer will quit and all changes will be lost. Password is empty - + 密码是空 @@ -2035,7 +2037,7 @@ The installer will quit and all changes will be lost. Product Name - + 产品名称 @@ -2045,12 +2047,12 @@ The installer will quit and all changes will be lost. Long Product Description - + 长产品描述 Package Selection - + 软件包选择 @@ -2063,7 +2065,7 @@ The installer will quit and all changes will be lost. Packages - + 软件包 @@ -2120,12 +2122,12 @@ The installer will quit and all changes will be lost. Your Full Name - + 全名 login - + 登录 @@ -2135,19 +2137,19 @@ The installer will quit and all changes will be lost. Computer Name - + 计算机名称 Password - + 密码 Repeat Password - + 重复密码 @@ -3364,7 +3366,7 @@ Output: Create Volume Group - + 创建存储组 @@ -3433,17 +3435,17 @@ Output: &Donate - + 捐赠(&D) Open help and support website - + 打开帮助和支持页面 Open issues and bug-tracking website - + 打开问题追踪网站 @@ -3541,32 +3543,32 @@ Output: <h3>%1 <quote>%2</quote></h3> - + <h3>%1 <quote>%2</quote></h3> About - + 关于 Support - + 支持 Known issues - + 已知问题 Release notes - + 发行说明 Donate - + 捐赠 From 6d638539e59d9889f3c0c58b61d9c33091a66899 Mon Sep 17 00:00:00 2001 From: Calamares CI Date: Thu, 27 Feb 2020 13:36:21 +0100 Subject: [PATCH 07/22] i18n: [desktop] Automatic merge of Transifex translations --- calamares.desktop | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/calamares.desktop b/calamares.desktop index f071c3410..6a5f91db5 100644 --- a/calamares.desktop +++ b/calamares.desktop @@ -103,9 +103,9 @@ Icon[ja]=calamares GenericName[ja]=システムインストーラー Comment[ja]=Calamares — システムインストーラー Name[ko]=시스템 설치 -Icon[ko]=깔라마레스 (Calamares) +Icon[ko]=깔라마레스 GenericName[ko]=시스템 설치 관리자 -Comment[ko]=깔라마레스 (Calamares) — 시스템 설치 관리자 +Comment[ko]=깔라마레스 — 시스템 설치 관리자 Name[lt]=Įdiegti Sistemą Icon[lt]=calamares GenericName[lt]=Sistemos diegimas į kompiuterį From 29ba5c961dce9a70d8eb57576384fec9c4c74332 Mon Sep 17 00:00:00 2001 From: Calamares CI Date: Thu, 27 Feb 2020 13:36:21 +0100 Subject: [PATCH 08/22] i18n: [dummypythonqt] Automatic merge of Transifex translations --- .../lang/ko/LC_MESSAGES/dummypythonqt.mo | Bin 941 -> 953 bytes .../lang/ko/LC_MESSAGES/dummypythonqt.po | 8 ++++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/dummypythonqt/lang/ko/LC_MESSAGES/dummypythonqt.mo b/src/modules/dummypythonqt/lang/ko/LC_MESSAGES/dummypythonqt.mo index be3c10a286666daf58da53e6660b1615cef41adf..9f6a1c4e604d9690745bcd4e52e1826bfc92d313 100644 GIT binary patch delta 160 zcmZ3>zLR}Ih-oP!149B33o z)0, YEAR. # # Translators: -# Ji-Hyeon Gim , 2018 # MarongHappy , 2019 +# 김지현 , 2020 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-02-19 17:27+0100\n" "PO-Revision-Date: 2016-12-16 12:18+0000\n" -"Last-Translator: MarongHappy , 2019\n" +"Last-Translator: 김지현 , 2020\n" "Language-Team: Korean (https://www.transifex.com/calamares/teams/20061/ko/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -40,8 +40,8 @@ msgstr "더미 PythonQt 작업" #: src/modules/dummypythonqt/main.py:186 msgid "This is the Dummy PythonQt Job. The dummy job says: {}" -msgstr "더미 PythonQt Job입니다. 이 더미 Job의 출력은 다음과 같습니다: {}" +msgstr "더미 PythonQt 작업입니다. 이 더미 작업의 출력은 다음과 같습니다: {}" #: src/modules/dummypythonqt/main.py:190 msgid "A status message for Dummy PythonQt Job." -msgstr "더미 PythonQt Job의 상태 메시지" +msgstr "더미 PythonQt 작업의 상태 메시지" From c93f749a35ff12e9356c84b639dc8a756474dbb6 Mon Sep 17 00:00:00 2001 From: Calamares CI Date: Thu, 27 Feb 2020 13:36:21 +0100 Subject: [PATCH 09/22] i18n: [python] Automatic merge of Transifex translations --- lang/python/ko/LC_MESSAGES/python.po | 2 +- lang/python/sv/LC_MESSAGES/python.mo | Bin 897 -> 3807 bytes lang/python/sv/LC_MESSAGES/python.po | 69 ++++++------- lang/python/zh_CN/LC_MESSAGES/python.mo | Bin 994 -> 7289 bytes lang/python/zh_CN/LC_MESSAGES/python.po | 128 ++++++++++++------------ 5 files changed, 101 insertions(+), 98 deletions(-) diff --git a/lang/python/ko/LC_MESSAGES/python.po b/lang/python/ko/LC_MESSAGES/python.po index 95980dbf0..3bf267cd6 100644 --- a/lang/python/ko/LC_MESSAGES/python.po +++ b/lang/python/ko/LC_MESSAGES/python.po @@ -4,7 +4,7 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Ji-Hyeon Gim , 2018 +# 김지현 , 2018 # MarongHappy , 2019 # #, fuzzy diff --git a/lang/python/sv/LC_MESSAGES/python.mo b/lang/python/sv/LC_MESSAGES/python.mo index f31e39ee55ba61274c3b36b2681fbbb917814863..71d1fa3f99db969c5936cef9b6c7ea5f704afe56 100644 GIT binary patch literal 3807 zcmb7`No*WN6owlTHU|PE>TBQY3Ongg5{flv{*^6$ykmBZLGJ7ld-+3W~)4s(Y69l9-lfzNzi?d#~Q& z-?nYO|L;B(+7;4|RY-~sS^@JaAC_!78%v*YXr z4}*KbbIJGva686dfRBPVz-PgqK$7<-Nb;TgVmUj&9T>g_J_WuFJ^?E5Y4AhvMews^ z{4GfGe+C~1Z-I}2w?Wc#>;19ZVQ@FbWsvmy2qd}RfZgB^AlZKl%!Azz#QUeg=P_=8 z^!`g=2K*8v`+o(uf`5YybRKk^cj3!!a36+O9*WQZ2)=;vUtoc@b;W)k2Kz962kZww z21$>b;C}F5knGyKCFW6(?rR(*KUP4}?>&(0yOONm1WDgNK(g;2ko>*#;rRSPko2Dh z$^R9Q-t&IKOCag>IoJ#S0`3DhJrdiW1?l`bkk%DA1YQRBgTI5ce+!&Lb{_)iJ#!$% zTm+K;KLzpUe1$L4^9Bg_IWObWe6}S&Xq{}w6@LdWOQ(=f9SH?45DD9S-)E8=8S6DHWC9hml+%64sDY3UXDcFQp zu9%TYCs`1Z&-;Su1#Lv&GA&fyD+)GH3|(=2QSv}^>!pF59cG({g3$F!3(d{V*@p6r zVB;f`t+!bfSjqE6de6jL8`%^qdRJjH6Ju+?vC|K1RH;xo!^xarr>5tIU{7m&CK7Ub zxM`B^Sefz{;C@qKrXm6u(mJxjXYDhdEVD$O8x++-WSVl@Z=^j!+C>4kH+Ym@^Q31K z4@x>c?T1C~ixrbWm39{+FT`dg;B^RZ31AHm%DajeYbNWQ^n9O|YmvQ|*apZOliG0K zXY+_GKjf}Z?YW2-tGrBaO?Ht0mm8j%2&F(s+MTKSJw37(^t#P8NNI2BSh}7DHS5?@0+CbA*EX>11(O6cS|emXdhr)3FeBDCvjhtg9DL5hS=<& zU(AH8rbX777C~62m!%xinqBRVjsRZYgc)vSN?{tIs-}}7>&ysa?W=I*Hb~JT0;QUD zW-G#qjIY_My=!r47wcJE>SbQ+Z(WO`P#NJmb26?ol(0!ffS=w(T9Y{?1ju~WQF=iZ zS&3th8;6#l)PhE?V2evxXG(?VMbTu&+{{^_H0o1&LQn8CT(lbIv!ee|l5P?=E)55ms{Mk=?|EHGW~ zn(|T3{mjWw1-igwWQTgN{}_vZ4)#daJ;?fck99dC%h!CbjL?Q23i5PRlT~z$a^CZi01tARn(L9x=6=S+eth+o1Aeb zJ+1u(lo1#8AV7?9gYsEbUY*h1DpU#=2UnE`-Dz&}cf<(YmD=R#nKBrc8p+q_=aI=Xiu2_{i6trr#q10lljjTAN zBei@DeMg(+tG+K0XgsB}Vx3)Srpi%CJ9-jbY_lazQPWW9NVX-#7PUHv4J%}@sc;Ht zq+x0);#GmJmh>fBPd6qzgW`xnzG`E;65A!}O4anOd4AlRY)i7DC>`S7w85?G1=E^> zCvDQghF05&+i+RP4JGs#ZlUumTfPc^*q(*!MJu2pu(EGaesNhx#=23>6N@O*OAzWr;z0Rzufzum1od5oWdk delta 317 zcmcaF+sIyjPl#nI0}!wSu?!H005LZZ_W&^n>;PgxAl?bY0ziBkh)sa_4iFmvu^=M@ zgE)|O0@8dyItoZ<192u0gY;cxg3!-_v>}lH6G&?VX>Dc(1}O#xONMYD1EjGCNCWkN z0ZfEeUB5MTvjHZY5UVe%{1$jOTAMk=W#C7F5Y3K@w-DdmYpsS3$C`N`RO z4B, 2020 # #, fuzzy msgid "" @@ -13,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-02-19 17:27+0100\n" "PO-Revision-Date: 2017-08-09 10:34+0000\n" -"Last-Translator: Jan-Olof Svensson, 2019\n" +"Last-Translator: Luna Jernberg , 2020\n" "Language-Team: Swedish (https://www.transifex.com/calamares/teams/20061/sv/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -23,11 +24,11 @@ msgstr "" #: src/modules/grubcfg/main.py:37 msgid "Configure GRUB." -msgstr "" +msgstr "Konfigurera GRUB." #: src/modules/mount/main.py:38 msgid "Mounting partitions." -msgstr "" +msgstr "Monterar partitioner." #: src/modules/mount/main.py:145 src/modules/initcpiocfg/main.py:201 #: src/modules/initcpiocfg/main.py:205 @@ -39,23 +40,23 @@ msgstr "" #: src/modules/fstab/main.py:328 src/modules/localecfg/main.py:144 #: src/modules/networkcfg/main.py:48 msgid "Configuration Error" -msgstr "" +msgstr "Konfigurationsfel" #: src/modules/mount/main.py:146 src/modules/initcpiocfg/main.py:202 #: src/modules/luksopenswaphookcfg/main.py:96 src/modules/rawfs/main.py:172 #: src/modules/initramfscfg/main.py:95 src/modules/openrcdmcryptcfg/main.py:79 #: src/modules/fstab/main.py:323 msgid "No partitions are defined for
{!s}
to use." -msgstr "" +msgstr "Inga partitioner är definerade för
{!s}
att använda." #: src/modules/services-systemd/main.py:35 msgid "Configure systemd services" -msgstr "" +msgstr "Konfigurera systemd tjänster" #: src/modules/services-systemd/main.py:68 #: src/modules/services-openrc/main.py:102 msgid "Cannot modify service" -msgstr "" +msgstr "Kunde inte modifiera tjänst" #: src/modules/services-systemd/main.py:69 msgid "" @@ -65,7 +66,7 @@ msgstr "" #: src/modules/services-systemd/main.py:72 #: src/modules/services-systemd/main.py:76 msgid "Cannot enable systemd service {name!s}." -msgstr "" +msgstr "Kunde inte aktivera systemd tjänst {name!s}." #: src/modules/services-systemd/main.py:74 msgid "Cannot enable systemd target {name!s}." @@ -87,15 +88,15 @@ msgstr "" #: src/modules/umount/main.py:40 msgid "Unmount file systems." -msgstr "" +msgstr "Avmontera filsystem." #: src/modules/unpackfs/main.py:41 msgid "Filling up filesystems." -msgstr "" +msgstr "Packar upp filsystem." #: src/modules/unpackfs/main.py:184 msgid "rsync failed with error code {}." -msgstr "" +msgstr "rsync misslyckades med felkod {}." #: src/modules/unpackfs/main.py:245 src/modules/unpackfs/main.py:268 msgid "Failed to unpack image \"{}\"" @@ -109,7 +110,7 @@ msgstr "" #: src/modules/unpackfs/main.py:370 msgid "No mount point for root partition" -msgstr "" +msgstr "Ingen monteringspunkt för root partition" #: src/modules/unpackfs/main.py:371 msgid "globalstorage does not contain a \"rootMountPoint\" key, doing nothing" @@ -117,7 +118,7 @@ msgstr "" #: src/modules/unpackfs/main.py:376 msgid "Bad mount point for root partition" -msgstr "" +msgstr "Dålig monteringspunkt för root partition" #: src/modules/unpackfs/main.py:377 msgid "rootMountPoint is \"{}\", which does not exist, doing nothing" @@ -126,11 +127,11 @@ msgstr "" #: src/modules/unpackfs/main.py:389 src/modules/unpackfs/main.py:393 #: src/modules/unpackfs/main.py:407 msgid "Bad unsquash configuration" -msgstr "" +msgstr "Dålig unsquash konfiguration" #: src/modules/unpackfs/main.py:390 msgid "The filesystem for \"{}\" ({}) is not supported" -msgstr "" +msgstr "Filsystemet för \"{}\" ({})  stöds inte" #: src/modules/unpackfs/main.py:394 msgid "The source filesystem \"{}\" does not exist" @@ -142,31 +143,31 @@ msgstr "" #: src/modules/displaymanager/main.py:515 msgid "Cannot write KDM configuration file" -msgstr "" +msgstr "Misslyckades med att skriva KDM konfigurationsfil" #: src/modules/displaymanager/main.py:516 msgid "KDM config file {!s} does not exist" -msgstr "" +msgstr "KDM konfigurationsfil {!s} existerar inte" #: src/modules/displaymanager/main.py:577 msgid "Cannot write LXDM configuration file" -msgstr "" +msgstr "Misslyckades med att skriva LXDM konfigurationsfil" #: src/modules/displaymanager/main.py:578 msgid "LXDM config file {!s} does not exist" -msgstr "" +msgstr "LXDM konfigurationsfil {!s} existerar inte" #: src/modules/displaymanager/main.py:661 msgid "Cannot write LightDM configuration file" -msgstr "" +msgstr "Misslyckades med att skriva LightDM konfigurationsfil" #: src/modules/displaymanager/main.py:662 msgid "LightDM config file {!s} does not exist" -msgstr "" +msgstr "LightDM konfigurationsfil {!s} existerar inte" #: src/modules/displaymanager/main.py:736 msgid "Cannot configure LightDM" -msgstr "" +msgstr "Kunde inte konfigurera LightDM" #: src/modules/displaymanager/main.py:737 msgid "No LightDM greeter installed." @@ -174,11 +175,11 @@ msgstr "" #: src/modules/displaymanager/main.py:768 msgid "Cannot write SLIM configuration file" -msgstr "" +msgstr "Misslyckades med att SLIM konfigurationsfil" #: src/modules/displaymanager/main.py:769 msgid "SLIM config file {!s} does not exist" -msgstr "" +msgstr "SLIM konfigurationsfil {!s} existerar inte" #: src/modules/displaymanager/main.py:895 msgid "No display managers selected for the displaymanager module." @@ -196,7 +197,7 @@ msgstr "" #: src/modules/initcpiocfg/main.py:37 msgid "Configuring mkinitcpio." -msgstr "" +msgstr "Konfigurerar mkinitcpio." #: src/modules/initcpiocfg/main.py:206 #: src/modules/luksopenswaphookcfg/main.py:100 @@ -208,7 +209,7 @@ msgstr "" #: src/modules/luksopenswaphookcfg/main.py:35 msgid "Configuring encrypted swap." -msgstr "" +msgstr "Konfigurerar krypterad swap." #: src/modules/rawfs/main.py:35 msgid "Installing data." @@ -216,7 +217,7 @@ msgstr "Installerar data." #: src/modules/services-openrc/main.py:38 msgid "Configure OpenRC services" -msgstr "" +msgstr "Konfigurera OpenRC tjänster" #: src/modules/services-openrc/main.py:66 msgid "Cannot add service {name!s} to run-level {level!s}." @@ -259,7 +260,7 @@ msgstr "" #: src/modules/plymouthcfg/main.py:36 msgid "Configure Plymouth theme" -msgstr "" +msgstr "Konfigurera Plymouth tema" #: src/modules/packages/main.py:62 #, python-format @@ -286,7 +287,7 @@ msgstr[1] "Tar bort %(num)d paket." #: src/modules/bootloader/main.py:51 msgid "Install bootloader." -msgstr "" +msgstr "Installera starthanterare." #: src/modules/removeuser/main.py:34 msgid "Remove live user from target system" @@ -298,7 +299,7 @@ msgstr "Ställer hårdvaruklockan." #: src/modules/dracut/main.py:36 msgid "Creating initramfs with dracut." -msgstr "" +msgstr "Skapar initramfs med dracut." #: src/modules/dracut/main.py:58 msgid "Failed to run dracut on the target" @@ -310,11 +311,11 @@ msgstr "" #: src/modules/initramfscfg/main.py:41 msgid "Configuring initramfs." -msgstr "" +msgstr "Konfigurerar initramfs." #: src/modules/openrcdmcryptcfg/main.py:34 msgid "Configuring OpenRC dmcrypt service." -msgstr "" +msgstr "Konfigurerar OpenRC dmcrypt tjänst." #: src/modules/fstab/main.py:38 msgid "Writing fstab." @@ -330,8 +331,8 @@ msgstr "" #: src/modules/localecfg/main.py:39 msgid "Configuring locales." -msgstr "" +msgstr "Konfigurerar språkinställningar" #: src/modules/networkcfg/main.py:37 msgid "Saving network configuration." -msgstr "" +msgstr "Sparar nätverkskonfiguration." diff --git a/lang/python/zh_CN/LC_MESSAGES/python.mo b/lang/python/zh_CN/LC_MESSAGES/python.mo index 09dcb62c7df23d13ef7df5a102907ebc1afddddc..f4552796b632e69cda29207c61c4b45d63706b2a 100644 GIT binary patch literal 7289 zcmbuDe{3AZ6~~wIqs67A1q!sK?cg@lhMdn%AOz~@_s*&+D%Adgs!IL7 zncck~wgYWf+532RXWqPd@6DSx`QW-Mh7?@&xNpI|{WFT9f=^w6AG)qmlm~&!JZ=Ze z@q7gQ8aM;42Hyv72Cx3CqTC6Vdwdk6@BLsH`~~(Nv{LoH^GzM`**WXkIC#q!<@jkZgy%!x4)6ll0A2&*R)XIH9|NBQe+d2&B!6whB+*o91~-Edkn|r1 z8JGc|zD!ZBgi#*AbN6+UzXnOKn_x8Z+Zyn0un{DC^n$Cv6CQu#@p62m_iI3iP&AOn zdkUm^PlF`)w;9t7k7a4{sEBWwR(IS+=S;NAOnBrz5f>o5z6&wOmSKXlDthIT%zm($sQ4q^wn|0a%0Q ze}H#^x51cX&&Tm|8HjYF)ZwOUBW`L#{-ulTdM9o_716k)1H-)*H`$SNApMX|M0^6` zBAeWcn{44u2h6M>B`EjfUWc1(LKnq6U9_gjj}&8c(cJFA4Recl z1w>pUEr^SJd7u1K z7E$AIrs*uwW*UagOm3%4oktlrO~Yi=hIQ(x1bS3?qO7!K^F+js|39KOsZo|NQo7BO zhKAo51``S-RnyjN&CnHUlG3dwQ>xVlMf8}~nle@KsZP~(D62-J%;M&5Eka7F2@Wlp zZ7?&XhvIxUhlT<|d9RNzh_mflYn#2fLGeCBHA`)Yb0()3Wj5@@Z6?jY6-Z?8X#JZ5A_)#3ilPVQL7Shc-79 zJA%cuIQNCiHrpTjG>xR`KT+7u?c0_fu`n9g77A6R&U?q%)}~#X;Gy7oN0RGJb^ffa zf-jBnG=k7>V|E))U?M>mKL|Wa<@;!QEA!+<6A?3=w0*hx5vdK=#YZe8t3yo|f79ST zQ%%II;@5ElYmt|{Ote$$NK!M<*yIR*2oD6X4h_mjO*N9TtCY=}m5i%tmQZ!ImDA!a zSTn3cwa_tQB$9D%b7gZXkw~*-+HNy+_Jq-b?uBo##FMOZuTrnV!&nRkT&?HVW6WBK zVcHQ&DU-9bkz#Es0t;qja>2%|kZl-oizU@aJG8;jmW@=yqXi&GQdSU3? zSGVZ>iV7sa%BcShQt}Hy=)gKD@k9-7F-l8(k7n6Q!9uu1qoRede7gopm84^k9-+m< zhM&V&tI6S1GjC<_6)CMSAS{GxoJVZaBCT!!X;6 z*I$*gliR|DZK@gVAd5w?;@hi~X1UQ|F~~iuB#yk#e$FoaN>1b!1dE+fED=OO!D8}u z4F)@lJrh1R5d?;rR+<+@fW_j7U24k{NjuFDCMn(bEX1}Lc3W%QXi?)9B+!~vkrj%g zsEYCqrUl_x2{z1t8iKM9(h0q!Jwv)dxSSR>tLWTY>1$}El1alvl#13#6&X%c2flrR zJ)JsuJ1w;m;U=5ndh1ie5);&~L+00nvsDIFU}aXDVn$`J!?G`ni^^s;;>^RJ}G- zeGjXtu3dfS9o4wXwyTyMYBp8fimO-}wXB}QLUnDb0YBq6hR2$kn){x766+(eaV5m8 zqF#Dy3d<pq= z#vhz2?BeON%&}w1E}v?YH=oZPo(mLn28NvOXD_W-W`5E={I=A`n_g!2&@xs*JUG20 z3&+MvZ26b2XM8*N93!Jry(LZOzO+9x`&RK+QE6S`vsYs+-$HEeMW5w^i~>bIc*hFw z!8-#;#Ytc9eQ=`4OwTTyJnFxeF&br_VTy(L2Z>T)6j4(>nVB(n;G_&tVVH?mo#AmQ z!RbBWoIdFEbUPDArDd|`X0x-eL!*4jlXPy3+WVZr+3(pr6QSvOooZjQk z>nz{N9~7 zwQy#P3ITWcjN5n7={*}9@nhD97y5Hk=d+`enfVjWWMA&p?#xV2>3JeIH-!Lj`n&xY z7#^3Q93&Ti4odFytInZ=3q!-sv(GzYZ{~h>N}eDb5mcr2k|R2UQ_g{LSRRQ0(-cz> zss!WaU%5kP-GRv}MfUV+#-etmaVrlBWVMN-aH2dTNS{b`7ByHRc1zpHtW^*o!)K&M zewtzK8z*z~hqB`botfuJ{Ssfga}eK`sNCTu{>DBmm)V?|CJAdKUR+DPJv00*mY{79Pds#L?{B3)$J> z{A!Z(%8tH)*mRG)weX@?f>M{leIRf>%}jolt3LSPy_FNdWNC{MH6>cON2fB=U76`K z=;_Q2l@wmii~UPg;zfxQ0vDd0lP>e(u6SLOUJG4a&iR&PNsQFprsPGO_OTd!yu*@vL1QvL%psDKmz delta 330 zcmexq@rb?to)F7a1|Z-7Vi_Qg0b*_-o&&@nZ~}-0f%qg4ivaO$DE|YHHUVNLMg|6L zAZ-q$4S;kqkQN2fQ-E|G5U&DaaUfrl8A3Y(X(1p#5=cujFnBWL02v?y+8_c9n}9UP zfHOcEsF#5ah*^Lb$Yo#!Vs;>g0VW^=*T!>29x, 2017 # plantman , 2017 -# leonfeng , 2018 +# Feng Chao , 2020 # #, fuzzy msgid "" @@ -15,7 +15,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-02-19 17:27+0100\n" "PO-Revision-Date: 2017-08-09 10:34+0000\n" -"Last-Translator: leonfeng , 2018\n" +"Last-Translator: Feng Chao , 2020\n" "Language-Team: Chinese (China) (https://www.transifex.com/calamares/teams/20061/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -25,11 +25,11 @@ msgstr "" #: src/modules/grubcfg/main.py:37 msgid "Configure GRUB." -msgstr "" +msgstr "配置 GRUB." #: src/modules/mount/main.py:38 msgid "Mounting partitions." -msgstr "" +msgstr "挂载分区。" #: src/modules/mount/main.py:145 src/modules/initcpiocfg/main.py:201 #: src/modules/initcpiocfg/main.py:205 @@ -41,51 +41,53 @@ msgstr "" #: src/modules/fstab/main.py:328 src/modules/localecfg/main.py:144 #: src/modules/networkcfg/main.py:48 msgid "Configuration Error" -msgstr "" +msgstr "配置错误" #: src/modules/mount/main.py:146 src/modules/initcpiocfg/main.py:202 #: src/modules/luksopenswaphookcfg/main.py:96 src/modules/rawfs/main.py:172 #: src/modules/initramfscfg/main.py:95 src/modules/openrcdmcryptcfg/main.py:79 #: src/modules/fstab/main.py:323 msgid "No partitions are defined for
{!s}
to use." -msgstr "" +msgstr "没有分配分区给
{!s}
。" #: src/modules/services-systemd/main.py:35 msgid "Configure systemd services" -msgstr "" +msgstr "配置 systemd 服务" #: src/modules/services-systemd/main.py:68 #: src/modules/services-openrc/main.py:102 msgid "Cannot modify service" -msgstr "" +msgstr "无法修改服务" #: src/modules/services-systemd/main.py:69 msgid "" "systemctl {arg!s} call in chroot returned error code {num!s}." -msgstr "" +msgstr "chroot 中的 systemctl {arg!s} 命令返回错误 {num!s}." #: src/modules/services-systemd/main.py:72 #: src/modules/services-systemd/main.py:76 msgid "Cannot enable systemd service {name!s}." -msgstr "" +msgstr "无法启用 systemd 服务 {name!s}." #: src/modules/services-systemd/main.py:74 msgid "Cannot enable systemd target {name!s}." -msgstr "" +msgstr "无法启用 systemd 目标 {name!s}." #: src/modules/services-systemd/main.py:78 msgid "Cannot disable systemd target {name!s}." -msgstr "" +msgstr "无法禁用 systemd 目标 {name!s}." #: src/modules/services-systemd/main.py:80 msgid "Cannot mask systemd unit {name!s}." -msgstr "" +msgstr "无法屏蔽 systemd 单元 {name!s}." #: src/modules/services-systemd/main.py:82 msgid "" "Unknown systemd commands {command!s} and " "{suffix!s} for unit {name!s}." msgstr "" +"未知的 systemd 命令 {command!s} 和 {name!s} 单元前缀 " +"{suffix!s}." #: src/modules/umount/main.py:40 msgid "Unmount file systems." @@ -93,112 +95,112 @@ msgstr "卸载文件系统。" #: src/modules/unpackfs/main.py:41 msgid "Filling up filesystems." -msgstr "" +msgstr "写入文件系统。" #: src/modules/unpackfs/main.py:184 msgid "rsync failed with error code {}." -msgstr "" +msgstr "rsync 报错,错误码 {}." #: src/modules/unpackfs/main.py:245 src/modules/unpackfs/main.py:268 msgid "Failed to unpack image \"{}\"" -msgstr "" +msgstr "解压镜像失败 \"{}\"" #: src/modules/unpackfs/main.py:246 msgid "" "Failed to find unsquashfs, make sure you have the squashfs-tools package " "installed" -msgstr "" +msgstr "未找到 unsquashfs,请确保安装了 squashfs-tools 软件包" #: src/modules/unpackfs/main.py:370 msgid "No mount point for root partition" -msgstr "" +msgstr "无 root 分区挂载点" #: src/modules/unpackfs/main.py:371 msgid "globalstorage does not contain a \"rootMountPoint\" key, doing nothing" -msgstr "" +msgstr "globalstorage 未包含 \"rootMountPoint\",跳过" #: src/modules/unpackfs/main.py:376 msgid "Bad mount point for root partition" -msgstr "" +msgstr "错误的 root 分区挂载点" #: src/modules/unpackfs/main.py:377 msgid "rootMountPoint is \"{}\", which does not exist, doing nothing" -msgstr "" +msgstr "rootMountPoint 是 \"{}\",不存在此位置,跳过" #: src/modules/unpackfs/main.py:389 src/modules/unpackfs/main.py:393 #: src/modules/unpackfs/main.py:407 msgid "Bad unsquash configuration" -msgstr "" +msgstr "错误的 unsquash 配置" #: src/modules/unpackfs/main.py:390 msgid "The filesystem for \"{}\" ({}) is not supported" -msgstr "" +msgstr "不支持文件系统 \"{}\" ({})" #: src/modules/unpackfs/main.py:394 msgid "The source filesystem \"{}\" does not exist" -msgstr "" +msgstr "源文件系统 \"{}\" 不存在" #: src/modules/unpackfs/main.py:408 msgid "The destination \"{}\" in the target system is not a directory" -msgstr "" +msgstr "目标系统中的 \"{}\" 不是一个目录" #: src/modules/displaymanager/main.py:515 msgid "Cannot write KDM configuration file" -msgstr "" +msgstr "无法写入 KDM 配置文件" #: src/modules/displaymanager/main.py:516 msgid "KDM config file {!s} does not exist" -msgstr "" +msgstr "KDM 配置文件 {!s} 不存在" #: src/modules/displaymanager/main.py:577 msgid "Cannot write LXDM configuration file" -msgstr "" +msgstr "无法写入 LXDM 配置文件" #: src/modules/displaymanager/main.py:578 msgid "LXDM config file {!s} does not exist" -msgstr "" +msgstr "LXDM 配置文件 {!s} 不存在" #: src/modules/displaymanager/main.py:661 msgid "Cannot write LightDM configuration file" -msgstr "" +msgstr "无法写入 LightDM 配置文件" #: src/modules/displaymanager/main.py:662 msgid "LightDM config file {!s} does not exist" -msgstr "" +msgstr "LightDM 配置文件 {!s} 不存在" #: src/modules/displaymanager/main.py:736 msgid "Cannot configure LightDM" -msgstr "" +msgstr "无法配置 LightDM" #: src/modules/displaymanager/main.py:737 msgid "No LightDM greeter installed." -msgstr "" +msgstr "未安装 LightDM 欢迎程序。" #: src/modules/displaymanager/main.py:768 msgid "Cannot write SLIM configuration file" -msgstr "" +msgstr "无法写入 SLIM 配置文件" #: src/modules/displaymanager/main.py:769 msgid "SLIM config file {!s} does not exist" -msgstr "" +msgstr "SLIM 配置文件 {!s} 不存在" #: src/modules/displaymanager/main.py:895 msgid "No display managers selected for the displaymanager module." -msgstr "" +msgstr "显示管理器模块中未选择显示管理器。" #: src/modules/displaymanager/main.py:896 msgid "" "The displaymanagers list is empty or undefined in bothglobalstorage and " "displaymanager.conf." -msgstr "" +msgstr "globalstorage 和 displaymanager.conf 配置文件中都没有配置显示管理器。" #: src/modules/displaymanager/main.py:978 msgid "Display manager configuration was incomplete" -msgstr "" +msgstr "显示管理器配置不完全" #: src/modules/initcpiocfg/main.py:37 msgid "Configuring mkinitcpio." -msgstr "" +msgstr "配置 mkinitcpio." #: src/modules/initcpiocfg/main.py:206 #: src/modules/luksopenswaphookcfg/main.py:100 @@ -206,62 +208,62 @@ msgstr "" #: src/modules/fstab/main.py:329 src/modules/localecfg/main.py:145 #: src/modules/networkcfg/main.py:49 msgid "No root mount point is given for
{!s}
to use." -msgstr "" +msgstr " 未设置
{!s}
要使用的根挂载点。" #: src/modules/luksopenswaphookcfg/main.py:35 msgid "Configuring encrypted swap." -msgstr "" +msgstr "配置加密交换分区。" #: src/modules/rawfs/main.py:35 msgid "Installing data." -msgstr "" +msgstr "安装数据." #: src/modules/services-openrc/main.py:38 msgid "Configure OpenRC services" -msgstr "" +msgstr "配置 OpenRC 服务。" #: src/modules/services-openrc/main.py:66 msgid "Cannot add service {name!s} to run-level {level!s}." -msgstr "" +msgstr "无法将服务 {name!s} 加入 {level!s} 运行级别." #: src/modules/services-openrc/main.py:68 msgid "Cannot remove service {name!s} from run-level {level!s}." -msgstr "" +msgstr "无法从 {level!s} 运行级别中删除服务 {name!s}。" #: src/modules/services-openrc/main.py:70 msgid "" "Unknown service-action {arg!s} for service {name!s} in run-" "level {level!s}." -msgstr "" +msgstr "未知的服务动作 {arg!s},服务名: {name!s},运行级别: {level!s}." #: src/modules/services-openrc/main.py:103 msgid "" "rc-update {arg!s} call in chroot returned error code {num!s}." -msgstr "" +msgstr "chroot 中运行的 rc-update {arg!s} 返回错误 {num!s}." #: src/modules/services-openrc/main.py:110 msgid "Target runlevel does not exist" -msgstr "" +msgstr "目标运行级别不存在。" #: src/modules/services-openrc/main.py:111 msgid "" "The path for runlevel {level!s} is {path!s}, which does not " "exist." -msgstr "" +msgstr "运行级别 {level!s} 所在目录 {path!s} 不存在。" #: src/modules/services-openrc/main.py:119 msgid "Target service does not exist" -msgstr "" +msgstr "目标服务不存在" #: src/modules/services-openrc/main.py:120 msgid "" "The path for service {name!s} is {path!s}, which does not " "exist." -msgstr "" +msgstr "服务 {name!s} 的路径 {path!s} 不存在。" #: src/modules/plymouthcfg/main.py:36 msgid "Configure Plymouth theme" -msgstr "" +msgstr "配置 Plymouth 主题" #: src/modules/packages/main.py:62 #, python-format @@ -286,39 +288,39 @@ msgstr[0] "移除%(num)d软件包。" #: src/modules/bootloader/main.py:51 msgid "Install bootloader." -msgstr "" +msgstr "安装启动加载器。" #: src/modules/removeuser/main.py:34 msgid "Remove live user from target system" -msgstr "" +msgstr "从目标系统删除 live 用户" #: src/modules/hwclock/main.py:35 msgid "Setting hardware clock." -msgstr "" +msgstr "设置硬件时钟。" #: src/modules/dracut/main.py:36 msgid "Creating initramfs with dracut." -msgstr "" +msgstr "用 dracut 创建 initramfs." #: src/modules/dracut/main.py:58 msgid "Failed to run dracut on the target" -msgstr "" +msgstr "无法在目标中运行 dracut " #: src/modules/dracut/main.py:59 msgid "The exit code was {}" -msgstr "" +msgstr "退出码是 {}" #: src/modules/initramfscfg/main.py:41 msgid "Configuring initramfs." -msgstr "" +msgstr "正在配置初始内存文件系统。" #: src/modules/openrcdmcryptcfg/main.py:34 msgid "Configuring OpenRC dmcrypt service." -msgstr "" +msgstr "配置 OpenRC dmcrypt 服务。" #: src/modules/fstab/main.py:38 msgid "Writing fstab." -msgstr "" +msgstr "正在写入 fstab。" #: src/modules/dummypython/main.py:44 msgid "Dummy python job." @@ -330,8 +332,8 @@ msgstr "占位 Python 步骤 {}" #: src/modules/localecfg/main.py:39 msgid "Configuring locales." -msgstr "" +msgstr "正在进行本地化配置。" #: src/modules/networkcfg/main.py:37 msgid "Saving network configuration." -msgstr "" +msgstr "正在保存网络配置。" From d4b26bbaf0d2b15e98c0215cc99d5698a252aff3 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 27 Feb 2020 13:49:02 +0100 Subject: [PATCH 10/22] [partition] Tighten up the types of internal methods --- src/modules/partition/jobs/FillGlobalStorageJob.cpp | 5 +++-- src/modules/partition/jobs/FillGlobalStorageJob.h | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/modules/partition/jobs/FillGlobalStorageJob.cpp b/src/modules/partition/jobs/FillGlobalStorageJob.cpp index 65c93014b..347dcb0a7 100644 --- a/src/modules/partition/jobs/FillGlobalStorageJob.cpp +++ b/src/modules/partition/jobs/FillGlobalStorageJob.cpp @@ -147,7 +147,7 @@ FillGlobalStorageJob::prettyDescription() const { QStringList lines; - const auto partitionList = createPartitionList().toList(); + const auto partitionList = createPartitionList(); for ( const QVariant& partitionItem : partitionList ) { if ( partitionItem.type() == QVariant::Map ) @@ -218,6 +218,7 @@ FillGlobalStorageJob::exec() Calamares::GlobalStorage* storage = Calamares::JobQueue::instance()->globalStorage(); storage->insert( "partitions", createPartitionList() ); cDebug() << "Saving partition information map to GlobalStorage[\"partitions\"]"; + if ( !m_bootLoaderPath.isEmpty() ) { QVariant var = createBootLoaderMap(); @@ -236,7 +237,7 @@ FillGlobalStorageJob::exec() return Calamares::JobResult::ok(); } -QVariant +QVariantList FillGlobalStorageJob::createPartitionList() const { UuidForPartitionHash hash = findPartitionUuids( m_devices ); diff --git a/src/modules/partition/jobs/FillGlobalStorageJob.h b/src/modules/partition/jobs/FillGlobalStorageJob.h index c2bf80a06..e8a463815 100644 --- a/src/modules/partition/jobs/FillGlobalStorageJob.h +++ b/src/modules/partition/jobs/FillGlobalStorageJob.h @@ -22,8 +22,8 @@ #include "Job.h" -// Qt #include +#include class Device; class Partition; @@ -48,7 +48,7 @@ private: QList< Device* > m_devices; QString m_bootLoaderPath; - QVariant createPartitionList() const; + QVariantList createPartitionList() const; QVariant createBootLoaderMap() const; }; From 54a46448930f1ddede870d74af0e4546230b3f1f Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 27 Feb 2020 14:29:54 +0100 Subject: [PATCH 11/22] [partition] Store filesystem types - Write a new GS key filesystems_use, which is a map of filesystems in use on the target system. --- .../partition/jobs/FillGlobalStorageJob.cpp | 49 ++++++++++++++++--- 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/src/modules/partition/jobs/FillGlobalStorageJob.cpp b/src/modules/partition/jobs/FillGlobalStorageJob.cpp index 347dcb0a7..ac65b5ff6 100644 --- a/src/modules/partition/jobs/FillGlobalStorageJob.cpp +++ b/src/modules/partition/jobs/FillGlobalStorageJob.cpp @@ -40,9 +40,9 @@ #include #include +using CalamaresUtils::Partition::PartitionIterator; using CalamaresUtils::Partition::untranslatedFS; using CalamaresUtils::Partition::userVisibleFS; -using CalamaresUtils::Partition::PartitionIterator; typedef QHash< QString, QString > UuidForPartitionHash; @@ -107,10 +107,8 @@ mapForPartition( Partition* partition, const QString& uuid ) Logger::CDebug deb; using TR = Logger::DebugRow< const char* const, const QString& >; deb << Logger::SubEntry << "mapping for" << partition->partitionPath() << partition->deviceNode() - << TR( "mtpoint:", PartitionInfo::mountPoint( partition ) ) - << TR( "fs:", map[ "fs" ].toString() ) - << TR( "fsName", map[ "fsName" ].toString() ) - << TR( "uuid", uuid ) + << TR( "mtpoint:", PartitionInfo::mountPoint( partition ) ) << TR( "fs:", map[ "fs" ].toString() ) + << TR( "fsName", map[ "fsName" ].toString() ) << TR( "uuid", uuid ) << TR( "claimed", map[ "claimed" ].toString() ); if ( partition->roles().has( PartitionRole::Luks ) ) @@ -212,12 +210,51 @@ FillGlobalStorageJob::prettyStatusMessage() const return tr( "Setting up mount points." ); } + +/** @brief note which FS'ses are in use in GS + * + * .. mark as "1" if it's on the system, somewhere + * .. mark as "2" if it's one of the claimed / in-use FSses + * + * Stores a GS key called "filesystems_use" with this mapping. + */ +static void +storeFSUse( Calamares::GlobalStorage* storage, const QVariantList& partitions ) +{ + QMap< QString, int > fsUses; + for ( const auto& p : partitions ) + { + const auto pmap = p.toMap(); + + QString fs = pmap.value( "fs" ).toString(); + int thisUse = pmap.value( "claimed" ).toBool() ? 2 : 1; + + if ( fs.isEmpty() ) + { + continue; + } + + int newUse = qMax( fsUses.value( fs ), thisUse ); // value() is 0 if not present + fsUses.insert( fs, newUse ); + } + + QVariantMap fsUsesVariant; + for ( auto it = fsUses.cbegin(); it != fsUses.cend(); ++it ) + { + fsUsesVariant.insert( it.key(), it.value() ); + } + + storage->insert( "filesystems_use", fsUsesVariant ); +} + Calamares::JobResult FillGlobalStorageJob::exec() { Calamares::GlobalStorage* storage = Calamares::JobQueue::instance()->globalStorage(); - storage->insert( "partitions", createPartitionList() ); + const auto partitions = createPartitionList(); cDebug() << "Saving partition information map to GlobalStorage[\"partitions\"]"; + storage->insert( "partitions", partitions ); + storeFSUse( storage, partitions ); if ( !m_bootLoaderPath.isEmpty() ) { From 510e4a00338aef077e9b2a66db626aa03f476481 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 27 Feb 2020 15:01:37 +0100 Subject: [PATCH 12/22] Changes: document debug-logging and FillGlobalStorageJob --- CHANGES | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 90587d46b..77370b9af 100644 --- a/CHANGES +++ b/CHANGES @@ -9,10 +9,18 @@ This release contains contributions from (alphabetically by first name): - No external contributors yet ## Core ## - - No core changes yet + - When logging level is set to 8 (eight), for instance via the `-D8` + logging flag, or the `-d` debug flag, the *Show debug information* + button will appear in the progress view. This helps with debugging + issues where the `-d` flag would be inappropriate. + - Calamares now starts at logging level 1 (warnings and errors to + the console) by default. Previously it (wrongly) started at level 8. ## Modules ## - - No module changes yet + - The *partition* module now stores which filesystems are in use in + global storage. While this is currently incompatible with the + *contextualprocess* module, a custom module can make use of that + to optimise the target system for the filesystems that are present. # 3.2.19.1 (2020-02-24) # From d114a3dc21b2a252e5fbb3a0e2dd807ab19b7d3f Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 27 Feb 2020 17:14:41 +0100 Subject: [PATCH 13/22] [contextualprocess] Allow selection from GS with "var1.var2.var3" --- .../ContextualProcessJob.cpp | 88 +++++++++++++++---- 1 file changed, 70 insertions(+), 18 deletions(-) diff --git a/src/modules/contextualprocess/ContextualProcessJob.cpp b/src/modules/contextualprocess/ContextualProcessJob.cpp index c65261b23..a2aa507ea 100644 --- a/src/modules/contextualprocess/ContextualProcessJob.cpp +++ b/src/modules/contextualprocess/ContextualProcessJob.cpp @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === * - * Copyright 2017-2018, Adriaan de Groot + * Copyright 2017-2020, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -49,15 +49,19 @@ struct ValueCheck : public QPair< QString, CalamaresUtils::CommandList* > CalamaresUtils::CommandList* commands() const { return second; } }; -struct ContextualProcessBinding +class ContextualProcessBinding { +public: ContextualProcessBinding( const QString& varname ) - : variable( varname ) + : m_variable( varname ) { } ~ContextualProcessBinding(); + QString variable() const { return m_variable; } + int count() const { return m_checks.count(); } + /** * @brief add commands to be executed when @p value is matched. * @@ -65,16 +69,16 @@ struct ContextualProcessBinding */ void append( const QString& value, CalamaresUtils::CommandList* commands ) { - checks.append( ValueCheck( value, commands ) ); + m_checks.append( ValueCheck( value, commands ) ); if ( value == QString( "*" ) ) { - wildcard = commands; + m_wildcard = commands; } } Calamares::JobResult run( const QString& value ) const { - for ( const auto& c : checks ) + for ( const auto& c : m_checks ) { if ( value == c.value() ) { @@ -82,24 +86,69 @@ struct ContextualProcessBinding } } - if ( wildcard ) + if ( m_wildcard ) { - return wildcard->run(); + return m_wildcard->run(); } return Calamares::JobResult::ok(); } - QString variable; - QList< ValueCheck > checks; - CalamaresUtils::CommandList* wildcard { nullptr }; + /** @brief Tries to obtain this binding's value from GS + * + * Stores the value in @p value and returns true if a value + * was found (e.g. @p storage contains the variable this binding + * is for) and false otherwise. + */ + bool fetch( Calamares::GlobalStorage* storage, QString& value ) const + { + value.clear(); + if ( !storage ) + { + return false; + } + if ( m_variable.contains( '.' ) ) + { + QStringList steps = m_variable.split( '.' ); + return fetch( value, steps, 1, storage->value( steps.first() ) ); + } + else + { + value = storage->value( m_variable ).toString(); + return storage->contains( m_variable ); + } + } + +private: + static bool fetch( QString& value, QStringList& selector, int index, const QVariant& v ) + { + if ( !v.canConvert( QMetaType::QVariantMap ) ) + { + return false; + } + const QVariantMap map = v.toMap(); + const QString& key = selector.at( index ); + if ( index == selector.length() ) + { + value = map.value( key ).toString(); + return map.contains( key ); + } + else + { + return fetch( value, selector, index + 1, map.value( key ) ); + } + } + + QString m_variable; + QList< ValueCheck > m_checks; + CalamaresUtils::CommandList* m_wildcard = nullptr; }; ContextualProcessBinding::~ContextualProcessBinding() { - wildcard = nullptr; - for ( const auto& c : checks ) + m_wildcard = nullptr; + for ( const auto& c : m_checks ) { delete c.commands(); } @@ -131,9 +180,10 @@ ContextualProcessJob::exec() for ( const ContextualProcessBinding* binding : m_commands ) { - if ( gs->contains( binding->variable ) ) + QString value; + if ( binding->fetch( gs, value ) ) { - Calamares::JobResult r = binding->run( gs->value( binding->variable ).toString() ); + Calamares::JobResult r = binding->run( value ); if ( !r ) { return r; @@ -141,7 +191,7 @@ ContextualProcessJob::exec() } else { - cWarning() << "ContextualProcess checks for unknown variable" << binding->variable; + cWarning() << "ContextualProcess checks for unknown variable" << binding->variable(); } } return Calamares::JobResult::ok(); @@ -203,10 +253,12 @@ int ContextualProcessJob::count( const QString& variableName ) { for ( const ContextualProcessBinding* binding : m_commands ) - if ( binding->variable == variableName ) + { + if ( binding->variable() == variableName ) { - return binding->checks.count(); + return binding->count(); } + } return -1; } From 4a5b3e7bc833097828c3ea0efbf402763d57dd93 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 27 Feb 2020 18:22:07 +0100 Subject: [PATCH 14/22] [contextualprocess] Document new behavior for compound keys --- .../contextualprocess/contextualprocess.conf | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/modules/contextualprocess/contextualprocess.conf b/src/modules/contextualprocess/contextualprocess.conf index 74bd2304a..0f5972d04 100644 --- a/src/modules/contextualprocess/contextualprocess.conf +++ b/src/modules/contextualprocess/contextualprocess.conf @@ -13,6 +13,17 @@ # to the variable's value. If the variable has that particular value, the # corresponding value (script) is executed. # +# The variable **may** contain dots, in which case the dot is used +# to select into maps inside global storage, e.g. +# +# - *firmwareType* is a simple global name +# - *branding.bootloader* is the *bootloader* value in the *branding* map +# +# Only a few global storage entries have well-defined sub-maps; +# branding is one of them, and *filesystem_use* is another. Note that +# variable names with dots **must** be quoted, or you will get a YAML error. +# +# # You can check for an empty value with "". # # As a special case, the value-check "*" matches any value, but **only** @@ -44,3 +55,6 @@ firmwareType: bios: "-pkg remove bios-firmware" "": "/bin/false no-firmware-type-set" "*": "/bin/false some-other-firmware-value" +"branding.shortVersion": + "2020.2": "/bin/false february" + "2019.4": "/bin/true april" From bdb208c0799f0497901c91ca4eeaf936a12cf51f Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 27 Feb 2020 18:40:17 +0100 Subject: [PATCH 15/22] [contextualprocess] Split API In order to test some of the internals, split them into Binding.h. This makes the interface visible for tests. The implementation still lives in the same place. While here, adjust the test to the changed **example** which now lists an additional variable. --- src/modules/contextualprocess/Binding.h | 95 +++++++++ .../ContextualProcessJob.cpp | 190 +++++++----------- .../contextualprocess/ContextualProcessJob.h | 2 +- src/modules/contextualprocess/Tests.cpp | 2 +- 4 files changed, 170 insertions(+), 119 deletions(-) create mode 100644 src/modules/contextualprocess/Binding.h diff --git a/src/modules/contextualprocess/Binding.h b/src/modules/contextualprocess/Binding.h new file mode 100644 index 000000000..fce43a65c --- /dev/null +++ b/src/modules/contextualprocess/Binding.h @@ -0,0 +1,95 @@ +/* === This file is part of Calamares - === + * + * Copyright 2017-2020, Adriaan de Groot + * + * Calamares is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Calamares is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Calamares. If not, see . + */ + +/* This file isn't public API, but is used to express the API that + * the tests for ContextualProcess can work with. + */ +#ifndef CONTEXTUALPROCESSJOB_BINDING_H +#define CONTEXTUALPROCESSJOB_BINDING_H + +#include +#include +#include + +namespace CalamaresUtils +{ +class CommandList; +} +namespace Calamares +{ +class GlobalStorage; +} + +struct ValueCheck : public QPair< QString, CalamaresUtils::CommandList* > +{ + ValueCheck( const QString& value, CalamaresUtils::CommandList* commands ) + : QPair< QString, CalamaresUtils::CommandList* >( value, commands ) + { + } + + // ~ValueCheck() + // + // There is no destructor. + // + // We don't own the commandlist, the binding holding this valuecheck + // does, so don't delete. This is closely tied to (temporaries created + // by) pass-by-value in QList::append(). + + QString value() const { return first; } + CalamaresUtils::CommandList* commands() const { return second; } +}; + +class ContextualProcessBinding +{ +public: + ContextualProcessBinding( const QString& varname ) + : m_variable( varname ) + { + } + + ~ContextualProcessBinding(); + + QString variable() const { return m_variable; } + int count() const { return m_checks.count(); } + + /** + * @brief add commands to be executed when @p value is matched. + * + * Ownership of the CommandList passes to this binding. + */ + void append( const QString& value, CalamaresUtils::CommandList* commands ); + + ///@brief The bound variable has @p value , run the associated commands. + Calamares::JobResult run( const QString& value ) const; + + /** @brief Tries to obtain this binding's value from GS + * + * Stores the value in @p value and returns true if a value + * was found (e.g. @p storage contains the variable this binding + * is for) and false otherwise. + */ + bool fetch( Calamares::GlobalStorage* storage, QString& value ) const; + +private: + QString m_variable; + QList< ValueCheck > m_checks; + CalamaresUtils::CommandList* m_wildcard = nullptr; +}; + + +#endif diff --git a/src/modules/contextualprocess/ContextualProcessJob.cpp b/src/modules/contextualprocess/ContextualProcessJob.cpp index a2aa507ea..b0d7a6743 100644 --- a/src/modules/contextualprocess/ContextualProcessJob.cpp +++ b/src/modules/contextualprocess/ContextualProcessJob.cpp @@ -18,9 +18,7 @@ #include "ContextualProcessJob.h" -#include -#include -#include +#include "Binding.h" #include "CalamaresVersion.h" #include "GlobalStorage.h" @@ -30,120 +28,6 @@ #include "utils/Logger.h" #include "utils/Variant.h" -struct ValueCheck : public QPair< QString, CalamaresUtils::CommandList* > -{ - ValueCheck( const QString& value, CalamaresUtils::CommandList* commands ) - : QPair< QString, CalamaresUtils::CommandList* >( value, commands ) - { - } - - // ~ValueCheck() - // - // There is no destructor. - // - // We don't own the commandlist, the binding holding this valuecheck - // does, so don't delete. This is closely tied to (temporaries created - // by) pass-by-value in QList::append(). - - QString value() const { return first; } - CalamaresUtils::CommandList* commands() const { return second; } -}; - -class ContextualProcessBinding -{ -public: - ContextualProcessBinding( const QString& varname ) - : m_variable( varname ) - { - } - - ~ContextualProcessBinding(); - - QString variable() const { return m_variable; } - int count() const { return m_checks.count(); } - - /** - * @brief add commands to be executed when @p value is matched. - * - * Ownership of the CommandList passes to this binding. - */ - void append( const QString& value, CalamaresUtils::CommandList* commands ) - { - m_checks.append( ValueCheck( value, commands ) ); - if ( value == QString( "*" ) ) - { - m_wildcard = commands; - } - } - - Calamares::JobResult run( const QString& value ) const - { - for ( const auto& c : m_checks ) - { - if ( value == c.value() ) - { - return c.commands()->run(); - } - } - - if ( m_wildcard ) - { - return m_wildcard->run(); - } - - return Calamares::JobResult::ok(); - } - - /** @brief Tries to obtain this binding's value from GS - * - * Stores the value in @p value and returns true if a value - * was found (e.g. @p storage contains the variable this binding - * is for) and false otherwise. - */ - bool fetch( Calamares::GlobalStorage* storage, QString& value ) const - { - value.clear(); - if ( !storage ) - { - return false; - } - if ( m_variable.contains( '.' ) ) - { - QStringList steps = m_variable.split( '.' ); - return fetch( value, steps, 1, storage->value( steps.first() ) ); - } - else - { - value = storage->value( m_variable ).toString(); - return storage->contains( m_variable ); - } - } - -private: - static bool fetch( QString& value, QStringList& selector, int index, const QVariant& v ) - { - if ( !v.canConvert( QMetaType::QVariantMap ) ) - { - return false; - } - const QVariantMap map = v.toMap(); - const QString& key = selector.at( index ); - if ( index == selector.length() ) - { - value = map.value( key ).toString(); - return map.contains( key ); - } - else - { - return fetch( value, selector, index + 1, map.value( key ) ); - } - } - - QString m_variable; - QList< ValueCheck > m_checks; - CalamaresUtils::CommandList* m_wildcard = nullptr; -}; - ContextualProcessBinding::~ContextualProcessBinding() { @@ -154,6 +38,78 @@ ContextualProcessBinding::~ContextualProcessBinding() } } +void +ContextualProcessBinding::append( const QString& value, CalamaresUtils::CommandList* commands ) +{ + m_checks.append( ValueCheck( value, commands ) ); + if ( value == QString( "*" ) ) + { + m_wildcard = commands; + } +} + +Calamares::JobResult +ContextualProcessBinding::run( const QString& value ) const +{ + for ( const auto& c : m_checks ) + { + if ( value == c.value() ) + { + return c.commands()->run(); + } + } + + if ( m_wildcard ) + { + return m_wildcard->run(); + } + + return Calamares::JobResult::ok(); +} + +///@brief Implementation of fetch() for recursively looking up dotted selector parts. +static bool +fetch( QString& value, QStringList& selector, int index, const QVariant& v ) +{ + if ( !v.canConvert( QMetaType::QVariantMap ) ) + { + return false; + } + const QVariantMap map = v.toMap(); + const QString& key = selector.at( index ); + if ( index == selector.length() ) + { + value = map.value( key ).toString(); + return map.contains( key ); + } + else + { + return fetch( value, selector, index + 1, map.value( key ) ); + } +} + + +bool +ContextualProcessBinding::fetch( Calamares::GlobalStorage* storage, QString& value ) const +{ + value.clear(); + if ( !storage ) + { + return false; + } + if ( m_variable.contains( '.' ) ) + { + QStringList steps = m_variable.split( '.' ); + return ::fetch( value, steps, 1, storage->value( steps.first() ) ); + } + else + { + value = storage->value( m_variable ).toString(); + return storage->contains( m_variable ); + } +} + + ContextualProcessJob::ContextualProcessJob( QObject* parent ) : Calamares::CppJob( parent ) { diff --git a/src/modules/contextualprocess/ContextualProcessJob.h b/src/modules/contextualprocess/ContextualProcessJob.h index 3a252d2d3..5ab4b935e 100644 --- a/src/modules/contextualprocess/ContextualProcessJob.h +++ b/src/modules/contextualprocess/ContextualProcessJob.h @@ -27,7 +27,7 @@ #include "utils/PluginFactory.h" -struct ContextualProcessBinding; +class ContextualProcessBinding; class PLUGINDLLEXPORT ContextualProcessJob : public Calamares::CppJob { diff --git a/src/modules/contextualprocess/Tests.cpp b/src/modules/contextualprocess/Tests.cpp index f62726775..8e7000f17 100644 --- a/src/modules/contextualprocess/Tests.cpp +++ b/src/modules/contextualprocess/Tests.cpp @@ -59,6 +59,6 @@ ContextualProcessTests::testProcessListSampleConfig() ContextualProcessJob job; job.setConfigurationMap( CalamaresUtils::yamlMapToVariant( doc ).toMap() ); - QCOMPARE( job.count(), 1 ); // Only "firmwareType" + QCOMPARE( job.count(), 2 ); // Only "firmwareType" and "branding.shortVersion" QCOMPARE( job.count( "firmwareType" ), 4 ); } From 28bf4082b3bf4ce62f83ffe1f2d19fb4f852d7e9 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 27 Feb 2020 22:34:46 +0100 Subject: [PATCH 16/22] [contextualprocess] Tests for new lookup behavior --- src/modules/contextualprocess/Binding.h | 2 + src/modules/contextualprocess/Tests.cpp | 125 ++++++++++++++++++++++++ src/modules/contextualprocess/Tests.h | 3 + 3 files changed, 130 insertions(+) diff --git a/src/modules/contextualprocess/Binding.h b/src/modules/contextualprocess/Binding.h index fce43a65c..25b5c7547 100644 --- a/src/modules/contextualprocess/Binding.h +++ b/src/modules/contextualprocess/Binding.h @@ -22,6 +22,8 @@ #ifndef CONTEXTUALPROCESSJOB_BINDING_H #define CONTEXTUALPROCESSJOB_BINDING_H +#include "Job.h" + #include #include #include diff --git a/src/modules/contextualprocess/Tests.cpp b/src/modules/contextualprocess/Tests.cpp index 8e7000f17..8f3322455 100644 --- a/src/modules/contextualprocess/Tests.cpp +++ b/src/modules/contextualprocess/Tests.cpp @@ -17,9 +17,15 @@ */ #include "Tests.h" + +#include "Binding.h" #include "ContextualProcessJob.h" +#include "GlobalStorage.h" +#include "JobQueue.h" +#include "utils/CalamaresUtilsSystem.h" #include "utils/CommandList.h" +#include "utils/Logger.h" #include "utils/Yaml.h" #include @@ -38,6 +44,22 @@ ContextualProcessTests::~ContextualProcessTests() {} void ContextualProcessTests::initTestCase() { + Logger::setupLogLevel( Logger::LOGDEBUG ); + + // Ensure we have a system object, expect it to be a "bogus" one + CalamaresUtils::System* system = CalamaresUtils::System::instance(); + QVERIFY( system ); + QVERIFY( system->doChroot() ); + + // Ensure we have a system-wide GlobalStorage with /tmp as root + if ( !Calamares::JobQueue::instance() ) + { + cDebug() << "Creating new JobQueue"; + (void)new Calamares::JobQueue(); + } + Calamares::GlobalStorage* gs + = Calamares::JobQueue::instance() ? Calamares::JobQueue::instance()->globalStorage() : nullptr; + QVERIFY( gs ); } void @@ -61,4 +83,107 @@ ContextualProcessTests::testProcessListSampleConfig() QCOMPARE( job.count(), 2 ); // Only "firmwareType" and "branding.shortVersion" QCOMPARE( job.count( "firmwareType" ), 4 ); + QCOMPARE( job.count( "branding.shortVersion" ), 2 ); // in the example config +} + +void ContextualProcessTests::testFetch() +{ + QVariantMap m; + // Some keys without sub-map + m.insert( QStringLiteral( "carrot" ), true ); + m.insert( QStringLiteral( "tomato" ), QStringLiteral( "fruit" ) ); + + // A key with sub-map + { + QVariantMap names; + names.insert( QStringLiteral( "blackcurrant" ), QStringLiteral( "black" ) ); + names.insert( QStringLiteral( "redcurrant" ), QStringLiteral( "red" ) ); + names.insert( QStringLiteral( "knoebels" ), QStringLiteral( "green" ) ); + names.insert( QStringLiteral( "strawberry" ), QStringLiteral( "red" ) ); + m.insert( QStringLiteral( "berries" ), names ); + } + + // Another key with sub-map + { + QVariantMap names; + names.insert( QStringLiteral( "ext4" ), 1 ); + names.insert( QStringLiteral( "zfs" ), 2 ); + names.insert( QStringLiteral( "swap" ), 2 ); + m.insert( QStringLiteral( "filesystem_use" ), names ); + } + + QCOMPARE( m.count(), 4 ); + + Calamares::GlobalStorage* gs + = Calamares::JobQueue::instance() ? Calamares::JobQueue::instance()->globalStorage() : nullptr; + QVERIFY( gs ); + + // Copy the built-up-map into GS + for ( auto it = m.cbegin(); it != m.cend(); ++it ) + { + gs->insert( it.key(), it.value() ); + } + + // Testing of fetch() + { + ContextualProcessBinding b( QStringLiteral( "carrot" ) ); + QString s; + QVERIFY( b.fetch( gs, s ) ); + QCOMPARE( s, QStringLiteral( "true" ) ); // String representation of boolean true + } + { + ContextualProcessBinding b( QStringLiteral( "tomato" ) ); + QString s; + QVERIFY( b.fetch( gs, s ) ); + QCOMPARE( s, QStringLiteral( "fruit" ) ); + } + { + // Key not found + ContextualProcessBinding b( QStringLiteral( "parsnip" ) ); + QString s = QStringLiteral( "white" ); + QVERIFY( !b.fetch( gs, s ) ); + QCOMPARE( s, QString() ); + QVERIFY( s.isEmpty() ); + } + { + // Submap gets smashed + ContextualProcessBinding b( QStringLiteral( "berries" ) ); + QString s; + QVERIFY( b.fetch( gs, s ) ); + QVERIFY( s.contains( QStringLiteral( "QVariant" ) ) ); + } + { + // Compound lookup + ContextualProcessBinding b( QStringLiteral( "berries.strawberry" ) ); + QString s; + QVERIFY( b.fetch( gs, s ) ); + QCOMPARE( s, QStringLiteral( "red" ) ); + } + { + ContextualProcessBinding b( QStringLiteral( "berries.knoebels" ) ); + QString s; + QVERIFY( b.fetch( gs, s ) ); + QCOMPARE( s, QStringLiteral( "green" ) ); + } + { + ContextualProcessBinding b( QStringLiteral( "filesystem_use.ext4" ) ); + QString s; + QVERIFY( b.fetch( gs, s ) ); + QCOMPARE( s, QStringLiteral( "1" ) ); + } + { + ContextualProcessBinding b( QStringLiteral( "filesystem_use.zfs" ) ); + QString s; + QVERIFY( b.fetch( gs, s ) ); + QCOMPARE( s, QStringLiteral( "2" ) ); + } + { + // Key not found, compound + ContextualProcessBinding b( QStringLiteral( "filesystem_use.ufs" ) ); + QString s = QStringLiteral( "ufs" ); + QVERIFY( !b.fetch( gs, s ) ); + QCOMPARE( s, QString() ); + QVERIFY( s.isEmpty() ); + } + } diff --git a/src/modules/contextualprocess/Tests.h b/src/modules/contextualprocess/Tests.h index 1708e53f0..fd705a103 100644 --- a/src/modules/contextualprocess/Tests.h +++ b/src/modules/contextualprocess/Tests.h @@ -32,6 +32,9 @@ private Q_SLOTS: void initTestCase(); // Check the sample config file is processed correctly void testProcessListSampleConfig(); + + // Variable binding lookup + void testFetch(); }; #endif From 72dcf886bfaf66d4e1f448609a1c4d56d473f45a Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 27 Feb 2020 22:44:49 +0100 Subject: [PATCH 17/22] [contextualprocess] Improve tests, fix off-by-one - there's no string representation for a QVariantMap, so it won't be converted; in *debug* output it looks like there's a string there. - off-by-one when diving into compound selectors, spotted by test, now fixed. --- src/modules/contextualprocess/ContextualProcessJob.cpp | 2 +- src/modules/contextualprocess/Tests.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/contextualprocess/ContextualProcessJob.cpp b/src/modules/contextualprocess/ContextualProcessJob.cpp index b0d7a6743..1173a3071 100644 --- a/src/modules/contextualprocess/ContextualProcessJob.cpp +++ b/src/modules/contextualprocess/ContextualProcessJob.cpp @@ -77,7 +77,7 @@ fetch( QString& value, QStringList& selector, int index, const QVariant& v ) } const QVariantMap map = v.toMap(); const QString& key = selector.at( index ); - if ( index == selector.length() ) + if ( index == selector.length() - 1) { value = map.value( key ).toString(); return map.contains( key ); diff --git a/src/modules/contextualprocess/Tests.cpp b/src/modules/contextualprocess/Tests.cpp index 8f3322455..a0071328a 100644 --- a/src/modules/contextualprocess/Tests.cpp +++ b/src/modules/contextualprocess/Tests.cpp @@ -88,6 +88,8 @@ ContextualProcessTests::testProcessListSampleConfig() void ContextualProcessTests::testFetch() { + Logger::setupLogLevel( Logger::LOGVERBOSE ); + QVariantMap m; // Some keys without sub-map m.insert( QStringLiteral( "carrot" ), true ); @@ -150,7 +152,7 @@ void ContextualProcessTests::testFetch() ContextualProcessBinding b( QStringLiteral( "berries" ) ); QString s; QVERIFY( b.fetch( gs, s ) ); - QVERIFY( s.contains( QStringLiteral( "QVariant" ) ) ); + QVERIFY( s.isEmpty() ); // No string representation } { // Compound lookup From 3c059cc599b629f609bd3d87e057acb3c95a83ec Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 27 Feb 2020 23:12:03 +0100 Subject: [PATCH 18/22] Changes: pre-release housekeeping --- CHANGES | 15 ++++++++++----- CMakeLists.txt | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 77370b9af..67edca8f0 100644 --- a/CHANGES +++ b/CHANGES @@ -3,10 +3,10 @@ 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.20 (unreleased) # +# 3.2.20 (2020-02-27) # This release contains contributions from (alphabetically by first name): - - No external contributors yet + - Bart Ribbers ## Core ## - When logging level is set to 8 (eight), for instance via the `-D8` @@ -18,9 +18,14 @@ This release contains contributions from (alphabetically by first name): ## Modules ## - The *partition* module now stores which filesystems are in use in - global storage. While this is currently incompatible with the - *contextualprocess* module, a custom module can make use of that - to optimise the target system for the filesystems that are present. + global storage. + - The *contextualprocess* module now understands "compound variable + names", where a dot (.) is used to index into structured data + stored in global storage. This allows it to use the map stored + by the partition module (but also other things, like looking into + the branding information). + - The *packages* module now understands "apk", the Alpine Linux + package manager. # 3.2.19.1 (2020-02-24) # diff --git a/CMakeLists.txt b/CMakeLists.txt index 6eb705812..eee6c01b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,7 @@ project( CALAMARES VERSION 3.2.20 LANGUAGES C CXX ) -set( CALAMARES_VERSION_RC 1 ) # Set to 0 during release cycle, 1 during development +set( CALAMARES_VERSION_RC 0 ) # Set to 0 during release cycle, 1 during development ### OPTIONS # From 0793971d01de11d8a022a8e9149ec5ef4c00738e Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 27 Feb 2020 23:13:55 +0100 Subject: [PATCH 19/22] [libcalamares] Warnings--, unused variable --- src/libcalamares/JobQueue.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libcalamares/JobQueue.cpp b/src/libcalamares/JobQueue.cpp index 294bf5a0a..a77f334ff 100644 --- a/src/libcalamares/JobQueue.cpp +++ b/src/libcalamares/JobQueue.cpp @@ -36,7 +36,6 @@ public: : QThread( queue ) , m_queue( queue ) , m_jobIndex( 0 ) - , m_jobCount( 0 ) { } @@ -104,7 +103,6 @@ private: QList< qreal > m_jobWeights; JobQueue* m_queue; int m_jobIndex; - int m_jobCount; void emitProgress( qreal jobPercent = 0 ) { From 3df0878e43ee423df6c010eb754242ac0d4e4592 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 27 Feb 2020 23:18:28 +0100 Subject: [PATCH 20/22] [initramfs] Warnings-- Initializing the JobQuene (and hence Global Storage) and the System instance is a bit odd, avoid unused-variable warning with an ugly cast instead. --- src/modules/initramfs/Tests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/initramfs/Tests.cpp b/src/modules/initramfs/Tests.cpp index 04910f724..2a236e64b 100644 --- a/src/modules/initramfs/Tests.cpp +++ b/src/modules/initramfs/Tests.cpp @@ -46,7 +46,7 @@ InitramfsTests::initTestCase() { Logger::setupLogLevel( Logger::LOGDEBUG ); - auto* j = new Calamares::JobQueue(); + (void) new Calamares::JobQueue(); (void) new CalamaresUtils::System( true ); } From bfe45aea18d6c5cd903e0111a511fea3f7d9792e Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 27 Feb 2020 23:19:55 +0100 Subject: [PATCH 21/22] [netinstall] Warnings--, unused parameter --- src/modules/netinstall/PackageModel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/netinstall/PackageModel.cpp b/src/modules/netinstall/PackageModel.cpp index 6d299f633..0805a8135 100644 --- a/src/modules/netinstall/PackageModel.cpp +++ b/src/modules/netinstall/PackageModel.cpp @@ -106,7 +106,7 @@ PackageModel::rowCount( const QModelIndex& parent ) const } int -PackageModel::columnCount( const QModelIndex& parent ) const +PackageModel::columnCount( const QModelIndex& ) const { return 2; } From 0d91220ab7941e50466b7e871ad26688430a2312 Mon Sep 17 00:00:00 2001 From: Calamares CI Date: Thu, 27 Feb 2020 23:26:29 +0100 Subject: [PATCH 22/22] i18n: [calamares] Automatic merge of Transifex translations --- lang/calamares_it_IT.ts | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/lang/calamares_it_IT.ts b/lang/calamares_it_IT.ts index f73cfe173..b1f50c6a7 100644 --- a/lang/calamares_it_IT.ts +++ b/lang/calamares_it_IT.ts @@ -2471,7 +2471,7 @@ Il programma d'installazione sarà terminato e tutte le modifiche andranno perse Please choose a look-and-feel for the KDE Plasma Desktop. You can also skip this step and configure the look-and-feel once the system is set up. Clicking on a look-and-feel selection will give you a live preview of that look-and-feel. - + Scegliere il tema per l'ambiente desktop KDE Plasma. Si può anche saltare questa scelta e configurare il tema dopo aver installato il sistema. Cliccando su selezione del tema, ne sarà mostrata un'anteprima. @@ -2620,7 +2620,7 @@ Output: Requirements checking for module <i>%1</i> is complete. - + Il controllo dei requisiti per il modulo <i>%1</i> è completo. @@ -2778,7 +2778,7 @@ Output: Calamares cannot start KPMCore for the file-system resize job. - + Calamares non riesce ad avviare KPMCore per ridimensionare il file-system. @@ -2832,7 +2832,7 @@ Output: Resize <strong>%2MiB</strong> partition <strong>%1</strong> to <strong>%3MiB</strong>. - + Ridimensionare la partizione <strong>%1</strong> da <strong>%2MiB</strong> a <strong>%3MiB</strong>. @@ -2996,7 +2996,7 @@ Output: Set flags on %1MiB %2 partition. - + Impostare le flag sulla partizione %2 da %1MiB. @@ -3011,22 +3011,22 @@ Output: Clear flags on %1MiB <strong>%2</strong> partition. - + Rimuovere le flag dalla partizione <strong>%2</strong> da %1MiB. Flag %1MiB <strong>%2</strong> partition as <strong>%3</strong>. - + Flag della partizione <strong>%2</strong> da %1MiB impostate come <strong>%3</strong>. Clearing flags on %1MiB <strong>%2</strong> partition. - + Rimozione delle flag sulla partizione <strong>%2</strong> da %1MiB in corso. Setting flags <strong>%3</strong> on %1MiB <strong>%2</strong> partition. - + Impostazione delle flag <strong>%3</strong> sulla partizione <strong>%2</strong> da %1MiB in corso. @@ -3172,7 +3172,7 @@ Output: This is an overview of what will happen once you start the setup procedure. - + Questa è una panoramica di quello che succederà una volta avviata la procedura di configurazione. @@ -3296,12 +3296,12 @@ Output: <small>If more than one person will use this computer, you can create multiple accounts after setup.</small> - + <small>Se più di una persona utilizzerà questo computer, puoi creare ulteriori account dopo la configurazione.</small> <small>If more than one person will use this computer, you can create multiple accounts after installation.</small> - + <small>Se più di una persona utilizzerà questo computer, puoi creare ulteriori account dopo l'installazione.</small> @@ -3311,17 +3311,17 @@ Output: Your username must start with a lowercase letter or underscore. - + Il tuo username deve iniziare con una lettera minuscola o un trattino basso. Only lowercase letters, numbers, underscore and hyphen are allowed. - + Solo lettere minuscole, numeri, trattini e trattini bassi sono permessi. Only letters, numbers, underscore and hyphen are allowed. - + Solo lettere, numeri, trattini e trattini bassi sono permessi. @@ -3385,7 +3385,7 @@ Output: Physical Extent Size: - + Dimensione fisica dell'estensione: @@ -3410,7 +3410,7 @@ Output: Quantity of LVs: - + Numero di LV: @@ -3424,7 +3424,7 @@ Output: Select application and system language - + Selezionare lingua per l'applicazione e il sistema @@ -3444,7 +3444,7 @@ Output: Open issues and bug-tracking website - + Apri il sito per la gestione di problemi e bug @@ -3494,7 +3494,7 @@ Output: About %1 setup - + Informazioni sul sistema di configurazione %1