Alexandre Julliard : patches: Display Signed-off-by information.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Oct 6 09:15:33 CDT 2015


Module: tools
Branch: master
Commit: 7cc88583d998bb78c4833e5b45260d98a5e12810
URL:    http://source.winehq.org/git/tools.git/?a=commit;h=7cc88583d998bb78c4833e5b45260d98a5e12810

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Oct  6 22:58:11 2015 +0900

patches: Display Signed-off-by information.

---

 patches/expire      |  3 +++
 patches/patches.css |  1 +
 patches/update      | 27 +++++++++++++++++++++++----
 3 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/patches/expire b/patches/expire
index e092a71..a3b99c1 100755
--- a/patches/expire
+++ b/patches/expire
@@ -120,6 +120,7 @@ foreach my $file (sort readdir DIR)
                 rename "$dir/$file",        "$dir/OLD/$file";
                 rename "$dir/$file.status", "$dir/OLD/$file.status";
                 rename "$dir/$file.order",  "$dir/OLD/$file.order";
+                rename "$dir/$file.signoff", "$dir/OLD/$file.signoff";
                 rename "$dir/$file.testbot", "$dir/OLD/$file.testbot";
                 rename "$dir/$file.testfail", "$dir/OLD/$file.testfail";
             }
@@ -132,6 +133,7 @@ foreach my $file (sort readdir DIR)
                 unlink "$dir/$file";
                 unlink "$dir/$file.status";
                 unlink "$dir/$file.order";
+                unlink "$dir/$file.signoff";
                 unlink "$dir/$file.testbot";
                 unlink "$dir/$file.testfail";
             }
@@ -162,6 +164,7 @@ foreach my $file (sort readdir DIR)
             unlink "$dir/OLD/$file";
             unlink "$dir/OLD/$file.status";
             unlink "$dir/OLD/$file.order";
+            unlink "$dir/OLD/$file.signoff";
             unlink "$dir/OLD/$file.testbot";
             unlink "$dir/OLD/$file.testfail";
         }
diff --git a/patches/patches.css b/patches/patches.css
index b47d244..5706681 100644
--- a/patches/patches.css
+++ b/patches/patches.css
@@ -140,6 +140,7 @@ tr.odd { background-color: #f8e8e8; }
 
 .id, .status, .testbot { text-align: center; }
 .id, .status, .author { white-space: nowrap; padding: 0 3px; }
+.checkmark { text-align: center; color:green; }
 .sha1 { white-space: nowrap; font-family: monospace; padding: 2px 12px; }
 
 .id :link, .sha1 :link, .subject :link { color: #A50D0D; text-decoration: none; }
diff --git a/patches/update b/patches/update
index 576b405..aa8d8c9 100755
--- a/patches/update
+++ b/patches/update
@@ -92,9 +92,9 @@ my %patches;
 
 sub format_author($)
 {
-    my $_ = shift;
-    if (/\s*((\"(.*)\")|(.*))\s*<(\S+\@\S+)>/) { return $3 || $4 || $5; }
-    return $_;
+    my $str = shift;
+    if ($str =~ /\s*((\"(.*)\")|(.*))\s*<(\S+\@\S+)>/) { return $3 || $4 || $5; }
+    return $str;
 }
 
 open INDEX, "> $dest/index.html.new" or die "cannot create $dest/index.html.new";
@@ -117,6 +117,7 @@ print INDEX "<table class=\"main\"><tr><th class=\"id\">ID</th>",
     "<th class=\"status\">Status</th>",
     "<th class=\"author\">Author</th>",
     "<th class=\"subject\">Subject</th>",
+    "<th class=\"status\">Sign</th>",
     "<th class=\"status\">Testbot</th>",
     "<th class=\"status\">Job ID</th></tr>\n";
 
@@ -130,7 +131,8 @@ foreach my $file (readdir DIR)
     {
         if (/^Subject: (.*)$/) { $patch{"subject"} = $1; }
         elsif (/^From: (.*)$/) { $patch{"author"} = format_author($1); }
-        last if (defined $patch{"subject"} && defined $patch{"author"});
+        elsif (/^Signed-off-by: (.*)$/) { push @{$patch{"signoff"}}, format_author($1); }
+        last if (/^---$/);
     }
     close PATCH;
 
@@ -148,6 +150,15 @@ foreach my $file (readdir DIR)
         $patch{"order"} = <ORDER>;
         close ORDER;
     }
+    if (open SIGNOFF, "<$dir/$file.signoff")
+    {
+        while (<SIGNOFF>)
+        {
+            chomp;
+            push @{$patch{"signoff"}}, format_author($_);
+        }
+        close SIGNOFF;
+    }
     $patch{"testbot"} = "";
     $patch{"testjob"} = "";
     $patch{"testurl"} = "";
@@ -182,6 +193,14 @@ foreach my $file (sort { $patches{$b}->{"order"} <=> $patches{$a}->{"order"} } k
            escapeHTML($patch->{"author"});
     printf INDEX "<td class=\"subject\"><a href=\"data/$file\">%s</a></td>",
            escapeHTML($patch->{"subject"});
+    if (defined($patch->{"signoff"}))
+    {
+        printf INDEX "<td class=\"checkmark\"><a title=\"%s\">✓</a></td>", join("\n",@{$patch->{"signoff"}});
+    }
+    else
+    {
+        printf INDEX "<td></td>";
+    }
     if ($patch->{"testbot"} eq "Failed")
     {
         print INDEX "<td class=\"testbot botfail\"><a href=\"data/$file.testfail\">Failed</a></td>";




More information about the wine-cvs mailing list