'LOGROOT' => "../xen-release-logs",
'XSALISTDIR' => "../xsa-lists",
# LATER: Remove these
- 'NOCHECKOUT' => 0,
'GETLOGS' => 0,
'SMART' => 0,
'DEBUG' => 0,
'html' => \$o{'HTML'},
# LATER: Remove these
- 'nocheckout' => \$o{'NOCHECKOUT'},
'getlogs' => \$o{'GETLOGS'},
# Make these available to match-xsa
" --major not specified\n";
}
- # Normalize Calculate Derived Options
+ # Normalize Calculate Derived Options and create directories, if needed
+ # Clean temporary directories such as tmp and debug
$o{'SHORT'} = $o{'VERSION'}.$o{'MAJOR'}.$o{'SINCE'}."-".$o{'UNTIL'};
$o{'LOGROOT'} = File::Spec->rel2abs($o{'LOGROOT'});
if (!-d $o{'LOGROOT'}) {
mkdir $o{'LOGROOT'};
}
$o{'LOGDIR'} = $o{'LOGROOT'}."/logs-".$o{'SHORT'};
+ if (!-d $o{'LOGDIR'}) {
+ mkdir $o{'LOGDIR'};
+ }
$o{'OUTPUTFILE'} = $o{'LOGROOT'}."/".$o{'SHORT'}."-".$o{'OUTPUTFILE'};
$o{'TMPDIR'} = $o{'LOGDIR'}."/tmp";
system("rm -rf ".$o{'TMPDIR'});
}
sub options_matchxsa {
- my $u = " --version <xen version, e.g. 4>".
- " --major <major version>".
- " [--since|--minor-since <minor version start>]".
- " [--until|--minor-until <minor version end>]".
- " [--outputfile filename (relative to logdir)]".
-# " [--smart] [--debug] [--html]".
-# " [--getlogs]".
+ my $u = " --version <xen version, e.g. 4>\n".
+ " --major <major version>\n".
+ " [--since|--minor-since <minor version start>]\n".
+ " [--until|--minor-until <minor version end>]\n".
+ " [--outputfile filename (relative to logdir)]\n".
+# " [--smart] [--debug] [--html]\n".
+# " [--getlogs]\n".
" [--xsadir xsadir (default=LOGDIR/tmp/xsaweb; files fetched from".
- " http://xenbits.xenproject.org/xsa/)]".
- " [--logroot directory]".
- " [--xsalistdir directory]".
+ " http://xenbits.xenproject.org/xsa/)]\n".
+ " [--logroot directory]\n".
+ " [--xsalistdir directory]\n".
" --xsalist xsalistfile\n";
my %opt = handleoptions("output_xsamatch.html", $u);
}
sub options_xenreleaselogs {
- my $u = " --version <xen version, e.g. 4>".
- " --major <major version>".
- " [--since|--minor-since <minor version start>]".
- " [--until|--minor-until <minor version end>]".
- " [--outputfile filename (relative to logdir)]".
-# " [--nocheckout]".
+ my $u = " --version <xen version, e.g. 4>\n".
+ " --major <major version>\n".
+ " [--since|--minor-since <minor version start>]\n".
+ " [--until|--minor-until <minor version end>]\n".
+ " [--outputfile filename (relative to logdir)]\n".
" [--logroot directory\n";
my %opt = handleoptions("output_xenreleaselogs.txt", $u);
}
sub options_makewebpage {
- my $u = " --version <xen version, e.g. 4>".
- " --major <major version>".
- " [--since|--minor-since <minor version start>]".
- " [--until|--minor-until <minor version end>]".
- " [--outputfile filename (relative to logdir)]".
-# " [--nocheckout]".
- " --xsastart <number of 1st xsa>".
- " --xsasend <number of last xsa>".
+ my $u = " --version <xen version, e.g. 4>\n".
+ " --major <major version>\n".
+ " [--since|--minor-since <minor version start>]\n".
+ " [--until|--minor-until <minor version end>]\n".
+ " [--outputfile filename (relative to logdir)]\n".
+# " [--nocheckout]\n".
+ " --xsastart <number of 1st xsa>\n".
+ " --xsasend <number of last xsa>\n".
" [--logroot directory]\n";
my %opt = handleoptions("output_webpage.html", $u);
use warnings;
use FindBin;
use lib $FindBin::Bin.'/lib';
+use IO::Handle;
use MyOptions;
use Cwd;
my $UNTIL = $opt{'UNTIL'};
my $LOGDIR = $opt{'LOGDIR'};
my $SHORT = $opt{'SHORT'};
-my $NOCHECKOUT = $opt{'NOCHECKOUT'};
+
+my $XEN_GIT = $opt{'XEN_GIT'} ;
+my $QEMUU_GIT = $opt{'QEMUU_GIT'};
+my $QEMUT_GIT = $opt{'QEMUT_GIT'};
+
+# Output
+my $OUTPUTFILE = $opt{'OUTPUTFILE'};
+# Redirect Output to file
+print "Redirecting output to '$OUTPUTFILE'\n";
+open(OUTPUT, '>', $OUTPUTFILE) or die "Could not open file '$OUTPUTFILE' $!";
+STDOUT->fdopen( \*OUTPUT, 'w' ) or die $!;
# Set up variables
my $MAJOR_LAST=$MAJOR-1;
my $SERIES=$VERSION.".".$MAJOR;
my $SERIES_LAST=$VERSION.".".$MAJOR_LAST;
-if (!$NOCHECKOUT) {
- system("rm -rf $LOGDIR");
- mkdir $LOGDIR;
+
+print "\n";
+print "Fetch or Update Git trees\n";
+print "=========================\n";
+print "\n";
+
+chdir $LOGDIR or die "INTERNAL ERROR: '$LOGDIR' not exist\n";
+
+print "* $XEN_GIT\n";
+if (!-d $XEN_GIT) {
+ system("git clone git://xenbits.xen.org/xen.git");
+} elsif (system("git -C $XEN_GIT rev-parse") != 0 ) {
+ system("rm -rf $XEN_GIT");
+ system("git clone git://xenbits.xen.org/xen.git");
+} else {
+ system("git -C $XEN_GIT pull --all");
}
-chdir $LOGDIR;
-if (!$NOCHECKOUT) {
- print "\n";
- print "Fetching Git trees\n";
- print "==================\n";
- print "\n";
+print "* $QEMUU_GIT\n";
+if (!-d $QEMUU_GIT) {
+ system("git clone git://xenbits.xen.org/qemu-xen.git");
+} elsif (system("git -C $QEMUU_GIT rev-parse") != 0 ) {
+ system("rm -rf $QEMUU_GIT");
+ system("git clone git://xenbits.xen.org/qemu-xen.git");
+} else {
+ system("git -C $QEMUU_GIT pull --all");
+}
+print "* $QEMUT_GIT\n";
+if (!-d $QEMUT_GIT) {
system("git clone git://xenbits.xen.org/qemu-xen-traditional.git");
- system("git clone git://xenbits.xen.org/qemu-xen.git");
- system("git clone git://xenbits.xen.org/xen.git");
+} elsif (system("git -C $QEMUT_GIT rev-parse") != 0 ) {
+ system("rm -rf $QEMUT_GIT");
+ system("git clone git://xenbits.xen.org/qemu-xen-traditional.git");
+} else {
+ system("git -C $QEMUT_GIT pull --all");
}
+
print "\n";
print "Getting xen.git logs\n";
print "====================\n";
print "\n";
chdir "xen"
- or die "ERROR: repo xen does not exist: do not use --nocheckout\n";
+ or die "INTERNAL ERROR: repo xen does not exist\n";
system("git checkout stable-$SERIES");
if ( $SINCE eq "none" ) {
print "\n";
chdir "../qemu-xen" or
- die "ERROR: repo qemu-xen does not exist: do not use --nocheckout\n";
+ die "INTERNAL ERROR: repo qemu-xen does not exist\n";
system("git checkout stable-$SERIES");
if ( $SINCE eq "none" ) {
print "\n";
chdir "../qemu-xen-traditional" or
- die "ERROR: repo qemu-xen-traditional does not exist: do not use ".
- "--nocheckout\n";
+ die "INTERNAL ERROR: repo qemu-xen-traditional does not exist\n";
system("git checkout stable-$SERIES");
if ( $SINCE eq "none" ) {