Only run additional update steps when the source has been updated

This commit is contained in:
Charlotte 🦝 Delenk 2022-11-21 10:55:15 +01:00
parent fd669bc868
commit de8ad39e87
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122
8 changed files with 33 additions and 16 deletions

View file

@ -74,8 +74,10 @@ in
passthru = {
updateScript = writeScript "update-pleroma-fe" ''
${../../scripts/update-git.sh} https://akkoma.dev/AkkomaGang/admin-fe.git akkoma/admin-fe/source.json
SRC_PATH=$(nix-build -E '(import ./. {}).${pname}.src')
${../../scripts/update-yarn.sh} $SRC_PATH akkoma/admin-fe
if [ "$(git diff -- akkoma/admin-fe/source.json)" ]; then
SRC_PATH=$(nix-build -E '(import ./. {}).${pname}.src')
${../../scripts/update-yarn.sh} $SRC_PATH akkoma/admin-fe
fi
'';
};

View file

@ -214,8 +214,10 @@ in
inherit mixNixDeps;
updateScript = writeScript "update-akkoma" ''
${../scripts/update-git.sh} https://akkoma.dev/AkkomaGang/akkoma.git akkoma/source.json
SRC_PATH=$(nix-build -E '(import ./. {}).${pname}.src')
${../scripts/update-mix.sh} $SRC_PATH akkoma/mix.nix
if [ "$(git diff -- akkoma/source.json)" ]; then
SRC_PATH=$(nix-build -E '(import ./. {}).${pname}.src')
${../scripts/update-mix.sh} $SRC_PATH akkoma/mix.nix
fi
'';
};

View file

@ -59,8 +59,10 @@ in
passthru = {
updateScript = writeScript "update-pleroma-fe" ''
${../../scripts/update-git.sh} https://akkoma.dev/AkkomaGang/pleroma-fe.git akkoma/pleroma-fe/source.json
SRC_PATH=$(nix-build -E '(import ./. {}).${pname}.src')
${../../scripts/update-yarn.sh} $SRC_PATH akkoma/pleroma-fe
if [ "$(git diff -- akkoma/pleroma-fe/source.json)" ]; then
SRC_PATH=$(nix-build -E '(import ./. {}).${pname}.src')
${../../scripts/update-yarn.sh} $SRC_PATH akkoma/pleroma-fe
fi
'';
};

View file

@ -36,6 +36,9 @@ in
};
passthru.updateScript = writeScript "update-matrix-media-repo" ''
${../../scripts/update-git.sh} "https://github.com/drone-runners/drone-runner-docker" ci/drone-runner-docker/source.json
SRC_PATH=$(nix-build -E '(import ./. {}).${pname}.src')
${../../scripts/update-go.sh} ./ci/drone-runner-docker ci/drone-runner-docker/goVendor.hash '';
if [ "$(git diff -- ci/drone-runner-docker/source.json)" ]; then
SRC_PATH=$(nix-build -E '(import ./. {}).${pname}.src')
${../../scripts/update-go.sh} ./ci/drone-runner-docker ci/drone-runner-docker/goVendor.hash
fi
'';
}

View file

@ -25,7 +25,9 @@ in
};
passthru.updateScript = writeScript "update-nasin-nanpa" ''
${../../scripts/update-git.sh} https://github.com/ETBCOR/nasin-nanpa fonts/nasin-nanpa/source.json
SRC_PATH=$(nix-build -E '(import ./. {}).nasin-nanpa.src')
ls $SRC_PATH/ffversions/*/*.sfd | sort | tail -n1 | sed 's|[/-]| |g' | sed 's/.sfd//' | awk '{print "{\"major\": \"" $6 "\", \"minor\": \"" $9 "\"}" }' > fonts/nasin-nanpa/version.json
if [ "$(git diff -- fonts/nasin-nanpa/source.json)" ]; then
SRC_PATH=$(nix-build -E '(import ./. {}).nasin-nanpa.src')
ls $SRC_PATH/ffversions/*/*.sfd | sort | tail -n1 | sed 's|[/-]| |g' | sed 's/.sfd//' | awk '{print "{\"major\": \"" $6 "\", \"minor\": \"" $9 "\"}" }' > fonts/nasin-nanpa/version.json
fi
'';
}

View file

@ -37,7 +37,9 @@ in
};
passthru.updateScript = writeScript "update-matrix-media-repo" ''
${../../scripts/update-git.sh} "https://github.com/turt2live/matrix-media-repo" matrix/matrix-media-repo/source.json
SRC_PATH=$(nix-build -E '(import ./. {}).${pname}.src')
${../../scripts/update-go.sh} ./matrix/matrix-media-repo matrix/matrix-media-repo/vendor.sha256
if [ "$(git diff -- matrix/matrix-media-repo/source.json)" ]; then
SRC_PATH=$(nix-build -E '(import ./. {}).${pname}.src')
${../../scripts/update-go.sh} ./matrix/matrix-media-repo matrix/matrix-media-repo/vendor.sha256
fi
'';
}

View file

@ -30,7 +30,9 @@ in
};
passthru.updateScript = writeScript "update-matrix-media-repo" ''
${../../scripts/update-git.sh} "https://github.com/mautrix/discord" matrix/mautrix-discord/source.json
SRC_PATH=$(nix-build -E '(import ./. {}).${pname}.src')
${../../scripts/update-go.sh} ./matrix/mautrix-discord matrix/mautrix-discord/vendor.sha256
if [ "$(git diff -- matrix/mautrix-discord/source.json)" ]; then
SRC_PATH=$(nix-build -E '(import ./. {}).${pname}.src')
${../../scripts/update-go.sh} ./matrix/mautrix-discord matrix/mautrix-discord/vendor.sha256
fi
'';
}

View file

@ -29,7 +29,9 @@ in
};
passthru.updateScript = writeScript "update-mautrix-whatsapp" ''
${../../scripts/update-git.sh} "https://github.com/mautrix/whatsapp" matrix/mautrix-whatsapp/source.json
SRC_PATH=$(nix-build -E '(import ./. {}).${pname}.src')
${../../scripts/update-go.sh} ./matrix/mautrix-whatsapp matrix/mautrix-whatsapp/vendor.sha256
if [ "$(git diff -- matrix/mautrix-whatsapp/source.json)" ]; then
SRC_PATH=$(nix-build -E '(import ./. {}).${pname}.src')
${../../scripts/update-go.sh} ./matrix/mautrix-whatsapp matrix/mautrix-whatsapp/vendor.sha256
fi
'';
}