summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Blake Kongslie <jblake@omgwallhack.org>2011-04-27 19:23:03 -0700
committerJulian Blake Kongslie <jblake@omgwallhack.org>2011-04-27 19:23:03 -0700
commit430a5c47e38611704acebba04fac2927a9a0beff (patch)
tree26f1626b3f1ef39058420087909c2aa11855db4f
parent68b72fa62aadbda4e48a4f9075b332583c5b5338 (diff)
parenta4814ee3918f2fba08e2a05bb9bbefc224a14fd7 (diff)
downloadpiny-code-430a5c47e38611704acebba04fac2927a9a0beff.tar.gz
piny-code-430a5c47e38611704acebba04fac2927a9a0beff.zip
Merge branch 'master' of ssh://piny/srv/git/piny-code
-rw-r--r--docs/issues/repo_name_limit.mdwn6
-rw-r--r--libpiny/lib/Piny/Repo.pm14
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 ) = @_;