2
|
1 #!/usr/bin/perl
|
|
2 use strict;
|
|
3
|
|
4 use IMPL::require {
|
|
5 Repository => 'Yours::Model::Repository',
|
|
6 Sync => 'Yours::SyncRepository',
|
|
7 Dumper => 'Data::Dumper',
|
|
8
|
|
9 };
|
|
10
|
|
11 my @repos = (
|
|
12 {
|
|
13 name => 'gnome',
|
|
14 dir => 'gnome',
|
|
15 location => 'http://download.opensuse.org/repositories/GNOME:/STABLE:/3.8/openSUSE_12.3/'
|
3
|
16 },
|
|
17 {
|
|
18 name => 'mono',
|
|
19 dir => 'mono',
|
|
20 location => 'http://download.opensuse.org/repositories/Mono/openSUSE_12.3/'
|
|
21 },
|
|
22 {
|
|
23 name => 'nvidia',
|
|
24 dir => 'nvidia',
|
|
25 location => 'ftp://download.nvidia.com/opensuse/12.3/'
|
4
|
26 },
|
|
27 {
|
|
28 name => 'broken',
|
|
29 dir => 'broken',
|
|
30 location => 'http://mirror.yandex.ru/opensuse/repositories/KDE:/Extra/KDE_Release_410_openSUSE_12.3/'
|
2
|
31 }
|
|
32 );
|
|
33
|
|
34 foreach my $info ( @repos ) {
|
|
35 eval {
|
|
36 my $repo = Repository->new( map $info->{$_},qw(name dir location));
|
|
37 Sync
|
3
|
38 ->new({
|
|
39 log => *STDOUT,
|
|
40 skipDebug => 1,
|
|
41 skipSrc => 1
|
|
42 })
|
2
|
43 ->Update($repo);
|
|
44 };
|
3
|
45 if(my $err = $@) {
|
|
46 print eval { $err->message || $err }, "\n";
|
|
47 } else {
|
|
48 print "done\n";
|
|
49 }
|
2
|
50 }
|
|
51
|
|
52
|
3
|
53 print "ALL TASKS COMPLETE\n"; |