Skip to content

Commit

Permalink
add update support for MariaDB 11.4
Browse files Browse the repository at this point in the history
  • Loading branch information
striezel committed Jul 5, 2024
1 parent 9e96529 commit 6240e4e
Show file tree
Hide file tree
Showing 5 changed files with 150 additions and 0 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ _(Note: This changelog focuses on the major changes between the different
versions. Therefore, it may not contain all changes. Especially smaller fixes or
improvements may be omitted.)_

## Next Version

__[new features]__

* Update support for MariaDB 11.4 is added.

## Version 2024.06.28.0

__[announcement]__
Expand Down
1 change: 1 addition & 0 deletions supported_applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ application.
* MariaDB 10.5
* MariaDB 10.6
* MariaDB 10.11
* MariaDB 11.4
* Mozilla Firefox
* Mozilla Firefox Developer Edition
* Mozilla Firefox ESR
Expand Down
70 changes: 70 additions & 0 deletions updater-test/software/MariaDB_11_4_Tests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
This file is part of the updater command line interface.
Copyright (C) 2024 Dirk Stolle
This program 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.
This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/

using Microsoft.VisualStudio.TestTools.UnitTesting;
using updater.software;

namespace updater_test.software
{
/// <summary>
/// Contains tests for MariaDB_11_4.
/// </summary>
[TestClass]
public class MariaDB_11_4_Tests: BasicSoftwareTests
{
/// <summary>
/// Checks whether info() returns some meaningful data.
/// </summary>
[TestMethod]
public void Test_info()
{
_info(new MariaDB_11_4(false));
}


/// <summary>
/// Checks whether the class implements the searchForNewer() method.
/// </summary>
[TestMethod]
public void Test_implementsSearchForNewer()
{
var mdb = new MariaDB_11_4(false);
Assert.IsTrue(mdb.implementsSearchForNewer());
}


/// <summary>
/// Checks whether searchForNewer() returns something.
/// </summary>
[TestMethod]
public void Test_searchForNewer()
{
_searchForNewer(new MariaDB_11_4(false));
}


/// <summary>
/// Checks whether the class info is up to date.
/// </summary>
[TestMethod]
public void Test_upToDate_info()
{
_upToDate_info(new MariaDB_11_4(false));
}
}
}
1 change: 1 addition & 0 deletions updater/software/All.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ private static List<ISoftware> getUnfiltered(Options opts)
result.Add(new MariaDB_10_5(autoGetNewer));
result.Add(new MariaDB_10_6(autoGetNewer));
result.Add(new MariaDB_10_11(autoGetNewer));
result.Add(new MariaDB_11_4(autoGetNewer));
result.Add(new Mumble(autoGetNewer));
result.Add(new NodeJS(autoGetNewer));
result.Add(new NotepadPlusPlus(autoGetNewer));
Expand Down
72 changes: 72 additions & 0 deletions updater/software/MariaDB_11_4.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
This file is part of the updater command line interface.
Copyright (C) 2024 Dirk Stolle
This program 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.
This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/

using System;
using updater.data;

namespace updater.software
{
/// <summary>
/// Handles updates of MariaDB 11.4.
/// </summary>
public sealed class MariaDB_11_4: MariaDB_Base
{
/// <summary>
/// Default constructor.
/// </summary>
/// <param name="autoGetNewer">whether to automatically get newer
/// information about the software when calling the info() method</param>
public MariaDB_11_4(bool autoGetNewer)
: base(autoGetNewer, "11.4")
{ }


/// <summary>
/// Gets the currently known information about the software.
/// </summary>
/// <returns>Returns an AvailableSoftware instance with the known
/// details about the software.</returns>
public override AvailableSoftware knownInfo()
{
const string version = "11.4.2";
var signature = new Signature(publisherX509, certificateExpiration);
return new AvailableSoftware("MariaDB Server 11.4",
version,
null, // no 32-bit installer
"^MariaDB 11\\.4 \\(x64\\)$",
null, // no 32-bit installer
new InstallInfoMsi(
"https://downloads.mariadb.org/rest-api/mariadb/" + version + "/mariadb-" + version + "-winx64.msi",
HashAlgorithm.SHA256,
"4c0c1dc4d23ec13c02e10e5d0eb36553c4536fd949ea4ff0c6c493dd57d1cbce",
signature,
"/qn /norestart")
);
}


/// <summary>
/// Gets the date when this branch of MariaDB reaches its end of life.
/// </summary>
/// <returns>Returns the end of life date for this release branch.</returns>
public override DateTime EndOfLife()
{
return new DateTime(2029, 5, 29, 23, 59, 59, DateTimeKind.Utc);
}
}
}

0 comments on commit 6240e4e

Please sign in to comment.