diff options
author | Nicolas Vigier <boklm@mars-attacks.org> | 2013-09-22 00:01:16 +0200 |
---|---|---|
committer | Nicolas Vigier <boklm@mars-attacks.org> | 2013-09-22 00:01:16 +0200 |
commit | 6d0a8bd712b664769b18a5deae743f97bafc141f (patch) | |
tree | 2957ae93fd74d9981c303ce7e0b96195258656ca | |
parent | 5a3958c37a1d28589b48249404f8965589cd8f40 (diff) | |
download | mgagit-6d0a8bd712b664769b18a5deae743f97bafc141f.tar mgagit-6d0a8bd712b664769b18a5deae743f97bafc141f.tar.gz mgagit-6d0a8bd712b664769b18a5deae743f97bafc141f.tar.bz2 mgagit-6d0a8bd712b664769b18a5deae743f97bafc141f.tar.xz mgagit-6d0a8bd712b664769b18a5deae743f97bafc141f.zip |
Give $r instead of $r->{repos} as argument to load_gitrepos_dir
This will make it possible to create groups from load_gitrepos_dir.
-rw-r--r-- | lib/MGA/Git.pm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/MGA/Git.pm b/lib/MGA/Git.pm index 6c8fc72..c46dc4e 100644 --- a/lib/MGA/Git.pm +++ b/lib/MGA/Git.pm @@ -17,7 +17,7 @@ my $etc_config = LoadFile($etc_config_file); @{$config}{keys %$etc_config} = values %$etc_config; sub load_gitrepos_dir { - my ($repos, $infos) = @_; + my ($r, $infos) = @_; if (!$infos->{include_dir}) { my ($dir) = fileparse($infos->{git_url}); $dir =~ s/\.git$//; @@ -37,13 +37,13 @@ sub load_gitrepos_dir { my %i = %$infos; $i{prefix} .= '/' . $file; $i{include_dir} .= '/' . $file; - load_gitrepos_dir($repos, \%i); + load_gitrepos_dir($r, \%i); } elsif ($file =~ m/(.+)\.repo$/) { my $bname = $1; my $name = "$infos->{prefix}/$bname"; - $repos->{$name} = LoadFile("$infos->{include_dir}/$file"); - $repos->{$name}{name} = $bname; - @{$repos->{$name}}{keys %$infos} = values %$infos; + $r->{repos}{$name} = LoadFile("$infos->{include_dir}/$file"); + $r->{repos}{$name}{name} = $bname; + @{$r->{repos}{$name}}{keys %$infos} = values %$infos; } } closedir $dh; @@ -54,7 +54,7 @@ sub load_gitrepos { $r->{repos} = {}; foreach my $repodef (@{$config->{repos_config}}) { if ($repodef->{include_dir} || $repodef->{git_url}) { - load_gitrepos_dir($r->{repos}, $repodef); + load_gitrepos_dir($r, $repodef); } foreach my $repo ($repodef->{repos} ? @{$repodef->{repos}} : ()) { my $name = "$repodef->{prefix}/$repo->{name}"; |