aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Youri/Check/Input/MandrivaConflicts.pm
diff options
context:
space:
mode:
authorFlorent Villard <warly@mandriva.com>2006-08-04 16:45:06 +0000
committerFlorent Villard <warly@mandriva.com>2006-08-04 16:45:06 +0000
commit0a7ef4aa1b338a6c23dccd0db15086596f05a22a (patch)
tree620105c88261aa086535f04d1ca5fba94cb4cbbf /lib/Youri/Check/Input/MandrivaConflicts.pm
parent1fec4f0cac5732229070c4ad2e24c01ba2bab51b (diff)
downloadmga-youri-core-0a7ef4aa1b338a6c23dccd0db15086596f05a22a.tar
mga-youri-core-0a7ef4aa1b338a6c23dccd0db15086596f05a22a.tar.gz
mga-youri-core-0a7ef4aa1b338a6c23dccd0db15086596f05a22a.tar.bz2
mga-youri-core-0a7ef4aa1b338a6c23dccd0db15086596f05a22a.tar.xz
mga-youri-core-0a7ef4aa1b338a6c23dccd0db15086596f05a22a.zip
imported initial version of youri svn
Diffstat (limited to 'lib/Youri/Check/Input/MandrivaConflicts.pm')
-rw-r--r--lib/Youri/Check/Input/MandrivaConflicts.pm63
1 files changed, 63 insertions, 0 deletions
diff --git a/lib/Youri/Check/Input/MandrivaConflicts.pm b/lib/Youri/Check/Input/MandrivaConflicts.pm
new file mode 100644
index 0000000..c43623b
--- /dev/null
+++ b/lib/Youri/Check/Input/MandrivaConflicts.pm
@@ -0,0 +1,63 @@
+# $Id: Conflicts.pm 533 2005-10-20 07:08:03Z guillomovitch $
+package Youri::Check::Input::MandrivaConflicts;
+
+=head1 NAME
+
+Youri::Check::Input::MandrivaConflicts - Check file conflicts on Mandriva
+
+=head1 DESCRIPTION
+
+This class checks file conflicts between packages, taking care of Mandriva
+packaging policy.
+
+=cut
+
+use warnings;
+use strict;
+use Carp;
+use Youri::Package;
+use base 'Youri::Check::Input::Conflicts';
+
+sub _directory_duplicate_exception {
+ my ($self, $package1, $package2, $file) = @_;
+
+ # allow shared directories between devel packages of different arch
+ return 1 if _multiarch_exception($package1, $package2);
+
+ # allow shared modules directories between perl packages
+ return 1 if
+ $file->[Youri::Package::FILE_NAME] =~ /^\/usr\/lib\/perl5\/vendor_perl\// &&
+ $file->[Youri::Package::FILE_NAME] !~ /^(auto|[^\/]+-linux)$/;
+
+ return 0;
+}
+
+sub _file_duplicate_exception {
+ my ($self, $package1, $package2, $file) = @_;
+
+ # allow shared files between devel packages of different arch
+ return 1 if _multiarch_exception($package1, $package2);
+
+ return 0;
+}
+
+sub _multiarch_exception {
+ my ($package1, $package2) = @_;
+
+ return 1 if
+ $package1->get_canonical_name() eq $package2->get_canonical_name()
+ && $package1->get_name() =~ /-devel$/
+ && $package2->get_name() =~ /-devel$/;
+
+ return 0;
+}
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2002-2006, YOURI project
+
+This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
+
+=cut
+
+1;