aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mars-attacks.org>2013-07-15 20:17:25 +0200
committerNicolas Vigier <boklm@mars-attacks.org>2013-07-15 20:17:25 +0200
commit17c86c47c49fbebc47db0fa0e094338c4218f78e (patch)
tree490806f3b03b4b03f39257010bcde3011405050b
parentdecf0ab8f21e287ce9dbb87ff07061d50561ac0d (diff)
downloadmgagit-17c86c47c49fbebc47db0fa0e094338c4218f78e.tar
mgagit-17c86c47c49fbebc47db0fa0e094338c4218f78e.tar.gz
mgagit-17c86c47c49fbebc47db0fa0e094338c4218f78e.tar.bz2
mgagit-17c86c47c49fbebc47db0fa0e094338c4218f78e.tar.xz
mgagit-17c86c47c49fbebc47db0fa0e094338c4218f78e.zip
Use Git::Repository instead of Git module
Git module on Mageia 1 seems to have some problems to clone a repo.
-rw-r--r--NEWS3
-rw-r--r--lib/MGA/Git.pm10
2 files changed, 7 insertions, 6 deletions
diff --git a/NEWS b/NEWS
index 42dc82b..337a51a 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+
+- use Git::Repository instead of Git module
+
Version 0.5
- soft_repo.gl: allow @mga-packagers to push to master and release/
diff --git a/lib/MGA/Git.pm b/lib/MGA/Git.pm
index 99d71d4..6c8fc72 100644
--- a/lib/MGA/Git.pm
+++ b/lib/MGA/Git.pm
@@ -1,7 +1,7 @@
package MGA::Git;
use strict;
-use Git;
+use Git::Repository;
use YAML qw(LoadFile DumpFile);
use Template;
use File::Slurp;
@@ -23,12 +23,10 @@ sub load_gitrepos_dir {
$dir =~ s/\.git$//;
$infos->{include_dir} = "$config->{repodef_dir}/$dir";
if (-d $infos->{include_dir}) {
- my $repo = Git->repository(Directory => $infos->{include_dir});
- $repo->command('pull');
+ my $repo = Git::Repository->new(work_tree => $infos->{include_dir});
+ $repo->run('pull');
} else {
- Git::command('clone', $infos->{git_url}, $infos->{include_dir});
- my $repo = Git->repository(Directory => $infos->{include_dir});
- $repo->command('remote', 'add', 'origin', $infos->{git_url});
+ Git::Repository->run(clone => $infos->{git_url}, $infos->{include_dir});
}
}
opendir(my $dh, $infos->{include_dir})