aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Youri/Submit/Post/Gendistrib.pm23
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