sub processadvisoryfiles {
my $xsa_dir = $XSADIR;
- #my $version = $VERSION.".".$MAJOR;
- #note: 4.6 contains [12], 4.5 ,
- my $version = "4.";
-
- print "* $version\n";
+ my $version = $VERSION.".".$MAJOR;
+ # Note: For testing at the beginning of the function set
+ # $version to "4." or "4.6" contains [12], "4.5", etc.
# Get a unique array of XSA numbers in the file
my @xsa = uniq(@XSA);
# Find brackets for processing {[0123456789.,]+}
my $regex = qr/{[0123456789.,]+}/p;
if ($tmp =~ /$regex/g) {
- # Use index, as \$-[0] and \$+[0] isn't working
+
my $s = index($tmp, "{");
my $e = index($tmp, "}");
my $middle = substr $tmp, $s+1, $e-$s-1;
my $end = substr $tmp, $e+1;
- #print "<<<<".$tmp."\n";
- #print $start."\n";
- #print "----\n";
- #print $middle."\n";
- #print "----\n";
- #print $end."\n";
- #print ">>>>\n";
-
# Process the content
my $leadingzero;
my @numbers;
# Re-assemble
$tmp = $start.$middle.$end;
- #print "OUTPUT: ".$tmp."\n\n";
}
}
push @XSA_REGEXFORVERSION, $tmp;
}
@XSA_REGEXFORVERSION = uniq(@XSA_REGEXFORVERSION);
+
+ if ($DEBUG != 0) {
+ # DEBUG FILES
+ my $debugregex = $debug."/XSA_REGEXFORVERSION.txt";
+ my $debugversion = $debug."/XSA_PATCHFORVERSION.txt";
+
+ write_file($debugregex , join("\n", @XSA_REGEXFORVERSION)."\n");
+ write_file($debugversion , join("\n", @XSA_PATCHFORVERSION)."\n");
+ }
- # print join("\n", @XSA_REGEXFORVERSION);
-
- # TODO: check whether the found matches can be found
- # Note: For testing at the beginning of the function set
- # $version to "4." or "4.6" contains [12], "4.5", etc.
+ # TODO: Check whether the found matches can be found
# TODO: maybe make @XSA_REGEXFORVERSION a hash (see later)
}