From bd59cac72d234cbf0d6b56a34f5bf85c87dd1483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sun, 8 Mar 2020 11:25:34 +0100 Subject: [PATCH] FTBFS reminder: Deal with week numbers 01 to 09 correctly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apparently, date +%W gives week number with leading zero and there is no alternative. Shell math's % cannot deal with that, so we sed the zero out. Signed-off-by: Miro HronĨok Consider my patch Public Domain or CC0. --- roles/releng/files/ftbfs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/releng/files/ftbfs.sh b/roles/releng/files/ftbfs.sh index 3c6b748adb..21f67ec538 100644 --- a/roles/releng/files/ftbfs.sh +++ b/roles/releng/files/ftbfs.sh @@ -1,7 +1,7 @@ #!/bin/bash # A weekly cron job which actually does the items needed. # Only run every third week, see https://pagure.io/releng/issue/8915 -test $(($(date +%W) % 3)) -eq 0 || exit 0 +test $(($(date +%W | sed s.^0..) % 3)) -eq 0 || exit 0 TMPDIR=`mktemp -d /tmp/ftbfs_reminder.XXXXXX` GITREPO=https://pagure.io/releng.git SCRIPT=ftbfs_weekly_reminder.py