(minor) fixup various TODOs and such

some got junked, some were already done or got done, and some were
converted into actual todo items in the 'todo' file.
This commit is contained in:
Sitaram Chamarty 2012-03-22 05:31:17 +05:30
parent 446a611327
commit e9ea674be9
8 changed files with 2 additions and 61 deletions

View file

@ -51,8 +51,6 @@ sub parse {
my @refs = parse_refs( $2 || '' );
my @users = parse_users($3);
# XXX what do we do? s/\bCREAT[EO]R\b/~\$creator/g for @users;
for my $ref (@refs) {
for my $user (@users) {
add_rule( $perm, $ref, $user );

View file

@ -55,12 +55,6 @@ sub incsub {
or $include_glob =~ /^'(.+)'$/;
$include_glob = $1;
# XXX move this to Macros... substitute HOSTNAME word if GL_HOSTNAME defined, otherwise leave as is
# $include_glob =~ s/\bHOSTNAME\b/$GL_HOSTNAME/ if $GL_HOSTNAME;
# XXX g2 diff: include glob is *implicitly* from $rc{GL_ADMIN_BASE}/conf, not *explicitly*
# for my $file (glob($include_glob =~ m(^/) ? $include_glob : "$rc{GL_ADMIN_BASE}/conf/$include_glob")) {
trace( 2, $is_subconf, $include_glob );
for my $file ( glob($include_glob) ) {
@ -74,7 +68,6 @@ sub incsub {
push @{$out}, "subconf $basename";
explode( $file, $basename, $out );
push @{$out}, "subconf $subconf";
# XXX g2 delegaton compat: deal with this: $subconf_seen++;
} else {
explode( $file, $subconf, $out );
}

View file

@ -45,7 +45,6 @@ my @repolist; # current repo list; reset on each 'repo ...' line
my $subconf = 'master';
my $nextseq = 0;
my %ignored;
# XXX you still have to "warn" if this has any entries
# ----------------------------------------------------------------------
@ -71,7 +70,6 @@ sub set_repolist {
_warn "explicit '.git' extension ignored for $_.git" if s/\.git$//;
_die "bad reponame '$_'" if $_ !~ $REPOPATT_PATT;
}
# XXX -- how do we deal with this? s/\bCREAT[EO]R\b/\$creator/g for @{ $repos_p };
}
sub parse_refs {
@ -85,7 +83,6 @@ sub parse_refs {
# fully qualify refs that dont start with "refs/" or "VREF/";
# prefix them with "refs/heads/"
@refs = map { m(^(refs|VREF)/) or s(^)(refs/heads/); $_ } @refs;
# XXX what do we do? @refs = map { s(/USER/)(/\$gl_user/); $_ } @refs;
return @refs;
}
@ -114,15 +111,6 @@ sub add_rule {
}
push @{ $repos{$repo}{$user} }, [ $nextseq, $perm, $ref ];
# XXX g2 diff: we're not doing a lint check for usernames versus pubkeys;
# maybe we can add that later
# XXX to do: C/R/W, then CREATE_IS_C, etc
# XXX to do: also NAME_LIMITS
# XXX and hacks like $creator -> "$creatror - wild"
# XXX consider if you want to use rurp_seen; initially no
}
}
@ -131,7 +119,6 @@ sub add_config {
$nextseq++;
for my $repo (@repolist) {
# XXX should we check_subconf_repo_disallowed here?
push @{ $configs{$repo} }, [ $nextseq, $key, $value ];
}
}
@ -174,7 +161,6 @@ sub new_repos {
next unless $repo =~ $REPONAME_PATT; # skip repo patterns
next if $repo =~ m(^\@|EXTCMD/); # skip groups and fake repos
# XXX how do we deal with GL_NO_CREATE_REPOS?
new_repo($repo) if not -d "$repo.git";
}
}
@ -183,16 +169,11 @@ sub new_repo {
my $repo = shift;
trace( 3, $repo );
# XXX ignoring UMASK for now
_mkdir("$repo.git");
_chdir("$repo.git");
_system("git init --bare >&2");
_chdir( $rc{GL_REPO_BASE} );
hook_1($repo);
# XXX ignoring creator for now
# XXX ignoring gl-post-init for now
}
sub new_wild_repo {
@ -203,8 +184,6 @@ sub new_wild_repo {
new_repo($repo);
_print( "$repo.git/gl-creator", $user );
_print( "$repo.git/gl-perms", "$rc{DEFAULT_ROLE_PERMS}\n" ) if $rc{DEFAULT_ROLE_PERMS};
# XXX git config, daemon, web...
# XXX pre-create, post-create
trigger( 'POST_CREATE', $repo, $user );
_chdir( $rc{GL_ADMIN_BASE} );
@ -215,8 +194,6 @@ sub hook_repos {
# all repos, all hooks
_chdir( $rc{GL_REPO_BASE} );
# XXX g2 diff: we now don't care if it's a symlink -- it's upto the admin
# on the server to make sure things are kosher
for my $repo (`find . -name "*.git" -prune`) {
chomp($repo);
$repo =~ s/\.git$//;
@ -288,8 +265,6 @@ sub store_1 {
$dumped_data .= Data::Dumper->Dump( [ \%one_config ], [qw(*one_config)] );
}
# XXX deal with this better now
# $dumped_data =~ s/'(?=[^']*\$(?:creator|gl_user))~?(.*?)'/"$1"/g;
print $compiled_fh $dumped_data;
close $compiled_fh;
@ -308,16 +283,11 @@ sub store_common {
my $dumped_data = Data::Dumper->Dump( [ \%repos ], [qw(*repos)] );
$dumped_data .= Data::Dumper->Dump( [ \%configs ], [qw(*configs)] ) if %configs;
# XXX and again...
# XXX $dumped_data =~ s/'(?=[^']*\$(?:creator|gl_user))~?(.*?)'/"$1"/g;
print $compiled_fh $dumped_data;
if (%groups) {
my %groups = %{ inside_out( \%groups ) };
$dumped_data = Data::Dumper->Dump( [ \%groups ], [qw(*groups)] );
# XXX $dumped_data =~ s/\bCREAT[EO]R\b/\$creator/g;
# XXX $dumped_data =~ s/'(?=[^']*\$(?:creator|gl_user))~?(.*?)'/"$1"/g;
print $compiled_fh $dumped_data;
}
print $compiled_fh Data::Dumper->Dump( [ \%split_conf ], [qw(*split_conf)] ) if %split_conf;

View file

@ -117,11 +117,6 @@ sub owner_desc {
my $lines = shift;
my @ret;
# XXX compat breakage: (1) adding repo/owner does not automatically add an
# entry to projects.list -- we need a post-procesor for that, and (2)
# removing the 'repo' line no longer suffices to remove the config entry
# from projects.list. Maybe the post-procesor should do that as well?
# owner = "owner name"
# -> config gitweb.owner = owner name
# description = "some long description"
@ -138,10 +133,6 @@ sub owner_desc {
for my $line (@$lines) {
if ( $line =~ /^(\S+)(?: "(.*?)")? = "(.*)"$/ ) {
my ( $repo, $owner, $desc ) = ( $1, $2, $3 );
# XXX these two checks should go into add_config
# _die "bad repo name '$repo'" unless $repo =~ $REPONAME_PATT;
# _die "$fragment attempting to set description for $repo"
# if check_fragment_repo_disallowed( $fragment, $repo );
push @ret, "repo $repo";
push @ret, "config gitweb.description = $desc";
push @ret, "config gitweb.owner = $owner" if $owner;

View file

@ -74,7 +74,6 @@ do $ENV{G3T_RC} if exists $ENV{G3T_RC} and -r $ENV{G3T_RC};
# fix some env vars, setup gitolite internal "env" vars (aka rc vars)
# ----------------------------------------------------------------------
# fix PATH (TODO: do it only if 'gitolite' isn't in PATH)
$ENV{PATH} = "$ENV{GL_BINDIR}:$ENV{PATH}";
{
@ -117,10 +116,6 @@ sub glrc {
# search $HOME first
return "$ENV{HOME}/.gitolite.rc" if -f "$ENV{HOME}/.gitolite.rc";
# XXX for fedora, we can add the following line, but I would really prefer
# if ~/.gitolite.rc on each $HOME was just a symlink to /etc/gitolite.rc
# XXX return "/etc/gitolite.rc" if -f "/etc/gitolite.rc";
return '';
} elsif ( $cmd eq 'current-data-version' ) {
return $current_data_version;

View file

@ -35,8 +35,6 @@ Advanced uses: see src/commands/post-compile/update-git-daemon-access-list for
a good example.
=cut
# TODO: deal with "C", call it ^C
usage() if not @ARGV or $ARGV[0] eq '-h';
my $quiet = 0;
if ( $ARGV[0] eq '-q' ) { $quiet = 1; shift @ARGV; }
@ -44,7 +42,6 @@ if ( $ARGV[0] eq '-q' ) { $quiet = 1; shift @ARGV; }
my ( $repo, $user, $aa, $ref ) = @ARGV;
$aa ||= '+';
$ref ||= 'any';
# XXX the 4th one below might need fine tuning
_die "invalid perm" if not( $aa and $aa =~ /^(R|W|\+|C|D|M)$/ );
_die "invalid ref name" if not( $ref and $ref =~ $REPONAME_PATT );

View file

@ -18,7 +18,6 @@ trace( 2, "'keydir' not found in '$ab'; exiting" ), exit if not -d "$ab/keydir";
my $akdir = "$ENV{HOME}/.ssh";
my $akfile = "$ENV{HOME}/.ssh/authorized_keys";
my $glshell = `gitolite query-rc -n GL_BINDIR` . "/gitolite-shell";
# XXX gl-time not yet coded (GL_PERFLOGT)
my $auth_options = auth_options();
sanity();

View file

@ -34,8 +34,6 @@ exit 0;
# ----------------------------------------------------------------------
# XXX lots of stuff from gl-auth-command is missing for now...
sub in_local {
if ( $ENV{SSH_ORIGINAL_COMMAND} =~ /git-\w+-pack/ ) {
print STDERR "TRACE: gsh(", join( ")(", @ARGV ), ")\n";
@ -109,8 +107,8 @@ sub parse_soc {
my $soc = $ENV{SSH_ORIGINAL_COMMAND};
$soc ||= 'info';
if ( $soc =~ m(^(git-(?:upload|receive)-pack) '/?(.*?)(?:\.git(\d)?)?'$) ) {
# TODO git archive
my $git_commands = "git-upload-pack|git-receive-pack|git-upload-archive";
if ( $soc =~ m(^($git_commands) '/?(.*?)(?:\.git(\d)?)?'$) ) {
my ( $verb, $repo, $trace_level ) = ( $1, $2, $3 );
$ENV{D} = $trace_level if $trace_level;
_die "invalid repo name: '$repo'" if $repo !~ $REPONAME_PATT;