summaryrefslogtreecommitdiff
path: root/libpiny
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk@omgwallhack.org>2014-03-16 21:22:00 -0700
committerJoe Rayhawk <jrayhawk@omgwallhack.org>2014-03-16 21:22:00 -0700
commit23e5fca9cb8f3ed34b7d31d5330088b650d45788 (patch)
tree3e90c311acf326a8be911ac9c45e123aef475c6a /libpiny
parent5532bcd9c3852203b8d2280b92e0a254eaf7b694 (diff)
parent74f36e7294764b136514b2ed67b9345fdc6e1e44 (diff)
downloadpiny-code-23e5fca9cb8f3ed34b7d31d5330088b650d45788.tar.gz
piny-code-23e5fca9cb8f3ed34b7d31d5330088b650d45788.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'libpiny')
-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 {