diff options
author | Joe Rayhawk <jrayhawk@omgwallhack.org> | 2010-10-16 00:48:47 -0700 |
---|---|---|
committer | Joe Rayhawk <jrayhawk@omgwallhack.org> | 2010-10-16 00:48:47 -0700 |
commit | dc581b0f8ca95e112654b47bbeeea9b23f0b2a1f (patch) | |
tree | 8a518e58523dbd306afdfb3bd875d1e9c0e5bb20 /usr | |
parent | ec127b2557ab185874f11e1f348f3918395fba46 (diff) | |
download | piny-code-dc581b0f8ca95e112654b47bbeeea9b23f0b2a1f.tar.gz piny-code-dc581b0f8ca95e112654b47bbeeea9b23f0b2a1f.zip |
Eliminating almost all cgit configuration and cleaning up some inconsistent style.
Diffstat (limited to 'usr')
-rw-r--r-- | usr/src/libpiny/lib/Piny/Repo.pm | 47 |
1 files changed, 4 insertions, 43 deletions
diff --git a/usr/src/libpiny/lib/Piny/Repo.pm b/usr/src/libpiny/lib/Piny/Repo.pm index 003be93..6df1e03 100644 --- a/usr/src/libpiny/lib/Piny/Repo.pm +++ b/usr/src/libpiny/lib/Piny/Repo.pm @@ -207,7 +207,7 @@ sub rebuild { (-e $s->path . "/" . $_) or mkdir( $s->path . "/" . $_ ) or die "Could not mkdir $_ for repo: $!"; }; - chown( 0, 0, $s->path, $s->path . '/config' ) or 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: $!"; @@ -242,26 +242,7 @@ sub rebuild { rename( $temp->filename, "/etc/ikiwiki/wikilist" ) or die "Could not rename over old wikilist: $!"; - open( CGITLIST, ">", "/etc/cgitrc.d/" . $s->name ) or die "Could not create cgitrc.d file: $!"; - print CGITLIST "repo.url=" . $s->name . "\nrepo.path=" . $s->path . "\nrepo.owner=" . $s->owner->email->address . "\n\n"; - close( CGITLIST ) or die "Could not close cgitrc.d file: $!"; - - $temp = File::Temp->new( ) or die "Could not create temporary file: $!"; - $temp->unlink_on_destroy( 0 ); - - $dh = IO::Dir->new( "/etc/cgitrc.d" ) or die "Could not open cgitrc.d directory: $!"; - while ( defined ( my $entry = $dh->read ) ) { - next if ( $entry =~ /^\./ ); - open( FILE, "<", "/etc/cgitrc.d/" . $entry ) or die "Could not open cgitrc.d entry $entry: $!"; - print $temp <FILE>; - close( FILE ) or die "Could not close cgitrc.d entry $entry: $!"; - }; - - $temp->close or die "Could not close new cgitrc: $!"; - - chmod( 00644, $temp->filename ) or die "Could not fix mode of new cgitrc: $!"; - - rename( $temp->filename, "/etc/cgitrepos" ) or die "Could not rename over old cgitrc: $!"; + system( "/usr/bin/git", "config", "gitweb.owner", $s->owner->email->address ) and die "Could not git config gitweb.owner!"; system( "/usr/bin/sudo", "-u", $ikiuser->name, "/usr/bin/ikiwiki", "--setup", "/etc/ikiwiki/piny/" . $s->name . ".setup" ) and die "Could not do initial compile of ikiwiki!"; @@ -433,12 +414,11 @@ sub create { ( -e $repo->path . "/" . $_ ) or mkdir( $repo->path . "/" . $_ ) or die "Could not mkdir $_ for repo: $!"; }; - foreach( "branches", "description", "HEAD", "info", "logs", "objects", "packed-refs", "refs" ) { 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' ) or 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!"; @@ -474,26 +454,7 @@ sub create { rename( $temp->filename, "/etc/ikiwiki/wikilist" ) or die "Could not rename over old wikilist: $!"; - open( CGITLIST, ">", "/etc/cgitrc.d/" . $repo->name ) or die "Could not create cgitrc.d file: $!"; - print CGITLIST "repo.url=" . $repo->name . "\nrepo.path=" . $repo->path . "\nrepo.owner=" . $repo->owner->email->address . "\n\n"; - close( CGITLIST ) or die "Could not close cgitrc.d file: $!"; - - $temp = File::Temp->new( ) or die "Could not create temporary file: $!"; - $temp->unlink_on_destroy( 0 ); - - $dh = IO::Dir->new( "/etc/cgitrc.d" ) or die "Could not open cgitrc.d directory: $!"; - while ( defined ( my $entry = $dh->read ) ) { - next if ( $entry =~ /^\./ ); - open( FILE, "<", "/etc/cgitrc.d/" . $entry ) or die "Could not open cgitrc.d entry $entry: $!"; - print $temp <FILE>; - close( FILE ) or die "Could not close cgitrc.d entry $entry: $!"; - }; - - $temp->close or die "Could not close new cgitrc: $!"; - - chmod( 00644, $temp->filename ) or die "Could not fix mode of new cgitrc: $!"; - - rename( $temp->filename, "/etc/cgitrepos" ) or die "Could not rename over old cgitrc: $!"; + system( "/usr/bin/git", "config", "gitweb.owner", $repo->owner->email->address ) and die "Could not git config gitweb.owner!"; system( "/usr/bin/sudo", "-u", $ikiuser->name, "/usr/bin/ikiwiki", "--setup", "/etc/ikiwiki/piny/" . $repo->name . ".setup" ) and die "Could not do initial compile of ikiwiki!"; |