/[soft]/build_system/mga-youri-submit/trunk/lib/Youri/Submit/Post/Mirror.pm
ViewVC logotype

Contents of /build_system/mga-youri-submit/trunk/lib/Youri/Submit/Post/Mirror.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2907 - (show annotations) (download)
Tue Feb 7 21:00:55 2012 UTC (12 years, 1 month ago) by pterjan
File size: 1051 byte(s)
Use --delete-after to reduce inconsistent time
1 # $Id: Gendistrib.pm 115367 2007-01-30 09:47:04Z pixel $
2 package Youri::Submit::Post::Mirror;
3
4 =head1 NAME
5
6 Youri::Submit::Post::Mirror - synchronizes repository to mirror
7
8 =head1 DESCRIPTION
9
10 Calls genhdlist2
11
12 =cut
13
14 use warnings;
15 use strict;
16 use Carp;
17 use base qw/Youri::Submit::Post/;
18
19 sub _init {
20 my $self = shift;
21 my %options = (
22 destination => '',
23 @_
24 );
25
26 foreach my $var ('destination') {
27 $self->{"_$var"} = $options{$var};
28 }
29 }
30
31 sub run {
32 my ($self, $repository, $target, $define) = @_;
33 croak "Not a class method" unless ref $self;
34 my $root = $repository->get_install_root();
35
36 croak "Missing destination" unless $self->{'_destination'};
37
38
39 if (system("/usr/bin/rsync -alH --delete --delete-after $root/$target/ $self->{_destination}/$target/")) {
40 $self->{_error} = "Rsync command failed ($!)";
41 }
42
43 return;
44 }
45
46 =head1 COPYRIGHT AND LICENSE
47
48 Copyright (C) 2010, Mageia
49
50 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
51
52 =cut
53
54 1;
55

  ViewVC Help
Powered by ViewVC 1.1.30