diff options
| author | Patrick Williams <iawillia@us.ibm.com> | 2015-06-08 15:25:40 -0500 |
|---|---|---|
| committer | Patrick Williams <patrick@stwcx.xyz> | 2016-08-01 13:23:33 -0500 |
| commit | 37567b7657afe2879579e16c4ad764706cbaf098 (patch) | |
| tree | f35b67432f15d9359b21942c1e57d4237ff777ee /openpower/scripts/release-notes | |
| parent | 0e8d7ff2c88dc553fd226e9c08c5f394fe216cc6 (diff) | |
| download | talos-op-build-37567b7657afe2879579e16c4ad764706cbaf098.tar.gz talos-op-build-37567b7657afe2879579e16c4ad764706cbaf098.zip | |
Release notes tool.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'openpower/scripts/release-notes')
| -rwxr-xr-x | openpower/scripts/release-notes | 180 |
1 files changed, 180 insertions, 0 deletions
diff --git a/openpower/scripts/release-notes b/openpower/scripts/release-notes new file mode 100755 index 00000000..402c88d0 --- /dev/null +++ b/openpower/scripts/release-notes @@ -0,0 +1,180 @@ +#!/bin/env perl +use strict; + +my $repos = +{ + 'op-build' => { REPO => "http://github.com/open-power/op-build" }, + 'hostboot' => { REPO => "http://github.com/open-power/hostboot" , + DIR => "openpower/package/hostboot", + PACKAGE => "HOSTBOOT" }, + 'skiboot' => { REPO => "http://github.com/open-power/skiboot" , + DIR => "openpower/package/skiboot", + PACKAGE => "SKIBOOT" }, + 'occ' => { REPO => "http://github.com/open-power/occ" , + DIR => "openpower/package/occ", + PACKAGE => "OCC" }, + 'pnor' => { REPO => "http://github.com/open-power/pnor" , + DIR => "openpower/package/openpower-pnor", + PACKAGE => "OPENPOWER_PNOR" }, + 'palmetto-xml' => { REPO => "http://github.com/open-power/palmetto-xml" , + DIR => "openpower/package/palmetto-xml", + PACKAGE => "PALMETTO_XML" }, + 'habanero-xml' => { REPO => "http://github.com/open-power/habanero-xml" , + DIR => "openpower/package/habanero-xml", + PACKAGE => "HABANERO_XML" }, + 'firestone-xml' => { REPO => "http://github.com/open-power/firestone-xml" , + DIR => "openpower/package/firestone-xml", + PACKAGE => "FIRESTONE_XML" }, + 'garrison-xml' => { REPO => "http://github.com/open-power/garrison-xml" , + DIR => "openpower/package/garrison-xml", + PACKAGE => "GARRISON_XML" }, + 'barreleye-xml' => { REPO => "http://github.com/open-power/barreleye-xml" , + DIR => "openpower/package/barreleye-xml", + PACKAGE => "BARRELEYE_XML" }, + 'petitboot' => { REPO => "http://github.com/open-power/petitboot" , + DIR => "openpower/package/petitboot", + PACKAGE => "PETITBOOT" }, +}; + +my $begin_release = shift; +my $end_release = shift; + +foreach my $repo (keys %{$repos}) +{ + if (-e $repo) + { + system("cd $repo; git fetch") && die "Could not fetch $repo"; + } + else + { + system("git clone $repos->{$repo}->{REPO} $repo") && + die "Could not clone $repo"; + } +} + +system("cd op-build; git checkout $end_release --force; git reset HEAD --hard"); + + +open(OP_SUMMARY, "cd op-build; ". + "git diff $begin_release...$end_release --name-only |". + "grep -e \"\.mk\" -e \"Config.in\" |". + "xargs git diff $begin_release...$end_release -- |". + "grep -e '^[+-][^[:space:]]*_VERSION' ". + "-e'^[+-][[:space:]]*default.*if.*LATEST_VERSION' |") || die; + +my $old_level = {}; +my $new_level = {}; + +while(my $line = <OP_SUMMARY>) +{ + chomp $line; + if ($line =~ m/\$/) # Sanity check there are not variables here. + { + next; + } + if ($line =~ m/-([^[:space:]]*)_VERSION([[:space:]]*\?*=[[:space:]]*)(.*)/) + { + print "Old $1:$3\n"; + $old_level->{$1} = $3; + } + if ($line =~ m/\+([^[:space:]]*)_VERSION([[:space:]]*\?*=[[:space:]]*)(.*)/) + { + print "New $1:$3\n"; + $new_level->{$1} = $3; + } + if ($line =~ m/-[[:space:]]*default[[:space:]]*"([^[:space:]]*)"[[:space:]]*if[[:space:]]BR2_([^[:space:]]*)_LATEST_VERSION/) + { + print "Old $2:$1\n"; + $old_level->{$2} = $1; + } + if ($line =~ m/\+[[:space:]]*default[[:space:]]*"([^[:space:]]*)"[[:space:]]*if[[:space:]]BR2_([^[:space:]]*)_LATEST_VERSION/) + { + print "New $2:$1\n"; + $new_level->{$2} = $1; + } +} + +open(OUTPUT, "> RELEASE.md") || die "Failed to open RELEASE.md"; + +print OUTPUT "# Release Notes for OpenPower Firmware $end_release\n"; + +my $op_url = $repos->{'op-build'}->{REPO}; + +foreach my $repo (sort keys %{$repos}) +{ + next if (not exists $repos->{$repo}->{PACKAGE}); + + my $package = $repos->{$repo}->{PACKAGE}; + my $url = $repos->{$repo}->{REPO}; + my $dir = $repos->{$repo}->{DIR}; + + print OUTPUT "## Package: $repo\n"; + print OUTPUT "[Repository]($url)\n"; + print OUTPUT "\n"; + + my $package = $repos->{$repo}->{PACKAGE}; + + # Display patches. + if (open(LSLOG, "ls op-build/$dir/*.patch | ". + "xargs -n1 --no-run-if-empty basename |")) + { + print OUTPUT "### Patches\n"; + while (my $logline = <LSLOG>) + { + chomp $logline; + print OUTPUT "* [$logline]". + "($op_url/tree/$end_release/$dir/$logline)\n"; + } + close LSLOG; + print OUTPUT "\n"; + } + else + { + print OUTPUT "None.\n"; + } + + # Display changes. + print OUTPUT "### Commits\n"; + if ((not exists $old_level->{$package}) && + (not exists $new_level->{$package})) + { + # No change identified. + print "No changes: $repo\n"; + print OUTPUT "No changes.\n"; + next; + } + + if ((exists $old_level->{$package}) && + (exists $new_level->{$package})) + { + print "Changes in $repo...\n"; + + open(GITLOG, "cd $repo; git shortlog $old_level->{$package}...". + "$new_level->{$package} --no-merges --format=". + "\"* [%h]($url/commit/%h) %s\" |"); + + while (my $logline = <GITLOG>) + { + chomp $logline; + $logline =~ s/^[[:space:]]*//; + print OUTPUT "$logline\n"; + } + close GITLOG; + print OUTPUT "\n"; + next; + } + + if (not exists $old_level->{$package}) + { + print "New package $repo.\n"; + print OUTPUT "New package.\n"; + next; + } + + if (not exists $new_level->{$package}) + { + print "Deleted package $repo.\n"; + print OUTPUT "Package removed.\n"; + next; + } +} |

