commit: 0d01497249a825e1d39862fd9d9ed6edde9a92bf Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Sat Sep 3 01:23:04 2022 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Sat Sep 3 01:23:04 2022 +0000 URL: https://gitweb.gentoo.org/proj/qa-scripts.git/commit/?id=0d014972
keyrings-export.bash: only run weekly for timestamped files Otherwise we'd end up having files like service-keys-20220905.gpg created on 20220830. Signed-off-by: Sam James <sam <AT> gentoo.org> keyrings-export.bash | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/keyrings-export.bash b/keyrings-export.bash index 815c50b..39091f4 100755 --- a/keyrings-export.bash +++ b/keyrings-export.bash @@ -51,7 +51,13 @@ for key in service-keys committing-devs active-devs infra-devs retired-devs all- ln -s "${OUTPUT_DIR}"/keys/${key}.gpg "${OUTPUT_DIR}"/${key}.gpg fi - timestamp=$(date -u +%Y%m%d -d "monday") + timestamp=$(date -u +%Y%m%d-%A -d "monday") + + if [[ ${timestamp} != *-Monday ]] ; + break + fi + + timestamp=${timestamp/-Monday/} # Don't clobber existing timestamped keys for this period (weekly) # if we're running several times a day.