annotate _test/repo.pl @ 2:f2a86753b494

implemented object model robust validation
author cin
date Tue, 22 Oct 2013 16:15:22 +0400
parents
children ae61af01bfa5
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 $ENV{http_proxy} = "http://10.111.0.3:3128";
f2a86753b494 implemented object model
cin
parents:
diff changeset
5
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 {
f2a86753b494 implemented object model
cin
parents:
diff changeset
15 name => 'gnome',
f2a86753b494 implemented object model
cin
parents:
diff changeset
16 dir => 'gnome',
f2a86753b494 implemented object model
cin
parents:
diff changeset
17 location => 'http://download.opensuse.org/repositories/GNOME:/STABLE:/3.8/openSUSE_12.3/'
f2a86753b494 implemented object model
cin
parents:
diff changeset
18 }
f2a86753b494 implemented object model
cin
parents:
diff changeset
19 );
f2a86753b494 implemented object model
cin
parents:
diff changeset
20
f2a86753b494 implemented object model
cin
parents:
diff changeset
21 foreach my $info ( @repos ) {
f2a86753b494 implemented object model
cin
parents:
diff changeset
22 eval {
f2a86753b494 implemented object model
cin
parents:
diff changeset
23 my $repo = Repository->new( map $info->{$_},qw(name dir location));
f2a86753b494 implemented object model
cin
parents:
diff changeset
24 Sync
f2a86753b494 implemented object model
cin
parents:
diff changeset
25 ->new(*STDOUT) # log to STDOUT
f2a86753b494 implemented object model
cin
parents:
diff changeset
26 ->Update($repo);
f2a86753b494 implemented object model
cin
parents:
diff changeset
27 };
f2a86753b494 implemented object model
cin
parents:
diff changeset
28 warn $@ if $@;
f2a86753b494 implemented object model
cin
parents:
diff changeset
29 }
f2a86753b494 implemented object model
cin
parents:
diff changeset
30
f2a86753b494 implemented object model
cin
parents:
diff changeset
31
f2a86753b494 implemented object model
cin
parents:
diff changeset
32 print "SUCCESS\n";