From f6e39aac5295513849de5e4c8446be3ca71e2f22 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 7 Nov 2024 23:09:21 +0100 Subject: [PATCH 1/6] Changes: post-release housekeeping --- CHANGES-3.3 | 12 ++++++++++++ CMakeLists.txt | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGES-3.3 b/CHANGES-3.3 index bf02374d0..4f7a0ab64 100644 --- a/CHANGES-3.3 +++ b/CHANGES-3.3 @@ -7,6 +7,18 @@ contributors are listed. Note that Calamares does not have a historical changelog -- this log starts with version 3.3.0. See CHANGES-3.2 for the history of the 3.2 series (2018-05 - 2022-08). +# 3.3.12 (unreleased) + +This release contains contributions from (alphabetically by given name): + - Nobody + +## Core ## + - Nothing yet + +## Modules ## + - Nothing yet + + # 3.3.11 (2024-11-05) This release contains contributions from (alphabetically by given name): diff --git a/CMakeLists.txt b/CMakeLists.txt index ad1148676..6b376c299 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,8 +48,8 @@ cmake_minimum_required(VERSION 3.16 FATAL_ERROR) -set(CALAMARES_VERSION 3.3.11) -set(CALAMARES_RELEASE_MODE ON) # Set to ON during a release +set(CALAMARES_VERSION 3.3.12) +set(CALAMARES_RELEASE_MODE OFF) # Set to ON during a release if(CMAKE_SCRIPT_MODE_FILE) include(${CMAKE_CURRENT_LIST_DIR}/CMakeModules/ExtendedVersion.cmake) From a93dc7740c973a80d5febd23374fbce8757f03df Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 8 Nov 2024 22:28:45 +0100 Subject: [PATCH 2/6] [users] Expand test coverage with numeric value --- src/modules/users/Tests.cpp | 1 + src/modules/users/tests/8h-issue-2362.conf | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 src/modules/users/tests/8h-issue-2362.conf diff --git a/src/modules/users/Tests.cpp b/src/modules/users/Tests.cpp index f44e73f6a..4593b5890 100644 --- a/src/modules/users/Tests.cpp +++ b/src/modules/users/Tests.cpp @@ -527,6 +527,7 @@ UserTests::testUserUmask_data() QTest::newRow( "-wrd " ) << "tests/8e-issue-2362.conf" << 0214 << 0563; QTest::newRow( "bogus" ) << "tests/8f-issue-2362.conf" << -1 << -1; QTest::newRow( "good2" ) << "tests/8g-issue-2362.conf" << 0750 << 0027; + QTest::newRow( "numrc" ) << "tests/8h-issue-2362.conf" << 0751 << 0026; } void diff --git a/src/modules/users/tests/8h-issue-2362.conf b/src/modules/users/tests/8h-issue-2362.conf new file mode 100644 index 000000000..a4e7ba548 --- /dev/null +++ b/src/modules/users/tests/8h-issue-2362.conf @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +# +--- +user: + shell: /usr/bin/new + forbidden_names: + - me + - myself + - moi + # This is a number, which is interpreted by YAML as decimal even with a leading 0 + home_permissions: 0751 From 3614fd003d0c643e758ca68d2b232dde95cfb0df Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 11 Nov 2024 00:34:53 +0100 Subject: [PATCH 3/6] [users] Ensure UMASK= gets a leading 0 if needed --- src/modules/users/CreateUserJob.cpp | 3 ++- src/modules/users/Tests.cpp | 21 +++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/modules/users/CreateUserJob.cpp b/src/modules/users/CreateUserJob.cpp index 422b77c05..c55ee1858 100644 --- a/src/modules/users/CreateUserJob.cpp +++ b/src/modules/users/CreateUserJob.cpp @@ -70,7 +70,8 @@ createUser( const QString& loginName, const QString& fullName, const QString& sh useraddCommand << "-c" << fullName; if ( umask >= 0 ) { - useraddCommand << "-K" << ( QStringLiteral( "UMASK=" ) + QString::number( umask, 8 ) ); + // The QChar() is needed to disambiguate from the overload that takes a double + useraddCommand << "-K" << ( QStringLiteral( "UMASK=%1" ).arg( umask, 3, 8, QChar( '0' ) ) ); } useraddCommand << loginName; #endif diff --git a/src/modules/users/Tests.cpp b/src/modules/users/Tests.cpp index 4593b5890..76446064c 100644 --- a/src/modules/users/Tests.cpp +++ b/src/modules/users/Tests.cpp @@ -519,15 +519,17 @@ UserTests::testUserUmask_data() QTest::addColumn< QString >( "filename" ); QTest::addColumn< int >( "permission" ); QTest::addColumn< int >( "umask" ); + QTest::addColumn< QString >( "umask_string" ); - QTest::newRow( "good " ) << "tests/8a-issue-2362.conf" << 0700 << 0077; - QTest::newRow( "open " ) << "tests/8b-issue-2362.conf" << 0755 << 0022; - QTest::newRow( "weird" ) << "tests/8c-issue-2362.conf" << 0126 << 0651; - QTest::newRow( "rwxx " ) << "tests/8d-issue-2362.conf" << 0710 << 0067; - QTest::newRow( "-wrd " ) << "tests/8e-issue-2362.conf" << 0214 << 0563; - QTest::newRow( "bogus" ) << "tests/8f-issue-2362.conf" << -1 << -1; - QTest::newRow( "good2" ) << "tests/8g-issue-2362.conf" << 0750 << 0027; - QTest::newRow( "numrc" ) << "tests/8h-issue-2362.conf" << 0751 << 0026; + QTest::newRow( "good " ) << "tests/8a-issue-2362.conf" << 0700 << 0077 << QStringLiteral( "077" ); + QTest::newRow( "open " ) << "tests/8b-issue-2362.conf" << 0755 << 0022 << QStringLiteral( "022" ); + QTest::newRow( "weird" ) << "tests/8c-issue-2362.conf" << 0126 << 0651 << QStringLiteral( "651" ); + QTest::newRow( "rwxx " ) << "tests/8d-issue-2362.conf" << 0710 << 0067 << QStringLiteral( "067" ); + QTest::newRow( "-wrd " ) << "tests/8e-issue-2362.conf" << 0214 << 0563 << QStringLiteral( "563" ); + QTest::newRow( "bogus" ) << "tests/8f-issue-2362.conf" << -1 << -1 + << QStringLiteral( "-01" ); // Bogus 3-character representation + QTest::newRow( "good2" ) << "tests/8g-issue-2362.conf" << 0750 << 0027 << QStringLiteral( "027" ); + QTest::newRow( "numrc" ) << "tests/8h-issue-2362.conf" << 0751 << 0026 << QStringLiteral( "026" ); } void @@ -550,6 +552,7 @@ UserTests::testUserUmask() QFETCH( QString, filename ); QFETCH( int, permission ); QFETCH( int, umask ); + QFETCH( QString, umask_string ); // Checks that the test-data is valid if ( permission != -1 ) @@ -572,6 +575,8 @@ UserTests::testUserUmask() QCOMPARE( c.homePermissions(), permission ); QCOMPARE( c.homeUMask(), umask ); + // The QChar() is needed to disambiguate from the overload that takes a double + QCOMPARE( QStringLiteral( "%1" ).arg( umask, 3, 8, QChar( '0' ) ), umask_string ); QCOMPARE( c.forbiddenLoginNames(), forbidden ); } From 6a31e30cbfd0b68bdd39d65a21e65531d27164c4 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 21 Nov 2024 22:50:44 +0100 Subject: [PATCH 4/6] CMake: repair KDE Frameworks 6 dependencies Be a little more chatty and look for the correct KDE Frameworks for consumers of Calamares (e.g. calamares-extensions). --- CalamaresConfig.cmake.in | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/CalamaresConfig.cmake.in b/CalamaresConfig.cmake.in index 67350352b..5145666b8 100644 --- a/CalamaresConfig.cmake.in +++ b/CalamaresConfig.cmake.in @@ -49,8 +49,12 @@ endmacro() set(Calamares_WITH_QT6 @WITH_QT6@) if(Calamares_WITH_QT6) set(qtname "Qt6") + set(kfname "kf6") + message(STATUS "Calamares was built with Qt6 and KDE Frameworks 6") else() set(qtname "Qt5") + set(kfname "kf5") + message(STATUS "Calamares was built with Qt5 and KDE Frameworks 5 (legacy)") endif() # Qt infrastructure for translations is required @@ -59,14 +63,14 @@ accumulate_deps(qt_required Calamares::calamares ${qtname}::) accumulate_deps(qt_required Calamares::calamaresui ${qtname}::) find_package(${qtname} CONFIG REQUIRED ${qt_required}) -set(kf5_required "") -accumulate_deps(kf5_required Calamares::calamares ${kfname}::) -accumulate_deps(kf5_required Calamares::calamaresui ${kfname}::) -if(kf5_required) +set(kf_required "") +accumulate_deps(kf_required Calamares::calamares ${kfname}::) +accumulate_deps(kf_required Calamares::calamaresui ${kfname}::) +if(kf_required) find_package(ECM ${ECM_VERSION} NO_MODULE) if( ECM_FOUND ) list(INSERT CMAKE_MODULE_PATH 0 ${ECM_MODULE_PATH}) - find_package(${kfname} REQUIRED COMPONENTS ${kf5_required}) + find_package(${kfname} REQUIRED COMPONENTS ${kf_required}) endif() endif() From c83aa1da70b7ff295e7ada90615a9a0e9645596b Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 21 Nov 2024 22:53:17 +0100 Subject: [PATCH 5/6] Changes: pre-release housekeeping --- CHANGES-3.3 | 9 +++++---- CMakeLists.txt | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGES-3.3 b/CHANGES-3.3 index 4f7a0ab64..d2be18a3e 100644 --- a/CHANGES-3.3 +++ b/CHANGES-3.3 @@ -7,16 +7,17 @@ contributors are listed. Note that Calamares does not have a historical changelog -- this log starts with version 3.3.0. See CHANGES-3.2 for the history of the 3.2 series (2018-05 - 2022-08). -# 3.3.12 (unreleased) +# 3.3.12 (2024-11-21) This release contains contributions from (alphabetically by given name): - - Nobody + - Adriaan de Groot ## Core ## - - Nothing yet + - This release repairs the Calamares configuration file which is + used by external Calamares modules -- calamares-extensions in particular. ## Modules ## - - Nothing yet + - *users* module always uses a 3-digit UMASK if one is specified. # 3.3.11 (2024-11-05) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b376c299..91521ca0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,7 @@ cmake_minimum_required(VERSION 3.16 FATAL_ERROR) set(CALAMARES_VERSION 3.3.12) -set(CALAMARES_RELEASE_MODE OFF) # Set to ON during a release +set(CALAMARES_RELEASE_MODE ON) # Set to ON during a release if(CMAKE_SCRIPT_MODE_FILE) include(${CMAKE_CURRENT_LIST_DIR}/CMakeModules/ExtendedVersion.cmake) From 9cc4cb356fceac325cac330cbe6c03ab7ddc72fb Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 21 Nov 2024 23:42:39 +0100 Subject: [PATCH 6/6] CMake: repair KPMcore helper for KF5 (legacy) case --- CMakeModules/KPMcoreHelper.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeModules/KPMcoreHelper.cmake b/CMakeModules/KPMcoreHelper.cmake index 888b4aea4..cdbd2336f 100644 --- a/CMakeModules/KPMcoreHelper.cmake +++ b/CMakeModules/KPMcoreHelper.cmake @@ -36,7 +36,8 @@ if(NOT TARGET calapmcore) if(KPMcore_FOUND) find_package(${qtname} REQUIRED DBus) # Needed for KPMCore - find_package(${kfname} REQUIRED I18n WidgetsAddons) # Needed for KPMCore + find_package(${kfname}I18n REQUIRED) # Needed for KPMCore + find_package(${kfname}WidgetsAddons REQUIRED) # Needed for KPMCore target_link_libraries(calapmcore INTERFACE kpmcore ${qtname}::DBus ${kfname}::I18n ${kfname}::WidgetsAddons) target_include_directories(calapmcore INTERFACE ${KPMCORE_INCLUDE_DIR})