summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libpiny/lib/Piny/Config.pm1
-rw-r--r--libpiny/lib/Piny/Repo.pm16
2 files changed, 13 insertions, 4 deletions
diff --git a/libpiny/lib/Piny/Config.pm b/libpiny/lib/Piny/Config.pm
index ec86955..0f02921 100644
--- a/libpiny/lib/Piny/Config.pm
+++ b/libpiny/lib/Piny/Config.pm
@@ -259,6 +259,7 @@ tweakable "piny_template" => undef, 'Maybe[PathDir]', 'inhibit';
tweakable "piny_gitpath" => '/srv/git', 'PathDir';
# Repo-specific tweakables, in the repos' .git/config files.
+tweakable "piny_apachereload" => "true", 'GitBool';
tweakable "piny_ikiwiki" => "true", 'GitBool';
tweakable "piny_ikiwikidestdir" => "/srv/www/piny.be/", 'PathDir';
tweakable "piny_ikiwikisrcdir" => "/srv/ikiwiki/", 'PathDir';
diff --git a/libpiny/lib/Piny/Repo.pm b/libpiny/lib/Piny/Repo.pm
index ba1ee09..ffdd9fb 100644
--- a/libpiny/lib/Piny/Repo.pm
+++ b/libpiny/lib/Piny/Repo.pm
@@ -330,7 +330,9 @@ sub rebuild_apache {
$wwwtemp->close or die "Could not close new wikilist: $!";
rename( $wwwtemp->filename, "/etc/apache2/piny/www/" . $s->name ) or die "Could not rename apache config: $!";
- system( "/etc/init.d/apache2", "reload" ) and die "Could not reload apache config!";
+ if ( $s->config->piny_apachereload =~ /^(1|true)$/ ) {
+ system( "/etc/init.d/apache2", "reload" ) and die "Could not reload apache config!";
+ };
};
sub rebuild_ikiwiki {
@@ -415,7 +417,9 @@ sub destroy_apache {
};
};
- system( "/etc/init.d/apache2", "reload" ) and die "Could not reload apache config!";
+ if ( $s->config->piny_apachereload =~ /^(1|true)$/ ) {
+ system( "/etc/init.d/apache2", "reload" ) and die "Could not reload apache config!";
+ };
};
sub destroy_ikiwiki {
@@ -464,7 +468,9 @@ sub _change_owner {
sub all_repos {
my ( $class, $dir ) = @_;
- $dir = $s->config->piny_gitpath unless defined $dir;
+ my $config = Piny::Config->new( );
+
+ $dir = $config->piny_gitpath unless defined $dir;
my @ret;
@@ -577,7 +583,9 @@ sub _build_group {
sub _build_path {
my ( $s ) = @_;
- return $s->config->piny_gitpath . $s->name . ".git";
+ my $config = Piny::Config->new( ); # New, otherwise we'd wind up recursing. It's considered global anyway.
+
+ return $config->piny_gitpath . "/" . $s->name . ".git";
};
sub _build_description {