From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RFssk-0005Wa-D0 for garchives@archives.gentoo.org; Mon, 17 Oct 2011 19:29:54 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6479C21C122; Mon, 17 Oct 2011 19:29:22 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 23DE221C123 for ; Mon, 17 Oct 2011 19:29:22 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 829731B403C for ; Mon, 17 Oct 2011 19:29:21 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id ED1F88004F for ; Mon, 17 Oct 2011 19:29:20 +0000 (UTC) From: "Christian Ruppert" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Christian Ruppert" Message-ID: <29e54a9785234a744eec3e82d841edcf239b7722.idl0r@gentoo> Subject: [gentoo-commits] proj/gitolite-gentoo:master commit in: / X-VCS-Repository: proj/gitolite-gentoo X-VCS-Committer: idl0r X-VCS-Committer-Name: Christian Ruppert X-VCS-Revision: 29e54a9785234a744eec3e82d841edcf239b7722 Date: Mon, 17 Oct 2011 19:29:20 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: bd99cce179a954ea9bb9dcbe7c335f53 commit: 29e54a9785234a744eec3e82d841edcf239b7722 Author: Christian Ruppert gentoo org> AuthorDate: Mon Oct 17 19:04:40 2011 +0000 Commit: Christian Ruppert gentoo org> CommitDate: Mon Oct 17 19:04:40 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gitolite-gent= oo.git;a=3Dcommit;h=3D29e54a97 Merge branch 't/per_repo_umask' Conflicts: src/gitolite.pm src/gitolite.pm | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --cc src/gitolite.pm index 924194f,18a820e..3cb87ab --- a/src/gitolite.pm +++ b/src/gitolite.pm @@@ -1297,82 -1256,15 +1296,82 @@@ sub mirror_redirectOK=20 # Gentoo specific stuff # ---------------------------------------------------------------------= ------- =20 +# Find pubkeys recursive +sub find_pubkeys { + my $dir =3D shift; + my $name =3D shift; + my @files =3D (); + my @tmp =3D (); + + opendir(my $dir_fh, $dir) or do { print STDERR "Error opendir(): $!= '$dir'\n"; return @files; }; + foreach my $entry (readdir($dir_fh)) { + next if $entry =3D~ /^\.\.?$/; # Skip . and .. entries. + $entry =3D join("/", $dir, $entry); + + if(-f $entry and $entry =3D~ /\.pub$/) { + if(defined($name) && length($name) > 0) { + my $cmp =3D $entry; + $cmp =3D~ s(.*/)(); + $cmp =3D~ s/\.pub$//; + if($cmp eq $name) { + push(@files, $entry); + next; + } + } + else { + push(@files, $entry); + next; + } + } + if(-d $entry) { + @tmp =3D find_pubkeys($entry, $name); + @files =3D (@files, @tmp); + next; + } + } + + closedir($dir_fh); + + return sort(@files); +} + +sub export_key_metadata { + my $user =3D shift; + + my @tmp =3D find_pubkeys($GL_KEYDIR, $user); + return if $#tmp ne 0; # one pubkey only! + + my $pubkey =3D $tmp[0]; + + return if ! -f $pubkey; + + open(PUBKEY, '<', $pubkey); + while(defined(my $line =3D )) { + chomp($line); + next if $line !~ m/^\s*#/; + $line =3D~ s/^\s*#\s*//; + + my ($variable, $value) =3D split(/:\s*/, $line, 2); + + if(grep(/^\Q${variable}\E$/, @GL_METADATA)) { + if(length($value) > 0) { + $variable =3D~ s/-/_/g; + $ENV{$variable} =3D $value; + } + } + } + close(PUBKEY); +} + sub get_repo_umask { - my $repo =3D shift; + my $repo =3D shift; =20 - return $REPO_UMASK if ! $repo; + return $REPO_UMASK if ! $repo; =20 - do $GL_CONF_COMPILED if ! %repos; + do $GL_CONF_COMPILED if ! %repos; =20 - return $REPO_UMASK if ! $repos{$repo}; - return $repos{$repo}{"umask"} ? $repos{$repo}{"umask"} : $REPO_UMASK; + return $REPO_UMASK if ! $repos{$repo}; + return $repos{$repo}{"umask"} ? $repos{$repo}{"umask"} : $REPO_UMAS= K; } =20 # ---------------------------------------------------------------------= ---------