blob: 2b75ce460e6b1030b23eafed95d048495f9b1d77 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# $Id: CleanRpmsrate.pm 115367 2007-01-30 09:47:04Z pixel $
package Youri::Submit::Post::CleanRpmsrate;
=head1 NAME
Youri::Submit::Post::CleanRpmsrate - calls clean-rpmsrate
=head1 DESCRIPTION
Calls clean-rpmsrate
=cut
use warnings;
use strict;
use Carp;
use base qw/Youri::Submit::Post/;
#- inlined from MDK::Common::DataStructure
sub uniq { my %l; $l{$_} = 1 foreach @_; grep { delete $l{$_} } @_ }
sub _init {
}
sub run {
my ($self, $repository, $target, $define) = @_;
croak "Not a class method" unless ref $self;
my $root = $repository->get_install_root();
foreach my $arch (uniq(@{$repository->get_arch_changed($target)}, 'i586', 'x86_64')) {
my $rpmsrate = "$root/$target/$arch/media/media_info/rpmsrate";
my @media = "$root/$target/$arch/media/main/release";
system("cp", "$rpmsrate-raw", "$rpmsrate-new");
system("clean-rpmsrate", "$rpmsrate-new", @media);
system("mv", "-f", "$rpmsrate-new", $rpmsrate);
}
return
}
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2007, Mandriva <blino@mandriva.com>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
=cut
1;
|