From 248776144e06966ac4dca77128379f41a9fdbabc Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 21 Feb 2020 12:39:26 +0100 Subject: [PATCH 1/9] [unpackfs] Now it's text, it's not encoded anymore --- src/modules/unpackfs/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/unpackfs/main.py b/src/modules/unpackfs/main.py index d3a7198e9..5e4287048 100644 --- a/src/modules/unpackfs/main.py +++ b/src/modules/unpackfs/main.py @@ -154,7 +154,7 @@ def file_copy(source, entry, progress_cb): # If you're copying directory with some links in it, the xfer# # might not be a reliable counter (for one increase of xfer, many # files may be created). - m = re.findall(r'xfr#(\d+), ..-chk=(\d+)/(\d+)', line.decode()) + m = re.findall(r'xfr#(\d+), ..-chk=(\d+)/(\d+)', line) if m: # we've got a percentage update From a78556b56a3dd77daec148a297b955e7693ced7f Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 21 Feb 2020 16:37:58 +0100 Subject: [PATCH 2/9] [unpackfs] Revert text mode - Follow original patch from Gabriel Craciunescu: just drop the *bufsize* parameter and stick to binary reads. Text mode was associated in my testing with multiple hangs, which didn't show up during binary-reads. --- src/modules/unpackfs/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/unpackfs/main.py b/src/modules/unpackfs/main.py index 5e4287048..b08315968 100644 --- a/src/modules/unpackfs/main.py +++ b/src/modules/unpackfs/main.py @@ -133,7 +133,7 @@ def file_copy(source, entry, progress_cb): args.extend(["--exclude", f]) args.extend(['--progress', source, dest]) process = subprocess.Popen( - args, env=at_env, universal_newlines=True, bufsize=1, + args, env=at_env, stdout=subprocess.PIPE, close_fds=ON_POSIX ) # last_num_files_copied trails num_files_copied, and whenever at least 100 more @@ -154,7 +154,7 @@ def file_copy(source, entry, progress_cb): # If you're copying directory with some links in it, the xfer# # might not be a reliable counter (for one increase of xfer, many # files may be created). - m = re.findall(r'xfr#(\d+), ..-chk=(\d+)/(\d+)', line) + m = re.findall(r'xfr#(\d+), ..-chk=(\d+)/(\d+)', line.decode()) if m: # we've got a percentage update From 39cc43f26ba295342270ce5e5d6427d726e05e04 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 21 Feb 2020 17:53:43 +0100 Subject: [PATCH 3/9] [libcalamares] Fix tests - QCOMPARE() is sensitive to differing types in actual and expected, and uchar and int (and mode_t and int) are different. --- src/libcalamares/utils/Tests.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libcalamares/utils/Tests.cpp b/src/libcalamares/utils/Tests.cpp index 34701a940..d50abef39 100644 --- a/src/libcalamares/utils/Tests.cpp +++ b/src/libcalamares/utils/Tests.cpp @@ -162,7 +162,7 @@ LibCalamaresTests::testUmask() // m gets the previous value of the mask (depends on the environment the // test is run in, might be 002, might be 077), .. mode_t m = CalamaresUtils::setUMask( 022 ); - QCOMPARE( CalamaresUtils::setUMask( m ), 022 ); // But now most recently set was 022 + QCOMPARE( CalamaresUtils::setUMask( m ), mode_t( 022 ) ); // But now most recently set was 022 for ( mode_t i = 0; i <= 0777 /* octal! */; ++i ) { @@ -178,7 +178,7 @@ LibCalamaresTests::testUmask() QCOMPARE( unlink( name ), 0 ); } QCOMPARE( CalamaresUtils::setUMask( 022 ), m ); - QCOMPARE( CalamaresUtils::setUMask( m ), 022 ); + QCOMPARE( CalamaresUtils::setUMask( m ), mode_t( 022 ) ); } void @@ -219,7 +219,7 @@ LibCalamaresTests::testPrintableEntropy() for ( QChar c : s ) { QVERIFY( c.isPrint() ); - QCOMPARE( c.row(), 0 ); + QCOMPARE( c.row(), uchar( 0 ) ); QVERIFY( c.cell() > 32 ); // ASCII SPACE QVERIFY( c.cell() < 127 ); } @@ -245,7 +245,7 @@ LibCalamaresTests::testOddSizedPrintable() for ( QChar c : s ) { QVERIFY( c.isPrint() ); - QCOMPARE( c.row(), 0 ); + QCOMPARE( c.row(), uchar( 0 ) ); QVERIFY( c.cell() > 32 ); // ASCII SPACE QVERIFY( c.cell() < 127 ); } From e49fb74847f93ce0dcc570e419b6af749e6dbc3d Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 21 Feb 2020 17:58:55 +0100 Subject: [PATCH 4/9] [libcalamares] Fix more tests --- src/libcalamares/locale/Tests.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/libcalamares/locale/Tests.cpp b/src/libcalamares/locale/Tests.cpp index b63eb9e18..bf71fb0a2 100644 --- a/src/libcalamares/locale/Tests.cpp +++ b/src/libcalamares/locale/Tests.cpp @@ -128,8 +128,8 @@ LocaleTests::testTranslatableConfig1() QCOMPARE( ts1.count(), 1 ); QVERIFY( !ts1.isEmpty() ); - QCOMPARE( ts1.get(), "Hello" ); - QCOMPARE( ts1.get( QLocale( "nl" ) ), "Hello" ); + QCOMPARE( ts1.get(), QStringLiteral( "Hello" ) ); + QCOMPARE( ts1.get( QLocale( "nl" ) ), QStringLiteral( "Hello" ) ); QVariantMap map; map.insert( "description", "description (no language)" ); @@ -137,8 +137,8 @@ LocaleTests::testTranslatableConfig1() QCOMPARE( ts2.count(), 1 ); QVERIFY( !ts2.isEmpty() ); - QCOMPARE( ts2.get(), "description (no language)" ); - QCOMPARE( ts2.get( QLocale( "nl" ) ), "description (no language)" ); + QCOMPARE( ts2.get(), QStringLiteral( "description (no language)" ) ); + QCOMPARE( ts2.get( QLocale( "nl" ) ), QStringLiteral( "description (no language)" ) ); } /** @bref Test strings with translations. @@ -173,8 +173,8 @@ LocaleTests::testTranslatableConfig2() QCOMPARE( ts1.count(), someLanguages().count() + 1 ); QVERIFY( !ts1.isEmpty() ); - QCOMPARE( ts1.get(), "description (no language)" ); // it wasn't set - QCOMPARE( ts1.get( QLocale( "nl" ) ), "description (language nl)" ); + QCOMPARE( ts1.get(), QStringLiteral( "description (no language)" ) ); // it wasn't set + QCOMPARE( ts1.get( QLocale( "nl" ) ), QStringLiteral( "description (language nl)" ) ); for ( const auto& language : someLanguages() ) { // Skip Serbian (latin) because QLocale() constructed with it @@ -188,7 +188,7 @@ LocaleTests::testTranslatableConfig2() language ); } QCOMPARE( ts1.get( QLocale( QLocale::Language::Serbian, QLocale::Script::LatinScript, QLocale::Country::Serbia ) ), - "description (language sr@latin)" ); + QStringLiteral( "description (language sr@latin)" ) ); CalamaresUtils::Locale::TranslatedString ts2( map, "name" ); // We skipped dutch this time From 6352b50ed05069d90164688b42b253137c9422b6 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 21 Feb 2020 18:13:51 +0100 Subject: [PATCH 5/9] [initramfs] Fix more tests --- 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 a9e0ce44c..04910f724 100644 --- a/src/modules/initramfs/Tests.cpp +++ b/src/modules/initramfs/Tests.cpp @@ -79,7 +79,7 @@ void InitramfsTests::testCreateTargetFile() QFileInfo fi( path ); QVERIFY( fi.exists() ); - QCOMPARE( fi.size(), sizeof( contents )-1 ); // don't count trailing NUL + QCOMPARE( ulong( fi.size() ), sizeof( contents )-1 ); // don't count trailing NUL QFile::remove( path ); From adf81c0ab55620123319705a18358013b4e06a9a Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 21 Feb 2020 18:24:39 +0100 Subject: [PATCH 6/9] [locale][packagechooser] Fix tests, QCOMPARE again --- src/modules/locale/Tests.cpp | 22 +++++++++++----------- src/modules/packagechooser/Tests.cpp | 14 +++++++------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/modules/locale/Tests.cpp b/src/modules/locale/Tests.cpp index b8e471339..83a2d42ff 100644 --- a/src/modules/locale/Tests.cpp +++ b/src/modules/locale/Tests.cpp @@ -48,13 +48,13 @@ LocaleTests::testDefaultLocaleConfiguration() { LocaleConfiguration lc( "en_US.UTF-8" ); QVERIFY( !lc.isEmpty() ); - QCOMPARE( lc.language(), "en_US.UTF-8" ); - QCOMPARE( lc.toBcp47(), "en" ); + QCOMPARE( lc.language(), QStringLiteral( "en_US.UTF-8" ) ); + QCOMPARE( lc.toBcp47(), QStringLiteral( "en" ) ); LocaleConfiguration lc2( "de_DE.UTF-8" ); QVERIFY( !lc2.isEmpty() ); - QCOMPARE( lc2.language(), "de_DE.UTF-8" ); - QCOMPARE( lc2.toBcp47(), "de" ); + QCOMPARE( lc2.language(), QStringLiteral( "de_DE.UTF-8" ) ); + QCOMPARE( lc2.toBcp47(), QStringLiteral( "de" ) ); } void @@ -62,18 +62,18 @@ LocaleTests::testSplitLocaleConfiguration() { LocaleConfiguration lc( "en_US.UTF-8", "de_DE.UTF-8" ); QVERIFY( !lc.isEmpty() ); - QCOMPARE( lc.language(), "en_US.UTF-8" ); - QCOMPARE( lc.toBcp47(), "en" ); + QCOMPARE( lc.language(), QStringLiteral( "en_US.UTF-8" ) ); + QCOMPARE( lc.toBcp47(), QStringLiteral( "en" ) ); QCOMPARE( lc.lc_numeric, QStringLiteral( "de_DE.UTF-8" ) ); LocaleConfiguration lc2( "de_DE.UTF-8", "da_DK.UTF-8" ); QVERIFY( !lc2.isEmpty() ); - QCOMPARE( lc2.language(), "de_DE.UTF-8" ); - QCOMPARE( lc2.toBcp47(), "de" ); - QCOMPARE( lc2.lc_numeric, "da_DK.UTF-8" ); + QCOMPARE( lc2.language(), QStringLiteral( "de_DE.UTF-8" ) ); + QCOMPARE( lc2.toBcp47(), QStringLiteral( "de" ) ); + QCOMPARE( lc2.lc_numeric, QStringLiteral( "da_DK.UTF-8" ) ); LocaleConfiguration lc3( "da_DK.UTF-8", "de_DE.UTF-8" ); QVERIFY( !lc3.isEmpty() ); - QCOMPARE( lc3.toBcp47(), "da" ); - QCOMPARE( lc3.lc_numeric, "de_DE.UTF-8" ); + QCOMPARE( lc3.toBcp47(), QStringLiteral( "da" ) ); + QCOMPARE( lc3.lc_numeric, QStringLiteral( "de_DE.UTF-8" ) ); } diff --git a/src/modules/packagechooser/Tests.cpp b/src/modules/packagechooser/Tests.cpp index 639d06d65..da355dc96 100644 --- a/src/modules/packagechooser/Tests.cpp +++ b/src/modules/packagechooser/Tests.cpp @@ -71,21 +71,21 @@ PackageChooserTests::testAppData() #ifdef HAVE_XML PackageItem p1 = fromAppData( m ); QVERIFY( p1.isValid() ); - QCOMPARE( p1.id, "io.calamares.calamares.desktop" ); - QCOMPARE( p1.name.get(), "Calamares" ); + QCOMPARE( p1.id, QStringLiteral( "io.calamares.calamares.desktop" ) ); + QCOMPARE( p1.name.get(), QStringLiteral( "Calamares" ) ); // The entry has precedence - QCOMPARE( p1.description.get(), "Calamares is an installer program for Linux distributions." ); + QCOMPARE( p1.description.get(), QStringLiteral( "Calamares is an installer program for Linux distributions." ) ); // .. but en_GB doesn't have an entry in description, so uses - QCOMPARE( p1.description.get( QLocale( "en_GB" ) ), "Calamares Linux Installer" ); - QCOMPARE( p1.description.get( QLocale( "nl" ) ), "Calamares is een installatieprogramma voor Linux distributies." ); + QCOMPARE( p1.description.get( QLocale( "en_GB" ) ), QStringLiteral( "Calamares Linux Installer" ) ); + QCOMPARE( p1.description.get( QLocale( "nl" ) ), QStringLiteral( "Calamares is een installatieprogramma voor Linux distributies." ) ); QVERIFY( p1.screenshot.isNull() ); m.insert( "id", "calamares" ); m.insert( "screenshot", ":/images/calamares.png" ); PackageItem p2 = fromAppData( m ); QVERIFY( p2.isValid() ); - QCOMPARE( p2.id, "calamares" ); - QCOMPARE( p2.description.get( QLocale( "nl" ) ), "Calamares is een installatieprogramma voor Linux distributies." ); + QCOMPARE( p2.id, QStringLiteral( "calamares" ) ); + QCOMPARE( p2.description.get( QLocale( "nl" ) ), QStringLiteral( "Calamares is een installatieprogramma voor Linux distributies." ) ); QVERIFY( !p2.screenshot.isNull() ); #endif } From 01c9916cb9d26a227652335b4599370ce20f58a2 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 21 Feb 2020 18:53:03 +0100 Subject: [PATCH 7/9] Changes: pre-release housekeeping --- CHANGES | 6 +++++- CMakeLists.txt | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 0ecaafb51..a63390956 100644 --- a/CHANGES +++ b/CHANGES @@ -3,7 +3,7 @@ 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.19 (unreleased) # +# 3.2.19 (2020-02-21) # This release contains contributions from (alphabetically by first name): - Anke Boersma @@ -39,6 +39,10 @@ This release contains contributions from (alphabetically by first name): Previously, a netinstall module would overwrite all of the package configuration done by other netinstall modules. Translations can be provided in the configuration file, `netinstall.conf`. #1303 + - The *fstab* module no longer "claims" all the swap partitions it finds + on disk. It only uses swap specified for the current installation. + This means that "replace" and "alongside" installations will have + no swap configured in the target system. # 3.2.18 (2020-01-28) # diff --git a/CMakeLists.txt b/CMakeLists.txt index 479009faf..db8fab382 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,7 @@ project( CALAMARES VERSION 3.2.19 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 6a02f2cfec9a3737d6568a3e7b2611a97ce2af51 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 21 Feb 2020 19:21:58 +0100 Subject: [PATCH 8/9] [machineid] Fix tests - Make tests more resilient: do them in a temp-dir, and clean it up after successful tests. This was prompted by tests failing because of things hanging around in /tmp. --- src/modules/machineid/Tests.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/modules/machineid/Tests.cpp b/src/modules/machineid/Tests.cpp index 4600633b0..2b6a9b1d1 100644 --- a/src/modules/machineid/Tests.cpp +++ b/src/modules/machineid/Tests.cpp @@ -108,6 +108,10 @@ MachineIdTests::testJob() { Logger::setupLogLevel( Logger::LOGDEBUG ); + QTemporaryDir tempRoot( QDir::tempPath() + QStringLiteral( "/test-job-XXXXXX" ) ); + tempRoot.setAutoRemove( false ); + cDebug() << "Temporary files as" << QDir::tempPath(); + // Ensure we have a system object, expect it to be a "bogus" one CalamaresUtils::System* system = CalamaresUtils::System::instance(); QVERIFY( system ); @@ -122,7 +126,7 @@ MachineIdTests::testJob() Calamares::GlobalStorage* gs = Calamares::JobQueue::instance() ? Calamares::JobQueue::instance()->globalStorage() : nullptr; QVERIFY( gs ); - gs->insert( "rootMountPoint", "/tmp" ); + gs->insert( "rootMountPoint", tempRoot.path() ); // Prepare part of the target filesystem { @@ -143,7 +147,7 @@ MachineIdTests::testJob() { auto r = job.exec(); QVERIFY( !r ); // It's supposed to fail, because no dbus-uuidgen executable exists - QVERIFY( QFile::exists( "/tmp/var/lib/dbus" ) ); // but the target dir exists + QVERIFY( QFile::exists( tempRoot.filePath( "var/lib/dbus" ) ) ); // but the target dir exists } config.insert( "dbus-symlink", true ); @@ -151,7 +155,7 @@ MachineIdTests::testJob() { auto r = job.exec(); QVERIFY( !r ); // It's supposed to fail, because no dbus-uuidgen executable exists - QVERIFY( QFile::exists( "/tmp/var/lib/dbus" ) ); // but the target dir exists + QVERIFY( QFile::exists( tempRoot.filePath( "var/lib/dbus" ) ) ); // but the target dir exists // These all (would) fail, because the chroot isn't viable #if 0 @@ -163,6 +167,7 @@ MachineIdTests::testJob() QCOMPARE( fi.size(), 5); #endif } + tempRoot.setAutoRemove( true ); // All tests succeeded } QTEST_GUILESS_MAIN( MachineIdTests ) From a7b0b03bde3d288359c370be743eb92051ba2404 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 21 Feb 2020 22:07:15 +0100 Subject: [PATCH 9/9] Changes: post-release housekeeping --- CHANGES | 12 ++++++++++++ CMakeLists.txt | 4 ++-- ci/RELEASE.md | 13 +++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index a63390956..db5b75f82 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,18 @@ contributors are listed. Note that Calamares does not have a historical changelog -- this log starts with version 3.2.0. The release notes on the website will have to do for older versions. +# 3.2.20 (unreleased) # + +This release contains contributions from (alphabetically by first name): + - No external contributors yet + +## Core ## + - No core changes yet + +## Modules ## + - No module changes yet + + # 3.2.19 (2020-02-21) # This release contains contributions from (alphabetically by first name): diff --git a/CMakeLists.txt b/CMakeLists.txt index db8fab382..6eb705812 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,10 +40,10 @@ cmake_minimum_required( VERSION 3.3 FATAL_ERROR ) project( CALAMARES - VERSION 3.2.19 + VERSION 3.2.20 LANGUAGES C CXX ) -set( CALAMARES_VERSION_RC 0 ) # Set to 0 during release cycle, 1 during development +set( CALAMARES_VERSION_RC 1 ) # Set to 0 during release cycle, 1 during development ### OPTIONS # diff --git a/ci/RELEASE.md b/ci/RELEASE.md index 5293abf6b..524a67a65 100644 --- a/ci/RELEASE.md +++ b/ci/RELEASE.md @@ -120,3 +120,16 @@ text *not released yet*. * Commit and push that, usually with the message *Changes: post-release housekeeping*. + +``` +# 3.2.XX (unreleased) # + +This release contains contributions from (alphabetically by first name): + - No external contributors yet + +## Core ## + - No core changes yet + +## Modules ## + - No module changes yet +```