Initial commit: Imported yaala 0.7.3.
[yaala.git] / lib / Yaala / Report / Core.pm
1 package Yaala::Report::Core;
2
3 use strict;
4 use warnings;
5 use vars qw#$OUTPUTDIR#;
6
7 use Exporter;
8 use Yaala::Config qw#get_config#;
9
10 @Yaala::Report::Core::EXPORT_OK = qw#$OUTPUTDIR#;
11 @Yaala::Report::Core::ISA = ('Exporter');
12
13 my $VERSION = '$Id: Core.pm,v 1.5 2003/12/07 14:53:30 octo Exp $';
14 print STDERR $/, __FILE__, ": $VERSION" if ($::DEBUG);
15
16 $OUTPUTDIR = get_config ('directory');
17 if ($OUTPUTDIR)
18 {
19         $OUTPUTDIR =~ s#/$##;
20         if (!-d $OUTPUTDIR)
21         {
22                 print STDERR $/, __FILE__, qq#: Directory "$OUTPUTDIR" does not exist.\n#;
23                 exit (1);
24         }
25         $OUTPUTDIR .= '/';
26 }
27 elsif (-d 'reports')
28 {
29         $OUTPUTDIR = 'reports/';
30 }
31 else
32 {
33         print STDERR $/, __FILE__, ": Unknown output directory. Using current ",
34                 "directory instead!",
35                 $/, __FILE__, ": To abort press CTRL+c within the next 10 secons";
36         
37         sleep 10;
38
39         $OUTPUTDIR = './';
40 }
41
42 return (1);