8 use POSIX qw(strftime);
12 # 0. See "configuration" below
14 # 1. Put the decision in
15 # tech-ctte.git/<BUGNUMBER>_blah_blah/decision
16 # in the special template format. Commit it.
20 # scripts/publish-decision BUGNUMBER_blah_blah/decision
23 # - BUGNUMBER_blah_blah/decision.email ready for sendmail -t
24 # - BUGNUMBER_blah_blah/decision.wml ready to paste into webmml
25 # Inspect them and if appropriate send and commit.
27 die "bad usage" unless @ARGV==1 && $ARGV[0] =~ m#^((\d+)_[\w-]+)/.*$#;
28 my ($dir, $bugn, $decision) = ($1,$2,$&);
30 my %decision = process_decision($decision,$bugn);
32 decision_email($decision,\%decision);
33 decision_webml($decision,\%decision);
36 my ($decision,$bugn) = @_;
37 my $dfh = IO::File->new($decision,'r') or
38 die "Unable to open $decision for reading: $!";
39 my %d_bits = (bug => $bugn,
47 if (/^={4,}\s+(\S.+?)\s*\n?$/) {
49 $current_bit =~ s/[\s_]+/_/g;
50 $current_bit = lc($current_bit);
53 # this will unset the current bit
57 # silently skip wrong sections
58 if (not defined $current_bit) {
61 $d_bits{$current_bit} .= $_;
66 for my $key (keys %d_bits) {
67 # ditch leading and trailing blank lines
68 $d_bits{$key} =~ s/(?:^\n*|\n*$)//g;
75 my ($dfn,$d_bits) = @_;
76 my $efh = IO::File->new($dfn.".email",'w') or
77 die "Unable to open ${dfn}.email for writing: $!";
79 To: debian-devel-announce\@lists.debian.org
80 From: $ENV{DEBFULLNAME} <$ENV{DEBEMAIL}>
81 Subject: [CTTE #$d_bits->{bug}] $d_bits->{title}
82 Mail-Followup-To: debian-ctte\@lists.debian.org
84 $d_bits->{email_intro}
90 ==== END OF RESOLUTION ====
92 $d_bits->{email_epilogue}
94 Please see http://bugs.debian.org/$d_bits->{bug} for discussion of
102 my ($dfn,$d_bits) = @_;
103 my $wfh = IO::File->new($dfn.".wml",'w') or
104 die "Unable to open ${dfn}.wml for writing: $!";
105 my $date = strftime('%Y-%m-%d',gmtime());
108 <a href="http://bugs.debian.org/$d_bits->{bug}">Bug #$d_bits->{bug}:</a>$d_bits->{web_summary}</li>