commit:     3eafe7fb22fbe3f85a32801db33aea94f05de1e7
Author:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 24 16:46:58 2014 +0000
Commit:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
CommitDate: Tue Jun 24 16:46:58 2014 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=proj/linux-patches.git;a=commit;h=3eafe7fb

Add back sending announcement email. Add fixed email perl script.

---
 scripts/gpdorelease       |   2 +-
 web/email-announcement.pl | 112 +++++++++++++++++++++++++++++++---------------
 2 files changed, 78 insertions(+), 36 deletions(-)

diff --git a/scripts/gpdorelease b/scripts/gpdorelease
index 4625190..bec5650 100755
--- a/scripts/gpdorelease
+++ b/scripts/gpdorelease
@@ -117,4 +117,4 @@ scp /tmp/${TARBALL_BASENAME}-$newfullver.* 
${USERNAME}@dev.gentoo.org:/space/dis
 #      gpdoweb
 #fi
 
-#[[ ${DO_EMAIL_ANNOUNCEMENT} == "yes" ]] && gpdoemail $newfullver $KERNEL_NAME
+[[ ${DO_EMAIL_ANNOUNCEMENT} == "yes" ]] && gpdoemail $newfullver $KERNEL_NAME

diff --git a/web/email-announcement.pl b/web/email-announcement.pl
index 573c59a..d618c58 100755
--- a/web/email-announcement.pl
+++ b/web/email-announcement.pl
@@ -1,8 +1,8 @@
 #!/usr/bin/perl
-# Copyright 2005 Gentoo Foundation; Distributed under the GPL v2
+# Copyright 2014 Gentoo Foundation; Distributed under the GPL v2
 
 use Cwd;
-use gentoo_sources_web;
+#use gentoo_sources_web;
 
 $tag = shift;
 $kernel_name = shift;
@@ -20,54 +20,96 @@ else { # support for kernels >= 3.0
 $have_history = 0;
 
 # Try and find previous release
+
 if ($rel > 1) {
        $oldtag = $ver.'-'.($rel-1);
-       $cmd = 'svn log -q --stop-on-copy '.$subversion_root.'/tags/'.$oldtag;
-       @log_lines = `$cmd`;
-       $lastrev = 0;
-       foreach (@log_lines) {
-               next if $_ !~ /^r(\d+) \|/;
-               $lastrev = $1;
-               last;
-       }
-}
+    $cmd='git -C '.${LOCAL_PATCHES_TRUNK}.' rev-list '.$oldtag;
+    @output = `$cmd`;
+
+    foreach $line (@output) { 
+        $have_history = 1;
+        if (index($line, "fatal") != -1) {
+            $have_history =0;
+        }
+        if ($have_history == 0) {
+           break;
+        }
+    }
+
 
-if ($lastrev) {
-       @commits = _parse_log($tag, $lastrev);
-       $have_history = @commits;
+
+    if ($have_history == 1) {
+        $cmd='git --no-pager -C '.${LOCAL_PATCHES_TRUNK}.' log  
--pretty=format:"%s (%an)" --name-status '.$oldtag.'..'.$tag;
+        @log_lines = `$cmd`;
+        $have_history = 1;
+    }
+    else {
+        $cmd='git --no-pager -C '.${LOCAL_PATCHES_TRUNK}.' log  
--pretty=format:"%s (%an)" --name-status '.$tag;
+        @log_lines = `$cmd`;
+    }
 }
 
-local $ext;
-$ext = get_tarball_ext($tag);
 
+#if ($rel > 1) {
+#      $oldtag = $ver.'-'.($rel-1);
+#      #$cmd = 'svn log -q --stop-on-copy '.$subversion_root.'/tags/'.$oldtag;
+#      #$cmd = 'svn log -q --stop-on-copy '.$subversion_root.'/tags/'.$oldtag;
+#
+#    # check out branch
+#    printf("LOCAL_PATCHES_TRUNK is ${LOCAL_PATCHES_TRUNK}\n");
+#    $cmd='git -C '.${LOCAL_PATCHES_TRUNK}.' checkout '.$ver;
+#    @result = `$cmd`;
+#
+#    # get log in between tags
+#    $cmd='git -C '.${LOCAL_PATCHES_TRUNK}.' log '.$oldtag.'..'.$tag.' 
--name-status';
+#    printf (" cmd is $cmd\n");
+#
+#      @log_lines = `$cmd`;
+#      $lastrev = 0;
+#      foreach (@log_lines) {
+#              next if $_ !~ /^r(\d+) \|/;
+#              $lastrev = $1;
+#              last;
+#      }
+#}
+#
+#printf("lastrev is $lastrev\n");
+#
+#if ($lastrev) {
+#    printf("inside lastrev\n");
+#      @commits = _parse_log($tag, $lastrev);
+#      $have_history = @commits;
+#}
+#
+#local $ext;
+#$ext = get_tarball_ext($tag);
+#
 $email .= "To: Gentoo Kernel List <gentoo-kernel\@lists.gentoo.org>\n";
 $email .= "Subject: [ANNOUNCE] $kernel_name-$tag release\n";
 
 $email .= "\nThis is an automated email announcing the release of 
$kernel_name-$tag\n\n";
 
-if ($lastrev && $have_history) {
+if ($have_history) {
        $email .= "\nCHANGES SINCE $oldtag\n";
+}
+else {
+       $email .= "\nCHANGES\n";
+}
        $email .= "-----------------------\n\n";
-       foreach $rev (@commits) {
-               next if !$rev->{'rev'};
-               chomp $rev->{'logmsg'};
-               $email .= 'Revision '.$rev->{'rev'}.': ';
-               $email .= $rev->{'logmsg'}.' ('.$rev->{'author'}.')'."\n";
-               $email .= 'Added: '.$_."\n" foreach (@{$rev->{'actionA'}});
-               $email .= 'Modified: '.$_."\n" foreach (@{$rev->{'actionM'}});
-               $email .= 'Deleted: '.$_."\n" foreach (@{$rev->{'actionD'}});
-               $email .= "\n";
+       foreach $line (@log_lines) {
+        if (index($line, "0000_README") == -1) {
+            $email .= "$line";
+        }
        }
-}
 
-$email .= "\nPATCHES\n";
-$email .= "-------\n\n";
-$email .= "When the website updates, the complete patch list and split-out 
patches will be\n";
-$email .= "available here:\n";
-$email .= $website_base."/patches-".$tag.".htm\n";
-$email .= 
$website_base."/tarballs/".$kernel_name."-".$tag.".base.tar".$ext."\n";
-$email .= 
$website_base."/tarballs/".$kernel_name."-".$tag.".extras.tar".$ext."\n";
-$email .= 
$website_base."/tarballs/".$kernel_name."-".$tag.".experimental.tar".$ext."\n";
+#$email .= "\nPATCHES\n";
+#$email .= "-------\n\n";
+#$email .= "When the website updates, the complete patch list and split-out 
patches will be\n";
+#$email .= "available here:\n";
+#$email .= $website_base."/patches-".$tag.".htm\n";
+#$email .= 
$website_base."/tarballs/".$kernel_name."-".$tag.".base.tar".$ext."\n";
+#$email .= 
$website_base."/tarballs/".$kernel_name."-".$tag.".extras.tar".$ext."\n";
+#$email .= 
$website_base."/tarballs/".$kernel_name."-".$tag.".experimental.tar".$ext."\n";
 
 if ($kernel_name == "genpatches") {
        $email .= "\n\nABOUT GENPATCHES\n";

Reply via email to