diff options
author | Joe Rayhawk <jrayhawk@omgwallhack.org> | 2011-05-07 00:21:19 -0700 |
---|---|---|
committer | Joe Rayhawk <jrayhawk@omgwallhack.org> | 2011-05-07 00:21:19 -0700 |
commit | 4d947573b09437f9b5757b871bd3776c5f1ff46d (patch) | |
tree | d0b64e957d3da96a97b1c0083aa4a10ceef48e45 /libpiny | |
parent | e95abb17142830142641ef14266ddcbdaa919dcd (diff) | |
download | piny-code-4d947573b09437f9b5757b871bd3776c5f1ff46d.tar.gz piny-code-4d947573b09437f9b5757b871bd3776c5f1ff46d.zip |
Split destroy into destroy_ikiwiki and destroy_git so we can be a bit more selective
Diffstat (limited to 'libpiny')
-rw-r--r-- | libpiny/lib/Piny/Repo.pm | 15 |
1 files changed, 14 insertions, 1 deletions
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 ); |