#!/usr/bin/perl -w
# looks for tumbleweed fixes not in SLE
use strict;

my $dn = `dirname $0`;chomp($dn);
my $pwd = `pwd`;chomp($pwd);
if ($dn !~ /^\//) { $dn = $pwd . "/" . $dn; }
push @INC,$dn;

require CanDBReader;
require SMASHData;

my %nobug = ();

my %cves = ();

open(TW,"data/ga/opensuse_tumbleweed.csv");
while (<TW>) {
	chomp;
	my ($date,$srcpkg,$pkgs,$cve) = split(/,/);

	$cves{$cve} = $srcpkg;
}
close(TW);

foreach my $cve (sort keys %cves) {
	&SMASHData::read_smash_issue($cve);

	if (!defined($CanDBReader::bugzillas{$cve})) {
		$nobug{$cve} = 1;
	}
}

print "Fixed in Tumbleweed, but no bug:\n";
foreach my $cve (sort keys %nobug) {
	print "$cve:" . $cves{$cve} . "\n";
}
