From fedora-security-commits at redhat.com Tue Nov 3 18:29:26 2009 From: fedora-security-commits at redhat.com (fedora-security-commits at redhat.com) Date: Tue, 3 Nov 2009 18:29:26 +0000 (UTC) Subject: [Fedora-security-commits] fedora-security/tools/lib/Libexig Fedora.pm, 1.11, 1.12 Message-ID: <20091103182926.4A8CC11C00E8@cvs1.fedora.phx.redhat.com> Author: vdanen Update of /cvs/fedora/fedora-security/tools/lib/Libexig In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv8066/lib/Libexig Modified Files: Fedora.pm Log Message: fully handle the 'all' version type now Index: Fedora.pm =================================================================== RCS file: /cvs/fedora/fedora-security/tools/lib/Libexig/Fedora.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- Fedora.pm 22 Oct 2009 16:37:18 -0000 1.11 +++ Fedora.pm 3 Nov 2009 18:29:25 -0000 1.12 @@ -196,23 +196,14 @@ $bug{'short_desc'} .= " [Fedora $versions{$version}]"; $bug{'version'} = $versions{$version}; - if ($bug{'version'} eq 'all') { - my $allcomps = 1; - } else { - my $allcomps = 0; - } - $bug{'comment'} = $comment_head. $comment_parents. ($bug{'version'} eq 'rawhide' ? $comment_rawhide : $comment_update). ($bug{'version'} eq 'all' ? $comment_all : print '' ). $comment_tail; - if ($bug{'version'} eq 'all') { - $bug{'version'} = 'rawhide'; - } - push @retval, \%bug; + push @retval, \%bug; } return \@retval; @@ -235,11 +226,22 @@ 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; + + if ($bug->{'version'} eq 'all') + { + $allcomps = 1; + $bug->{'version'} = 'rawhide'; + } else { + $allcomps = 0; + } + my $bug_id = $bugzilla->file_bug ($bug); if (!defined($bug_id)) { @@ -263,30 +265,33 @@ $bugzilla->add_comment ($bug_id, $tr_comment); - push @created_versions, $bug->{'version'}; + push @created_versions, $bug->{'version'}; } else { -# # XXX temporary until F9 BZ component is created XXX -# my $tr_comment = -# 'You can eventually use the following link to '. -# 'create the update request for upcoming Fedora 9: '."\n". -# 'https://admin.fedoraproject.org/updates/new/'. -# '?request=Stable'. -# '&type=security'. -# '&release=Fedora%209'. -# '&bugs='.$bug_id; -# -# foreach my $bug (@{$parent_bugs}) { -# $tr_comment .= ','.$bug; -# } -# -# $bugzilla->add_comment ($bug_id, $tr_comment); +# # 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; + + foreach my $bug (@{$parent_bugs}) { + $tr_comment .= ','.$bug; + } + + $bugzilla->add_comment ($bug_id, $tr_comment); + } push @created_versions, $rawhide_version; } $bugzilla->add_blockers ($bug_id, $parent_bugs); - if (my $allcomps eq 0) + if ($allcomps == 0) { $comment .= $bug->{'version'}.": bug #$bug_id\n"; } else { From fedora-security-commits at redhat.com Wed Nov 18 17:32:31 2009 From: fedora-security-commits at redhat.com (fedora-security-commits at redhat.com) Date: Wed, 18 Nov 2009 17:32:31 +0000 (UTC) Subject: [Fedora-security-commits] fedora-security/tools/scripts add-tracking-bugs, 1.5, 1.6 Message-ID: <20091118173231.1B53811C00DE@cvs1.fedora.phx.redhat.com> Author: thoger Update of /cvs/fedora/fedora-security/tools/scripts In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv31616/tools/scripts Modified Files: add-tracking-bugs 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: add-tracking-bugs =================================================================== RCS file: /cvs/fedora/fedora-security/tools/scripts/add-tracking-bugs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- add-tracking-bugs 22 Oct 2009 16:37:18 -0000 1.5 +++ add-tracking-bugs 18 Nov 2009 17:32:30 -0000 1.6 @@ -52,7 +52,7 @@ $options{'bugs'} or die 'bugs argument is mandatory'; @bugs = split (/,/, $options{'bugs'}); -$options{'versions'} or die 'versions argument is mandatory'; +$options{'versions'} or $options{'versions'} = 'all'; @versions = split (/,/, $options{'versions'}); #XXX ##$versions{$_} or die "Invalid version: $_" foreach (@versions); From fedora-security-commits at redhat.com Wed Nov 18 17:33:01 2009 From: fedora-security-commits at redhat.com (fedora-security-commits at redhat.com) Date: Wed, 18 Nov 2009 17:33:01 +0000 (UTC) Subject: [Fedora-security-commits] fedora-security/tools/lib/Libexig Fedora.pm, 1.12, 1.13 Message-ID: <20091118173301.0181811C00DE@cvs1.fedora.phx.redhat.com> 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; }