libreoffice: add integration test and use lib.fakeSha256
This commit is contained in:
parent
d679ccc970
commit
2fb0615a66
@ -52,8 +52,7 @@ stdenvNoCC.mkDerivation {
|
||||
let
|
||||
inherit (import ./update-utils.nix { inherit lib; })
|
||||
getLatestStableVersion
|
||||
getSha256
|
||||
nullHash;
|
||||
getSha256;
|
||||
newVersion = getLatestStableVersion;
|
||||
newAarch64Sha256 = getSha256 dist."aarch64-darwin".url version newVersion;
|
||||
newX86_64Sha256 = getSha256 dist."x86_64-darwin".url version newVersion;
|
||||
@ -65,9 +64,9 @@ stdenvNoCC.mkDerivation {
|
||||
set -eou pipefail
|
||||
|
||||
# reset version first so that both platforms are always updated and in sync
|
||||
update-source-version libreoffice 0 ${nullHash} --system=aarch64-darwin
|
||||
update-source-version libreoffice 0 ${lib.fakeSha256} --system=aarch64-darwin
|
||||
update-source-version libreoffice ${newVersion} ${newAarch64Sha256} --system=aarch64-darwin
|
||||
update-source-version libreoffice 0 ${nullHash} --system=x86_64-darwin
|
||||
update-source-version libreoffice 0 ${lib.fakeSha256} --system=x86_64-darwin
|
||||
update-source-version libreoffice ${newVersion} ${newX86_64Sha256} --system=x86_64-darwin
|
||||
'';
|
||||
|
||||
|
@ -4,7 +4,8 @@
|
||||
let
|
||||
inherit (import ./update-utils.nix { inherit (pkgs) lib; })
|
||||
extractLatestVersionFromHtml
|
||||
extractSha256FromHtml;
|
||||
extractSha256FromHtml
|
||||
getLatestStableVersion;
|
||||
in
|
||||
nixt.mkSuite "LibreOffice Updater"
|
||||
{
|
||||
@ -38,6 +39,8 @@ nixt.mkSuite "LibreOffice Updater"
|
||||
in
|
||||
"7.3.3" == actual;
|
||||
|
||||
"should extract latest stable version from website" = (builtins.compareVersions getLatestStableVersion "7.3.3") >= 0;
|
||||
|
||||
"should extract sha256 from html" =
|
||||
let
|
||||
sha256Html = "50ed3deb8d9c987516e2687ebb865bca15486c69da79f1b6d74381e43f2ec863 LibreOffice_7.3.3_MacOS_aarch64.dmg\n";
|
||||
|
@ -39,8 +39,6 @@ let
|
||||
getSha256Url = dmgUrl: oldVersion: newVersion:
|
||||
(builtins.replaceStrings [ oldVersion ] [ newVersion ] dmgUrl) + ".sha256";
|
||||
|
||||
# nullHash :: String
|
||||
nullHash = "0000000000000000000000000000000000000000000000000000000000000000";
|
||||
in
|
||||
{
|
||||
inherit
|
||||
@ -49,6 +47,5 @@ in
|
||||
getLatestStableVersion
|
||||
extractSha256FromHtml
|
||||
getSha256
|
||||
getSha256Url
|
||||
nullHash;
|
||||
getSha256Url;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user