Patrick Williams | 37567b7 | 2015-06-08 15:25:40 -0500 | [diff] [blame] | 1 | #!/bin/env perl |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 2 | |
Patrick Williams | 37567b7 | 2015-06-08 15:25:40 -0500 | [diff] [blame] | 3 | use strict; |
| 4 | |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 5 | use Getopt::Long; |
| 6 | use DBI; |
| 7 | |
| 8 | # We use an in-memory SQLite database as SQL is good for doing queries |
| 9 | # of differences between data sets, and doing that in perl is annoying. |
| 10 | my $db = "dbi:SQLite:dbname=release-notes.sqlite"; |
| 11 | #my $dbh = DBI->connect("dbi:SQLite:dbname=:memory:","",""); |
| 12 | my $dbh = DBI->connect($db,undef,undef, {AutoCommit => 1, RaiseError=>1}); |
| 13 | |
Patrick Williams | 37567b7 | 2015-06-08 15:25:40 -0500 | [diff] [blame] | 14 | my $repos = |
| 15 | { |
| 16 | 'op-build' => { REPO => "http://github.com/open-power/op-build" }, |
| 17 | 'hostboot' => { REPO => "http://github.com/open-power/hostboot" , |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 18 | DIR => "openpower/package/hostboot" }, |
Sachin Gupta | df0b6a0 | 2017-03-16 08:59:51 -0500 | [diff] [blame] | 19 | 'sbe' => { REPO => "http://github.com/open-power/sbe" , |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 20 | DIR => "openpower/package/sbe"}, |
Patrick Williams | 37567b7 | 2015-06-08 15:25:40 -0500 | [diff] [blame] | 21 | 'skiboot' => { REPO => "http://github.com/open-power/skiboot" , |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 22 | DIR => "openpower/package/skiboot"}, |
Patrick Williams | 37567b7 | 2015-06-08 15:25:40 -0500 | [diff] [blame] | 23 | 'occ' => { REPO => "http://github.com/open-power/occ" , |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 24 | DIR => "openpower/package/occ"}, |
Patrick Williams | 37567b7 | 2015-06-08 15:25:40 -0500 | [diff] [blame] | 25 | 'pnor' => { REPO => "http://github.com/open-power/pnor" , |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 26 | DIR => "openpower/package/openpower-pnor"}, |
Patrick Williams | 37567b7 | 2015-06-08 15:25:40 -0500 | [diff] [blame] | 27 | 'petitboot' => { REPO => "http://github.com/open-power/petitboot" , |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 28 | DIR => "openpower/package/petitboot"}, |
Patrick Williams | 37567b7 | 2015-06-08 15:25:40 -0500 | [diff] [blame] | 29 | }; |
| 30 | |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 31 | my $begin_release; |
| 32 | my $end_release; |
| 33 | my $begin_worktree; |
| 34 | my $end_worktree; |
| 35 | my $platform; |
| 36 | |
| 37 | GetOptions("begin-release=s" => \$begin_release, |
| 38 | "end-release=s" => \$end_release, |
| 39 | "begin-worktree=s" => \$begin_worktree, |
| 40 | "platform=s" => \$platform, |
| 41 | "end-worktree=s" => \$end_worktree) |
| 42 | or die("Error in command line arguments"); |
| 43 | |
| 44 | die "Required argument missing" unless ($begin_release and $end_release and $begin_worktree and $end_worktree); |
| 45 | |
| 46 | open(OUTPUT, "> RELEASE.md") || die "Failed to open RELEASE.md"; |
| 47 | |
| 48 | print OUTPUT "# Release Notes for OpenPower Firmware $end_release\n"; |
| 49 | |
| 50 | if (-e $begin_worktree) { |
| 51 | system("cd $begin_worktree && git checkout $begin_release && git submodule update --reference ../buildroot && git submodule update") and die "Could not update $begin_worktree"; |
| 52 | } else { |
| 53 | system("git worktree add $begin_worktree $begin_release && cd $begin_worktree&& git submodule update --reference ../buildroot && git submodule update && rm -rf dl && ln -s ../dl dl") and die "Couldn't init $begin_worktree"; |
| 54 | } |
| 55 | |
| 56 | if (-e $end_worktree) { |
| 57 | system("cd $end_worktree && git checkout $end_release && git submodule update --reference ../buildroot && git submodule update") and die "Could not update $end_worktree"; |
| 58 | } else { |
| 59 | system("git worktree add $end_worktree $end_release && cd $end_worktree && git submodule update --reference ../buildroot && git submodule update && rm -rf dl && ln -s ../dl dl") and die "Couldn't init $end_worktree"; |
| 60 | } |
| 61 | |
| 62 | opendir (my $dh, "$begin_worktree/openpower/configs") |
| 63 | or die "can't scan $begin_worktree defconfigs"; |
| 64 | my @begin_platforms = grep { /.*_defconfig/ } readdir($dh); |
| 65 | closedir $dh; |
| 66 | |
| 67 | opendir (my $dh, "$end_worktree/openpower/configs") |
| 68 | or die "can't scan $end_worktree defconfigs"; |
| 69 | my @end_platforms = grep { /.*_defconfig/ } readdir($dh); |
| 70 | closedir $dh; |
| 71 | |
| 72 | s/_defconfig// foreach (@begin_platforms); |
| 73 | s/_defconfig// foreach (@end_platforms); |
| 74 | |
Stewart Smith | 24f8255 | 2017-07-14 15:53:22 +1000 | [diff] [blame] | 75 | my $witherspoon_insanity; |
| 76 | |
Stewart Smith | 88c7e35 | 2017-07-14 15:12:36 +1000 | [diff] [blame] | 77 | if (($platform && $platform eq 'witherspoon') |
| 78 | && -f "$end_worktree/openpower/configs/witherspoon-sequoia_defconfig") { |
| 79 | @begin_platforms = ('witherspoon'); |
| 80 | @end_platforms = ('witherspoon-sequoia', 'witherspoon-redbud'); |
Stewart Smith | 24f8255 | 2017-07-14 15:53:22 +1000 | [diff] [blame] | 81 | $witherspoon_insanity = 1; |
Stewart Smith | 88c7e35 | 2017-07-14 15:12:36 +1000 | [diff] [blame] | 82 | } elsif ($platform) { |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 83 | @begin_platforms = ($platform); |
| 84 | @end_platforms = ($platform); |
| 85 | } |
| 86 | |
| 87 | $dbh->do("CREATE TABLE platforms (platform TEXT, version TEXT);") or die "$!"; |
| 88 | { |
| 89 | my $q = "INSERT INTO platforms (platform,version) VALUES (?,?)"; |
| 90 | my $sth = $dbh->prepare($q) or die "$!"; |
| 91 | $sth->execute($_, $begin_release) foreach (@begin_platforms); |
| 92 | $sth->execute($_, $end_release) foreach (@end_platforms); |
| 93 | } |
| 94 | |
| 95 | { |
Stewart Smith | 88c7e35 | 2017-07-14 15:12:36 +1000 | [diff] [blame] | 96 | my $q = "SELECT platform as p FROM platforms WHERE version is ? AND platform NOT IN (SELECT platform FROM platforms WHERE version is ? and platform=p)"; |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 97 | my $sth = $dbh->prepare($q) or die $!; |
| 98 | $sth->execute($begin_release, $end_release); |
| 99 | my $r; |
Stewart Smith | 88c7e35 | 2017-07-14 15:12:36 +1000 | [diff] [blame] | 100 | print OUTPUT "## Removed platforms\n\n- ".$r->{p}."\n" if $r = $sth->fetchrow_hashref; |
| 101 | print OUTPUT "- ".$r->{p}."\n" while ($r = $sth->fetchrow_hashref); |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 102 | |
| 103 | $sth->execute($end_release, $begin_release); |
Stewart Smith | 88c7e35 | 2017-07-14 15:12:36 +1000 | [diff] [blame] | 104 | print OUTPUT "## New platforms\n\n- ".$r->{p}."\n" if $r = $sth->fetchrow_hashref; |
| 105 | print OUTPUT "- ".$r->{p}."\n" while($r = $sth->fetchrow_hashref); |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 106 | } |
| 107 | |
| 108 | my @common_platforms; |
| 109 | { |
Stewart Smith | 88c7e35 | 2017-07-14 15:12:36 +1000 | [diff] [blame] | 110 | my $q = "SELECT platform as p FROM platforms WHERE version is ? AND EXISTS (select platform from platforms where version is ? and platform=p)"; |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 111 | my $sth = $dbh->prepare($q) or die $!; |
| 112 | $sth->execute($begin_release, $end_release); |
| 113 | my $r; |
Stewart Smith | 88c7e35 | 2017-07-14 15:12:36 +1000 | [diff] [blame] | 114 | push @common_platforms, $r->{p} while ($r = $sth->fetchrow_hashref); |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 115 | } |
| 116 | |
Stewart Smith | 88c7e35 | 2017-07-14 15:12:36 +1000 | [diff] [blame] | 117 | use Data::Dumper; |
| 118 | |
| 119 | print "# COMMON PLATFORMS\n"; |
| 120 | print Dumper(\@common_platforms); |
| 121 | |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 122 | foreach my $p (@common_platforms) { |
| 123 | next if $p =~ /firenze/; |
| 124 | next if $p =~ /^zz$/; |
| 125 | next if $p =~ /mambo/; |
Samuel Mendoza-Jonas | 84f3d25 | 2017-07-12 13:26:55 +1000 | [diff] [blame] | 126 | next if $p =~ /redbud/; |
Samuel Mendoza-Jonas | 264a6cd | 2017-08-04 11:42:41 +1000 | [diff] [blame^] | 127 | next if $p =~ /pseries/; |
| 128 | next if $p =~ /witherspoon-redbud/; |
| 129 | if ($p =~ /witherspoon-sequoia/) { |
| 130 | $p = "witherspoon"; |
| 131 | $witherspoon_insanity = 1; |
| 132 | } |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 133 | $repos->{"$p-xml"} = { REPO => "http://github.com/open-power/$p-xml" , |
| 134 | DIR => "openpower/package/$p-xml" }; |
| 135 | } |
| 136 | |
| 137 | foreach my $p (@begin_platforms) { |
| 138 | system("bash -c '(cd $begin_worktree && . op-build-env && op-build ".$p."_defconfig && op-build legal-info)'"); |
Stewart Smith | 88c7e35 | 2017-07-14 15:12:36 +1000 | [diff] [blame] | 139 | # Work-around bug in op-build v1.17, fixed 2 commits later |
| 140 | system('sed -e \'s/,""\([^",]\)/,"\1/; s/\([^,]\)"",/\1",/; s/machine-xml-"\(.*\)".tar/machine-xml-\1.tar/\' -i '. $begin_worktree .'/output/legal-info/manifest.csv'); |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 141 | # Forgive me for this.... |
Stewart Smith | cd96a99 | 2017-07-14 15:40:19 +1000 | [diff] [blame] | 142 | system("sqlite3 release-notes.sqlite \".mode csv\" \".import $begin_worktree/output/legal-info/manifest.csv i\""); |
| 143 | $dbh->do("ALTER TABLE i RENAME to 'begin_".$p."_manifest'") or die $!; |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 144 | } |
| 145 | |
| 146 | foreach my $p (@end_platforms) { |
Stewart Smith | 88c7e35 | 2017-07-14 15:12:36 +1000 | [diff] [blame] | 147 | print "# END PLATFORMS LEGAL-INFO $p\n"; |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 148 | system("bash -c '(cd $end_worktree && . op-build-env && op-build ".$p."_defconfig && op-build legal-info)'"); |
| 149 | # Forgive me for this.... |
Stewart Smith | cd96a99 | 2017-07-14 15:40:19 +1000 | [diff] [blame] | 150 | print "# loading manifest\n"; |
| 151 | system("sqlite3 release-notes.sqlite \".mode csv\" \".import $end_worktree/output/legal-info/manifest.csv i\""); |
| 152 | $dbh->do("ALTER TABLE i RENAME to 'end_".$p."_manifest'") or die $!; |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 153 | } |
| 154 | |
Stewart Smith | 24f8255 | 2017-07-14 15:53:22 +1000 | [diff] [blame] | 155 | if ($witherspoon_insanity) { |
| 156 | $dbh->do("ALTER TABLE 'end_witherspoon-sequoia_manifest' RENAME to end_witherspoon_manifest"); |
Samuel Mendoza-Jonas | 264a6cd | 2017-08-04 11:42:41 +1000 | [diff] [blame^] | 157 | $dbh->do("ALTER TABLE 'begin_witherspoon-sequoia_manifest' RENAME to begin_witherspoon_manifest"); |
Stewart Smith | 24f8255 | 2017-07-14 15:53:22 +1000 | [diff] [blame] | 158 | @end_platforms = grep { $_ != 'witherspoon-sequoia' } @end_platforms; |
Samuel Mendoza-Jonas | 264a6cd | 2017-08-04 11:42:41 +1000 | [diff] [blame^] | 159 | @begin_platforms = grep { $_ != 'witherspoon-sequoia' } @begin_platforms; |
Stewart Smith | 24f8255 | 2017-07-14 15:53:22 +1000 | [diff] [blame] | 160 | push @end_platforms, 'witherspoon'; |
Samuel Mendoza-Jonas | 264a6cd | 2017-08-04 11:42:41 +1000 | [diff] [blame^] | 161 | push @begin_platforms, 'witherspoon'; |
Stewart Smith | 24f8255 | 2017-07-14 15:53:22 +1000 | [diff] [blame] | 162 | push @common_platforms, 'witherspoon'; |
| 163 | } |
| 164 | |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 165 | $dbh->do(<<'SQL') or die "$!"; |
| 166 | CREATE TABLE package_upgrades ( |
| 167 | PACKAGE TEXT, |
| 168 | OLDVERSION TEXT, |
| 169 | NEWVERSION TEXT, |
| 170 | PLATFORM TEXT |
| 171 | ) |
| 172 | SQL |
| 173 | |
| 174 | foreach my $p (@common_platforms) { |
Stewart Smith | 88c7e35 | 2017-07-14 15:12:36 +1000 | [diff] [blame] | 175 | $dbh->do("INSERT INTO package_upgrades select b.package,b.version,e.version,'$p' from 'begin_".$p."_manifest' as b LEFT JOIN 'end_".$p."_manifest' AS e ON b.package=e.package WHERE b.version != e.version") or die $!; |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 176 | } |
| 177 | |
| 178 | $dbh->do(<<'SQL') or die "$!"; |
| 179 | CREATE TABLE new_package ( |
| 180 | PACKAGE TEXT, |
| 181 | VERSION TEXT, |
| 182 | PLATFORM TEXT |
| 183 | ) |
| 184 | SQL |
| 185 | |
| 186 | foreach my $p (@common_platforms) { |
Stewart Smith | 88c7e35 | 2017-07-14 15:12:36 +1000 | [diff] [blame] | 187 | $dbh->do("INSERT INTO new_package select b.package,b.version,'$p' from 'end_".$p."_manifest' as b WHERE NOT EXISTS(SELECT package FROM 'begin_".$p."_manifest' AS e WHERE b.package=e.package)") or die $!; |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 188 | } |
| 189 | |
| 190 | $dbh->do(<<'SQL') or die "$!"; |
| 191 | CREATE TABLE removed_package ( |
| 192 | PACKAGE TEXT, |
| 193 | VERSION TEXT, |
| 194 | PLATFORM TEXT |
| 195 | ) |
| 196 | SQL |
| 197 | |
| 198 | foreach my $p (@common_platforms) { |
Stewart Smith | 88c7e35 | 2017-07-14 15:12:36 +1000 | [diff] [blame] | 199 | $dbh->do("INSERT INTO removed_package select b.package,b.version,'$p' from 'begin_".$p."_manifest' as b WHERE NOT EXISTS(SELECT package FROM 'end_".$p."_manifest' AS e WHERE b.package=e.package)") or die $!; |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 200 | } |
| 201 | |
| 202 | my $old_level = {}; |
| 203 | my $new_level = {}; |
| 204 | |
| 205 | { |
| 206 | my $q = <<'SQL'; |
| 207 | select package as pk ,oldversion as o ,newversion as n, |
| 208 | GROUP_CONCAT(platform) as ps |
| 209 | FROM package_upgrades |
| 210 | GROUP BY package,oldversion,newversion |
| 211 | ORDER BY package,platform |
| 212 | SQL |
| 213 | my $sth = $dbh->prepare($q) or die $!; |
| 214 | $sth->execute(); |
| 215 | |
| 216 | print OUTPUT "## Updated Packages\n\n"; |
| 217 | print OUTPUT "Package | Old Version | New Version | Platforms\n"; |
| 218 | print OUTPUT "--- | --- | --- | ---\n"; |
| 219 | while (my $r = $sth->fetchrow_hashref) { |
| 220 | print OUTPUT join(' | ',($r->{pk}, $r->{o}, $r->{n}, $r->{ps}))."\n" ; |
| 221 | if ($r->{pk} eq 'machine-xml') { |
| 222 | $old_level->{$r->{ps}."-xml"} = $r->{o}; |
| 223 | $new_level->{$r->{ps}."-xml"} = $r->{n}; |
| 224 | } else { |
| 225 | $old_level->{$r->{pk}} = $r->{o}; |
| 226 | $new_level->{$r->{pk}} = $r->{n}; |
| 227 | } |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | { |
| 232 | my $q = <<'SQL'; |
| 233 | select package as pk ,version as v, |
| 234 | GROUP_CONCAT(platform) as ps |
| 235 | FROM new_package |
| 236 | GROUP BY package,version |
| 237 | ORDER BY package,platform |
| 238 | SQL |
| 239 | my $sth = $dbh->prepare($q) or die $!; |
| 240 | $sth->execute(); |
| 241 | |
| 242 | print OUTPUT "\n\n## New Packages\n\n"; |
| 243 | print OUTPUT "Package | Version | Platforms\n"; |
| 244 | print OUTPUT "--- | --- | ---\n"; |
| 245 | while (my $r = $sth->fetchrow_hashref) { |
| 246 | print OUTPUT join(' | ',($r->{pk}, $r->{v}, $r->{ps}))."\n" ; |
| 247 | if ($r->{pk} eq 'machine-xml') { |
| 248 | $new_level->{$r->{ps}."-xml"} = $r->{v}; |
| 249 | } |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | { |
| 254 | my $q = <<'SQL'; |
| 255 | select package as pk ,version as v, |
| 256 | GROUP_CONCAT(platform) as ps |
| 257 | FROM removed_package |
| 258 | GROUP BY package,version |
| 259 | ORDER BY package,platform |
| 260 | SQL |
| 261 | my $sth = $dbh->prepare($q) or die $!; |
| 262 | $sth->execute(); |
| 263 | |
| 264 | print OUTPUT "\n\n## Removed Packages\n\n"; |
| 265 | print OUTPUT "Package | Version | Platforms\n"; |
| 266 | print OUTPUT "--- | --- | ---\n"; |
| 267 | while (my $r = $sth->fetchrow_hashref) { |
| 268 | print OUTPUT join(' | ',($r->{pk}, $r->{v}, $r->{ps}))."\n" ; |
| 269 | if ($r->{pk} eq $r->{ps}."-xml") { |
| 270 | $old_level->{$r->{ps}."-xml"} = $r->{v}; |
| 271 | } |
| 272 | } |
| 273 | print OUTPUT "\n\n"; |
| 274 | } |
Patrick Williams | 37567b7 | 2015-06-08 15:25:40 -0500 | [diff] [blame] | 275 | |
| 276 | foreach my $repo (keys %{$repos}) |
| 277 | { |
| 278 | if (-e $repo) |
| 279 | { |
| 280 | system("cd $repo; git fetch") && die "Could not fetch $repo"; |
| 281 | } |
| 282 | else |
| 283 | { |
| 284 | system("git clone $repos->{$repo}->{REPO} $repo") && |
| 285 | die "Could not clone $repo"; |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | system("cd op-build; git checkout $end_release --force; git reset HEAD --hard"); |
| 290 | |
| 291 | |
Patrick Williams | 37567b7 | 2015-06-08 15:25:40 -0500 | [diff] [blame] | 292 | my $op_url = $repos->{'op-build'}->{REPO}; |
| 293 | |
| 294 | foreach my $repo (sort keys %{$repos}) |
| 295 | { |
Stewart Smith | f76e7f9 | 2017-05-19 10:42:01 +1000 | [diff] [blame] | 296 | my $package = $repo; |
Patrick Williams | 37567b7 | 2015-06-08 15:25:40 -0500 | [diff] [blame] | 297 | my $url = $repos->{$repo}->{REPO}; |
| 298 | my $dir = $repos->{$repo}->{DIR}; |
| 299 | |
| 300 | print OUTPUT "## Package: $repo\n"; |
| 301 | print OUTPUT "[Repository]($url)\n"; |
| 302 | print OUTPUT "\n"; |
| 303 | |
Patrick Williams | 37567b7 | 2015-06-08 15:25:40 -0500 | [diff] [blame] | 304 | # Display patches. |
| 305 | if (open(LSLOG, "ls op-build/$dir/*.patch | ". |
| 306 | "xargs -n1 --no-run-if-empty basename |")) |
| 307 | { |
| 308 | print OUTPUT "### Patches\n"; |
| 309 | while (my $logline = <LSLOG>) |
| 310 | { |
| 311 | chomp $logline; |
| 312 | print OUTPUT "* [$logline]". |
| 313 | "($op_url/tree/$end_release/$dir/$logline)\n"; |
| 314 | } |
| 315 | close LSLOG; |
| 316 | print OUTPUT "\n"; |
| 317 | } |
| 318 | else |
| 319 | { |
| 320 | print OUTPUT "None.\n"; |
| 321 | } |
| 322 | |
| 323 | # Display changes. |
| 324 | print OUTPUT "### Commits\n"; |
| 325 | if ((not exists $old_level->{$package}) && |
| 326 | (not exists $new_level->{$package})) |
| 327 | { |
| 328 | # No change identified. |
| 329 | print "No changes: $repo\n"; |
| 330 | print OUTPUT "No changes.\n"; |
| 331 | next; |
| 332 | } |
| 333 | |
| 334 | if ((exists $old_level->{$package}) && |
| 335 | (exists $new_level->{$package})) |
| 336 | { |
| 337 | print "Changes in $repo...\n"; |
Patrick Williams | 37567b7 | 2015-06-08 15:25:40 -0500 | [diff] [blame] | 338 | open(GITLOG, "cd $repo; git shortlog $old_level->{$package}...". |
| 339 | "$new_level->{$package} --no-merges --format=". |
| 340 | "\"* [%h]($url/commit/%h) %s\" |"); |
| 341 | |
| 342 | while (my $logline = <GITLOG>) |
| 343 | { |
| 344 | chomp $logline; |
| 345 | $logline =~ s/^[[:space:]]*//; |
| 346 | print OUTPUT "$logline\n"; |
| 347 | } |
| 348 | close GITLOG; |
| 349 | print OUTPUT "\n"; |
| 350 | next; |
| 351 | } |
| 352 | |
| 353 | if (not exists $old_level->{$package}) |
| 354 | { |
| 355 | print "New package $repo.\n"; |
| 356 | print OUTPUT "New package.\n"; |
| 357 | next; |
| 358 | } |
| 359 | |
| 360 | if (not exists $new_level->{$package}) |
| 361 | { |
| 362 | print "Deleted package $repo.\n"; |
| 363 | print OUTPUT "Package removed.\n"; |
| 364 | next; |
| 365 | } |
| 366 | } |