From bfffd588f6ea2184324b5ab11f1189b8d6b262f1 Mon Sep 17 00:00:00 2001 From: Joe Rayhawk Date: Wed, 27 Apr 2011 18:23:33 -0700 Subject: Make sure shortname refs get fully evaluated. --- libpiny/lib/Piny/Repo.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libpiny/lib/Piny/Repo.pm b/libpiny/lib/Piny/Repo.pm index dc4e5c1..25bd744 100644 --- a/libpiny/lib/Piny/Repo.pm +++ b/libpiny/lib/Piny/Repo.pm @@ -376,13 +376,13 @@ sub create { mkdir( $repo->path ) or die "The repo $name appears to already exist! ($!)"; - system( "/usr/sbin/adduser", "--quiet", "--system", "--group", "--gecos", $name, "iki-$repo->shortname" ) and die "Could not create ikiwiki user!"; + system( "/usr/sbin/adduser", "--quiet", "--system", "--group", "--gecos", $name, "iki-" . $repo->shortname ) and die "Could not create ikiwiki user!"; + + my $ikiuser = Piny::User::IkiWiki->new( "name" => "iki-" . $repo->shortname ); - my $ikiuser = Piny::User::IkiWiki->new( "name" => "iki-$repo->shortname" ); + system( "/usr/sbin/addgroup", "--quiet", "git-" . $repo->shortname ) and die "Could not create repo group!"; - system( "/usr/sbin/addgroup", "--quiet", "git-$repo->shortname" ) and die "Could not create repo group!"; - - my $group = Piny::Group->new( "name" => "git-$repo->shortname" ); + my $group = Piny::Group->new( "name" => "git-" . $repo->shortname ); system( "/usr/sbin/adduser", "--quiet", $user->name, $group->name ) and die "Could not add you to the repo group!"; system( "/usr/sbin/adduser", "--quiet", $ikiuser->name, $group->name ) and die "Could not add ikiwiki user to the repo group!"; -- cgit v1.2.3