#!/usr/bin/perl -w use strict; use File::Basename; use File::Spec; -d '.git' or die "$0: Not a Git repository"; my $no_push = 0; $no_push = @ARGV && $ARGV[0] eq '-n'; my $root = dirname($0); my $application = "$root/application"; my $last = `(cd $root; git ls-files "whats" | tail -1)`; @ARGV = ("$root/$last"); my $output_file = "GH-PAGES/index.html"; open STDOUT, ">", $output_file or die "$0: Failed to open $output_file for writing: $!\n"; my %cooking; my $current; if (@ARGV) { while (<>) { next if /^-------/; next if m/^\[([^\]]*)\]/; if (/^[*] (\S+)/) { $current = $1; $cooking{$current} = ""; next; } next if /^ [+-]/; next unless $current; $cooking{$current} .= $_ unless /^\s*$/ && $cooking{$current} eq ''; } } my $title = "Currently in the 'pu' branch"; print <<"END"; $title

$title

The comment about each topic branch is taken from the latest What\'s cooking in erlang/otp email and may no longer apply if the topic branch has been updated.

\n"; print "\n"; print "\n"; close STDOUT; system qq(cd GH-PAGES; git commit --amend -m "Update index.html" index.html >/dev/null); system qq(cd GH-PAGES; git push erlang +gh-pages) unless $no_push;