From cee7f7283f7d9114ef4911a26b3bbcd31597788f Mon Sep 17 00:00:00 2001 From: Mandrake Date: Thu, 26 Oct 2006 11:16:08 +0000 Subject: add gendistrib command directly into gendistrib module --- lib/Youri/Submit/Post/Gendistrib.pm | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'lib/Youri/Submit/Post') diff --git a/lib/Youri/Submit/Post/Gendistrib.pm b/lib/Youri/Submit/Post/Gendistrib.pm index a48a6cf..01aa959 100644 --- a/lib/Youri/Submit/Post/Gendistrib.pm +++ b/lib/Youri/Submit/Post/Gendistrib.pm @@ -26,16 +26,31 @@ sub _init { @_ ); - foreach my $var ('user', 'host', 'source', 'destination') { + foreach my $var ('tmpdir', 'command') { $self->{"_$var"} = $options{$var}; } } sub run { - my ($self, $pre_package, $repository, $target, $define) = @_; + my ($self, $repository, $target, $define) = @_; croak "Not a class method" unless ref $self; - - 1 + my $root = $repository->get_install_root(); + (undef, undef, my $hour) = gmtime(time); + # during the night, use complete hdlist rebuild + my $fast = '--fast'; + if ($hour > 22 && $hour < 5) { + if ($hour < 4) { + $fast = '--blind' + } else { + $fast = '' + } + } + foreach my $arch (@{$repository->get_arch_changed($target)}) { + my $cmd = "TMPDIR=$self->{_tmpdir}/$target/$arch time $self->{_command} --nochkdep --nobadrpm $fast --noclean $root/$target/$arch"; + print "$cmd\n"; + system($cmd); + } + return } =head1 COPYRIGHT AND LICENSE -- cgit v1.2.1