6 my $home_path = '/data/work/repo.or.cz/site';
8 site_admin
=> 'pasky@ucw.cz',
9 site_domain
=> 'repo.or.cz',
11 web_path
=> "$home_path/www",
12 log_path
=> "/var/log/apache2",
14 bin_path
=> "$home_path/bin",
15 jail_path
=> "$home_path/jail",
16 repomgr_path
=> "$home_path/repomgr",
17 repodata_path
=> "$home_path/repodata",
18 repo_path
=> "$home_path/repos",
20 group_file
=> '/etc/group',
21 user_file
=> '/etc/passwd',
22 sshkeys_path
=> '/etc/sshkeys',
24 doghouse_path
=> '/etc/watchdogs',
26 my @keys = map { $config[$_ * 2] } 0 .. (@config / 2 - 1);
28 my $config = 'config.txt';
29 my $update = @ARGV && $ARGV[0] eq '-u';
32 open F
, "<$config" or die $!;
36 next if /^\s*$/ || /^#/;
37 my ( $key, $value ) = split(/=/, $_);
38 $config{$key} = $value;
45 my $settings = read_config
if -f
$config;
47 if ($update || ! -f
$config ) {
48 open F
, ">$config" or die $!;
49 print F
"# repository manager site parameters\n";
50 print F
$_, "=", $config{$_}, "\n" for @keys;
58 $line =~ s/\@$_\@/$config{$_}/ for @keys;
62 while (<STDIN
>) { print STDOUT substitute
($_); }