diff options
author | Mandrake <mandrake@mandriva.com> | 2006-10-26 11:16:08 +0000 |
---|---|---|
committer | Mandrake <mandrake@mandriva.com> | 2006-10-26 11:16:08 +0000 |
commit | cee7f7283f7d9114ef4911a26b3bbcd31597788f (patch) | |
tree | 9bd67f16206475599cfd7b589186a6333b9f986f /lib/Youri/Submit/Post | |
parent | 1bb47f37da834b7bfc777ff3a6f8e8f9be26b385 (diff) | |
download | mga-youri-submit-cee7f7283f7d9114ef4911a26b3bbcd31597788f.tar mga-youri-submit-cee7f7283f7d9114ef4911a26b3bbcd31597788f.tar.gz mga-youri-submit-cee7f7283f7d9114ef4911a26b3bbcd31597788f.tar.bz2 mga-youri-submit-cee7f7283f7d9114ef4911a26b3bbcd31597788f.tar.xz mga-youri-submit-cee7f7283f7d9114ef4911a26b3bbcd31597788f.zip |
add gendistrib command directly into gendistrib module
Diffstat (limited to 'lib/Youri/Submit/Post')
-rw-r--r-- | lib/Youri/Submit/Post/Gendistrib.pm | 23 |
1 files changed, 19 insertions, 4 deletions
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 |