e-smith-ingo/createlinks

62 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

#!/usr/bin/perl -w
use File::Basename;
use File::Path;
use esmith::Build::CreateLinks qw(:all);
sub safe_touch
{
my ($path) = @_;
my ($file, $dir) = fileparse $path;
unless (-d $dir)
{
mkpath $dir or die "Could not create dir $dir: $!";
}
open(F, ">$path") or die "Could not open/create file $path: $!";
close(F) or die "Could not close file $path: $!";
}
# Prime the empty file tree that the generic template expansion
# action uses
sub templates2events
{
my ($path, @events) = @_;
foreach (@events)
{
safe_touch "root/etc/e-smith/events/$_/templates2expand/$path";
}
}
# conf-ingo
foreach (qw(conf.php backends.php prefs.php))
{
templates2events("/home/httpd/html/horde/ingo/config/$_",
qw(
bootstrap-console-save
email-update
));
}
foreach (qw(
78mysql.create.ingo
79ingo_upgrade
))
{
templates2events(
"/etc/e-smith/sql/init/$_",
qw(post-install post-upgrade));
}
foreach (qw(conf.php prefs.php backends.php))
{
safe_symlink("/etc/e-smith/templates-default/template-begin-php",
"root/etc/e-smith/templates/home/httpd/html/horde/ingo/config/$_/template-begin");
safe_symlink("/etc/e-smith/templates-default/template-end-php",
"root/etc/e-smith/templates/home/httpd/html/horde/ingo/config/$_/template-end");
}