Author: lkundrak
Update of /cvs/fedora/fedora-security/tools In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12854
Modified Files: Tag: lkundrak-tools-ng add-cve-bug add-tracking-bugs Log Message: Split some common routines away to a Library
Index: add-cve-bug =================================================================== RCS file: /cvs/fedora/fedora-security/tools/Attic/add-cve-bug,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- add-cve-bug 7 Nov 2007 16:20:40 -0000 1.1.2.1 +++ add-cve-bug 7 Nov 2007 16:58:50 -0000 1.1.2.2 @@ -31,6 +31,7 @@ use Data::Dumper;
use Libexig::CVE; +use Libexig::Util;
use warnings; use strict; @@ -67,18 +68,6 @@ return $string; }
-# Get password not echoing characters -sub read_noecho -{ - print STDERR @_; - system ('stty -echo'); - my $string = <STDIN>; - system ('stty echo'); - chomp ($string); - print STDERR "\n"; - $string; -} - # Get list of owners of a package from Bugzilla sub owners { @@ -180,12 +169,12 @@ defined $impact{$impact} or die 'specified unrecognized impact value'; $username = ($options{'username'} or $ENV{'LOGNAME'}.'@redhat.com'); $password = ($options{'password'} or $dryrun or - read_noecho ("Bugzilla password for $username: ")); + Libexig::Util::read_noecho ("Bugzilla password for $username: ")); # TODO: add whiteboard option to fill in and get impact from it $interactive = ($options{'interactive'} or 0);
my $bug_desc = bug_desc ($cve); -$bug_desc = edit_string ($bug_desc) if $interactive; +$bug_desc = Libexig::Util::edit_string ($bug_desc) if $interactive;
# Get CC list # TODO: get rid of duplicates
Index: add-tracking-bugs =================================================================== RCS file: /cvs/fedora/fedora-security/tools/add-tracking-bugs,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -r1.2 -r1.2.2.1 --- add-tracking-bugs 5 Nov 2007 22:10:39 -0000 1.2 +++ add-tracking-bugs 7 Nov 2007 16:58:50 -0000 1.2.2.1 @@ -2,6 +2,7 @@
# $Id$ # File a bugs for specified versions and add dependencies +# Lubomir Kundrak lkundrak@redhat.com
my $usage = 'add-cve-bug [options...] --bugs=<bug>[,...] Parent bugs @@ -18,6 +19,8 @@ use Getopt::Long; use Data::Dumper;
+use Libexig::Util; + use warnings; use strict;
@@ -75,18 +78,6 @@ my (@bugs, @versions, $dryrun, $debug, $username, $password, $component);
-# Get password not echoing characters -sub read_noecho -{ - print STDERR @_; - system ('stty -echo'); - my $string = <STDIN>; - system ('stty echo'); - chomp ($string); - print STDERR "\n"; - $string; -} - # Create a bug (unless dryrun) and return its ID sub file_bug { @@ -172,7 +163,7 @@ $debug = ($options{'debug'} or 0); $username = ($options{'username'} or $ENV{'LOGNAME'}.'@redhat.com'); $password = ($options{'password'} or $dryrun or - read_noecho ("Bugzilla password for $username: ")); + Libexig::Util::read_noecho ("Bugzilla password for $username: "));
# Get parent bugs
@@ -220,7 +211,6 @@
# File for each version
-my @tracking_bugs; foreach my $version (@versions) { my %bug = %bug_tmpl; $bug{'short_desc'} .= " [$versions{$version}]";
security-commits@lists.fedoraproject.org