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 1Q3DF3-0004tu-EU for garchives@archives.gentoo.org; Fri, 25 Mar 2011 20:04:18 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A5A121C162; Fri, 25 Mar 2011 20:00:04 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 4EA6F1C162 for ; Fri, 25 Mar 2011 19:59:59 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id F0DF91BC108 for ; Fri, 25 Mar 2011 19:59:58 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 5DDC680072 for ; Fri, 25 Mar 2011 19:59:58 +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: <7b847f5884187c8ae490e521b6d95c47a7556641.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: 7b847f5884187c8ae490e521b6d95c47a7556641 Date: Fri, 25 Mar 2011 19:59:58 +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: 8d3a8a35a571707db6f8a24d0bfbf5cd commit: 7b847f5884187c8ae490e521b6d95c47a7556641 Author: Christian Ruppert gentoo org> AuthorDate: Fri Mar 25 19:26:06 2011 +0000 Commit: Christian Ruppert gentoo org> CommitDate: Fri Mar 25 19:26:06 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gitolite-gent= oo.git;a=3Dcommit;h=3D7b847f58 Merge commit 'refs/top-bases/t/export_key_metadata-function' into t/expor= t_key_metadata-function README.mkd | 30 +- conf/example.conf | 243 +--------- conf/example.gitolite.rc | 26 +- contrib/adc/able | 20 +- contrib/adc/adc.common-functions | 5 + contrib/adc/fork | 9 +- contrib/adc/get-rights-and-owner.in-perl | 15 +- contrib/adc/git | 123 +++++ contrib/adc/gl-reflog | 8 +- contrib/adc/hub | 443 +++++++++++++++++ contrib/adc/hub.mkd | 202 ++++++++ contrib/adc/perms | 115 +++++ contrib/adc/pygitolite.py | 77 +++ contrib/adc/rm | 4 +- contrib/adc/set-head | 17 + contrib/adc/who-pushed | 2 +- contrib/autotoc | 35 -- contrib/gerrit.mkd | 2 +- contrib/gitolite-tools.mkd | 2 +- contrib/gitweb/gitweb.conf | 44 ++- contrib/ldap/README.mkd | 6 +- contrib/vim/README.mkd | 2 +- doc/1-INSTALL.mkd | 53 ++- doc/2-admin.mkd | 56 ++- doc/3-faq-tips-etc.mkd | 285 ++---------- doc/CHANGELOG | 22 + doc/admin-defined-commands.mkd | 14 +- doc/big-config.mkd | 14 +- doc/delegation.mkd | 10 +- doc/developer-notes.mkd | 213 ++++++++ doc/gitolite.conf.mkd | 469 ++++++++++++++++++ doc/gitolite.rc.mkd | 62 ++- doc/hook-propagation.mkd | 4 +- doc/http-backend.mkd | 142 +++++-- doc/migrate.mkd | 10 +- doc/mirroring.mkd | 21 +- doc/mob-branches.mkd | 2 +- doc/monkeysphere.mkd | 2 + doc/overkill.mkd | 2 +- doc/packaging.mkd | 2 +- doc/progit-article.mkd | 14 +- doc/report-output.mkd | 19 + doc/shell-games.mkd | 25 +- doc/ssh-troubleshooting.mkd | 42 ++- doc/uninstall.mkd | 2 +- doc/who-uses-it.mkd | 4 +- doc/wildcard-repositories.mkd | 17 +- hooks/common/gl-pre-git.hub-sample | 10 + hooks/common/update | 62 +-- hooks/gitolite-admin/post-update | 8 +- src/gitolite.pm | 775 +++++++++++++++---------= ------ src/gitolite_env.pm | 157 ++++++ src/gitolite_rc.pm | 72 +++ src/gl-auth-command | 235 +++------ src/gl-compile-conf | 141 ++---- src/gl-dont-panic | 17 +- src/gl-easy-install | 16 +- src/gl-install | 33 +- src/gl-mirror-shell | 13 +- src/gl-mirror-sync | 4 +- src/gl-query-rc | 23 + src/gl-setup | 47 ++- src/gl-setup-authkeys | 64 ++-- src/gl-time | 30 +- src/gl-tool | 9 +- src/sshkeys-lint | 6 +- t/README.mkd | 11 +- t/t53-check-info-expand-output | 16 + t/t64-write-able | 11 +- t/t65-rsync | 83 ++++ t/t67-hub | 174 +++++++ t/test-driver.sh | 73 ++-- 72 files changed, 3485 insertions(+), 1541 deletions(-) diff --cc src/gitolite.pm index 9945e91,a880037..f32bcf0 --- a/src/gitolite.pm +++ b/src/gitolite.pm @@@ -1205,32 -1186,6 +1186,34 @@@ sub find_pubkeys=20 return sort(@files); } =20 +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); +} + + # ---------------------------------------------------------------------= --------- + # per perl rules, this should be the last line in such a file: 1; diff --cc src/gitolite_rc.pm index 0000000,09cd172..132fc90 mode 000000,100644..100644 --- a/src/gitolite_rc.pm +++ b/src/gitolite_rc.pm @@@ -1,0 -1,70 +1,72 @@@ + # stuff to help pull in the rc file, plus various constants +=20 + package gitolite_rc; + use Exporter 'import'; +=20 + # the first set (before the blank line) are constants defined right her= e in + # this program. The second set are from the 'rc'; We're clubbing all i= n + # because they're all "constants" in a programmatic sense + @EXPORT =3D qw( + $ABRT $WARN + $R_COMMANDS $W_COMMANDS + $REPONAME_PATT $USERNAME_PATT $REPOPATT_PATT + $ADC_CMD_ARGS_PATT + $current_data_version +=20 + $ADMIN_POST_UPDATE_CHAINS_TO $ENV $GITOLITE_BASE $GITOLITE_PATH $GI= T_PATH + $GL_ADC_PATH $GL_ADMINDIR $GL_ALL_INCLUDES_SPECIAL $GL_ALL_READ_ALL + $GL_BIG_CONFIG $GL_CONF $GL_CONF_COMPILED $GL_GET_MEMBERSHIPS_PGM + $GL_GITCONFIG_KEYS $GL_GITCONFIG_WILD $GL_KEYDIR $GL_LOGT $GL_NICE_= VALUE + $GL_NO_CREATE_REPOS $GL_NO_DAEMON_NO_GITWEB $GL_NO_SETUP_AUTHKEYS + $GL_PACKAGE_CONF $GL_PACKAGE_HOOKS $GL_PERFLOGT $GL_SITE_INFO + $GL_SLAVE_MODE $GL_WILDREPOS $GL_WILDREPOS_DEFPERMS + $GL_WILDREPOS_PERM_CATS $HTPASSWD_FILE $PROJECTS_LIST $REPO_BASE + $REPO_UMASK $RSYNC_BASE $SVNSERVE $UPDATE_CHAINS_TO +=20 + $GL_HTTP_ANON_USER ++ ++ @GL_METADATA + ); +=20 + # ---------------------------------------------------------------------= --------- + # real constants + # ---------------------------------------------------------------------= --------- +=20 + $current_data_version =3D '1.7'; +=20 + $ABRT =3D "\n\t\t***** ABORTING *****\n "; + $WARN =3D "\n\t\t***** WARNING *****\n "; +=20 + # commands we're expecting + $R_COMMANDS=3Dqr/^(git[ -]upload-pack|git[ -]upload-archive)$/; + $W_COMMANDS=3Dqr/^git[ -]receive-pack$/; +=20 + # note that REPONAME_PATT allows "/", while USERNAME_PATT does not + # also, the reason REPONAME_PATT is a superset of USERNAME_PATT is (duh= !) + # because a repo can have "CREATOR" in the name + $REPONAME_PATT=3Dqr(^\@?[0-9a-zA-Z][0-9a-zA-Z._\@/+-]*$); + $USERNAME_PATT=3Dqr(^\@?[0-9a-zA-Z][0-9a-zA-Z._\@+-]*$); + # same as REPONAME, but used for wildcard repos, allows some common reg= ex metas + $REPOPATT_PATT=3Dqr(^\@?[0-9a-zA-Z[][\\^.$|()[\]*+?{}0-9a-zA-Z._\@/-]*$= ); +=20 + # ADC commands and arguments must match this pattern + $ADC_CMD_ARGS_PATT=3Dqr(^[0-9a-zA-Z._\@/+:-]*$); +=20 + # ---------------------------------------------------------------------= --------- + # bring in the rc vars and allow querying them + # ---------------------------------------------------------------------= --------- +=20 + # in case we're running under Apache using smart http + $ENV{HOME} =3D $ENV{GITOLITE_HTTP_HOME} if $ENV{GITOLITE_HTTP_HOME}; +=20 + # we also need to "bring in" the rc variables. The rc can only be in o= ne of + # these two places; the first one we find, wins + for ("$ENV{HOME}/.gitolite.rc", "/etc/gitolite/gitolite.rc") { + $ENV{GL_RC} ||=3D $_ if -f; + } + die "no rc file found\n" unless $ENV{GL_RC}; + do $ENV{GL_RC} or die "error parsing $ENV{GL_RC}\n"; +=20 + # ---------------------------------------------------------------------= --------- + # per perl rules, this should be the last line in such a file: + 1; 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 1Q3DFU-0004yt-OM for garchives@archives.gentoo.org; Fri, 25 Mar 2011 20:04:44 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 495781C17C; Fri, 25 Mar 2011 20:00:16 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 070B31C17C for ; Fri, 25 Mar 2011 20:00:15 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 676232AC019 for ; Fri, 25 Mar 2011 20:00:10 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id C4C8E8006D for ; Fri, 25 Mar 2011 20:00:09 +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: <7b847f5884187c8ae490e521b6d95c47a7556641.idl0r@gentoo> Subject: [gentoo-commits] proj/gitolite-gentoo:t/export_key_metadata-function commit in: / X-VCS-Repository: proj/gitolite-gentoo X-VCS-Committer: idl0r X-VCS-Committer-Name: Christian Ruppert X-VCS-Revision: 7b847f5884187c8ae490e521b6d95c47a7556641 Date: Fri, 25 Mar 2011 20:00:09 +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: d467d23dded3fe2323df6c203475b300 Message-ID: <20110325200009.rU5i-yoARt99ICyx6zDv2nAA9HW-bq0fqW-he1xEbnY@z> commit: 7b847f5884187c8ae490e521b6d95c47a7556641 Author: Christian Ruppert gentoo org> AuthorDate: Fri Mar 25 19:26:06 2011 +0000 Commit: Christian Ruppert gentoo org> CommitDate: Fri Mar 25 19:26:06 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gitolite-gent= oo.git;a=3Dcommit;h=3D7b847f58 Merge commit 'refs/top-bases/t/export_key_metadata-function' into t/expor= t_key_metadata-function README.mkd | 30 +- conf/example.conf | 243 +--------- conf/example.gitolite.rc | 26 +- contrib/adc/able | 20 +- contrib/adc/adc.common-functions | 5 + contrib/adc/fork | 9 +- contrib/adc/get-rights-and-owner.in-perl | 15 +- contrib/adc/git | 123 +++++ contrib/adc/gl-reflog | 8 +- contrib/adc/hub | 443 +++++++++++++++++ contrib/adc/hub.mkd | 202 ++++++++ contrib/adc/perms | 115 +++++ contrib/adc/pygitolite.py | 77 +++ contrib/adc/rm | 4 +- contrib/adc/set-head | 17 + contrib/adc/who-pushed | 2 +- contrib/autotoc | 35 -- contrib/gerrit.mkd | 2 +- contrib/gitolite-tools.mkd | 2 +- contrib/gitweb/gitweb.conf | 44 ++- contrib/ldap/README.mkd | 6 +- contrib/vim/README.mkd | 2 +- doc/1-INSTALL.mkd | 53 ++- doc/2-admin.mkd | 56 ++- doc/3-faq-tips-etc.mkd | 285 ++---------- doc/CHANGELOG | 22 + doc/admin-defined-commands.mkd | 14 +- doc/big-config.mkd | 14 +- doc/delegation.mkd | 10 +- doc/developer-notes.mkd | 213 ++++++++ doc/gitolite.conf.mkd | 469 ++++++++++++++++++ doc/gitolite.rc.mkd | 62 ++- doc/hook-propagation.mkd | 4 +- doc/http-backend.mkd | 142 +++++-- doc/migrate.mkd | 10 +- doc/mirroring.mkd | 21 +- doc/mob-branches.mkd | 2 +- doc/monkeysphere.mkd | 2 + doc/overkill.mkd | 2 +- doc/packaging.mkd | 2 +- doc/progit-article.mkd | 14 +- doc/report-output.mkd | 19 + doc/shell-games.mkd | 25 +- doc/ssh-troubleshooting.mkd | 42 ++- doc/uninstall.mkd | 2 +- doc/who-uses-it.mkd | 4 +- doc/wildcard-repositories.mkd | 17 +- hooks/common/gl-pre-git.hub-sample | 10 + hooks/common/update | 62 +-- hooks/gitolite-admin/post-update | 8 +- src/gitolite.pm | 775 +++++++++++++++---------= ------ src/gitolite_env.pm | 157 ++++++ src/gitolite_rc.pm | 72 +++ src/gl-auth-command | 235 +++------ src/gl-compile-conf | 141 ++---- src/gl-dont-panic | 17 +- src/gl-easy-install | 16 +- src/gl-install | 33 +- src/gl-mirror-shell | 13 +- src/gl-mirror-sync | 4 +- src/gl-query-rc | 23 + src/gl-setup | 47 ++- src/gl-setup-authkeys | 64 ++-- src/gl-time | 30 +- src/gl-tool | 9 +- src/sshkeys-lint | 6 +- t/README.mkd | 11 +- t/t53-check-info-expand-output | 16 + t/t64-write-able | 11 +- t/t65-rsync | 83 ++++ t/t67-hub | 174 +++++++ t/test-driver.sh | 73 ++-- 72 files changed, 3485 insertions(+), 1541 deletions(-) diff --cc src/gitolite.pm index 9945e91,a880037..f32bcf0 --- a/src/gitolite.pm +++ b/src/gitolite.pm @@@ -1205,32 -1186,6 +1186,34 @@@ sub find_pubkeys=20 return sort(@files); } =20 +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); +} + + # ---------------------------------------------------------------------= --------- + # per perl rules, this should be the last line in such a file: 1; diff --cc src/gitolite_rc.pm index 0000000,09cd172..132fc90 mode 000000,100644..100644 --- a/src/gitolite_rc.pm +++ b/src/gitolite_rc.pm @@@ -1,0 -1,70 +1,72 @@@ + # stuff to help pull in the rc file, plus various constants +=20 + package gitolite_rc; + use Exporter 'import'; +=20 + # the first set (before the blank line) are constants defined right her= e in + # this program. The second set are from the 'rc'; We're clubbing all i= n + # because they're all "constants" in a programmatic sense + @EXPORT =3D qw( + $ABRT $WARN + $R_COMMANDS $W_COMMANDS + $REPONAME_PATT $USERNAME_PATT $REPOPATT_PATT + $ADC_CMD_ARGS_PATT + $current_data_version +=20 + $ADMIN_POST_UPDATE_CHAINS_TO $ENV $GITOLITE_BASE $GITOLITE_PATH $GI= T_PATH + $GL_ADC_PATH $GL_ADMINDIR $GL_ALL_INCLUDES_SPECIAL $GL_ALL_READ_ALL + $GL_BIG_CONFIG $GL_CONF $GL_CONF_COMPILED $GL_GET_MEMBERSHIPS_PGM + $GL_GITCONFIG_KEYS $GL_GITCONFIG_WILD $GL_KEYDIR $GL_LOGT $GL_NICE_= VALUE + $GL_NO_CREATE_REPOS $GL_NO_DAEMON_NO_GITWEB $GL_NO_SETUP_AUTHKEYS + $GL_PACKAGE_CONF $GL_PACKAGE_HOOKS $GL_PERFLOGT $GL_SITE_INFO + $GL_SLAVE_MODE $GL_WILDREPOS $GL_WILDREPOS_DEFPERMS + $GL_WILDREPOS_PERM_CATS $HTPASSWD_FILE $PROJECTS_LIST $REPO_BASE + $REPO_UMASK $RSYNC_BASE $SVNSERVE $UPDATE_CHAINS_TO +=20 + $GL_HTTP_ANON_USER ++ ++ @GL_METADATA + ); +=20 + # ---------------------------------------------------------------------= --------- + # real constants + # ---------------------------------------------------------------------= --------- +=20 + $current_data_version =3D '1.7'; +=20 + $ABRT =3D "\n\t\t***** ABORTING *****\n "; + $WARN =3D "\n\t\t***** WARNING *****\n "; +=20 + # commands we're expecting + $R_COMMANDS=3Dqr/^(git[ -]upload-pack|git[ -]upload-archive)$/; + $W_COMMANDS=3Dqr/^git[ -]receive-pack$/; +=20 + # note that REPONAME_PATT allows "/", while USERNAME_PATT does not + # also, the reason REPONAME_PATT is a superset of USERNAME_PATT is (duh= !) + # because a repo can have "CREATOR" in the name + $REPONAME_PATT=3Dqr(^\@?[0-9a-zA-Z][0-9a-zA-Z._\@/+-]*$); + $USERNAME_PATT=3Dqr(^\@?[0-9a-zA-Z][0-9a-zA-Z._\@+-]*$); + # same as REPONAME, but used for wildcard repos, allows some common reg= ex metas + $REPOPATT_PATT=3Dqr(^\@?[0-9a-zA-Z[][\\^.$|()[\]*+?{}0-9a-zA-Z._\@/-]*$= ); +=20 + # ADC commands and arguments must match this pattern + $ADC_CMD_ARGS_PATT=3Dqr(^[0-9a-zA-Z._\@/+:-]*$); +=20 + # ---------------------------------------------------------------------= --------- + # bring in the rc vars and allow querying them + # ---------------------------------------------------------------------= --------- +=20 + # in case we're running under Apache using smart http + $ENV{HOME} =3D $ENV{GITOLITE_HTTP_HOME} if $ENV{GITOLITE_HTTP_HOME}; +=20 + # we also need to "bring in" the rc variables. The rc can only be in o= ne of + # these two places; the first one we find, wins + for ("$ENV{HOME}/.gitolite.rc", "/etc/gitolite/gitolite.rc") { + $ENV{GL_RC} ||=3D $_ if -f; + } + die "no rc file found\n" unless $ENV{GL_RC}; + do $ENV{GL_RC} or die "error parsing $ENV{GL_RC}\n"; +=20 + # ---------------------------------------------------------------------= --------- + # per perl rules, this should be the last line in such a file: + 1; 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 1Q3DD2-0004UH-H3 for garchives@archives.gentoo.org; Fri, 25 Mar 2011 20:02:13 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BB5581C164; Fri, 25 Mar 2011 20:00:05 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 592221C164 for ; Fri, 25 Mar 2011 20:00:05 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B924D2AC005 for ; Fri, 25 Mar 2011 20:00:04 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 10E2280073 for ; Fri, 25 Mar 2011 20:00:04 +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: <7b847f5884187c8ae490e521b6d95c47a7556641.idl0r@gentoo> Subject: [gentoo-commits] proj/gitolite-gentoo:t/export-key-metadata commit in: / X-VCS-Repository: proj/gitolite-gentoo X-VCS-Committer: idl0r X-VCS-Committer-Name: Christian Ruppert X-VCS-Revision: 7b847f5884187c8ae490e521b6d95c47a7556641 Date: Fri, 25 Mar 2011 20:00:04 +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: a7e7429e4287748a2df3bd1469a88df5 Message-ID: <20110325200004.-1h34sEsjRMKBelPXkNOKCKeZNoNHFnUkdrAbUkHD8s@z> commit: 7b847f5884187c8ae490e521b6d95c47a7556641 Author: Christian Ruppert gentoo org> AuthorDate: Fri Mar 25 19:26:06 2011 +0000 Commit: Christian Ruppert gentoo org> CommitDate: Fri Mar 25 19:26:06 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gitolite-gent= oo.git;a=3Dcommit;h=3D7b847f58 Merge commit 'refs/top-bases/t/export_key_metadata-function' into t/expor= t_key_metadata-function README.mkd | 30 +- conf/example.conf | 243 +--------- conf/example.gitolite.rc | 26 +- contrib/adc/able | 20 +- contrib/adc/adc.common-functions | 5 + contrib/adc/fork | 9 +- contrib/adc/get-rights-and-owner.in-perl | 15 +- contrib/adc/git | 123 +++++ contrib/adc/gl-reflog | 8 +- contrib/adc/hub | 443 +++++++++++++++++ contrib/adc/hub.mkd | 202 ++++++++ contrib/adc/perms | 115 +++++ contrib/adc/pygitolite.py | 77 +++ contrib/adc/rm | 4 +- contrib/adc/set-head | 17 + contrib/adc/who-pushed | 2 +- contrib/autotoc | 35 -- contrib/gerrit.mkd | 2 +- contrib/gitolite-tools.mkd | 2 +- contrib/gitweb/gitweb.conf | 44 ++- contrib/ldap/README.mkd | 6 +- contrib/vim/README.mkd | 2 +- doc/1-INSTALL.mkd | 53 ++- doc/2-admin.mkd | 56 ++- doc/3-faq-tips-etc.mkd | 285 ++---------- doc/CHANGELOG | 22 + doc/admin-defined-commands.mkd | 14 +- doc/big-config.mkd | 14 +- doc/delegation.mkd | 10 +- doc/developer-notes.mkd | 213 ++++++++ doc/gitolite.conf.mkd | 469 ++++++++++++++++++ doc/gitolite.rc.mkd | 62 ++- doc/hook-propagation.mkd | 4 +- doc/http-backend.mkd | 142 +++++-- doc/migrate.mkd | 10 +- doc/mirroring.mkd | 21 +- doc/mob-branches.mkd | 2 +- doc/monkeysphere.mkd | 2 + doc/overkill.mkd | 2 +- doc/packaging.mkd | 2 +- doc/progit-article.mkd | 14 +- doc/report-output.mkd | 19 + doc/shell-games.mkd | 25 +- doc/ssh-troubleshooting.mkd | 42 ++- doc/uninstall.mkd | 2 +- doc/who-uses-it.mkd | 4 +- doc/wildcard-repositories.mkd | 17 +- hooks/common/gl-pre-git.hub-sample | 10 + hooks/common/update | 62 +-- hooks/gitolite-admin/post-update | 8 +- src/gitolite.pm | 775 +++++++++++++++---------= ------ src/gitolite_env.pm | 157 ++++++ src/gitolite_rc.pm | 72 +++ src/gl-auth-command | 235 +++------ src/gl-compile-conf | 141 ++---- src/gl-dont-panic | 17 +- src/gl-easy-install | 16 +- src/gl-install | 33 +- src/gl-mirror-shell | 13 +- src/gl-mirror-sync | 4 +- src/gl-query-rc | 23 + src/gl-setup | 47 ++- src/gl-setup-authkeys | 64 ++-- src/gl-time | 30 +- src/gl-tool | 9 +- src/sshkeys-lint | 6 +- t/README.mkd | 11 +- t/t53-check-info-expand-output | 16 + t/t64-write-able | 11 +- t/t65-rsync | 83 ++++ t/t67-hub | 174 +++++++ t/test-driver.sh | 73 ++-- 72 files changed, 3485 insertions(+), 1541 deletions(-) diff --cc src/gitolite.pm index 9945e91,a880037..f32bcf0 --- a/src/gitolite.pm +++ b/src/gitolite.pm @@@ -1205,32 -1186,6 +1186,34 @@@ sub find_pubkeys=20 return sort(@files); } =20 +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); +} + + # ---------------------------------------------------------------------= --------- + # per perl rules, this should be the last line in such a file: 1; diff --cc src/gitolite_rc.pm index 0000000,09cd172..132fc90 mode 000000,100644..100644 --- a/src/gitolite_rc.pm +++ b/src/gitolite_rc.pm @@@ -1,0 -1,70 +1,72 @@@ + # stuff to help pull in the rc file, plus various constants +=20 + package gitolite_rc; + use Exporter 'import'; +=20 + # the first set (before the blank line) are constants defined right her= e in + # this program. The second set are from the 'rc'; We're clubbing all i= n + # because they're all "constants" in a programmatic sense + @EXPORT =3D qw( + $ABRT $WARN + $R_COMMANDS $W_COMMANDS + $REPONAME_PATT $USERNAME_PATT $REPOPATT_PATT + $ADC_CMD_ARGS_PATT + $current_data_version +=20 + $ADMIN_POST_UPDATE_CHAINS_TO $ENV $GITOLITE_BASE $GITOLITE_PATH $GI= T_PATH + $GL_ADC_PATH $GL_ADMINDIR $GL_ALL_INCLUDES_SPECIAL $GL_ALL_READ_ALL + $GL_BIG_CONFIG $GL_CONF $GL_CONF_COMPILED $GL_GET_MEMBERSHIPS_PGM + $GL_GITCONFIG_KEYS $GL_GITCONFIG_WILD $GL_KEYDIR $GL_LOGT $GL_NICE_= VALUE + $GL_NO_CREATE_REPOS $GL_NO_DAEMON_NO_GITWEB $GL_NO_SETUP_AUTHKEYS + $GL_PACKAGE_CONF $GL_PACKAGE_HOOKS $GL_PERFLOGT $GL_SITE_INFO + $GL_SLAVE_MODE $GL_WILDREPOS $GL_WILDREPOS_DEFPERMS + $GL_WILDREPOS_PERM_CATS $HTPASSWD_FILE $PROJECTS_LIST $REPO_BASE + $REPO_UMASK $RSYNC_BASE $SVNSERVE $UPDATE_CHAINS_TO +=20 + $GL_HTTP_ANON_USER ++ ++ @GL_METADATA + ); +=20 + # ---------------------------------------------------------------------= --------- + # real constants + # ---------------------------------------------------------------------= --------- +=20 + $current_data_version =3D '1.7'; +=20 + $ABRT =3D "\n\t\t***** ABORTING *****\n "; + $WARN =3D "\n\t\t***** WARNING *****\n "; +=20 + # commands we're expecting + $R_COMMANDS=3Dqr/^(git[ -]upload-pack|git[ -]upload-archive)$/; + $W_COMMANDS=3Dqr/^git[ -]receive-pack$/; +=20 + # note that REPONAME_PATT allows "/", while USERNAME_PATT does not + # also, the reason REPONAME_PATT is a superset of USERNAME_PATT is (duh= !) + # because a repo can have "CREATOR" in the name + $REPONAME_PATT=3Dqr(^\@?[0-9a-zA-Z][0-9a-zA-Z._\@/+-]*$); + $USERNAME_PATT=3Dqr(^\@?[0-9a-zA-Z][0-9a-zA-Z._\@+-]*$); + # same as REPONAME, but used for wildcard repos, allows some common reg= ex metas + $REPOPATT_PATT=3Dqr(^\@?[0-9a-zA-Z[][\\^.$|()[\]*+?{}0-9a-zA-Z._\@/-]*$= ); +=20 + # ADC commands and arguments must match this pattern + $ADC_CMD_ARGS_PATT=3Dqr(^[0-9a-zA-Z._\@/+:-]*$); +=20 + # ---------------------------------------------------------------------= --------- + # bring in the rc vars and allow querying them + # ---------------------------------------------------------------------= --------- +=20 + # in case we're running under Apache using smart http + $ENV{HOME} =3D $ENV{GITOLITE_HTTP_HOME} if $ENV{GITOLITE_HTTP_HOME}; +=20 + # we also need to "bring in" the rc variables. The rc can only be in o= ne of + # these two places; the first one we find, wins + for ("$ENV{HOME}/.gitolite.rc", "/etc/gitolite/gitolite.rc") { + $ENV{GL_RC} ||=3D $_ if -f; + } + die "no rc file found\n" unless $ENV{GL_RC}; + do $ENV{GL_RC} or die "error parsing $ENV{GL_RC}\n"; +=20 + # ---------------------------------------------------------------------= --------- + # per perl rules, this should be the last line in such a file: + 1;