mise au point du fichier de conf
authorJeremy Laine <jeremy.laine@m4x.org>
Fri, 6 Dec 2002 20:59:07 +0000 (20:59 +0000)
committerJeremy Laine <jeremy.laine@m4x.org>
Fri, 6 Dec 2002 20:59:07 +0000 (20:59 +0000)
deptrack/deptrack.conf [new file with mode: 0644]
deptrack/deptrack.pl

diff --git a/deptrack/deptrack.conf b/deptrack/deptrack.conf
new file mode 100644 (file)
index 0000000..49f9da8
--- /dev/null
@@ -0,0 +1,15 @@
+# default values for ~/.deptrack.conf
+# $Id$
+
+# database
+db_db          =       "deptrack"
+db_host                =       "localhost"
+db_pwd         =       ""
+db_user                =       "deptrack"
+
+# files and masks
+include_path   =       "."
+mask_img       =       "\.(png|gif|jpg)$"
+mask_inc       =       "\.inc(\.php)?$"
+mask_php       =       "(?<!\.inc)\.php$"
+
index 8e4ee35..5b8b306 100755 (executable)
@@ -32,7 +32,7 @@ my($dsn,$dbh);
 
 sub dprint {
   my $text = shift;
-  print STDERR $text if ($debug);
+  print $text if ($debug);
 }
 
 ###############################################################################
@@ -371,7 +371,7 @@ sub init {
   
   # process options
   if ($opts{'d'}){
-    print STDERR "Running in debug mode ...\n";
+    print "Running in debug mode ...\n";
     $debug = 1;
   }else{
     $debug = 0;
@@ -379,18 +379,18 @@ sub init {
  
   if ($opts{'f'}){
     if (-r "$opts{'f'}") {
-      print STDERR "Using $opts{'f'} as config file\n";
+      print "Using $opts{'f'} as config file\n";
       &read_conf("$opts{'f'}");
     } else {
-      print STDERR "$opts{'f'} : not a valid config file\n";
+      print "$opts{'f'} : not a valid config file\n";
       exit(1);
     }
   } else {
-    print STDERR "Using $confile as config file\n";
+    print "Using $confile as config file\n";
     if (-r "$confile") {
        &read_conf("$confile");
     } else {
-      print STDERR "No valid configuration file found, aborting\n";
+      print "No valid configuration file found, aborting\n";
       exit(1);
     }
   }
@@ -412,12 +412,12 @@ sub read_conf {
                                  -LowerCaseNames =>"yes",);
   %conf = $config->getall;
 
-
   $db_db = &read_val("deptrack", $conf{'db_db'});
   $db_host = &read_val("localhost", $conf{'db_host'});
   $db_pwd = &read_val("", $conf{'db_pwd'});
   $db_user = &read_val("deptrack", $conf{'db_user'});
-  @incpath = split /:/, &read_val("./", $conf{'include_path'});
+
+  @incpath = split /:/, &read_val(".", $conf{'include_path'});
   $mask_img = &read_val("\\.(png|gif|jpg)\$", $conf{'mask_img'});
   $mask_inc = &read_val("\\.inc(\\.php)?\$", $conf{'mask_inc'});
   $mask_php = &read_val("(?<!\\.inc)\\.php\$", $conf{'mask_php'});