Francois Gouget : testbot: Do cosmetic cleanups in the patch handling code.

Alexandre Julliard julliard at winehq.org
Tue Feb 4 13:03:07 CST 2020


Module: tools
Branch: master
Commit: 0ed47287f3f3d34f78a313363cd8851d87cd9591
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=0ed47287f3f3d34f78a313363cd8851d87cd9591

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Tue Feb  4 03:22:19 2020 +0100

testbot: Do cosmetic cleanups in the patch handling code.

Prefix unused variables with an underscore.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 testbot/lib/WineTestBot/Patches.pm          | 23 ++++++++---------------
 testbot/lib/WineTestBot/PendingPatchSets.pm |  4 ++--
 2 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/testbot/lib/WineTestBot/Patches.pm b/testbot/lib/WineTestBot/Patches.pm
index ca8d57f..46b17e5 100644
--- a/testbot/lib/WineTestBot/Patches.pm
+++ b/testbot/lib/WineTestBot/Patches.pm
@@ -212,7 +212,7 @@ sub Submit($$$)
                 $BuildStep->DebugLevel(0);
 
                 # Save the build step so the others can reference it.
-                my ($ErrKey, $ErrProperty, $ErrMessage) = $Jobs->Save();
+                my ($_ErrKey, $_ErrProperty, $ErrMessage) = $Jobs->Save();
                 if (defined($ErrMessage))
                 {
                   $self->Disposition("Failed to submit build step");
@@ -308,7 +308,7 @@ sub Submit($$$)
   }
 
   # Save it all
-  my ($ErrKey, $ErrProperty, $ErrMessage) = $Jobs->Save();
+  my ($_ErrKey, $_ErrProperty, $ErrMessage) = $Jobs->Save();
   if (defined $ErrMessage)
   {
     $self->Disposition("Failed to submit job");
@@ -325,7 +325,7 @@ sub Submit($$$)
   # Switch Status to staging to indicate we are done setting up the job
   $NewJob->Status("staging");
   $NewJob->Priority($Priority);
-  ($ErrKey, $ErrProperty, $ErrMessage) = $Jobs->Save();
+  ($_ErrKey, $_ErrProperty, $ErrMessage) = $Jobs->Save();
   if (defined $ErrMessage)
   {
     $self->Disposition("Failed to submit job (staging)");
@@ -470,9 +470,7 @@ sub NewPatch($$$)
     if ($Subject =~ m/\d+\/\d+/)
     {
       $Patch->Disposition("Checking series");
-      my $ErrKey;
-      my $ErrProperty;
-      ($ErrKey, $ErrProperty, $ErrMessage) = $self->Save();
+      (my $_ErrKey, my $_ErrProperty, $ErrMessage) = $self->Save();
       link($PatchBodies[0]->path, "$DataDir/patches/" . $Patch->Id);
       if (! defined($ErrMessage))
       {
@@ -482,9 +480,7 @@ sub NewPatch($$$)
     else
     {
       $Patch->Disposition("Checking patch");
-      my $ErrKey;
-      my $ErrProperty;
-      ($ErrKey, $ErrProperty, $ErrMessage) = $self->Save();
+      (my $_ErrKey, my $_ErrProperty, $ErrMessage) = $self->Save();
       link($PatchBodies[0]->path, "$DataDir/patches/" . $Patch->Id);
       if (! defined($ErrMessage))
       {
@@ -505,14 +501,11 @@ sub NewPatch($$$)
   {
     $PatchBody->purge();
   }
-  
+
   if (! defined($ErrMessage))
   {
-    my ($ErrKey, $ErrProperty, $ErrMessage) = $self->Save();
-    if (defined($ErrMessage))
-    {
-      return $ErrMessage;
-    }
+    (my $_ErrKey, my $_ErrProperty, $ErrMessage) = $self->Save();
+    return $ErrMessage if (defined $ErrMessage);
   }
 
   return undef;
diff --git a/testbot/lib/WineTestBot/PendingPatchSets.pm b/testbot/lib/WineTestBot/PendingPatchSets.pm
index 5be39e4..5339513 100644
--- a/testbot/lib/WineTestBot/PendingPatchSets.pm
+++ b/testbot/lib/WineTestBot/PendingPatchSets.pm
@@ -258,7 +258,7 @@ sub NewSubmission($$)
 
   $Part->Patch($Patch);
 
-  my ($ErrKey, $ErrProperty, $ErrMessage) = $self->Save();
+  my ($_ErrKey, $_ErrProperty, $ErrMessage) = $self->Save();
   if (defined($ErrMessage))
   {
     $Patch->Disposition("Error occurred during series processing");
@@ -280,7 +280,7 @@ sub NewSubmission($$)
         $ErrMessage = $Set->SubmitSubset($PartNo, $Part->Patch);
         if (!defined $ErrMessage)
         {
-          (my $ErrProperty, $ErrMessage) = $Part->Patch->Save();
+          ($_ErrProperty, $ErrMessage) = $Part->Patch->Save();
         }
       }
       else




More information about the wine-cvs mailing list