annotate _test/repo.pl @ 4:8001dc056331

fixed problems with sax parser fixed handling of empty repos added log autoflush
author sergey
date Wed, 23 Oct 2013 11:49:16 +0400
parents ae61af01bfa5
children 45a84be3ebb1
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
f2a86753b494 implemented object model
cin
parents:
diff changeset
4 use IMPL::require {
f2a86753b494 implemented object model
cin
parents:
diff changeset
5 Repository => 'Yours::Model::Repository',
f2a86753b494 implemented object model
cin
parents:
diff changeset
6 Sync => 'Yours::SyncRepository',
f2a86753b494 implemented object model
cin
parents:
diff changeset
7 Dumper => 'Data::Dumper',
f2a86753b494 implemented object model
cin
parents:
diff changeset
8
f2a86753b494 implemented object model
cin
parents:
diff changeset
9 };
f2a86753b494 implemented object model
cin
parents:
diff changeset
10
f2a86753b494 implemented object model
cin
parents:
diff changeset
11 my @repos = (
f2a86753b494 implemented object model
cin
parents:
diff changeset
12 {
f2a86753b494 implemented object model
cin
parents:
diff changeset
13 name => 'gnome',
f2a86753b494 implemented object model
cin
parents:
diff changeset
14 dir => 'gnome',
f2a86753b494 implemented object model
cin
parents:
diff changeset
15 location => 'http://download.opensuse.org/repositories/GNOME:/STABLE:/3.8/openSUSE_12.3/'
3
cin
parents: 2
diff changeset
16 },
cin
parents: 2
diff changeset
17 {
cin
parents: 2
diff changeset
18 name => 'mono',
cin
parents: 2
diff changeset
19 dir => 'mono',
cin
parents: 2
diff changeset
20 location => 'http://download.opensuse.org/repositories/Mono/openSUSE_12.3/'
cin
parents: 2
diff changeset
21 },
cin
parents: 2
diff changeset
22 {
cin
parents: 2
diff changeset
23 name => 'nvidia',
cin
parents: 2
diff changeset
24 dir => 'nvidia',
cin
parents: 2
diff changeset
25 location => 'ftp://download.nvidia.com/opensuse/12.3/'
4
8001dc056331 fixed problems with sax parser
sergey
parents: 3
diff changeset
26 },
8001dc056331 fixed problems with sax parser
sergey
parents: 3
diff changeset
27 {
8001dc056331 fixed problems with sax parser
sergey
parents: 3
diff changeset
28 name => 'broken',
8001dc056331 fixed problems with sax parser
sergey
parents: 3
diff changeset
29 dir => 'broken',
8001dc056331 fixed problems with sax parser
sergey
parents: 3
diff changeset
30 location => 'http://mirror.yandex.ru/opensuse/repositories/KDE:/Extra/KDE_Release_410_openSUSE_12.3/'
2
f2a86753b494 implemented object model
cin
parents:
diff changeset
31 }
f2a86753b494 implemented object model
cin
parents:
diff changeset
32 );
f2a86753b494 implemented object model
cin
parents:
diff changeset
33
f2a86753b494 implemented object model
cin
parents:
diff changeset
34 foreach my $info ( @repos ) {
f2a86753b494 implemented object model
cin
parents:
diff changeset
35 eval {
f2a86753b494 implemented object model
cin
parents:
diff changeset
36 my $repo = Repository->new( map $info->{$_},qw(name dir location));
f2a86753b494 implemented object model
cin
parents:
diff changeset
37 Sync
3
cin
parents: 2
diff changeset
38 ->new({
cin
parents: 2
diff changeset
39 log => *STDOUT,
cin
parents: 2
diff changeset
40 skipDebug => 1,
cin
parents: 2
diff changeset
41 skipSrc => 1
cin
parents: 2
diff changeset
42 })
2
f2a86753b494 implemented object model
cin
parents:
diff changeset
43 ->Update($repo);
f2a86753b494 implemented object model
cin
parents:
diff changeset
44 };
3
cin
parents: 2
diff changeset
45 if(my $err = $@) {
cin
parents: 2
diff changeset
46 print eval { $err->message || $err }, "\n";
cin
parents: 2
diff changeset
47 } else {
cin
parents: 2
diff changeset
48 print "done\n";
cin
parents: 2
diff changeset
49 }
2
f2a86753b494 implemented object model
cin
parents:
diff changeset
50 }
f2a86753b494 implemented object model
cin
parents:
diff changeset
51
f2a86753b494 implemented object model
cin
parents:
diff changeset
52
3
cin
parents: 2
diff changeset
53 print "ALL TASKS COMPLETE\n";