[Fedora-security-commits] fedora-security/tools/lib/Libexig Fedora.pm, 1.12, 1.13

fedora-security-commits at redhat.com fedora-security-commits at redhat.com
Wed Nov 18 17:33:01 UTC 2009


Author: thoger

Update of /cvs/fedora/fedora-security/tools/lib/Libexig
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv31616/tools/lib/Libexig

Modified Files:
	Fedora.pm 
Log Message:
fix some texts
update version map
fix indentation
for 'all' versions bugs, add bodhi link to comment #0
assuem 'all' versions by default



Index: Fedora.pm
===================================================================
RCS file: /cvs/fedora/fedora-security/tools/lib/Libexig/Fedora.pm,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Fedora.pm	3 Nov 2009 18:29:25 -0000	1.12
+++ Fedora.pm	18 Nov 2009 17:32:30 -0000	1.13
@@ -6,6 +6,8 @@
 
 use warnings;
 use strict;
+		
+use Data::Dumper;
 
 %Libexig::Fedora::srt_bz_map = (
 	'critical'	=> 'urgent',
@@ -76,11 +78,11 @@
 my $comment_head = 
 	'This is an automatically created tracking bug! '.
 	'It was created to ensure that one or more security '.
-	'vulnerabilities are fixed in all affected branches.'.
-	"\n\n".
-	'You should *not* refer to this bug publicly, as it is a '.
-	'private "Fedora Project Contributors" bug.'.
+	'vulnerabilities are fixed in affected Fedora versions.'.
 	"\n\n".
+#	'You should *not* refer to this bug publicly, as it is a '.
+#	'private "Fedora Project Contributors" bug.'.
+#	"\n\n".
 	'For comments that are specific to the vulnerability please use bugs '.
 	'filed against "Security Response" product referenced in "Blocks" '.
 	'field.'.
@@ -93,14 +95,18 @@
 my $comment_update = 
 	# Following the list of parent bugs
 	"\n".
-	'When creating an update for the version this this bug is reported '.
-	'against please include the bug IDs of respective bugs filed '.
-	'against "Security Response" product as well as of this bug and let the '.
-	'update system close them. Please '.
-	'note that the update announcement will (and should) contain only '.
-	'references to "Security Response" bugs as long as the tracking '.
-	'bug is restricted to "Fedora Project Contributors".'.
+	'When creating a Bodhi update request, please include the bug IDs of '.
+	'the respective parent bugs filed against the "Security Response" product. '.
+	'Please mention CVE ids in the RPM changelog when available.'.
 	"\n\n";
+#	'When creating an update for the version this this bug is reported '.
+#	'against please include the bug IDs of respective bugs filed '.
+#	'against "Security Response" product as well as of this bug and let the '.
+#	'update system close them.'.
+#	'Please note that the update announcement will (and should) contain only '.
+#	'references to "Security Response" bugs as long as the tracking '.
+#	'bug is restricted to "Fedora Project Contributors".'.
+#	"\n\n";
 
 my $comment_rawhide = 
 	"\n".
@@ -108,16 +114,18 @@
 	'Fixed In field if possible) once is it fixed in devel branch. '.
 #	'Please note it\'s currently not possible to file bugs against F9, '.
 #	'so please make sure to fix in both rawhide and upcoming F9. '.
-	'Do *not* include the bug id of this bug in the RPM changelog and the '.
-	'commit message.'.
+#	'Do *not* include the bug id of this bug in the RPM changelog and the '.
+#	'commit message.'.
 	"\n\n";
 
 my $comment_all =
-    "\n".
-    'Please note: this issue affects all currently supported versions of '.
-    'Fedora.  Only one tracking bug has been filed; you should use it for '.
-    'all affected versions.'.
-    "\n\n";
+	"\n".
+	'Please note: this issue affects multiple supported versions of '.
+	'Fedora.  Only one tracking bug has been filed; please only close it '.
+	'when all affected versions are fixed.'.
+	"\n\n";
+
+my $bodhi_link = 'https://admin.fedoraproject.org/updates/new/?type_=security';
 
 my %priorities = (
 	'urgent',	=> 4,
@@ -134,14 +142,18 @@
 	'11',		=> '11',
 	'f11',		=> '11',
 	'fc11',		=> '11',
-	'12',		=> 'rawhide',
-	'f12',		=> 'rawhide',
-	'fc12',		=> 'rawhide',
+	'12',		=> '12',
+	'f12',		=> '12',
+	'fc12',		=> '12',
+	'13',		=> 'rawhide',
+	'f13',		=> 'rawhide',
+	'fc13',		=> 'rawhide',
 	'devel',	=> 'rawhide',
-    'all',      => 'all'
+	'rawhide',	=> 'rawhide',
+	'all',		=> 'all'
 );
 
-my $rawhide_version= '12';
+my $rawhide_version= '13';
 
 sub tracking_bugs
 {
@@ -167,9 +179,9 @@
 	);
 
 	my $comment_parents = '';
+	my $parent_list = undef;
 
 	foreach my $bug (@{$bugs}) {
-
 		# Take the highest of priorities
 		$bug_tmpl{'bug_severity'} = $bug->{'bug_severity'}
 			if ($priorities{$bug->{'bug_severity'}} > $priorities{$bug_tmpl{'bug_severity'}});
@@ -180,7 +192,13 @@
 		$bug_tmpl{'short_desc'} .= $bug->{'alias'}.' ';
 
 		# Add the parent bug to the comment
-		$comment_parents .= "\tbug #$bug->{'bug_id'}: $bug->{'short_short_desc'}\n";
+		$comment_parents .= "bug #$bug->{'bug_id'}:\n$bug->{'short_short_desc'}\n";
+
+		if (!$parent_list) {
+			$parent_list = $bug->{'bug_id'};
+		} else {
+			$parent_list .= "," . $bug->{'bug_id'};
+		}
 	}
 
 	if (@{$bugs} > 1) {
@@ -190,7 +208,6 @@
 	}
 
 	# Create a bug hash for each version
-
 	foreach my $version (@versions) {
 		my %bug = %bug_tmpl;
 		$bug{'short_desc'} .= " [Fedora $versions{$version}]";
@@ -200,10 +217,14 @@
 			$comment_head.
 			$comment_parents.
 			($bug{'version'} eq 'rawhide' ? $comment_rawhide : $comment_update).
-            ($bug{'version'} eq 'all' ? $comment_all : print '' ).
+			($bug{'version'} ne 'all' ? '' :
+				"Bodhi update submission link:\n".
+				"$bodhi_link&bugs=$parent_list\n".
+				$comment_all
+			).
 			$comment_tail;
 
-        push @retval, \%bug;
+		push @retval, \%bug;
 	}
 
 	return \@retval;
@@ -227,20 +248,17 @@
 	my @created_bugs;
 	my @created_versions;
 
-    my $allcomps;
-	
 	my $comment = "Created Fedora tracking bugs for $component:\n\n";
 
 	foreach my $bug (@{$tracking_bugs}) {
-		use Data::Dumper;
+		my $allvers;
 
-        if ($bug->{'version'} eq 'all')
-        {
-			$allcomps = 1;
-            $bug->{'version'} = 'rawhide';
-        } else {
-			$allcomps = 0;
-        }
+		if ($bug->{'version'} eq 'all') {
+			$allvers = 1;
+			$bug->{'version'} = 'rawhide';
+		} else {
+			$allvers = 0;
+		}
 
 		my $bug_id = $bugzilla->file_bug ($bug);
 
@@ -251,52 +269,28 @@
 
 		### XXX: Move this somewhere else?
 		if ($bug->{'version'} ne 'rawhide') {
-			my $tr_comment = 
-				'You can eventually use the following link to '.
-				'create the update request: '."\n".
-				'https://admin.fedoraproject.org/updates/new/'.
-				'?request=Stable'.
-				'&type_=security'.
-				'&bugs='.$bug_id;
-
-			foreach my $bug (@{$parent_bugs}) {
-				$tr_comment .= ','.$bug;
-			}
-
-			$bugzilla->add_comment ($bug_id, $tr_comment);
-
-            push @created_versions, $bug->{'version'};
-		}
-		else {
-#			# This is for an "all" versioned issue so we can have our link
-			if ($allcomps == 1)
-            {
-			my $tr_comment = 
-                'This issue affects more than one Fedora version.'."\n".
-				'You can eventually use the following link to '.
-				'create the update request for each affected version: '."\n".
-				'https://admin.fedoraproject.org/updates/new/'.
-				'?request=Stable'.
-				'&type_=security'.
-				'&bugs='.$bug_id;
+			my $tr_comment =
+				"Bodhi update submission link:\n".
+				"$bodhi_link&bugs=$bug_id";
 
 			foreach my $bug (@{$parent_bugs}) {
 				$tr_comment .= ','.$bug;
 			}
 
 			$bugzilla->add_comment ($bug_id, $tr_comment);
-        }
 
+			push @created_versions, $bug->{'version'};
+		} else {
 			push @created_versions, $rawhide_version;
 		}
 
 		$bugzilla->add_blockers ($bug_id, $parent_bugs);
-        if ($allcomps == 0)
-        {
-		    $comment .= $bug->{'version'}.": bug #$bug_id\n";
-        } else {
-            $comment .= "All versions: bug #$bug_id\n";
-        }
+
+		if (! $allvers) {
+			$comment .= $bug->{'version'}.": bug #$bug_id\n";
+		} else {
+			$comment .= "All versions: bug #$bug_id\n";
+		}
 
 		push @created_bugs, $bug_id;
 	}
@@ -312,5 +306,8 @@
 	$command_hint.= " --versions ".join(',', @created_versions);
 	$command_hint.= " --cve\n";
 
+	# not needed any more
+	$command_hint = '';
+
 	return $comment."\n".$command_hint;
 }




More information about the Fedora-security-commits mailing list