[Reproducible-commits] [misc] 02/02: reports: use report week rather than "current month"
Ximin Luo
infinity0 at debian.org
Mon May 16 22:54:01 UTC 2016
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository misc.
commit 0c46354329ff11db8bcb65a20e977460ea889cb6
Author: Ximin Luo <infinity0 at debian.org>
Date: Tue May 17 00:53:50 2016 +0200
reports: use report week rather than "current month"
- includes handling the case where a week spans over two months
---
reports/README | 1 +
reports/bin/review-uploads | 27 +++++++++++++++++++++++++--
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/reports/README b/reports/README
index 597d2b9..bbda5c3 100644
--- a/reports/README
+++ b/reports/README
@@ -50,6 +50,7 @@ Process
3. Look at all uploads for the past week.
+ $ . ../misc/reports/latest/variables
$ bin/review-uploads
If you can't use that script, the archive is available on the web:
diff --git a/reports/bin/review-uploads b/reports/bin/review-uploads
index 6af80d9..796e737 100755
--- a/reports/bin/review-uploads
+++ b/reports/bin/review-uploads
@@ -6,7 +6,30 @@ set -e
pattern="${1:-reproduc\|SOURCE_DATE_EPOCH}"
quote() { printf "'%s'" "${1//\'/\'\\\'\'}"; }
-command="mutt -e \"push 'l ~b $pattern<Enter>';\" \
- -R -f /srv/mail-archives/lists/debian-devel-changes/debian-devel-changes.$(date -u +%Y%m)"
+mailbase=/srv/mail-archives/lists/debian-devel-changes/debian-devel-changes
+
+# get the relevant months
+if [ -z "$RB_REPORT_WEEK_END" ]; then echo >&2 "abort: RB_REPORT_WEEK_END not set"; exit 1; fi
+current_month="$(date -u +%Y%m)"
+month="$(date -u +%Y%m -d@$RB_REPORT_WEEK_END)"
+month_at_start="$(date -u +%Y%m -d@$RB_REPORT_WEEK_START)"
+
+get_emails=
+append_emails() {
+ if [ "$1" = "$current_month" ]; then
+ get_emails="${get_emails}cat $mailbase.$1 >> ~/.tmp.mutt-review; "
+ else
+ get_emails="${get_emails}xzcat $mailbase.$1.xz >> ~/.tmp.mutt-review; "
+ fi
+}
+append_emails "$month"
+if [ "$month_at_start" != "$month" ]; then
+ append_emails "$month_at_start"
+fi
+
+date_pattern="$(date -u -d"@$RB_REPORT_WEEK_START" +"%d/%m/%y")-$(date -u -d"@$RB_REPORT_WEEK_END" +"%d/%m/%y")"
+command="rm -f ~/.tmp.mutt-review;
+${get_emails}env TZ=UTC mutt -e \"push 'l ~d $date_pattern ~b $pattern<Enter>';\" -R -f ~/.tmp.mutt-review;
+rm -f ~/.tmp.mutt-review;"
ssh -t master.debian.org sh -c "$(quote "$command")"
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/misc.git
More information about the Reproducible-commits
mailing list