]> git.donarmstrong.com Git - debbugs.git/blob - debbugs-dump
[project @ 2000-04-30 10:25:27 by doogie]
[debbugs.git] / debbugs-dump
1 #!/usr/bin/perl -w
2
3 push(@INC,'/home/gecko/debian/debvote');
4 push(@INC,'/debian/home/doogie/debian/debbugs/cvs');
5 use strict;
6 use Debbugs::Config qw(%Globals &ParseConfigFile);
7 #use Debvote::Email qw(&InitEmailTags &LoadEmail &ProcessTags %gtags);
8 use Debbugs::DBase;
9 use Getopt::Long;
10
11 #############################################################################
12 #  Customization Variables
13 #############################################################################
14
15 #############################################################################
16 #  Gloabal Variable Declaration
17 #############################################################################
18 my $VERSION = '3.01';                                           #External Version number
19 my $BANNER = "DebBugs v$VERSION";                       #Version Banner - text form
20 my $FILE = 'debbugs-dump';                                      #File name
21 my $config = '';
22 my @config = undef;
23
24 #############################################################################
25 #  Commandline parsing
26 #############################################################################
27 # Hash used to process commandline options
28 my $verbose = 0;
29 my $quiet = 0;
30 my $debug = 0;
31 my %opthash = (# ------------------ actions
32     "config|c=s" => \$config,
33     "help|h" => \&syntax,
34     "version|V" => \&banner,
35     "verbose|v!" => \$verbose,
36     "quiet|q!" => \$quiet,
37     "debug|d" => \$debug,     # Count the -d flags
38     );
39 Getopt::Long::config('bundling', 'no_getopt_compat', 'no_auto_abbrev');
40 GetOptions(%opthash) or &syntax( 1 );
41 if ( $debug > 1 )
42 {       print "D2: Commandline:\n";
43         print "\tconfig = $config\n" unless $config eq '';
44         print "\tverbos\n" if $verbose;
45         print "\tquiet\n" if $quiet;
46         print "\tdebug  = $debug\n";
47 }
48 $Globals{ 'debug' } = $debug;
49 $Globals{ 'quiet' } = $quiet;
50 $Globals{ 'verbose' } = $verbose;
51
52 #############################################################################
53 #  Read Config File and parse
54 #############################################################################
55 $config = "./debbugs.cfg" if( $config eq '' );
56 print "D1: config file=$config\n" if $Globals{ 'debug' };
57 @config = ParseConfigFile( $config );
58
59 ## Put Real Code Here
60
61 Debbugs::DBase::OpenRecord( "59998" );
62 Debbugs::DBase::ReadRecord( "59998" );
63 Debbugs::DBase::CloseRecord();
64 foreach my $key ( keys( %Record ) )
65 {
66     print "Key= $key   Value = ". $Record{ "$key" } . "\n";
67 }
68 Debbugs::DBase::OpenRecord( "60003" );
69 Debbugs::DBase::ReadRecord( "60003" );
70 Debbugs::DBase::CloseRecord();
71 foreach my $key ( keys( %Record ) )
72 {
73     print "Key= $key   Value = ". $Record{ "$key" } . "\n";
74 }
75
76
77 #############################################################################
78 #  Ack Back
79 #############################################################################
80
81 sub syntax {
82   print "$BANNER\n";
83   print <<"EOT-EOT-EOT";
84 Syntax: $FILE [options]
85     -c, --config CFGFILE      read CFGFILE for configuration (default=./debvote.cfg)
86     -h, --help                display this help text
87     -v, --verbose             verbose messages
88     -q, --quiet               cancels verbose in a config file
89     -V, --version             display Debvote version and exit
90     -d, --debug               turn debug messages ON (multiple -d for more verbose)
91 EOT-EOT-EOT
92
93   exit $_[0];
94 }