aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mars-attacks.org>2013-09-22 00:01:16 +0200
committerNicolas Vigier <boklm@mars-attacks.org>2013-09-22 00:01:16 +0200
commit6d0a8bd712b664769b18a5deae743f97bafc141f (patch)
tree2957ae93fd74d9981c303ce7e0b96195258656ca
parent5a3958c37a1d28589b48249404f8965589cd8f40 (diff)
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.pm12
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}";