diff options
author | Julian Blake Kongslie <jblake@omgwallhack.org> | 2011-04-27 19:23:03 -0700 |
---|---|---|
committer | Julian Blake Kongslie <jblake@omgwallhack.org> | 2011-04-27 19:23:03 -0700 |
commit | 430a5c47e38611704acebba04fac2927a9a0beff (patch) | |
tree | 26f1626b3f1ef39058420087909c2aa11855db4f /libpiny/lib | |
parent | 68b72fa62aadbda4e48a4f9075b332583c5b5338 (diff) | |
parent | a4814ee3918f2fba08e2a05bb9bbefc224a14fd7 (diff) | |
download | piny-code-430a5c47e38611704acebba04fac2927a9a0beff.tar.gz piny-code-430a5c47e38611704acebba04fac2927a9a0beff.zip |
Merge branch 'master' of ssh://piny/srv/git/piny-code
Diffstat (limited to 'libpiny/lib')
-rw-r--r-- | libpiny/lib/Piny/Repo.pm | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libpiny/lib/Piny/Repo.pm b/libpiny/lib/Piny/Repo.pm index 70595d4..be363bd 100644 --- a/libpiny/lib/Piny/Repo.pm +++ b/libpiny/lib/Piny/Repo.pm @@ -249,7 +249,9 @@ sub rebuild { system( "/usr/bin/git", "clone", "--quiet", $s->path, $s->ikiwiki_srcdir ) and die "Could not clone repo to ikiwiki srcdir!"; }; - foreach( $ikiuser->name, $s->ikiwiki_srcdir, $s->ikiwiki_destdir, $s->secure_path ) { + system( "/usr/bin/find " . $s->ikiwiki_srcdir . " -type d -name .ikiwiki -print0 | xargs -0 --no-run-if-empty rm -r") and die "Could not remove old Ikiwiki state dir!"; + + foreach( $s->ikiwiki_srcdir, $s->ikiwiki_destdir, $s->secure_path ) { unless( -d $_ ) { mkdir( $_ ) }; system( "/bin/chown", "-R", $ikiuser->name . ".", $_ ) and die "Could not change ownership of ikiwiki directories!"; }; @@ -324,9 +326,9 @@ sub destroy { my $ikiuser = Piny::User::IkiWiki->new( "name" => "iki-" . $s->name ); - system( "deluser", "--remove-home", $ikiuser->name ); - system( "delgroup", $ikiuser->name ); - system( "delgroup", "git-" . $s->name ); + system( "deluser", "--remove-home", "iki-" . $s->shortname ); + system( "delgroup", "iki-" . $s->shortname ); + system( "delgroup", $s->group->name ); }; @@ -470,8 +472,8 @@ around BUILDARGS => sub { }; }; -my @letter1 = ( 'a' .. 'z', 'A' .. 'Z' ); # First digit is base 52. -my @lettern = ( '0' .. '9', 'a' .. 'z', 'A' .. 'Z', '-', '_' ); # Remaining digits are base 64. +my @letter1 = ( 'a' .. 'z' ); # First digit is base 26. +my @lettern = ( '0' .. '9', 'a' .. 'z', '-', '_' ); # Remaining digits are base 38. sub _build_shortname { my ( $s ) = @_; |