- xen-release-logs [output/input directory]
- xen-release-scripts [git repo]
- xsa-lists [output/input directory, see steps 1-5 in match-xsa]
- - xsa [git repo]
+ - xsa [git repo, optional]
xen-release-logs
================
my $SINCE="none";
my $UNTIL="stable";
my $XSAFILE;
-my $XSADIR = File::Spec->canonpath(cwd()."/../xsa" );
+my $XSADIR;
+my $XSAFETCH;
my $LOGROOT = File::Spec->canonpath(cwd()."/../xen-release-logs" );
GetOptions(
" [--until <minor version end>]".
" [--smart] [--debug] [--html]".
" [--getlogs]".
- " [--xsadir xsadir(default=../xsa)]".
- " [--logroot directory(default=../xen_release_logs)]".
+ " [--xsadir xsadir (default=../xsaweb; files fetched from http://xenbits.xenproject.org/xsa/)]".
+ " [--logroot directory (default=../xen_release_logs)]".
" --xsa xsafile\n";
if ($GETLOGS) {
# Calculate log file names
my $short="$VERSION$MAJOR$SINCE-$UNTIL";
+# Set up XSADIR and XSAFETCH, if not set
+if (!$XSADIR && $SMART!=0) {
+ $XSAFETCH = "https://xenbits.xenproject.org/xsa/";
+ $XSADIR = File::Spec->canonpath(cwd()."/../xsaweb" );
+ system("rm -rf $XSADIR");
+ mkdir $XSADIR;
+}
+
# Directories
if (! -e $LOGROOT) {
mkdir $LOGROOT;
chdir($git_dir);
my $git_command="git show ".@$loghash_ref[$index].' --format=""';
my $diff_git = `$git_command`;
+
+ if ($XSAFETCH) {
+ my $path="";
+ # Check whether $XSA_PATCH[$i] contains a path
+ my $index = rindex($XSA_PATCH[$i], "/");
+ if ($index != -1) {
+ $path = "/".substr($XSA_PATCH[$i], 0, $index);
+ }
+ if (! -d "$xsa_dir$path") {
+ system("mkdir $xsa_dir$path");
+ }
+ system("wget --quiet --no-check-certificate -P $xsa_dir$path $XSAFETCH/$XSA_PATCH[$i]");
+ }
+
my $patch = read_file("$xsa_dir/$XSA_PATCH[$i]");
my $diff_git_n = normalize_diff($diff_git);
}
return join "\n", @newlines;
-}
+}
\ No newline at end of file