]> xenbits.xensource.com Git - people/larsk/xen-release-scripts.git/commitdiff
Reformatted code to 80 characters for readability
authorLars Kurth <lars.kurth@citrix.com>
Thu, 27 Jul 2017 22:22:44 +0000 (23:22 +0100)
committerLars Kurth <lars.kurth@citrix.com>
Thu, 27 Jul 2017 22:22:44 +0000 (23:22 +0100)
match-xsa
xen-release-logs

index 67cb0db497fcd7f17f08caca2c278c500f6f495f..4d64dd0aa8b16c3137ec9d7469a4c7ba6a4f4590 100755 (executable)
--- a/match-xsa
+++ b/match-xsa
@@ -50,7 +50,8 @@ die "Usage: $0 --version <xen version, e.g. 4>".
              " --xsa xsafile\n";
  
 if ($GETLOGS) {
-    system("./xen-release-logs --version $VERSION --major $MAJOR --since $SINCE --until $UNTIL --logroot $LOGROOT");
+    system("./xen-release-logs --version $VERSION --major $MAJOR --since ".
+           "$SINCE --until $UNTIL --logroot $LOGROOT");
 }
 
 # Calculate log file names
@@ -123,7 +124,8 @@ getlogs("$LOGROOT/logs-$short/qemuu_$short", \@LOGQEMUU, \@LOGQEMUU_hash);
 getlogs("$LOGROOT/logs-$short/qemut_$short", \@LOGQEMUT, \@LOGQEMUT_hash);
 
 # Do the actual matching
-print "CHECKING '$XSAFILE' against 'xen_$short.log', 'qemuu_$short.log' and 'qemut_$short.log'.\n";
+print "CHECKING '$XSAFILE' against 'xen_$short.log', 'qemuu_$short.log' ".
+      "and 'qemut_$short.log'.\n";
 print "\n";
 for ($i=0; $i <= $XSAs; $i++) {
    my $j=0;
@@ -142,9 +144,12 @@ for ($i=0; $i <= $XSAs; $i++) {
       match($i, \@LOGQEMUU, \@LOGQEMUU_hash, \$j, \$qemuu);
       match($i, \@LOGQEMUT, \@LOGQEMUT_hash, \$j, \$qemut);   
    } else {
-      matchsmart($i, \@LOGXEN, \@LOGXEN_hash, \$j, \$xen, $xsa, $xen_git, "xen");
-      matchsmart($i, \@LOGQEMUU, \@LOGQEMUU_hash, \$j, \$qemuu, $xsa, $qemuu_git, "qemuu");
-      matchsmart($i, \@LOGQEMUT, \@LOGQEMUT_hash, \$j, \$qemut, $xsa, $qemut_git, "qemut");     
+      matchsmart($i, \@LOGXEN, \@LOGXEN_hash, \$j, \$xen, $xsa,
+                 $xen_git, "xen");
+      matchsmart($i, \@LOGQEMUU, \@LOGQEMUU_hash, \$j, \$qemuu, $xsa,
+                 $qemuu_git, "qemuu");
+      matchsmart($i, \@LOGQEMUT, \@LOGQEMUT_hash, \$j, \$qemut, $xsa,
+                 $qemut_git, "qemut");
    }
 
    if ($j == 0 ) {
@@ -178,16 +183,21 @@ if ($HTML) {
           $LAST_XSA = $XSA[$i];
        }
        printf('  <li>');
-       printf('<a href="http://xenbits.xenproject.org/xsa/advisory-%s.html">XSA %s</a> : ', $XSA[$i], $XSA[$i]);
+       printf('<a href="http://xenbits.xenproject.org/xsa/'.
+              'advisory-%s.html">XSA %s</a> : ', $XSA[$i], $XSA[$i]);
        printf(' <b>%s</b> ', $XSA_IN[$i]);
-       printf('(<a href="http://xenbits.xenproject.org/xsa/%s">%s</a>) ', $XSA_PATCH[$i], $XSA_PATCH[$i]);
+       printf('(<a href="http://xenbits.xenproject.org/xsa/%s">%s</a>) ',
+              $XSA_PATCH[$i], $XSA_PATCH[$i]);
        if ($XSA_HASH[$i]) {
-          printf('<em><a href="http://xenbits.xenproject.org/gitweb/?p=%s;a=commitdiff;h=%s">%s</a></em> ', $XSA_REPO[$i], $XSA_HASH[$i], $XSA_ID[$i]);       
+          printf('<em><a href="http://xenbits.xenproject.org/gitweb/?'.
+                 'p=%s;a=commitdiff;h=%s">%s</a></em> ', $XSA_REPO[$i],
+                 $XSA_HASH[$i], $XSA_ID[$i]);
        } else {
           printf('<em>%s</em> ', $XSA_ID[$i]);       
        }
        if ($DEBUG != 0) { 
-          printf(' ... <a href="File://%s">DEBUG</a> ', $debug."/".$XSA[$i]."[".$i_correct."]");
+          printf(' ... <a href="File://%s">DEBUG</a> ', $debug."/".
+                 $XSA[$i]."[".$i_correct."]");
        }       
        printf('</li>');
        printf("\n");
@@ -217,10 +227,12 @@ sub getlogs {
 
    my $handle;
    
-   open($handle, '<', "$basename.log") or die "Could not open '$basename.log' $!\n";
+   open($handle, '<', "$basename.log") or
+        die "Could not open '$basename.log' $!\n";
    chomp(@$log_ref = <$handle>);
    close($handle);
-   open($handle, '<', "$basename-hash.log") or die "Could not open '$basename-hash.log' $!\n";
+   open($handle, '<', "$basename-hash.log") or
+        die "Could not open '$basename-hash.log' $!\n";
    chomp(@$log_hash_ref = <$handle>);
    close($handle);
 }
@@ -284,9 +296,12 @@ sub match {
 sub matchsmart {
 
 #  called via 
-#  matchsmart($i, \@LOGXEN, \@LOGXEN_hash, \$j, \$xen, $xsa_dir, $git_dir);
-#  matchsmart($i, \@LOGQEMUU, \@LOGQEMUU_hash, \$j, \$qemuu, $xsa_dir, $git_dir);
-#  matchsmart($i, \@LOGQEMUT, \@LOGQEMUT_hash, \$j, \$qemut, $xsa_dir, $git_dir);
+#  matchsmart($i, \@LOGXEN, \@LOGXEN_hash, \$j, \$xen, $xsa_dir,
+#             $git_dir);
+#  matchsmart($i, \@LOGQEMUU, \@LOGQEMUU_hash, \$j, \$qemuu, $xsa_dir,
+#             $git_dir);
+#  matchsmart($i, \@LOGQEMUT, \@LOGQEMUT_hash, \$j, \$qemut, $xsa_dir,
+#             $git_dir);
 
    my $i = shift; 
    my $log_ref = shift;
@@ -351,7 +366,8 @@ sub matchsmart {
             if (! -d "$xsa_dir$path") {
                system("mkdir $xsa_dir$path");
             }
-            system("wget --quiet --no-check-certificate -P $xsa_dir$path $XSAFETCH/$XSA_PATCH[$i]"); 
+            system("wget --quiet --no-check-certificate -P $xsa_dir$path ".
+                   "$XSAFETCH/$XSA_PATCH[$i]");
          }
          
          my $patch = read_file("$xsa_dir/$XSA_PATCH[$i]");
index 4655aa36d926f134277926e8609cb03690683cb5..8736462a6b31fa79f06a503830995e456aed5357 100755 (executable)
 #   xen-release-logs --version 4 --major 7 
 #   xen-release-logs --version 4 --major 7 --until 0 
 #
-# Additional Options: specify EXISTING  log root directory, e.g. ../xen-release-logs
+# Additional Options:
+#   specify EXISTING  log root directory, e.g. ../xen-release-logs
 #   xen-release-logs ... --logroot <directory> 
 #
 # DEBUG OPTIONS
 #   xen-release-logs ... --nocheckout 
 #
 # Note: Git repos are checked out in directories specific to options
-#       This option is mainly useful for debugging the script or when changes to 
-#       the script are made 
+#       This option is mainly useful for debugging the script or when changes
+#       to the script are made
 
 use strict;
 use warnings;
@@ -110,8 +111,8 @@ print "Getting qemu-xen.git (qemu upstream) logs\n";
 print "=========================================\n";
 print "\n";
 
-chdir "../qemu-xen" 
-      or die "ERROR: repo qemu-xen does not exist: do not use --nocheckout\n";;
+chdir "../qemu-xen" or
+      die "ERROR: repo qemu-xen does not exist: do not use --nocheckout\n";
 system("git checkout stable-$SERIES");
 
 if ( $SINCE eq "none" ) {
@@ -133,8 +134,9 @@ print "Getting qemu-xen-traditional.git (qemu traditional) logs\n";
 print "========================================================\n";
 print "\n";
 
-chdir "../qemu-xen-traditional" 
-      or die "ERROR: repo qemu-xen-traditional does not exist: do not use --nocheckout\n";;
+chdir "../qemu-xen-traditional"  or
+      die "ERROR: repo qemu-xen-traditional does not exist: do not use ".
+          "--nocheckout\n";
 system("git checkout stable-$SERIES");
 
 if ( $SINCE eq "none" ) {
@@ -169,17 +171,18 @@ sub getlogs {
   my $P = shift;
   
   my $Q = '"';
-
+  my $git= "git log $S..$U --format=format:";
+    
   print "\n";
   print "START TAG: $S\n";
   print "END TAG: $U\n";
   print "\n";
 
-  system("git log $S..$U --format=format:$Q<li><a href=%x22http://xenbits.xen.org/gitweb/?p=$P;".
+  system("$git$Q<li><a href=%x22http://xenbits.xen.org/gitweb/?p=$P;".
          "a=commit;h=%H%x22>%h</a>: %s [%an]</li>$Q > ../$L-pretty.log");         
-  system("git log $S..$U --format=format:$Q* [https://xenbits.xenproject.org/gitweb/?p=$P;".
+  system("$git$Q* [https://xenbits.xenproject.org/gitweb/?p=$P;".
          "a=commit;h=%H %h]: %s [%an]$Q > ../$L-wiki.log");    
-  system("git log $S..$U --format=format:$Q* %h: %s [%an]$Q > ../$L-raw.log");    
-  system("git log $S..$U --format=format:$Q%s$Q > ../$L.log");  
-  system("git log $S..$U --format=format:$Q%H$Q > ../$L-hash.log");
+  system("$git$Q* %h: %s [%an]$Q > ../$L-raw.log");
+  system("$git$Q%s$Q > ../$L.log");
+  system("$git$Q%H$Q > ../$L-hash.log");
 }