gforge-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gforge-commits] gforge/utils fill-in-the-blanks.pl,1.1,1.2


From: cbayle
Subject: [Gforge-commits] gforge/utils fill-in-the-blanks.pl,1.1,1.2
Date: Thu, 15 Apr 2004 03:40:11 -0500

Update of /cvsroot/gforge/gforge/utils
In directory db.perdue.net:/tmp/cvs-serv13331/utils

Modified Files:
        fill-in-the-blanks.pl 
Log Message:
Enhancement to be able to use more than one conf file


Index: fill-in-the-blanks.pl
===================================================================
RCS file: /cvsroot/gforge/gforge/utils/fill-in-the-blanks.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- fill-in-the-blanks.pl       24 Nov 2003 23:29:55 -0000      1.1
+++ fill-in-the-blanks.pl       15 Apr 2004 08:40:09 -0000      1.2
@@ -8,11 +8,11 @@
 
 if ($#ARGV < 1) {
     print STDERR "Missing parameter.\n\n" ;
-    print STDERR "Usage: fill-in-the-blanks.pl <in-template> <out-file> 
[<conf_file>]\n" ;
+    print STDERR "Usage: fill-in-the-blanks.pl <in-template> <out-file> 
[<conf_files>]\n" ;
     exit 1 ;
 }
 
-if ($#ARGV == 2) {
+if ($#ARGV >= 2) {
        $ifile = shift @ARGV ;
        $ofile = shift @ARGV ;
        $cfile = shift @ARGV ;
@@ -31,6 +31,19 @@
     $hash{$key} = $val ;
 }
 close CONF ;
+
+while ($#ARGV > -1 ) {
+       $cfile = shift @ARGV ;
+       open CONF, "$cfile" ;
+       while ($line = <CONF>) {
+               chomp $line ;
+               next if $line =~ m/^\s*#/ ;
+               ($key, $val) = split ('=', $line, 2) ;
+               $hash{$key} = $val ;
+       }
+       close CONF ;
+}
+
 $hash{"PLEASE DO NOT REMOVE THIS LINE"} =
     "Do not edit this file, edit /etc/gforge/templates/* and run 
gforge-config" ;
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]