From: Lars Kurth Date: Thu, 27 Jul 2017 22:22:44 +0000 (+0100) Subject: Reformatted code to 80 characters for readability X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=161a574b7638b7f414247fedc520de026e1ab84b;p=people%2Flarsk%2Fxen-release-scripts.git Reformatted code to 80 characters for readability --- diff --git a/match-xsa b/match-xsa index 67cb0db..4d64dd0 100755 --- a/match-xsa +++ b/match-xsa @@ -50,7 +50,8 @@ die "Usage: $0 --version ". " --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('
  • '); - printf('XSA %s : ', $XSA[$i], $XSA[$i]); + printf('XSA %s : ', $XSA[$i], $XSA[$i]); printf(' %s ', $XSA_IN[$i]); - printf('(%s) ', $XSA_PATCH[$i], $XSA_PATCH[$i]); + printf('(%s) ', + $XSA_PATCH[$i], $XSA_PATCH[$i]); if ($XSA_HASH[$i]) { - printf('%s ', $XSA_REPO[$i], $XSA_HASH[$i], $XSA_ID[$i]); + printf('%s ', $XSA_REPO[$i], + $XSA_HASH[$i], $XSA_ID[$i]); } else { printf('%s ', $XSA_ID[$i]); } if ($DEBUG != 0) { - printf(' ... DEBUG ', $debug."/".$XSA[$i]."[".$i_correct."]"); + printf(' ... DEBUG ', $debug."/". + $XSA[$i]."[".$i_correct."]"); } printf('
  • '); 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]"); diff --git a/xen-release-logs b/xen-release-logs index 4655aa3..8736462 100755 --- a/xen-release-logs +++ b/xen-release-logs @@ -10,15 +10,16 @@ # 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 # # 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
  • %h: %s [%an]
  • $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"); }