diff options
author | Mandrake <mandrake@mandriva.com> | 2006-08-13 13:02:50 +0000 |
---|---|---|
committer | Mandrake <mandrake@mandriva.com> | 2006-08-13 13:02:50 +0000 |
commit | 1e5c08f05ee87f14894fdf4d5fed4ba41826c665 (patch) | |
tree | 6b80a691c24b30c6654eac01cb9dded7f28ff219 /lib/Youri/Upload/Action/Archive.pm | |
parent | 34b9a191444dee5cad79b9258d1d14d2387e2279 (diff) | |
download | mga-youri-core-1e5c08f05ee87f14894fdf4d5fed4ba41826c665.tar mga-youri-core-1e5c08f05ee87f14894fdf4d5fed4ba41826c665.tar.gz mga-youri-core-1e5c08f05ee87f14894fdf4d5fed4ba41826c665.tar.bz2 mga-youri-core-1e5c08f05ee87f14894fdf4d5fed4ba41826c665.tar.xz mga-youri-core-1e5c08f05ee87f14894fdf4d5fed4ba41826c665.zip |
Delete file when installed; include section in the mail subject; move debug package to debug; add function to find main section, only compare package which main section is different (packages can be duplicate in main/release and main/testing
Diffstat (limited to 'lib/Youri/Upload/Action/Archive.pm')
-rw-r--r-- | lib/Youri/Upload/Action/Archive.pm | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/Youri/Upload/Action/Archive.pm b/lib/Youri/Upload/Action/Archive.pm index b13aa51..3626d88 100644 --- a/lib/Youri/Upload/Action/Archive.pm +++ b/lib/Youri/Upload/Action/Archive.pm @@ -29,11 +29,24 @@ sub _init { sub run { my ($self, $package, $repository, $target, $define) = @_; croak "Not a class method" unless ref $self; - + + my $section = $repository->_get_section($package, $target, $define); + my $main_section = $repository->_get_main_section($package, $target, $define); + print "section $section main_section $main_section\n" if $self->{_verbose}; + my $arch = $package->get_arch(); + $arch = $self->{_noarch} if $arch eq 'noarch'; + my $path = $arch eq 'src' ? "$target/SRPMS/" : "$target/$arch/media"; + $path = "$repository->{_install_root}/$path"; + $path =~ s,/+,/,g; + $self->{_verbose} = 1; foreach my $replaced_package ( $repository->get_replaced_packages($package, $target, $define) ) { my $file = $replaced_package->get_file(); + my ($rep_section, $rep_main_section) = $file =~ m,$path(([^/]+)/.*)/[^/]+.rpm,; + # We do accept duplicate version for other submedia of the same main media section + print "file $file section $rep_section main_section $rep_main_section ($path)\n" if $self->{_verbose}; + next if $rep_main_section eq $main_section && $rep_section ne $section; my $dest = $repository->get_archive_dir($package, $target, $define); print "archiving file $file to $dest\n" if $self->{_verbose}; |