From 4d947573b09437f9b5757b871bd3776c5f1ff46d Mon Sep 17 00:00:00 2001 From: Joe Rayhawk Date: Sat, 7 May 2011 00:21:19 -0700 Subject: Split destroy into destroy_ikiwiki and destroy_git so we can be a bit more selective --- libpiny/lib/Piny/Repo.pm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'libpiny/lib/Piny/Repo.pm') diff --git a/libpiny/lib/Piny/Repo.pm b/libpiny/lib/Piny/Repo.pm index 4f520b8..86abc45 100644 --- a/libpiny/lib/Piny/Repo.pm +++ b/libpiny/lib/Piny/Repo.pm @@ -212,6 +212,7 @@ sub rebuild { my ( $s ) = @_; $s->rebuild_git; + $s->destroy_ikiwiki; $s->rebuild_ikiwiki; }; @@ -310,6 +311,18 @@ sub rebuild_ikiwiki { sub destroy { my ( $s ) = @_; + $s->destroy_ikiwiki; + $s->destroy_git; +}; + +sub destroy_git { + my ( $s ) = @_; + system( "rm", "-rf", $s->path ); +}; + +sub destroy_ikiwiki { + my ( $s ) = @_; + my $user = Piny::Environment->instance->user; unlink( "/etc/apache2/piny-enabled/" . $s->name ); @@ -336,7 +349,7 @@ sub destroy { rename( $temp->filename, "/etc/ikiwiki/wikilist" ) or die "Could not rename over old wikilist: $!"; - system( "rm", "-rf", $s->secure_path, $s->ikiwiki_destdir, $s->ikiwiki_srcdir, "/etc/ikiwiki/piny/" . $s->name . ".setup", $s->path ); + system( "rm", "-rf", $s->secure_path, $s->ikiwiki_destdir, $s->ikiwiki_srcdir, "/etc/ikiwiki/piny/" . $s->name . ".setup" ); my $ikiuser = Piny::User::IkiWiki->new( "name" => "iki-" . $s->name ); -- cgit v1.2.3