Changeset 234
- Timestamp:
- Oct 8, 2008, 4:29:29 PM (16 years ago)
- Location:
- trunk/dasscm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dasscm/dasscm
r233 r234 15 15 use File::Path; 16 16 use Term::ReadKey; 17 18 # 19 # used ConfigFile instead of SmartClient::Config, 20 # because the huge amount of SmartClient dependencies 21 #use SmartClient::Config; 22 use ConfigFile; 17 #use Data::Dumper; 23 18 24 19 ##################################################################### … … 32 27 # configuration file 33 28 my $config_file = "/etc/dasscm.conf"; 34 my $config = ConfigFile::read_config_file($config_file);29 my $config = get_config($config_file); 35 30 my $DASSCM_LOCAL_REPOSITORY_BASE; 36 31 my $DASSCM_REPOSITORY_NAME; … … 97 92 exit 1 98 93 } 94 95 sub get_config 96 { 97 my $file = $_[0]; 98 99 if( ! $file ) { 100 fatalerror( "failed to open config file" . $file ); 101 } 102 103 my $data = {}; 104 105 # try to open config file 106 if ( !open( FH, $file ) ) { 107 fatalerror( "failed to open config file" . $file ); 108 } else { 109 while (<FH>) { 110 chomp; 111 if (/^#/) { 112 next; 113 } 114 if ( $_ =~ /=/g ) { 115 ## splitting in 2 fields at maximum 116 my ( $option, $value ) = split( /=/, $_, 2 ); 117 $option =~ s/^\s+//g; 118 $option =~ s/\s+$//g; 119 $option =~ s/\"+//g; 120 $value =~ s/^\s+//g; 121 $value =~ s/\s+$//g; 122 $value =~ s/\"+//g; 123 124 if ( length($option) ) { 125 $data->{$option} = $value; 126 } 127 } 128 } 129 } 130 close(FH); 131 132 return $data; 133 } 134 99 135 100 136 sub check_env() -
trunk/dasscm/dasscm.spec
r232 r234 12 12 Autoreqprov: on 13 13 Summary: dass configuration management tool 14 Version: 0. 714 Version: 0.8 15 15 Release: 0 16 Requires: subversion perl perl-TermReadKey perl-libconfigfile16 Requires: subversion perl perl-TermReadKey 17 17 Source: %{name}-%{version}.tar.bz2 18 18 Packager: joerg.steffens@dass-it.de
Note:
See TracChangeset
for help on using the changeset viewer.