diff options
-rw-r--r-- | docs/issues/repo_name_limit.mdwn | 6 | ||||
-rw-r--r-- | libpiny/lib/Piny/Repo.pm | 14 |
2 files changed, 13 insertions, 7 deletions
diff --git a/docs/issues/repo_name_limit.mdwn b/docs/issues/repo_name_limit.mdwn index 7b42eb6..15b4023 100644 --- a/docs/issues/repo_name_limit.mdwn +++ b/docs/issues/repo_name_limit.mdwn @@ -1,4 +1,4 @@ -* Status: [[!taglink open]] <!-- Choose one: open, closed --> +* Status: [[!taglink closed]] <!-- Choose one: open, closed --> * Assigned to: [[!taglink jrayhawk]], [[!taglink jblake]] <!-- Choose one or more: jrayhawk, jblake --> * Priority: [[!taglink now]] <!-- Choose one: now, soon, later --> * Opened by: jrayhawk @@ -11,3 +11,7 @@ Possible solution: optional use of truncated md5 (the first character needing to ## 20110424 jrayhawk Added 31-character limit to usernames, still need to do the rest. + +## 20110427 jrayhawk + +seems to be working; closing 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 ) = @_; |