6 my $home_path = '/data/work/repo.or.cz/site';
8 site_admin
=> 'pasky@ucw.cz',
9 site_domain
=> 'repo.or.cz',
11 bin_path
=> "$home_path/bin",
12 jail_path
=> "$home_path/jail",
13 repomgr_path
=> "$home_path/repomgr",
14 repodata_path
=> "$home_path/repodata",
15 repo_path
=> "$home_path/repos",
17 group_file
=> '/etc/group',
18 user_file
=> '/etc/passwd',
19 sshkeys_path
=> '/etc/sshkeys',
21 my @keys = map { $config[$_ * 2] } 0 .. (@config / 2 - 1);
23 my $config = 'config.txt';
24 my $update = @ARGV && $ARGV[0] eq '-u';
27 open F
, "<$config" or die $!;
31 next if /^\s*$/ || /^#/;
32 my ( $key, $value ) = split(/=/, $_);
33 $config{$key} = $value;
40 my $settings = read_config
if -f
$config;
42 if ($update || ! -f
$config ) {
43 open F
, ">$config" or die $!;
44 print F
"# repository manager site parameters\n";
45 print F
$_, "=", $config{$_}, "\n" for @keys;
53 $line =~ s/\@$_\@/$config{$_}/ for @keys;
57 while (<STDIN
>) { print STDOUT substitute
($_); }