From ec127b2557ab185874f11e1f348f3918395fba46 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Fri, 15 Oct 2010 20:49:17 -0700 Subject: Fix some error handling. --- usr/src/libpiny/lib/Piny/Repo.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'usr/src/libpiny/lib/Piny/Repo.pm') diff --git a/usr/src/libpiny/lib/Piny/Repo.pm b/usr/src/libpiny/lib/Piny/Repo.pm index 1880ee2..003be93 100644 --- a/usr/src/libpiny/lib/Piny/Repo.pm +++ b/usr/src/libpiny/lib/Piny/Repo.pm @@ -204,10 +204,10 @@ sub rebuild { }; foreach( "info", "logs" ) { - (-e $s->path . "/" . $_) or mkdir( $s->path . "/" . $_ ) and die "Could not mkdir $_ for repo: $!"; + (-e $s->path . "/" . $_) or mkdir( $s->path . "/" . $_ ) or die "Could not mkdir $_ for repo: $!"; }; - chown( 0, 0, $s->path, $s->path . '/config' ) and die "Could not change ownership of git dir!"; + chown( 0, 0, $s->path, $s->path . '/config' ) or die "Could not change ownership of git dir!"; foreach( "branches", "description", "HEAD", "info", "logs", "objects", "packed-refs", "refs" ) { system( "/bin/chown", "-R", $s->owner->name . "." . $s->group->name, $s->path . "/" . $_ ) and die "Could not change ownership of $_ for repo: $!"; @@ -430,7 +430,7 @@ sub create { }; foreach( "info", "logs" ) { - mkdir( $repo->path . "/" . $_ ) and die "Could not mkdir $_ for repo: $!"; + ( -e $repo->path . "/" . $_ ) or mkdir( $repo->path . "/" . $_ ) or die "Could not mkdir $_ for repo: $!"; }; @@ -438,7 +438,7 @@ sub create { system( "/bin/chown", "-R", $user->name . "." . $group->name, $repo->path . "/" . $_ ) and die "Could not change ownership of $_ for repo: $!"; }; - chown( 0, 0, $repo->path, $repo->path . '/config' ) and die "Could not change ownership of git dir!"; + chown( 0, 0, $repo->path, $repo->path . '/config' ) or die "Could not change ownership of git dir!"; system( "/bin/chown", "-R", $ikiuser->name . "." . $ikiuser->name, $repo->path . "/hooks" ) and die "Could not change ownership of git hooks!"; -- cgit v1.2.3