annotate _test/repo.pl @ 5:45a84be3ebb1 default tip

added deltainfo (.drpm) packages support
author sergey
date Wed, 23 Oct 2013 16:24:52 +0400
parents 8001dc056331
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
f2a86753b494 implemented object model
cin
parents:
diff changeset
1 #!/usr/bin/perl
f2a86753b494 implemented object model
cin
parents:
diff changeset
2 use strict;
f2a86753b494 implemented object model
cin
parents:
diff changeset
3
5
45a84be3ebb1 added deltainfo (.drpm) packages support
sergey
parents: 4
diff changeset
4
45a84be3ebb1 added deltainfo (.drpm) packages support
sergey
parents: 4
diff changeset
5
2
f2a86753b494 implemented object model
cin
parents:
diff changeset
6 use IMPL::require {
f2a86753b494 implemented object model
cin
parents:
diff changeset
7 Repository => 'Yours::Model::Repository',
f2a86753b494 implemented object model
cin
parents:
diff changeset
8 Sync => 'Yours::SyncRepository',
f2a86753b494 implemented object model
cin
parents:
diff changeset
9 Dumper => 'Data::Dumper',
f2a86753b494 implemented object model
cin
parents:
diff changeset
10
f2a86753b494 implemented object model
cin
parents:
diff changeset
11 };
f2a86753b494 implemented object model
cin
parents:
diff changeset
12
f2a86753b494 implemented object model
cin
parents:
diff changeset
13 my @repos = (
f2a86753b494 implemented object model
cin
parents:
diff changeset
14 {
5
45a84be3ebb1 added deltainfo (.drpm) packages support
sergey
parents: 4
diff changeset
15 name => 'update',
45a84be3ebb1 added deltainfo (.drpm) packages support
sergey
parents: 4
diff changeset
16 dir => '_data/update',
45a84be3ebb1 added deltainfo (.drpm) packages support
sergey
parents: 4
diff changeset
17 location => 'http://mirror.yandex.ru/opensuse/update/12.3/',
45a84be3ebb1 added deltainfo (.drpm) packages support
sergey
parents: 4
diff changeset
18 },
45a84be3ebb1 added deltainfo (.drpm) packages support
sergey
parents: 4
diff changeset
19 {
2
f2a86753b494 implemented object model
cin
parents:
diff changeset
20 name => 'gnome',
5
45a84be3ebb1 added deltainfo (.drpm) packages support
sergey
parents: 4
diff changeset
21 dir => '_data/gnome',
2
f2a86753b494 implemented object model
cin
parents:
diff changeset
22 location => 'http://download.opensuse.org/repositories/GNOME:/STABLE:/3.8/openSUSE_12.3/'
3
cin
parents: 2
diff changeset
23 },
cin
parents: 2
diff changeset
24 {
cin
parents: 2
diff changeset
25 name => 'mono',
5
45a84be3ebb1 added deltainfo (.drpm) packages support
sergey
parents: 4
diff changeset
26 dir => '_data/mono',
3
cin
parents: 2
diff changeset
27 location => 'http://download.opensuse.org/repositories/Mono/openSUSE_12.3/'
cin
parents: 2
diff changeset
28 },
cin
parents: 2
diff changeset
29 {
cin
parents: 2
diff changeset
30 name => 'nvidia',
5
45a84be3ebb1 added deltainfo (.drpm) packages support
sergey
parents: 4
diff changeset
31 dir => '_data/nvidia',
3
cin
parents: 2
diff changeset
32 location => 'ftp://download.nvidia.com/opensuse/12.3/'
4
8001dc056331 fixed problems with sax parser
sergey
parents: 3
diff changeset
33 },
8001dc056331 fixed problems with sax parser
sergey
parents: 3
diff changeset
34 {
8001dc056331 fixed problems with sax parser
sergey
parents: 3
diff changeset
35 name => 'broken',
5
45a84be3ebb1 added deltainfo (.drpm) packages support
sergey
parents: 4
diff changeset
36 dir => '_data/broken',
4
8001dc056331 fixed problems with sax parser
sergey
parents: 3
diff changeset
37 location => 'http://mirror.yandex.ru/opensuse/repositories/KDE:/Extra/KDE_Release_410_openSUSE_12.3/'
2
f2a86753b494 implemented object model
cin
parents:
diff changeset
38 }
f2a86753b494 implemented object model
cin
parents:
diff changeset
39 );
f2a86753b494 implemented object model
cin
parents:
diff changeset
40
f2a86753b494 implemented object model
cin
parents:
diff changeset
41 foreach my $info ( @repos ) {
f2a86753b494 implemented object model
cin
parents:
diff changeset
42 eval {
f2a86753b494 implemented object model
cin
parents:
diff changeset
43 my $repo = Repository->new( map $info->{$_},qw(name dir location));
f2a86753b494 implemented object model
cin
parents:
diff changeset
44 Sync
3
cin
parents: 2
diff changeset
45 ->new({
cin
parents: 2
diff changeset
46 log => *STDOUT,
cin
parents: 2
diff changeset
47 skipDebug => 1,
cin
parents: 2
diff changeset
48 skipSrc => 1
cin
parents: 2
diff changeset
49 })
2
f2a86753b494 implemented object model
cin
parents:
diff changeset
50 ->Update($repo);
f2a86753b494 implemented object model
cin
parents:
diff changeset
51 };
5
45a84be3ebb1 added deltainfo (.drpm) packages support
sergey
parents: 4
diff changeset
52 if($@) {
45a84be3ebb1 added deltainfo (.drpm) packages support
sergey
parents: 4
diff changeset
53 warn $@;
3
cin
parents: 2
diff changeset
54 } else {
cin
parents: 2
diff changeset
55 print "done\n";
cin
parents: 2
diff changeset
56 }
2
f2a86753b494 implemented object model
cin
parents:
diff changeset
57 }
f2a86753b494 implemented object model
cin
parents:
diff changeset
58
f2a86753b494 implemented object model
cin
parents:
diff changeset
59
3
cin
parents: 2
diff changeset
60 print "ALL TASKS COMPLETE\n";