view _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
line wrap: on
line source

#!/usr/bin/perl
use strict;

use IMPL::require {
	Repository => 'Yours::Model::Repository',
	Sync => 'Yours::SyncRepository',
	Dumper => 'Data::Dumper',
	
};

my @repos = (
	{
		name => 'gnome',
		dir => 'gnome',
		location => 'http://download.opensuse.org/repositories/GNOME:/STABLE:/3.8/openSUSE_12.3/'
	},
	{
		name => 'mono',
		dir => 'mono',
		location => 'http://download.opensuse.org/repositories/Mono/openSUSE_12.3/'
	},
	{
		name => 'nvidia',
		dir => 'nvidia',
		location => 'ftp://download.nvidia.com/opensuse/12.3/'
	},
	{
		name => 'broken',
		dir => 'broken',
		location => 'http://mirror.yandex.ru/opensuse/repositories/KDE:/Extra/KDE_Release_410_openSUSE_12.3/'
	}
);

foreach my $info ( @repos ) {
	eval {
		my $repo = Repository->new( map $info->{$_},qw(name dir location));
		Sync
			->new({
				log => *STDOUT,
				skipDebug => 1,
				skipSrc => 1
			}) 
			->Update($repo);
	};
	if(my $err = $@) {
		print eval { $err->message || $err }, "\n";
	} else {
		print "done\n";
	}
}


print "ALL TASKS COMPLETE\n";