summaryrefslogtreecommitdiffstats
path: root/zarb-ml/mageia-sysadm/attachments/20110106/4f8cb1c6
diff options
context:
space:
mode:
Diffstat (limited to 'zarb-ml/mageia-sysadm/attachments/20110106/4f8cb1c6')
-rw-r--r--zarb-ml/mageia-sysadm/attachments/20110106/4f8cb1c6/attachment-0001.html1172
-rw-r--r--zarb-ml/mageia-sysadm/attachments/20110106/4f8cb1c6/attachment.html1172
2 files changed, 2344 insertions, 0 deletions
diff --git a/zarb-ml/mageia-sysadm/attachments/20110106/4f8cb1c6/attachment-0001.html b/zarb-ml/mageia-sysadm/attachments/20110106/4f8cb1c6/attachment-0001.html
new file mode 100644
index 000000000..785637314
--- /dev/null
+++ b/zarb-ml/mageia-sysadm/attachments/20110106/4f8cb1c6/attachment-0001.html
@@ -0,0 +1,1172 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<title>[218] rename Mandriva_upload.pm to Mageia_upload.pm</title>
+</head>
+<body>
+
+<style type="text/css"><!--
+#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
+#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
+#msg dt:after { content:':';}
+#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
+#msg dl a { font-weight: bold}
+#msg dl a:link { color:#fc3; }
+#msg dl a:active { color:#ff0; }
+#msg dl a:visited { color:#cc6; }
+h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
+#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
+#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
+#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
+#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
+#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
+#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
+#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
+#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
+#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
+#logmsg pre { background: #eee; padding: 1em; }
+#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
+#logmsg dl { margin: 0; }
+#logmsg dt { font-weight: bold; }
+#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
+#logmsg dd:before { content:'\00bb';}
+#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
+#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
+#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
+#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
+#logmsg table th.Corner { text-align: left; }
+#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
+#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
+#patch { width: 100%; }
+--></style>
+<div id="msg">
+<dl class="meta">
+<dt>Revision</dt> <dd>218</dd>
+<dt>Author</dt> <dd>boklm</dd>
+<dt>Date</dt> <dd>2011-01-06 03:12:24 +0100 (Thu, 06 Jan 2011)</dd>
+</dl>
+
+<h3>Log Message</h3>
+<pre>rename Mandriva_upload.pm to Mageia_upload.pm</pre>
+
+<h3>Added Paths</h3>
+<ul>
+<li><a href="#build_systemmdvyouricoretrunklibYouriRepositoryMageia_uploadpm">build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mageia_upload.pm</a></li>
+</ul>
+
+<h3>Removed Paths</h3>
+<ul>
+<li><a href="#build_systemmdvyouricoretrunklibYouriRepositoryMandriva_uploadpm">build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mandriva_upload.pm</a></li>
+</ul>
+
+</div>
+<div id="patch"><pre>
+<a id="build_systemmdvyouricoretrunklibYouriRepositoryMageia_uploadpmfromrev210build_systemmdvyouricoretrunklibYouriRepositoryMandriva_uploadpm">Copied: build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mageia_upload.pm (from rev 210, build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mandriva_upload.pm)</a>
+===================================================================
+--- build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mageia_upload.pm (rev 0)
++++ build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mageia_upload.pm 2011-01-06 02:12:24 UTC (rev 218)
+@@ -0,0 +1,546 @@
++# $Id: /local/youri/soft/trunk/lib/Youri/Upload/Action/RSS.pm 857 2006-01-29T10:15:43.298856Z guillaume $
++package Youri::Repository::Mandriva_upload;
++
++=head1 NAME
++
++Youri::Repository::PLF - PLF repository implementation
++
++=head1 DESCRIPTION
++
++This module implements PLF repository.
++
++=cut
++
++use warnings;
++use strict;
++use Carp;
++use Memoize;
++use File::Find 'find';
++use base qw/Youri::Repository/;
++use MDV::Distribconf::Build;
++use SVN::Client;
++
++use constant {
++ PACKAGE_CLASS =&gt; 'Youri::Package::URPM',
++ PACKAGE_CHARSET =&gt; 'utf8'
++};
++
++memoize('_get_media_config');
++
++my %translate_arch = (
++ i386 =&gt; 'i586',
++ sparc64 =&gt; 'sparcv9',
++);
++
++sub _init {
++ my $self = shift;
++ my %options = (
++ noarch =&gt; 'i586', # noarch packages policy
++ src =&gt; 'i586',
++ install_root =&gt; '',
++ test =&gt; 0, # test mode
++ verbose =&gt; 0, # verbose mode
++ queue =&gt; '',
++ rejected =&gt; '',
++ @_
++ );
++ foreach my $var ('upload_state') {
++ $self-&gt;{&quot;_$var&quot;} = [];
++ foreach my $value (split ' ', $options{$var}) {
++ push @{$self-&gt;{&quot;_$var&quot;}}, $value
++ }
++ }
++ print &quot;Initializing repository\n&quot;;
++ foreach my $v ('rejected', 'svn', 'queue', 'noarch', 'install_root', 'upload_root', 'verbose') {
++ $self-&gt;{&quot;_$v&quot;} = $options{$v}
++ }
++ foreach my $target (@{$options{targets}}) {
++ $self-&gt;{$target} = [];
++ print &quot;Adding $target ($options{$target}{arch})\n&quot; if $self-&gt;{_verbose};
++ foreach my $value (split ' ', $options{$target}{arch}) {
++ push @{$self-&gt;{_arch}{$target}}, $value;
++ push @{$self-&gt;{_extra_arches}}, $value
++ }
++ }
++ $self
++}
++
++sub get_group_id {
++ my ($user) = @_;
++ my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time);
++ $year+=1900;
++ $mon++;
++ my $hostname = `hostname`;
++ my ($host) = $hostname =~ /([^.]*)/;
++ sprintf &quot;$year%02d%02d%02d%02d%02d.$user.$host.${$}_&quot;, $mon, $mday, $hour, $min, $sec;
++}
++
++sub get_target_arch {
++ my ($self, $target) = $_;
++ return $self-&gt;{_arch}{$target}
++}
++
++sub set_arch_changed {
++ my ($self, $target, $arch) = @_;
++ if ($arch eq 'noarch') {
++ $self-&gt;{_arch_changed}{$_} = 1 foreach @{$self-&gt;{_arch}{$target}}
++ } elsif ($arch eq 'src') {
++ $self-&gt;{_arch_changed} = $self-&gt;{_src}
++ } else {
++ $self-&gt;{_arch_changed}{$arch} = 1
++ }
++}
++
++sub get_arch_changed {
++ my ($self, $target) = @_;
++ return [ keys %{$self-&gt;{_arch_changed}} ]
++}
++
++sub set_install_dir_changed {
++ my ($self, $install_dir) = @_;
++ $self-&gt;{_install_dir_changed}{$install_dir} = 1;
++}
++
++sub get_install_dir_changed {
++ my ($self) = @_;
++ return [ keys %{$self-&gt;{_install_dir_changed}} ];
++}
++
++sub _get_media_config {
++ my ($self, $target) = @_;
++ my %media;
++ my $real_target = $target;
++ $real_target =~ s/_force//;
++ foreach my $arch (@{$self-&gt;{_arch}{$target}}) {
++ my $root = &quot;$self-&gt;{_install_root}/$real_target/$arch&quot;;
++ my $distrib = MDV::Distribconf::Build-&gt;new($root);
++ print &quot;Getting media config from $root\n&quot; if $self-&gt;{_verbose};
++ $self-&gt;{distrib}{$arch} = $distrib;
++ $distrib-&gt;loadtree or die &quot;$root does not seem to be a distribution tree\n&quot;;
++ $distrib-&gt;parse_mediacfg;
++ foreach my $media ($distrib-&gt;listmedia) {
++ my $rpms = $distrib-&gt;getvalue($media, 'rpms');
++ my $debug_for = $distrib-&gt;getvalue($media, 'debug_for');
++ my $srpms = $distrib-&gt;getvalue($media, 'srpms');
++ my $path = $distrib-&gt;getfullpath($media, 'path');
++ if (!$rpms) {
++ if (-d $path) {
++ print &quot;MEDIA defining $media in $path\n&quot; if $self-&gt;{_verbose} &gt; 1;
++ $media{$arch}{$media} = $path
++ } else {
++ print &quot;ERROR $path does not exist for media $media on $arch\n&quot;
++ }
++ } else {
++ my ($media) = split ' ', $rpms;
++ if (-d $path) {
++ print &quot;MEDIA defining SOURCE media for $media in $path\n&quot; if $self-&gt;{_verbose} &gt; 1;
++ $media{src}{$media} = $path
++ } else {
++ print &quot;ERROR $path does not exist for source media $media on $arch\n&quot;
++ }
++ }
++ }
++ }
++ \%media
++}
++
++sub get_package_class {
++ return PACKAGE_CLASS;
++}
++
++sub get_package_charset {
++ return PACKAGE_CHARSET;
++}
++
++sub get_upload_dir {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++ croak &quot;Not a class method&quot; unless ref $self;
++ my $arch = $package-&gt;get_arch();
++ return
++ $self-&gt;{_upload_root} .
++ &quot;/$self-&gt;{_queue}/$target/&quot; .
++ _get_section($self, $package, $target, $user_context, $app_context) .
++ '/' .
++ ($user_context-&gt;{prefix} ? '' : get_group_id($user_context-&gt;{user}))
++}
++
++sub get_install_path {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++
++ return $self-&gt;_get_path($package, $target, $user_context, $app_context);
++}
++
++
++sub get_distribution_paths {
++ my ($self, $package, $target) = @_;
++
++ return $self-&gt;_get_distribution_paths($package, $target);
++}
++
++sub get_archive_path {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++
++ return $self-&gt;_get_path($package, $target, $user_context, $app_context);
++}
++
++sub get_reject_path {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++
++ return $self-&gt;{_rejected};
++}
++
++
++sub _get_path {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++
++ my $section = $self-&gt;_get_section($package, $target, $user_context, $app_context);
++ my $arch = $app_context-&gt;{arch} || $package-&gt;get_arch();
++ $arch = $translate_arch{$arch} || $arch;
++ if ($arch eq 'noarch') {
++ $arch = $self-&gt;{_noarch}
++ } elsif ($arch eq 'src') {
++ return &quot;$target/SRPMS/$section&quot;
++ }
++ &quot;$target/$arch/media/$section&quot;
++}
++
++sub _get_distribution_paths {
++ my ($self, $package, $target) = @_;
++
++ my $arch = $package-&gt;get_arch();
++ $arch = $translate_arch{$arch} || $arch;
++ if ($arch eq 'noarch') {
++ map { &quot;$target/$_&quot; } $self-&gt;get_extra_arches;
++ } elsif ($arch eq 'src') {
++ die &quot;no way to get distribution path using a $arch package&quot;;
++ } else {
++ &quot;$target/$arch&quot;;
++ }
++}
++
++sub get_arch {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++ my $arch = $package-&gt;get_arch();
++ $arch = $translate_arch{$arch} || $arch;
++ if ($arch eq 'noarch') {
++ $arch = $self-&gt;{_noarch}
++ }
++ $arch
++}
++
++sub get_version_path {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++
++ my $section = $self-&gt;_get_section($package, $target, $user_context, $app_context);
++
++ return &quot;$self-&gt;{_module}/$section&quot;;
++}
++
++=head2 get_replaced_packages($package, $target, $user_context, $app_context)
++
++Overrides parent method to add libified packages.
++
++=cut
++
++sub get_replaced_packages {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++ croak &quot;Not a class method&quot; unless ref $self;
++
++ my @replaced_packages =
++ $self-&gt;SUPER::get_replaced_packages($package, $target, $user_context, $app_context);
++
++ # mandriva lib policy:
++ # library package names change with revision, making mandatory to
++ # duplicate older revisions search with a custom pattern
++ my $name = $package-&gt;get_name();
++ if ($name =~ /^(lib\w+[a-zA-Z_])[\d_\.]+([-\w]*)$/) {
++ push(@replaced_packages,
++ grep { $package-&gt;compare($_) &gt; 0 }
++ map { PACKAGE_CLASS-&gt;new(file =&gt; $_) }
++ $self-&gt;get_files(
++ $self-&gt;{_install_root},
++ $self-&gt;get_install_path($package, $target, $user_context, $app_context),
++ PACKAGE_CLASS-&gt;get_pattern(
++ $1 . '[\d_\.]+' . $2, # custom name pattern
++ undef,
++ undef,
++ $package-&gt;get_arch()
++ ),
++ )
++ );
++ }
++
++ # kernel packages have the version in the name
++ # binary dkms built for old kernels have to be removed too
++ if ($name =~ /^kernel-([^\d]*-)?([\d.]*)-(.*)$/) { # &quot;desktop&quot;, &quot;2.6.28&quot;, &quot;2mnb&quot;
++ push(@replaced_packages,
++ map { PACKAGE_CLASS-&gt;new(file =&gt; $_) }
++ $self-&gt;get_files(
++ $self-&gt;{_install_root},
++ $self-&gt;get_install_path($package, $target, $user_context, $app_context),
++ PACKAGE_CLASS-&gt;get_pattern(
++ '(kernel-' . $1 . '\d.*|.*-kernel-[\d.]*-' . $1 . '\d.*)',
++ undef,
++ undef,
++ $package-&gt;get_arch()
++ ),
++ )
++ );
++ }
++
++ return @replaced_packages;
++
++}
++
++sub _get_main_section {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++
++ my $section = $self-&gt;_get_section($package, $target, $user_context, $app_context);
++ my ($main_section) = $section =~ m,^([^/]+),;
++ $main_section
++}
++
++sub _get_section {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++
++ my $name = $package-&gt;get_name();
++ my $cname = $package-&gt;get_canonical_name();
++ my $version = $package-&gt;get_version();
++ my $release = $package-&gt;get_release();
++ my $section = $user_context-&gt;{section};
++ my $media = $self-&gt;_get_media_config($target);
++ my $arch = $package-&gt;get_arch();
++ my $file = $package-&gt;as_file();
++ $file =~ s,/+,/,g; # unneeded?
++ # FIXME: use $self-&gt;get_arch()
++ $arch = $self-&gt;{_noarch} if $arch eq 'noarch';
++ $arch = $translate_arch{$arch} || $arch;
++
++ if (!$section) {
++ $section = $self-&gt;{packages}{$file}{section};
++ print &quot;Section undefined, repository says it is '$section' for '$file'\n&quot; if $self-&gt;{_verbose};
++ }
++ if ($section &amp;&amp; $section !~ /debug_/ &amp;&amp; $package-&gt;is_debug()) {
++ $section = &quot;debug_$section&quot;
++ }
++
++ # if have section already, check if it exists, and may return immediately
++ if ($section) {
++ print &quot;Using requested section $section\n&quot;;
++ if ($media-&gt;{$arch}{$section}) {
++ return $section
++ } else {
++ die &quot;FATAL youri: unknown section $section for target $target for arch $arch\n&quot;
++ }
++ }
++ # else, try to find section automatically
++
++ # pattern for search of src package with specific version-release,
++ # should be searched first, because we prefer to find the precise
++ # section a package is already in
++ my $specific_source_pattern = PACKAGE_CLASS-&gt;get_pattern(
++ $cname,
++ $version,
++ $release,
++ 'src'
++ );
++
++ my $source_pattern = PACKAGE_CLASS-&gt;get_pattern(
++ $cname,
++ undef,
++ undef,
++ 'src'
++ );
++
++ # if a media has no source media configured, or if it is a debug
++ # package, we search in binary media
++
++ # pattern for search when a binary media has no src media configured
++ my $specific_binary_pattern = PACKAGE_CLASS-&gt;get_pattern(
++ $name,
++ $version,
++ $release,
++ $arch
++ );
++
++ # last resort pattern: previous existing binary packages
++ my $binary_pattern = PACKAGE_CLASS-&gt;get_pattern(
++ $name,
++ undef,
++ undef,
++ $arch
++ );
++
++ # first try to find section for the specific version, as it is possibly already there;
++ # this is the case for when called in Youri::Submit::Action::Archive, to find the
++ # section the package got installed
++ print &quot;Looking for package $name with version $version-$release\n&quot;;
++ foreach my $m (keys %{$media-&gt;{$arch}}) {
++ print &quot; .. section '$m' path '&quot;.$media-&gt;{$arch}{$m}.&quot;'\n&quot; if $self-&gt;{_verbose};
++ # - prefer source for non-debug packages, use binary if there is no source media configured
++ # - debug packages must be searched in binary medias, due to their
++ # src section != binary section; NOTE: should/need we search in
++ # src medias and add the 'debug_' prefix?
++ if (!$package-&gt;is_debug() &amp;&amp; $media-&gt;{src}{$m}) {
++ next unless $self-&gt;get_files('', $media-&gt;{src}{$m}, $specific_source_pattern);
++ } else {
++ next unless $self-&gt;get_files('', $media-&gt;{$arch}{$m}, $specific_binary_pattern);
++ }
++ $section = $m;
++ last;
++ }
++
++ # if still not found, try finding any version of the package in a
++ # /release subsection (safe default: /release is default for cooker,
++ # should be locked for released distros, and we don't risk wrongly
++ # choosing /backports, /testing, or /updates);
++ # this is the case for when called at submit, to find the section where
++ # the package already resides
++ if (!$section) {
++ # debug packages should be found by previous specific version search
++ # NOTE: as above, should/need we search here and add the 'debug_' prefix?
++ # ... probably... as at least mdv-youri-submit-force will process debug packages
++ if ($package-&gt;is_debug() &amp;&amp; $self-&gt;{_verbose}) {
++ print &quot;Warning: debug package $name with version $version-$release not found.\n&quot;;
++ }
++
++ print &quot;Warning: Looking for any section with a package $name of any version\n&quot;;
++ foreach my $m (keys %{$media-&gt;{$arch}}) {
++ print &quot; .. section '$m' path '&quot;.$media-&gt;{$arch}{$m}.&quot;'\n&quot; if $self-&gt;{_verbose};
++ # NOTE: !$package-&gt;is_debug() test is here to prevent when above FATAL error is removed
++ next if $m !~ /release/ || ($m =~ /debug/ &amp;&amp; !$package-&gt;is_debug());
++ # - prefer source
++ if ($media-&gt;{src}{$m}) {
++ next unless $self-&gt;get_files('', $media-&gt;{src}{$m}, $source_pattern);
++ } else {
++ next unless $self-&gt;get_files('', $media-&gt;{$arch}{$m}, $binary_pattern);
++ }
++ $section = $m;
++ last;
++ }
++ }
++
++ # FIXME: doing this here is wrong; this way the caller can never know if
++ # a section was actually found or not; should return undef and let the
++ # caller set a default (Note: IIRC PLF|Zarb has this right, see there) -spuk
++ print STDERR &quot;Warning: Can't guess destination: section missing, defaulting to contrib/release\n&quot; unless $section;
++ $section ||= 'contrib/release';
++
++ # next time we don't need to search everything again
++ $self-&gt;{packages}{$file}{section} = $section;
++
++ print &quot;Section is '$section'.\n&quot;;
++
++ return $section;
++}
++
++sub get_upload_newer_revisions {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++ croak &quot;Not a class method&quot; unless ref $self;
++ my $arch = $package-&gt;get_arch();
++ my $name = $package-&gt;get_full_name;
++ $name =~ s/^\@\d+://;
++ my $pattern = $self-&gt;get_package_class()-&gt;get_pattern($package-&gt;get_name(), undef, undef, $arch);
++ my $media = $self-&gt;_get_media_config($target);
++ my @packages;
++ foreach my $state (@{$self-&gt;{_upload_state}}) {
++ foreach my $m (keys %{$media-&gt;{$arch}}) {
++ my $path = &quot;$self-&gt;{_upload_root}/$state/$target/$m&quot;;
++ print &quot;Looking for package $package revisions for $target in $path (pattern $pattern)\n&quot; if $self-&gt;{_verbose};
++ find(
++ sub {
++ s/\d{14}\.[^.]*\.[^.]*\.\d+_//;
++ s/^\@\d+://;
++ return if ! /^$pattern/;
++ return if /\.info$/;
++ print &quot;Find $_\n&quot;;
++ push @packages, $File::Find::name if $package-&gt;check_ranges_compatibility(&quot;== $name&quot;, &quot;&lt; $_&quot;)
++ }, $path);
++ }
++ }
++ return
++ @packages;
++}
++
++sub package_in_svn {
++ my ($self, $srpm_name) = @_;
++ my $ctx = new SVN::Client(
++ auth =&gt; [SVN::Client::get_simple_provider(),
++ SVN::Client::get_simple_prompt_provider(\&amp;simple_prompt,2),
++ SVN::Client::get_username_provider()]
++ );
++
++ my $svn_entry = $ctx-&gt;ls(&quot;$self-&gt;{_svn}/$srpm_name&quot;, 'HEAD', 0);
++ if ($svn_entry) {
++ print &quot;Package $srpm_name is in the SVN\n&quot;;
++ return 1
++ }
++}
++
++sub get_svn_url {
++ my ($self) = @_;
++ $self-&gt;{_svn}
++}
++
++sub get_revisions {
++ my ($self, $package, $target, $user_context, $app_context, $filter) = @_;
++ croak &quot;Not a class method&quot; unless ref $self;
++ print &quot;Looking for package $package revisions for $target\n&quot; if $self-&gt;{_verbose} &gt; 0;
++
++ my $arch = $app_context-&gt;{arch} || $user_context-&gt;{arch} || $package-&gt;get_arch();
++ my $media_arch = $arch eq 'noarch' ? $self-&gt;{_noarch} : $arch;
++ my $path = $arch eq 'src' ? &quot;$target/SRPMS/&quot; : &quot;$target/$media_arch/media&quot;;
++ my $media = $self-&gt;_get_section($package, $target, $user_context, $app_context);
++ my $name = $package-&gt;get_name();
++ my @packages = map { $self-&gt;get_package_class()-&gt;new(file =&gt; $_) }
++ $self-&gt;get_files(
++ $self-&gt;{_install_root},
++ &quot;$path/$media&quot;,
++ $self-&gt;get_package_class()-&gt;get_pattern(
++ $name,
++ undef,
++ undef,
++ $package-&gt;get_arch(),
++ )
++ );
++
++ @packages = grep { $filter-&gt;($_) } @packages if $filter;
++
++ return
++ sort { $b-&gt;compare($a) } # sort by revision order
++ @packages;
++}
++
++sub reject {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++ croak &quot;Not a class method&quot; unless ref $self;
++
++
++}
++
++sub get_archive_dir {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++ croak &quot;Not a class method&quot; unless ref $self;
++
++ return
++ $self-&gt;{_archive_root}
++}
++
++
++# 20060801 warly
++#
++# Upload steps
++# SRPMS are uploaded in /home/mandrake/uploads/todo/$target/$media/group_id
++#
++#
++#
++
++=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;
+
+<a id="build_systemmdvyouricoretrunklibYouriRepositoryMandriva_uploadpm">Deleted: build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mandriva_upload.pm</a>
+===================================================================
+--- build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mandriva_upload.pm 2011-01-06 02:11:28 UTC (rev 217)
++++ build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mandriva_upload.pm 2011-01-06 02:12:24 UTC (rev 218)
+@@ -1,546 +0,0 @@
+-# $Id: /local/youri/soft/trunk/lib/Youri/Upload/Action/RSS.pm 857 2006-01-29T10:15:43.298856Z guillaume $
+-package Youri::Repository::Mandriva_upload;
+-
+-=head1 NAME
+-
+-Youri::Repository::PLF - PLF repository implementation
+-
+-=head1 DESCRIPTION
+-
+-This module implements PLF repository.
+-
+-=cut
+-
+-use warnings;
+-use strict;
+-use Carp;
+-use Memoize;
+-use File::Find 'find';
+-use base qw/Youri::Repository/;
+-use MDV::Distribconf::Build;
+-use SVN::Client;
+-
+-use constant {
+- PACKAGE_CLASS =&gt; 'Youri::Package::URPM',
+- PACKAGE_CHARSET =&gt; 'utf8'
+-};
+-
+-memoize('_get_media_config');
+-
+-my %translate_arch = (
+- i386 =&gt; 'i586',
+- sparc64 =&gt; 'sparcv9',
+-);
+-
+-sub _init {
+- my $self = shift;
+- my %options = (
+- noarch =&gt; 'i586', # noarch packages policy
+- src =&gt; 'i586',
+- install_root =&gt; '',
+- test =&gt; 0, # test mode
+- verbose =&gt; 0, # verbose mode
+- queue =&gt; '',
+- rejected =&gt; '',
+- @_
+- );
+- foreach my $var ('upload_state') {
+- $self-&gt;{&quot;_$var&quot;} = [];
+- foreach my $value (split ' ', $options{$var}) {
+- push @{$self-&gt;{&quot;_$var&quot;}}, $value
+- }
+- }
+- print &quot;Initializing repository\n&quot;;
+- foreach my $v ('rejected', 'svn', 'queue', 'noarch', 'install_root', 'upload_root', 'verbose') {
+- $self-&gt;{&quot;_$v&quot;} = $options{$v}
+- }
+- foreach my $target (@{$options{targets}}) {
+- $self-&gt;{$target} = [];
+- print &quot;Adding $target ($options{$target}{arch})\n&quot; if $self-&gt;{_verbose};
+- foreach my $value (split ' ', $options{$target}{arch}) {
+- push @{$self-&gt;{_arch}{$target}}, $value;
+- push @{$self-&gt;{_extra_arches}}, $value
+- }
+- }
+- $self
+-}
+-
+-sub get_group_id {
+- my ($user) = @_;
+- my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time);
+- $year+=1900;
+- $mon++;
+- my $hostname = `hostname`;
+- my ($host) = $hostname =~ /([^.]*)/;
+- sprintf &quot;$year%02d%02d%02d%02d%02d.$user.$host.${$}_&quot;, $mon, $mday, $hour, $min, $sec;
+-}
+-
+-sub get_target_arch {
+- my ($self, $target) = $_;
+- return $self-&gt;{_arch}{$target}
+-}
+-
+-sub set_arch_changed {
+- my ($self, $target, $arch) = @_;
+- if ($arch eq 'noarch') {
+- $self-&gt;{_arch_changed}{$_} = 1 foreach @{$self-&gt;{_arch}{$target}}
+- } elsif ($arch eq 'src') {
+- $self-&gt;{_arch_changed} = $self-&gt;{_src}
+- } else {
+- $self-&gt;{_arch_changed}{$arch} = 1
+- }
+-}
+-
+-sub get_arch_changed {
+- my ($self, $target) = @_;
+- return [ keys %{$self-&gt;{_arch_changed}} ]
+-}
+-
+-sub set_install_dir_changed {
+- my ($self, $install_dir) = @_;
+- $self-&gt;{_install_dir_changed}{$install_dir} = 1;
+-}
+-
+-sub get_install_dir_changed {
+- my ($self) = @_;
+- return [ keys %{$self-&gt;{_install_dir_changed}} ];
+-}
+-
+-sub _get_media_config {
+- my ($self, $target) = @_;
+- my %media;
+- my $real_target = $target;
+- $real_target =~ s/_force//;
+- foreach my $arch (@{$self-&gt;{_arch}{$target}}) {
+- my $root = &quot;$self-&gt;{_install_root}/$real_target/$arch&quot;;
+- my $distrib = MDV::Distribconf::Build-&gt;new($root);
+- print &quot;Getting media config from $root\n&quot; if $self-&gt;{_verbose};
+- $self-&gt;{distrib}{$arch} = $distrib;
+- $distrib-&gt;loadtree or die &quot;$root does not seem to be a distribution tree\n&quot;;
+- $distrib-&gt;parse_mediacfg;
+- foreach my $media ($distrib-&gt;listmedia) {
+- my $rpms = $distrib-&gt;getvalue($media, 'rpms');
+- my $debug_for = $distrib-&gt;getvalue($media, 'debug_for');
+- my $srpms = $distrib-&gt;getvalue($media, 'srpms');
+- my $path = $distrib-&gt;getfullpath($media, 'path');
+- if (!$rpms) {
+- if (-d $path) {
+- print &quot;MEDIA defining $media in $path\n&quot; if $self-&gt;{_verbose} &gt; 1;
+- $media{$arch}{$media} = $path
+- } else {
+- print &quot;ERROR $path does not exist for media $media on $arch\n&quot;
+- }
+- } else {
+- my ($media) = split ' ', $rpms;
+- if (-d $path) {
+- print &quot;MEDIA defining SOURCE media for $media in $path\n&quot; if $self-&gt;{_verbose} &gt; 1;
+- $media{src}{$media} = $path
+- } else {
+- print &quot;ERROR $path does not exist for source media $media on $arch\n&quot;
+- }
+- }
+- }
+- }
+- \%media
+-}
+-
+-sub get_package_class {
+- return PACKAGE_CLASS;
+-}
+-
+-sub get_package_charset {
+- return PACKAGE_CHARSET;
+-}
+-
+-sub get_upload_dir {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+- croak &quot;Not a class method&quot; unless ref $self;
+- my $arch = $package-&gt;get_arch();
+- return
+- $self-&gt;{_upload_root} .
+- &quot;/$self-&gt;{_queue}/$target/&quot; .
+- _get_section($self, $package, $target, $user_context, $app_context) .
+- '/' .
+- ($user_context-&gt;{prefix} ? '' : get_group_id($user_context-&gt;{user}))
+-}
+-
+-sub get_install_path {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+-
+- return $self-&gt;_get_path($package, $target, $user_context, $app_context);
+-}
+-
+-
+-sub get_distribution_paths {
+- my ($self, $package, $target) = @_;
+-
+- return $self-&gt;_get_distribution_paths($package, $target);
+-}
+-
+-sub get_archive_path {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+-
+- return $self-&gt;_get_path($package, $target, $user_context, $app_context);
+-}
+-
+-sub get_reject_path {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+-
+- return $self-&gt;{_rejected};
+-}
+-
+-
+-sub _get_path {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+-
+- my $section = $self-&gt;_get_section($package, $target, $user_context, $app_context);
+- my $arch = $app_context-&gt;{arch} || $package-&gt;get_arch();
+- $arch = $translate_arch{$arch} || $arch;
+- if ($arch eq 'noarch') {
+- $arch = $self-&gt;{_noarch}
+- } elsif ($arch eq 'src') {
+- return &quot;$target/SRPMS/$section&quot;
+- }
+- &quot;$target/$arch/media/$section&quot;
+-}
+-
+-sub _get_distribution_paths {
+- my ($self, $package, $target) = @_;
+-
+- my $arch = $package-&gt;get_arch();
+- $arch = $translate_arch{$arch} || $arch;
+- if ($arch eq 'noarch') {
+- map { &quot;$target/$_&quot; } $self-&gt;get_extra_arches;
+- } elsif ($arch eq 'src') {
+- die &quot;no way to get distribution path using a $arch package&quot;;
+- } else {
+- &quot;$target/$arch&quot;;
+- }
+-}
+-
+-sub get_arch {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+- my $arch = $package-&gt;get_arch();
+- $arch = $translate_arch{$arch} || $arch;
+- if ($arch eq 'noarch') {
+- $arch = $self-&gt;{_noarch}
+- }
+- $arch
+-}
+-
+-sub get_version_path {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+-
+- my $section = $self-&gt;_get_section($package, $target, $user_context, $app_context);
+-
+- return &quot;$self-&gt;{_module}/$section&quot;;
+-}
+-
+-=head2 get_replaced_packages($package, $target, $user_context, $app_context)
+-
+-Overrides parent method to add libified packages.
+-
+-=cut
+-
+-sub get_replaced_packages {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+- croak &quot;Not a class method&quot; unless ref $self;
+-
+- my @replaced_packages =
+- $self-&gt;SUPER::get_replaced_packages($package, $target, $user_context, $app_context);
+-
+- # mandriva lib policy:
+- # library package names change with revision, making mandatory to
+- # duplicate older revisions search with a custom pattern
+- my $name = $package-&gt;get_name();
+- if ($name =~ /^(lib\w+[a-zA-Z_])[\d_\.]+([-\w]*)$/) {
+- push(@replaced_packages,
+- grep { $package-&gt;compare($_) &gt; 0 }
+- map { PACKAGE_CLASS-&gt;new(file =&gt; $_) }
+- $self-&gt;get_files(
+- $self-&gt;{_install_root},
+- $self-&gt;get_install_path($package, $target, $user_context, $app_context),
+- PACKAGE_CLASS-&gt;get_pattern(
+- $1 . '[\d_\.]+' . $2, # custom name pattern
+- undef,
+- undef,
+- $package-&gt;get_arch()
+- ),
+- )
+- );
+- }
+-
+- # kernel packages have the version in the name
+- # binary dkms built for old kernels have to be removed too
+- if ($name =~ /^kernel-([^\d]*-)?([\d.]*)-(.*)$/) { # &quot;desktop&quot;, &quot;2.6.28&quot;, &quot;2mnb&quot;
+- push(@replaced_packages,
+- map { PACKAGE_CLASS-&gt;new(file =&gt; $_) }
+- $self-&gt;get_files(
+- $self-&gt;{_install_root},
+- $self-&gt;get_install_path($package, $target, $user_context, $app_context),
+- PACKAGE_CLASS-&gt;get_pattern(
+- '(kernel-' . $1 . '\d.*|.*-kernel-[\d.]*-' . $1 . '\d.*)',
+- undef,
+- undef,
+- $package-&gt;get_arch()
+- ),
+- )
+- );
+- }
+-
+- return @replaced_packages;
+-
+-}
+-
+-sub _get_main_section {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+-
+- my $section = $self-&gt;_get_section($package, $target, $user_context, $app_context);
+- my ($main_section) = $section =~ m,^([^/]+),;
+- $main_section
+-}
+-
+-sub _get_section {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+-
+- my $name = $package-&gt;get_name();
+- my $cname = $package-&gt;get_canonical_name();
+- my $version = $package-&gt;get_version();
+- my $release = $package-&gt;get_release();
+- my $section = $user_context-&gt;{section};
+- my $media = $self-&gt;_get_media_config($target);
+- my $arch = $package-&gt;get_arch();
+- my $file = $package-&gt;as_file();
+- $file =~ s,/+,/,g; # unneeded?
+- # FIXME: use $self-&gt;get_arch()
+- $arch = $self-&gt;{_noarch} if $arch eq 'noarch';
+- $arch = $translate_arch{$arch} || $arch;
+-
+- if (!$section) {
+- $section = $self-&gt;{packages}{$file}{section};
+- print &quot;Section undefined, repository says it is '$section' for '$file'\n&quot; if $self-&gt;{_verbose};
+- }
+- if ($section &amp;&amp; $section !~ /debug_/ &amp;&amp; $package-&gt;is_debug()) {
+- $section = &quot;debug_$section&quot;
+- }
+-
+- # if have section already, check if it exists, and may return immediately
+- if ($section) {
+- print &quot;Using requested section $section\n&quot;;
+- if ($media-&gt;{$arch}{$section}) {
+- return $section
+- } else {
+- die &quot;FATAL youri: unknown section $section for target $target for arch $arch\n&quot;
+- }
+- }
+- # else, try to find section automatically
+-
+- # pattern for search of src package with specific version-release,
+- # should be searched first, because we prefer to find the precise
+- # section a package is already in
+- my $specific_source_pattern = PACKAGE_CLASS-&gt;get_pattern(
+- $cname,
+- $version,
+- $release,
+- 'src'
+- );
+-
+- my $source_pattern = PACKAGE_CLASS-&gt;get_pattern(
+- $cname,
+- undef,
+- undef,
+- 'src'
+- );
+-
+- # if a media has no source media configured, or if it is a debug
+- # package, we search in binary media
+-
+- # pattern for search when a binary media has no src media configured
+- my $specific_binary_pattern = PACKAGE_CLASS-&gt;get_pattern(
+- $name,
+- $version,
+- $release,
+- $arch
+- );
+-
+- # last resort pattern: previous existing binary packages
+- my $binary_pattern = PACKAGE_CLASS-&gt;get_pattern(
+- $name,
+- undef,
+- undef,
+- $arch
+- );
+-
+- # first try to find section for the specific version, as it is possibly already there;
+- # this is the case for when called in Youri::Submit::Action::Archive, to find the
+- # section the package got installed
+- print &quot;Looking for package $name with version $version-$release\n&quot;;
+- foreach my $m (keys %{$media-&gt;{$arch}}) {
+- print &quot; .. section '$m' path '&quot;.$media-&gt;{$arch}{$m}.&quot;'\n&quot; if $self-&gt;{_verbose};
+- # - prefer source for non-debug packages, use binary if there is no source media configured
+- # - debug packages must be searched in binary medias, due to their
+- # src section != binary section; NOTE: should/need we search in
+- # src medias and add the 'debug_' prefix?
+- if (!$package-&gt;is_debug() &amp;&amp; $media-&gt;{src}{$m}) {
+- next unless $self-&gt;get_files('', $media-&gt;{src}{$m}, $specific_source_pattern);
+- } else {
+- next unless $self-&gt;get_files('', $media-&gt;{$arch}{$m}, $specific_binary_pattern);
+- }
+- $section = $m;
+- last;
+- }
+-
+- # if still not found, try finding any version of the package in a
+- # /release subsection (safe default: /release is default for cooker,
+- # should be locked for released distros, and we don't risk wrongly
+- # choosing /backports, /testing, or /updates);
+- # this is the case for when called at submit, to find the section where
+- # the package already resides
+- if (!$section) {
+- # debug packages should be found by previous specific version search
+- # NOTE: as above, should/need we search here and add the 'debug_' prefix?
+- # ... probably... as at least mdv-youri-submit-force will process debug packages
+- if ($package-&gt;is_debug() &amp;&amp; $self-&gt;{_verbose}) {
+- print &quot;Warning: debug package $name with version $version-$release not found.\n&quot;;
+- }
+-
+- print &quot;Warning: Looking for any section with a package $name of any version\n&quot;;
+- foreach my $m (keys %{$media-&gt;{$arch}}) {
+- print &quot; .. section '$m' path '&quot;.$media-&gt;{$arch}{$m}.&quot;'\n&quot; if $self-&gt;{_verbose};
+- # NOTE: !$package-&gt;is_debug() test is here to prevent when above FATAL error is removed
+- next if $m !~ /release/ || ($m =~ /debug/ &amp;&amp; !$package-&gt;is_debug());
+- # - prefer source
+- if ($media-&gt;{src}{$m}) {
+- next unless $self-&gt;get_files('', $media-&gt;{src}{$m}, $source_pattern);
+- } else {
+- next unless $self-&gt;get_files('', $media-&gt;{$arch}{$m}, $binary_pattern);
+- }
+- $section = $m;
+- last;
+- }
+- }
+-
+- # FIXME: doing this here is wrong; this way the caller can never know if
+- # a section was actually found or not; should return undef and let the
+- # caller set a default (Note: IIRC PLF|Zarb has this right, see there) -spuk
+- print STDERR &quot;Warning: Can't guess destination: section missing, defaulting to contrib/release\n&quot; unless $section;
+- $section ||= 'contrib/release';
+-
+- # next time we don't need to search everything again
+- $self-&gt;{packages}{$file}{section} = $section;
+-
+- print &quot;Section is '$section'.\n&quot;;
+-
+- return $section;
+-}
+-
+-sub get_upload_newer_revisions {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+- croak &quot;Not a class method&quot; unless ref $self;
+- my $arch = $package-&gt;get_arch();
+- my $name = $package-&gt;get_full_name;
+- $name =~ s/^\@\d+://;
+- my $pattern = $self-&gt;get_package_class()-&gt;get_pattern($package-&gt;get_name(), undef, undef, $arch);
+- my $media = $self-&gt;_get_media_config($target);
+- my @packages;
+- foreach my $state (@{$self-&gt;{_upload_state}}) {
+- foreach my $m (keys %{$media-&gt;{$arch}}) {
+- my $path = &quot;$self-&gt;{_upload_root}/$state/$target/$m&quot;;
+- print &quot;Looking for package $package revisions for $target in $path (pattern $pattern)\n&quot; if $self-&gt;{_verbose};
+- find(
+- sub {
+- s/\d{14}\.[^.]*\.[^.]*\.\d+_//;
+- s/^\@\d+://;
+- return if ! /^$pattern/;
+- return if /\.info$/;
+- print &quot;Find $_\n&quot;;
+- push @packages, $File::Find::name if $package-&gt;check_ranges_compatibility(&quot;== $name&quot;, &quot;&lt; $_&quot;)
+- }, $path);
+- }
+- }
+- return
+- @packages;
+-}
+-
+-sub package_in_svn {
+- my ($self, $srpm_name) = @_;
+- my $ctx = new SVN::Client(
+- auth =&gt; [SVN::Client::get_simple_provider(),
+- SVN::Client::get_simple_prompt_provider(\&amp;simple_prompt,2),
+- SVN::Client::get_username_provider()]
+- );
+-
+- my $svn_entry = $ctx-&gt;ls(&quot;$self-&gt;{_svn}/$srpm_name&quot;, 'HEAD', 0);
+- if ($svn_entry) {
+- print &quot;Package $srpm_name is in the SVN\n&quot;;
+- return 1
+- }
+-}
+-
+-sub get_svn_url {
+- my ($self) = @_;
+- $self-&gt;{_svn}
+-}
+-
+-sub get_revisions {
+- my ($self, $package, $target, $user_context, $app_context, $filter) = @_;
+- croak &quot;Not a class method&quot; unless ref $self;
+- print &quot;Looking for package $package revisions for $target\n&quot; if $self-&gt;{_verbose} &gt; 0;
+-
+- my $arch = $app_context-&gt;{arch} || $user_context-&gt;{arch} || $package-&gt;get_arch();
+- my $media_arch = $arch eq 'noarch' ? $self-&gt;{_noarch} : $arch;
+- my $path = $arch eq 'src' ? &quot;$target/SRPMS/&quot; : &quot;$target/$media_arch/media&quot;;
+- my $media = $self-&gt;_get_section($package, $target, $user_context, $app_context);
+- my $name = $package-&gt;get_name();
+- my @packages = map { $self-&gt;get_package_class()-&gt;new(file =&gt; $_) }
+- $self-&gt;get_files(
+- $self-&gt;{_install_root},
+- &quot;$path/$media&quot;,
+- $self-&gt;get_package_class()-&gt;get_pattern(
+- $name,
+- undef,
+- undef,
+- $package-&gt;get_arch(),
+- )
+- );
+-
+- @packages = grep { $filter-&gt;($_) } @packages if $filter;
+-
+- return
+- sort { $b-&gt;compare($a) } # sort by revision order
+- @packages;
+-}
+-
+-sub reject {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+- croak &quot;Not a class method&quot; unless ref $self;
+-
+-
+-}
+-
+-sub get_archive_dir {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+- croak &quot;Not a class method&quot; unless ref $self;
+-
+- return
+- $self-&gt;{_archive_root}
+-}
+-
+-
+-# 20060801 warly
+-#
+-# Upload steps
+-# SRPMS are uploaded in /home/mandrake/uploads/todo/$target/$media/group_id
+-#
+-#
+-#
+-
+-=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;
+
+</pre></div>
+
+</body>
+</html> \ No newline at end of file
diff --git a/zarb-ml/mageia-sysadm/attachments/20110106/4f8cb1c6/attachment.html b/zarb-ml/mageia-sysadm/attachments/20110106/4f8cb1c6/attachment.html
new file mode 100644
index 000000000..785637314
--- /dev/null
+++ b/zarb-ml/mageia-sysadm/attachments/20110106/4f8cb1c6/attachment.html
@@ -0,0 +1,1172 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<title>[218] rename Mandriva_upload.pm to Mageia_upload.pm</title>
+</head>
+<body>
+
+<style type="text/css"><!--
+#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
+#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
+#msg dt:after { content:':';}
+#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
+#msg dl a { font-weight: bold}
+#msg dl a:link { color:#fc3; }
+#msg dl a:active { color:#ff0; }
+#msg dl a:visited { color:#cc6; }
+h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
+#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
+#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
+#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
+#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
+#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
+#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
+#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
+#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
+#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
+#logmsg pre { background: #eee; padding: 1em; }
+#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
+#logmsg dl { margin: 0; }
+#logmsg dt { font-weight: bold; }
+#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
+#logmsg dd:before { content:'\00bb';}
+#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
+#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
+#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
+#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
+#logmsg table th.Corner { text-align: left; }
+#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
+#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
+#patch { width: 100%; }
+--></style>
+<div id="msg">
+<dl class="meta">
+<dt>Revision</dt> <dd>218</dd>
+<dt>Author</dt> <dd>boklm</dd>
+<dt>Date</dt> <dd>2011-01-06 03:12:24 +0100 (Thu, 06 Jan 2011)</dd>
+</dl>
+
+<h3>Log Message</h3>
+<pre>rename Mandriva_upload.pm to Mageia_upload.pm</pre>
+
+<h3>Added Paths</h3>
+<ul>
+<li><a href="#build_systemmdvyouricoretrunklibYouriRepositoryMageia_uploadpm">build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mageia_upload.pm</a></li>
+</ul>
+
+<h3>Removed Paths</h3>
+<ul>
+<li><a href="#build_systemmdvyouricoretrunklibYouriRepositoryMandriva_uploadpm">build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mandriva_upload.pm</a></li>
+</ul>
+
+</div>
+<div id="patch"><pre>
+<a id="build_systemmdvyouricoretrunklibYouriRepositoryMageia_uploadpmfromrev210build_systemmdvyouricoretrunklibYouriRepositoryMandriva_uploadpm">Copied: build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mageia_upload.pm (from rev 210, build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mandriva_upload.pm)</a>
+===================================================================
+--- build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mageia_upload.pm (rev 0)
++++ build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mageia_upload.pm 2011-01-06 02:12:24 UTC (rev 218)
+@@ -0,0 +1,546 @@
++# $Id: /local/youri/soft/trunk/lib/Youri/Upload/Action/RSS.pm 857 2006-01-29T10:15:43.298856Z guillaume $
++package Youri::Repository::Mandriva_upload;
++
++=head1 NAME
++
++Youri::Repository::PLF - PLF repository implementation
++
++=head1 DESCRIPTION
++
++This module implements PLF repository.
++
++=cut
++
++use warnings;
++use strict;
++use Carp;
++use Memoize;
++use File::Find 'find';
++use base qw/Youri::Repository/;
++use MDV::Distribconf::Build;
++use SVN::Client;
++
++use constant {
++ PACKAGE_CLASS =&gt; 'Youri::Package::URPM',
++ PACKAGE_CHARSET =&gt; 'utf8'
++};
++
++memoize('_get_media_config');
++
++my %translate_arch = (
++ i386 =&gt; 'i586',
++ sparc64 =&gt; 'sparcv9',
++);
++
++sub _init {
++ my $self = shift;
++ my %options = (
++ noarch =&gt; 'i586', # noarch packages policy
++ src =&gt; 'i586',
++ install_root =&gt; '',
++ test =&gt; 0, # test mode
++ verbose =&gt; 0, # verbose mode
++ queue =&gt; '',
++ rejected =&gt; '',
++ @_
++ );
++ foreach my $var ('upload_state') {
++ $self-&gt;{&quot;_$var&quot;} = [];
++ foreach my $value (split ' ', $options{$var}) {
++ push @{$self-&gt;{&quot;_$var&quot;}}, $value
++ }
++ }
++ print &quot;Initializing repository\n&quot;;
++ foreach my $v ('rejected', 'svn', 'queue', 'noarch', 'install_root', 'upload_root', 'verbose') {
++ $self-&gt;{&quot;_$v&quot;} = $options{$v}
++ }
++ foreach my $target (@{$options{targets}}) {
++ $self-&gt;{$target} = [];
++ print &quot;Adding $target ($options{$target}{arch})\n&quot; if $self-&gt;{_verbose};
++ foreach my $value (split ' ', $options{$target}{arch}) {
++ push @{$self-&gt;{_arch}{$target}}, $value;
++ push @{$self-&gt;{_extra_arches}}, $value
++ }
++ }
++ $self
++}
++
++sub get_group_id {
++ my ($user) = @_;
++ my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time);
++ $year+=1900;
++ $mon++;
++ my $hostname = `hostname`;
++ my ($host) = $hostname =~ /([^.]*)/;
++ sprintf &quot;$year%02d%02d%02d%02d%02d.$user.$host.${$}_&quot;, $mon, $mday, $hour, $min, $sec;
++}
++
++sub get_target_arch {
++ my ($self, $target) = $_;
++ return $self-&gt;{_arch}{$target}
++}
++
++sub set_arch_changed {
++ my ($self, $target, $arch) = @_;
++ if ($arch eq 'noarch') {
++ $self-&gt;{_arch_changed}{$_} = 1 foreach @{$self-&gt;{_arch}{$target}}
++ } elsif ($arch eq 'src') {
++ $self-&gt;{_arch_changed} = $self-&gt;{_src}
++ } else {
++ $self-&gt;{_arch_changed}{$arch} = 1
++ }
++}
++
++sub get_arch_changed {
++ my ($self, $target) = @_;
++ return [ keys %{$self-&gt;{_arch_changed}} ]
++}
++
++sub set_install_dir_changed {
++ my ($self, $install_dir) = @_;
++ $self-&gt;{_install_dir_changed}{$install_dir} = 1;
++}
++
++sub get_install_dir_changed {
++ my ($self) = @_;
++ return [ keys %{$self-&gt;{_install_dir_changed}} ];
++}
++
++sub _get_media_config {
++ my ($self, $target) = @_;
++ my %media;
++ my $real_target = $target;
++ $real_target =~ s/_force//;
++ foreach my $arch (@{$self-&gt;{_arch}{$target}}) {
++ my $root = &quot;$self-&gt;{_install_root}/$real_target/$arch&quot;;
++ my $distrib = MDV::Distribconf::Build-&gt;new($root);
++ print &quot;Getting media config from $root\n&quot; if $self-&gt;{_verbose};
++ $self-&gt;{distrib}{$arch} = $distrib;
++ $distrib-&gt;loadtree or die &quot;$root does not seem to be a distribution tree\n&quot;;
++ $distrib-&gt;parse_mediacfg;
++ foreach my $media ($distrib-&gt;listmedia) {
++ my $rpms = $distrib-&gt;getvalue($media, 'rpms');
++ my $debug_for = $distrib-&gt;getvalue($media, 'debug_for');
++ my $srpms = $distrib-&gt;getvalue($media, 'srpms');
++ my $path = $distrib-&gt;getfullpath($media, 'path');
++ if (!$rpms) {
++ if (-d $path) {
++ print &quot;MEDIA defining $media in $path\n&quot; if $self-&gt;{_verbose} &gt; 1;
++ $media{$arch}{$media} = $path
++ } else {
++ print &quot;ERROR $path does not exist for media $media on $arch\n&quot;
++ }
++ } else {
++ my ($media) = split ' ', $rpms;
++ if (-d $path) {
++ print &quot;MEDIA defining SOURCE media for $media in $path\n&quot; if $self-&gt;{_verbose} &gt; 1;
++ $media{src}{$media} = $path
++ } else {
++ print &quot;ERROR $path does not exist for source media $media on $arch\n&quot;
++ }
++ }
++ }
++ }
++ \%media
++}
++
++sub get_package_class {
++ return PACKAGE_CLASS;
++}
++
++sub get_package_charset {
++ return PACKAGE_CHARSET;
++}
++
++sub get_upload_dir {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++ croak &quot;Not a class method&quot; unless ref $self;
++ my $arch = $package-&gt;get_arch();
++ return
++ $self-&gt;{_upload_root} .
++ &quot;/$self-&gt;{_queue}/$target/&quot; .
++ _get_section($self, $package, $target, $user_context, $app_context) .
++ '/' .
++ ($user_context-&gt;{prefix} ? '' : get_group_id($user_context-&gt;{user}))
++}
++
++sub get_install_path {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++
++ return $self-&gt;_get_path($package, $target, $user_context, $app_context);
++}
++
++
++sub get_distribution_paths {
++ my ($self, $package, $target) = @_;
++
++ return $self-&gt;_get_distribution_paths($package, $target);
++}
++
++sub get_archive_path {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++
++ return $self-&gt;_get_path($package, $target, $user_context, $app_context);
++}
++
++sub get_reject_path {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++
++ return $self-&gt;{_rejected};
++}
++
++
++sub _get_path {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++
++ my $section = $self-&gt;_get_section($package, $target, $user_context, $app_context);
++ my $arch = $app_context-&gt;{arch} || $package-&gt;get_arch();
++ $arch = $translate_arch{$arch} || $arch;
++ if ($arch eq 'noarch') {
++ $arch = $self-&gt;{_noarch}
++ } elsif ($arch eq 'src') {
++ return &quot;$target/SRPMS/$section&quot;
++ }
++ &quot;$target/$arch/media/$section&quot;
++}
++
++sub _get_distribution_paths {
++ my ($self, $package, $target) = @_;
++
++ my $arch = $package-&gt;get_arch();
++ $arch = $translate_arch{$arch} || $arch;
++ if ($arch eq 'noarch') {
++ map { &quot;$target/$_&quot; } $self-&gt;get_extra_arches;
++ } elsif ($arch eq 'src') {
++ die &quot;no way to get distribution path using a $arch package&quot;;
++ } else {
++ &quot;$target/$arch&quot;;
++ }
++}
++
++sub get_arch {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++ my $arch = $package-&gt;get_arch();
++ $arch = $translate_arch{$arch} || $arch;
++ if ($arch eq 'noarch') {
++ $arch = $self-&gt;{_noarch}
++ }
++ $arch
++}
++
++sub get_version_path {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++
++ my $section = $self-&gt;_get_section($package, $target, $user_context, $app_context);
++
++ return &quot;$self-&gt;{_module}/$section&quot;;
++}
++
++=head2 get_replaced_packages($package, $target, $user_context, $app_context)
++
++Overrides parent method to add libified packages.
++
++=cut
++
++sub get_replaced_packages {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++ croak &quot;Not a class method&quot; unless ref $self;
++
++ my @replaced_packages =
++ $self-&gt;SUPER::get_replaced_packages($package, $target, $user_context, $app_context);
++
++ # mandriva lib policy:
++ # library package names change with revision, making mandatory to
++ # duplicate older revisions search with a custom pattern
++ my $name = $package-&gt;get_name();
++ if ($name =~ /^(lib\w+[a-zA-Z_])[\d_\.]+([-\w]*)$/) {
++ push(@replaced_packages,
++ grep { $package-&gt;compare($_) &gt; 0 }
++ map { PACKAGE_CLASS-&gt;new(file =&gt; $_) }
++ $self-&gt;get_files(
++ $self-&gt;{_install_root},
++ $self-&gt;get_install_path($package, $target, $user_context, $app_context),
++ PACKAGE_CLASS-&gt;get_pattern(
++ $1 . '[\d_\.]+' . $2, # custom name pattern
++ undef,
++ undef,
++ $package-&gt;get_arch()
++ ),
++ )
++ );
++ }
++
++ # kernel packages have the version in the name
++ # binary dkms built for old kernels have to be removed too
++ if ($name =~ /^kernel-([^\d]*-)?([\d.]*)-(.*)$/) { # &quot;desktop&quot;, &quot;2.6.28&quot;, &quot;2mnb&quot;
++ push(@replaced_packages,
++ map { PACKAGE_CLASS-&gt;new(file =&gt; $_) }
++ $self-&gt;get_files(
++ $self-&gt;{_install_root},
++ $self-&gt;get_install_path($package, $target, $user_context, $app_context),
++ PACKAGE_CLASS-&gt;get_pattern(
++ '(kernel-' . $1 . '\d.*|.*-kernel-[\d.]*-' . $1 . '\d.*)',
++ undef,
++ undef,
++ $package-&gt;get_arch()
++ ),
++ )
++ );
++ }
++
++ return @replaced_packages;
++
++}
++
++sub _get_main_section {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++
++ my $section = $self-&gt;_get_section($package, $target, $user_context, $app_context);
++ my ($main_section) = $section =~ m,^([^/]+),;
++ $main_section
++}
++
++sub _get_section {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++
++ my $name = $package-&gt;get_name();
++ my $cname = $package-&gt;get_canonical_name();
++ my $version = $package-&gt;get_version();
++ my $release = $package-&gt;get_release();
++ my $section = $user_context-&gt;{section};
++ my $media = $self-&gt;_get_media_config($target);
++ my $arch = $package-&gt;get_arch();
++ my $file = $package-&gt;as_file();
++ $file =~ s,/+,/,g; # unneeded?
++ # FIXME: use $self-&gt;get_arch()
++ $arch = $self-&gt;{_noarch} if $arch eq 'noarch';
++ $arch = $translate_arch{$arch} || $arch;
++
++ if (!$section) {
++ $section = $self-&gt;{packages}{$file}{section};
++ print &quot;Section undefined, repository says it is '$section' for '$file'\n&quot; if $self-&gt;{_verbose};
++ }
++ if ($section &amp;&amp; $section !~ /debug_/ &amp;&amp; $package-&gt;is_debug()) {
++ $section = &quot;debug_$section&quot;
++ }
++
++ # if have section already, check if it exists, and may return immediately
++ if ($section) {
++ print &quot;Using requested section $section\n&quot;;
++ if ($media-&gt;{$arch}{$section}) {
++ return $section
++ } else {
++ die &quot;FATAL youri: unknown section $section for target $target for arch $arch\n&quot;
++ }
++ }
++ # else, try to find section automatically
++
++ # pattern for search of src package with specific version-release,
++ # should be searched first, because we prefer to find the precise
++ # section a package is already in
++ my $specific_source_pattern = PACKAGE_CLASS-&gt;get_pattern(
++ $cname,
++ $version,
++ $release,
++ 'src'
++ );
++
++ my $source_pattern = PACKAGE_CLASS-&gt;get_pattern(
++ $cname,
++ undef,
++ undef,
++ 'src'
++ );
++
++ # if a media has no source media configured, or if it is a debug
++ # package, we search in binary media
++
++ # pattern for search when a binary media has no src media configured
++ my $specific_binary_pattern = PACKAGE_CLASS-&gt;get_pattern(
++ $name,
++ $version,
++ $release,
++ $arch
++ );
++
++ # last resort pattern: previous existing binary packages
++ my $binary_pattern = PACKAGE_CLASS-&gt;get_pattern(
++ $name,
++ undef,
++ undef,
++ $arch
++ );
++
++ # first try to find section for the specific version, as it is possibly already there;
++ # this is the case for when called in Youri::Submit::Action::Archive, to find the
++ # section the package got installed
++ print &quot;Looking for package $name with version $version-$release\n&quot;;
++ foreach my $m (keys %{$media-&gt;{$arch}}) {
++ print &quot; .. section '$m' path '&quot;.$media-&gt;{$arch}{$m}.&quot;'\n&quot; if $self-&gt;{_verbose};
++ # - prefer source for non-debug packages, use binary if there is no source media configured
++ # - debug packages must be searched in binary medias, due to their
++ # src section != binary section; NOTE: should/need we search in
++ # src medias and add the 'debug_' prefix?
++ if (!$package-&gt;is_debug() &amp;&amp; $media-&gt;{src}{$m}) {
++ next unless $self-&gt;get_files('', $media-&gt;{src}{$m}, $specific_source_pattern);
++ } else {
++ next unless $self-&gt;get_files('', $media-&gt;{$arch}{$m}, $specific_binary_pattern);
++ }
++ $section = $m;
++ last;
++ }
++
++ # if still not found, try finding any version of the package in a
++ # /release subsection (safe default: /release is default for cooker,
++ # should be locked for released distros, and we don't risk wrongly
++ # choosing /backports, /testing, or /updates);
++ # this is the case for when called at submit, to find the section where
++ # the package already resides
++ if (!$section) {
++ # debug packages should be found by previous specific version search
++ # NOTE: as above, should/need we search here and add the 'debug_' prefix?
++ # ... probably... as at least mdv-youri-submit-force will process debug packages
++ if ($package-&gt;is_debug() &amp;&amp; $self-&gt;{_verbose}) {
++ print &quot;Warning: debug package $name with version $version-$release not found.\n&quot;;
++ }
++
++ print &quot;Warning: Looking for any section with a package $name of any version\n&quot;;
++ foreach my $m (keys %{$media-&gt;{$arch}}) {
++ print &quot; .. section '$m' path '&quot;.$media-&gt;{$arch}{$m}.&quot;'\n&quot; if $self-&gt;{_verbose};
++ # NOTE: !$package-&gt;is_debug() test is here to prevent when above FATAL error is removed
++ next if $m !~ /release/ || ($m =~ /debug/ &amp;&amp; !$package-&gt;is_debug());
++ # - prefer source
++ if ($media-&gt;{src}{$m}) {
++ next unless $self-&gt;get_files('', $media-&gt;{src}{$m}, $source_pattern);
++ } else {
++ next unless $self-&gt;get_files('', $media-&gt;{$arch}{$m}, $binary_pattern);
++ }
++ $section = $m;
++ last;
++ }
++ }
++
++ # FIXME: doing this here is wrong; this way the caller can never know if
++ # a section was actually found or not; should return undef and let the
++ # caller set a default (Note: IIRC PLF|Zarb has this right, see there) -spuk
++ print STDERR &quot;Warning: Can't guess destination: section missing, defaulting to contrib/release\n&quot; unless $section;
++ $section ||= 'contrib/release';
++
++ # next time we don't need to search everything again
++ $self-&gt;{packages}{$file}{section} = $section;
++
++ print &quot;Section is '$section'.\n&quot;;
++
++ return $section;
++}
++
++sub get_upload_newer_revisions {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++ croak &quot;Not a class method&quot; unless ref $self;
++ my $arch = $package-&gt;get_arch();
++ my $name = $package-&gt;get_full_name;
++ $name =~ s/^\@\d+://;
++ my $pattern = $self-&gt;get_package_class()-&gt;get_pattern($package-&gt;get_name(), undef, undef, $arch);
++ my $media = $self-&gt;_get_media_config($target);
++ my @packages;
++ foreach my $state (@{$self-&gt;{_upload_state}}) {
++ foreach my $m (keys %{$media-&gt;{$arch}}) {
++ my $path = &quot;$self-&gt;{_upload_root}/$state/$target/$m&quot;;
++ print &quot;Looking for package $package revisions for $target in $path (pattern $pattern)\n&quot; if $self-&gt;{_verbose};
++ find(
++ sub {
++ s/\d{14}\.[^.]*\.[^.]*\.\d+_//;
++ s/^\@\d+://;
++ return if ! /^$pattern/;
++ return if /\.info$/;
++ print &quot;Find $_\n&quot;;
++ push @packages, $File::Find::name if $package-&gt;check_ranges_compatibility(&quot;== $name&quot;, &quot;&lt; $_&quot;)
++ }, $path);
++ }
++ }
++ return
++ @packages;
++}
++
++sub package_in_svn {
++ my ($self, $srpm_name) = @_;
++ my $ctx = new SVN::Client(
++ auth =&gt; [SVN::Client::get_simple_provider(),
++ SVN::Client::get_simple_prompt_provider(\&amp;simple_prompt,2),
++ SVN::Client::get_username_provider()]
++ );
++
++ my $svn_entry = $ctx-&gt;ls(&quot;$self-&gt;{_svn}/$srpm_name&quot;, 'HEAD', 0);
++ if ($svn_entry) {
++ print &quot;Package $srpm_name is in the SVN\n&quot;;
++ return 1
++ }
++}
++
++sub get_svn_url {
++ my ($self) = @_;
++ $self-&gt;{_svn}
++}
++
++sub get_revisions {
++ my ($self, $package, $target, $user_context, $app_context, $filter) = @_;
++ croak &quot;Not a class method&quot; unless ref $self;
++ print &quot;Looking for package $package revisions for $target\n&quot; if $self-&gt;{_verbose} &gt; 0;
++
++ my $arch = $app_context-&gt;{arch} || $user_context-&gt;{arch} || $package-&gt;get_arch();
++ my $media_arch = $arch eq 'noarch' ? $self-&gt;{_noarch} : $arch;
++ my $path = $arch eq 'src' ? &quot;$target/SRPMS/&quot; : &quot;$target/$media_arch/media&quot;;
++ my $media = $self-&gt;_get_section($package, $target, $user_context, $app_context);
++ my $name = $package-&gt;get_name();
++ my @packages = map { $self-&gt;get_package_class()-&gt;new(file =&gt; $_) }
++ $self-&gt;get_files(
++ $self-&gt;{_install_root},
++ &quot;$path/$media&quot;,
++ $self-&gt;get_package_class()-&gt;get_pattern(
++ $name,
++ undef,
++ undef,
++ $package-&gt;get_arch(),
++ )
++ );
++
++ @packages = grep { $filter-&gt;($_) } @packages if $filter;
++
++ return
++ sort { $b-&gt;compare($a) } # sort by revision order
++ @packages;
++}
++
++sub reject {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++ croak &quot;Not a class method&quot; unless ref $self;
++
++
++}
++
++sub get_archive_dir {
++ my ($self, $package, $target, $user_context, $app_context) = @_;
++ croak &quot;Not a class method&quot; unless ref $self;
++
++ return
++ $self-&gt;{_archive_root}
++}
++
++
++# 20060801 warly
++#
++# Upload steps
++# SRPMS are uploaded in /home/mandrake/uploads/todo/$target/$media/group_id
++#
++#
++#
++
++=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;
+
+<a id="build_systemmdvyouricoretrunklibYouriRepositoryMandriva_uploadpm">Deleted: build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mandriva_upload.pm</a>
+===================================================================
+--- build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mandriva_upload.pm 2011-01-06 02:11:28 UTC (rev 217)
++++ build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mandriva_upload.pm 2011-01-06 02:12:24 UTC (rev 218)
+@@ -1,546 +0,0 @@
+-# $Id: /local/youri/soft/trunk/lib/Youri/Upload/Action/RSS.pm 857 2006-01-29T10:15:43.298856Z guillaume $
+-package Youri::Repository::Mandriva_upload;
+-
+-=head1 NAME
+-
+-Youri::Repository::PLF - PLF repository implementation
+-
+-=head1 DESCRIPTION
+-
+-This module implements PLF repository.
+-
+-=cut
+-
+-use warnings;
+-use strict;
+-use Carp;
+-use Memoize;
+-use File::Find 'find';
+-use base qw/Youri::Repository/;
+-use MDV::Distribconf::Build;
+-use SVN::Client;
+-
+-use constant {
+- PACKAGE_CLASS =&gt; 'Youri::Package::URPM',
+- PACKAGE_CHARSET =&gt; 'utf8'
+-};
+-
+-memoize('_get_media_config');
+-
+-my %translate_arch = (
+- i386 =&gt; 'i586',
+- sparc64 =&gt; 'sparcv9',
+-);
+-
+-sub _init {
+- my $self = shift;
+- my %options = (
+- noarch =&gt; 'i586', # noarch packages policy
+- src =&gt; 'i586',
+- install_root =&gt; '',
+- test =&gt; 0, # test mode
+- verbose =&gt; 0, # verbose mode
+- queue =&gt; '',
+- rejected =&gt; '',
+- @_
+- );
+- foreach my $var ('upload_state') {
+- $self-&gt;{&quot;_$var&quot;} = [];
+- foreach my $value (split ' ', $options{$var}) {
+- push @{$self-&gt;{&quot;_$var&quot;}}, $value
+- }
+- }
+- print &quot;Initializing repository\n&quot;;
+- foreach my $v ('rejected', 'svn', 'queue', 'noarch', 'install_root', 'upload_root', 'verbose') {
+- $self-&gt;{&quot;_$v&quot;} = $options{$v}
+- }
+- foreach my $target (@{$options{targets}}) {
+- $self-&gt;{$target} = [];
+- print &quot;Adding $target ($options{$target}{arch})\n&quot; if $self-&gt;{_verbose};
+- foreach my $value (split ' ', $options{$target}{arch}) {
+- push @{$self-&gt;{_arch}{$target}}, $value;
+- push @{$self-&gt;{_extra_arches}}, $value
+- }
+- }
+- $self
+-}
+-
+-sub get_group_id {
+- my ($user) = @_;
+- my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time);
+- $year+=1900;
+- $mon++;
+- my $hostname = `hostname`;
+- my ($host) = $hostname =~ /([^.]*)/;
+- sprintf &quot;$year%02d%02d%02d%02d%02d.$user.$host.${$}_&quot;, $mon, $mday, $hour, $min, $sec;
+-}
+-
+-sub get_target_arch {
+- my ($self, $target) = $_;
+- return $self-&gt;{_arch}{$target}
+-}
+-
+-sub set_arch_changed {
+- my ($self, $target, $arch) = @_;
+- if ($arch eq 'noarch') {
+- $self-&gt;{_arch_changed}{$_} = 1 foreach @{$self-&gt;{_arch}{$target}}
+- } elsif ($arch eq 'src') {
+- $self-&gt;{_arch_changed} = $self-&gt;{_src}
+- } else {
+- $self-&gt;{_arch_changed}{$arch} = 1
+- }
+-}
+-
+-sub get_arch_changed {
+- my ($self, $target) = @_;
+- return [ keys %{$self-&gt;{_arch_changed}} ]
+-}
+-
+-sub set_install_dir_changed {
+- my ($self, $install_dir) = @_;
+- $self-&gt;{_install_dir_changed}{$install_dir} = 1;
+-}
+-
+-sub get_install_dir_changed {
+- my ($self) = @_;
+- return [ keys %{$self-&gt;{_install_dir_changed}} ];
+-}
+-
+-sub _get_media_config {
+- my ($self, $target) = @_;
+- my %media;
+- my $real_target = $target;
+- $real_target =~ s/_force//;
+- foreach my $arch (@{$self-&gt;{_arch}{$target}}) {
+- my $root = &quot;$self-&gt;{_install_root}/$real_target/$arch&quot;;
+- my $distrib = MDV::Distribconf::Build-&gt;new($root);
+- print &quot;Getting media config from $root\n&quot; if $self-&gt;{_verbose};
+- $self-&gt;{distrib}{$arch} = $distrib;
+- $distrib-&gt;loadtree or die &quot;$root does not seem to be a distribution tree\n&quot;;
+- $distrib-&gt;parse_mediacfg;
+- foreach my $media ($distrib-&gt;listmedia) {
+- my $rpms = $distrib-&gt;getvalue($media, 'rpms');
+- my $debug_for = $distrib-&gt;getvalue($media, 'debug_for');
+- my $srpms = $distrib-&gt;getvalue($media, 'srpms');
+- my $path = $distrib-&gt;getfullpath($media, 'path');
+- if (!$rpms) {
+- if (-d $path) {
+- print &quot;MEDIA defining $media in $path\n&quot; if $self-&gt;{_verbose} &gt; 1;
+- $media{$arch}{$media} = $path
+- } else {
+- print &quot;ERROR $path does not exist for media $media on $arch\n&quot;
+- }
+- } else {
+- my ($media) = split ' ', $rpms;
+- if (-d $path) {
+- print &quot;MEDIA defining SOURCE media for $media in $path\n&quot; if $self-&gt;{_verbose} &gt; 1;
+- $media{src}{$media} = $path
+- } else {
+- print &quot;ERROR $path does not exist for source media $media on $arch\n&quot;
+- }
+- }
+- }
+- }
+- \%media
+-}
+-
+-sub get_package_class {
+- return PACKAGE_CLASS;
+-}
+-
+-sub get_package_charset {
+- return PACKAGE_CHARSET;
+-}
+-
+-sub get_upload_dir {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+- croak &quot;Not a class method&quot; unless ref $self;
+- my $arch = $package-&gt;get_arch();
+- return
+- $self-&gt;{_upload_root} .
+- &quot;/$self-&gt;{_queue}/$target/&quot; .
+- _get_section($self, $package, $target, $user_context, $app_context) .
+- '/' .
+- ($user_context-&gt;{prefix} ? '' : get_group_id($user_context-&gt;{user}))
+-}
+-
+-sub get_install_path {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+-
+- return $self-&gt;_get_path($package, $target, $user_context, $app_context);
+-}
+-
+-
+-sub get_distribution_paths {
+- my ($self, $package, $target) = @_;
+-
+- return $self-&gt;_get_distribution_paths($package, $target);
+-}
+-
+-sub get_archive_path {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+-
+- return $self-&gt;_get_path($package, $target, $user_context, $app_context);
+-}
+-
+-sub get_reject_path {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+-
+- return $self-&gt;{_rejected};
+-}
+-
+-
+-sub _get_path {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+-
+- my $section = $self-&gt;_get_section($package, $target, $user_context, $app_context);
+- my $arch = $app_context-&gt;{arch} || $package-&gt;get_arch();
+- $arch = $translate_arch{$arch} || $arch;
+- if ($arch eq 'noarch') {
+- $arch = $self-&gt;{_noarch}
+- } elsif ($arch eq 'src') {
+- return &quot;$target/SRPMS/$section&quot;
+- }
+- &quot;$target/$arch/media/$section&quot;
+-}
+-
+-sub _get_distribution_paths {
+- my ($self, $package, $target) = @_;
+-
+- my $arch = $package-&gt;get_arch();
+- $arch = $translate_arch{$arch} || $arch;
+- if ($arch eq 'noarch') {
+- map { &quot;$target/$_&quot; } $self-&gt;get_extra_arches;
+- } elsif ($arch eq 'src') {
+- die &quot;no way to get distribution path using a $arch package&quot;;
+- } else {
+- &quot;$target/$arch&quot;;
+- }
+-}
+-
+-sub get_arch {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+- my $arch = $package-&gt;get_arch();
+- $arch = $translate_arch{$arch} || $arch;
+- if ($arch eq 'noarch') {
+- $arch = $self-&gt;{_noarch}
+- }
+- $arch
+-}
+-
+-sub get_version_path {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+-
+- my $section = $self-&gt;_get_section($package, $target, $user_context, $app_context);
+-
+- return &quot;$self-&gt;{_module}/$section&quot;;
+-}
+-
+-=head2 get_replaced_packages($package, $target, $user_context, $app_context)
+-
+-Overrides parent method to add libified packages.
+-
+-=cut
+-
+-sub get_replaced_packages {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+- croak &quot;Not a class method&quot; unless ref $self;
+-
+- my @replaced_packages =
+- $self-&gt;SUPER::get_replaced_packages($package, $target, $user_context, $app_context);
+-
+- # mandriva lib policy:
+- # library package names change with revision, making mandatory to
+- # duplicate older revisions search with a custom pattern
+- my $name = $package-&gt;get_name();
+- if ($name =~ /^(lib\w+[a-zA-Z_])[\d_\.]+([-\w]*)$/) {
+- push(@replaced_packages,
+- grep { $package-&gt;compare($_) &gt; 0 }
+- map { PACKAGE_CLASS-&gt;new(file =&gt; $_) }
+- $self-&gt;get_files(
+- $self-&gt;{_install_root},
+- $self-&gt;get_install_path($package, $target, $user_context, $app_context),
+- PACKAGE_CLASS-&gt;get_pattern(
+- $1 . '[\d_\.]+' . $2, # custom name pattern
+- undef,
+- undef,
+- $package-&gt;get_arch()
+- ),
+- )
+- );
+- }
+-
+- # kernel packages have the version in the name
+- # binary dkms built for old kernels have to be removed too
+- if ($name =~ /^kernel-([^\d]*-)?([\d.]*)-(.*)$/) { # &quot;desktop&quot;, &quot;2.6.28&quot;, &quot;2mnb&quot;
+- push(@replaced_packages,
+- map { PACKAGE_CLASS-&gt;new(file =&gt; $_) }
+- $self-&gt;get_files(
+- $self-&gt;{_install_root},
+- $self-&gt;get_install_path($package, $target, $user_context, $app_context),
+- PACKAGE_CLASS-&gt;get_pattern(
+- '(kernel-' . $1 . '\d.*|.*-kernel-[\d.]*-' . $1 . '\d.*)',
+- undef,
+- undef,
+- $package-&gt;get_arch()
+- ),
+- )
+- );
+- }
+-
+- return @replaced_packages;
+-
+-}
+-
+-sub _get_main_section {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+-
+- my $section = $self-&gt;_get_section($package, $target, $user_context, $app_context);
+- my ($main_section) = $section =~ m,^([^/]+),;
+- $main_section
+-}
+-
+-sub _get_section {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+-
+- my $name = $package-&gt;get_name();
+- my $cname = $package-&gt;get_canonical_name();
+- my $version = $package-&gt;get_version();
+- my $release = $package-&gt;get_release();
+- my $section = $user_context-&gt;{section};
+- my $media = $self-&gt;_get_media_config($target);
+- my $arch = $package-&gt;get_arch();
+- my $file = $package-&gt;as_file();
+- $file =~ s,/+,/,g; # unneeded?
+- # FIXME: use $self-&gt;get_arch()
+- $arch = $self-&gt;{_noarch} if $arch eq 'noarch';
+- $arch = $translate_arch{$arch} || $arch;
+-
+- if (!$section) {
+- $section = $self-&gt;{packages}{$file}{section};
+- print &quot;Section undefined, repository says it is '$section' for '$file'\n&quot; if $self-&gt;{_verbose};
+- }
+- if ($section &amp;&amp; $section !~ /debug_/ &amp;&amp; $package-&gt;is_debug()) {
+- $section = &quot;debug_$section&quot;
+- }
+-
+- # if have section already, check if it exists, and may return immediately
+- if ($section) {
+- print &quot;Using requested section $section\n&quot;;
+- if ($media-&gt;{$arch}{$section}) {
+- return $section
+- } else {
+- die &quot;FATAL youri: unknown section $section for target $target for arch $arch\n&quot;
+- }
+- }
+- # else, try to find section automatically
+-
+- # pattern for search of src package with specific version-release,
+- # should be searched first, because we prefer to find the precise
+- # section a package is already in
+- my $specific_source_pattern = PACKAGE_CLASS-&gt;get_pattern(
+- $cname,
+- $version,
+- $release,
+- 'src'
+- );
+-
+- my $source_pattern = PACKAGE_CLASS-&gt;get_pattern(
+- $cname,
+- undef,
+- undef,
+- 'src'
+- );
+-
+- # if a media has no source media configured, or if it is a debug
+- # package, we search in binary media
+-
+- # pattern for search when a binary media has no src media configured
+- my $specific_binary_pattern = PACKAGE_CLASS-&gt;get_pattern(
+- $name,
+- $version,
+- $release,
+- $arch
+- );
+-
+- # last resort pattern: previous existing binary packages
+- my $binary_pattern = PACKAGE_CLASS-&gt;get_pattern(
+- $name,
+- undef,
+- undef,
+- $arch
+- );
+-
+- # first try to find section for the specific version, as it is possibly already there;
+- # this is the case for when called in Youri::Submit::Action::Archive, to find the
+- # section the package got installed
+- print &quot;Looking for package $name with version $version-$release\n&quot;;
+- foreach my $m (keys %{$media-&gt;{$arch}}) {
+- print &quot; .. section '$m' path '&quot;.$media-&gt;{$arch}{$m}.&quot;'\n&quot; if $self-&gt;{_verbose};
+- # - prefer source for non-debug packages, use binary if there is no source media configured
+- # - debug packages must be searched in binary medias, due to their
+- # src section != binary section; NOTE: should/need we search in
+- # src medias and add the 'debug_' prefix?
+- if (!$package-&gt;is_debug() &amp;&amp; $media-&gt;{src}{$m}) {
+- next unless $self-&gt;get_files('', $media-&gt;{src}{$m}, $specific_source_pattern);
+- } else {
+- next unless $self-&gt;get_files('', $media-&gt;{$arch}{$m}, $specific_binary_pattern);
+- }
+- $section = $m;
+- last;
+- }
+-
+- # if still not found, try finding any version of the package in a
+- # /release subsection (safe default: /release is default for cooker,
+- # should be locked for released distros, and we don't risk wrongly
+- # choosing /backports, /testing, or /updates);
+- # this is the case for when called at submit, to find the section where
+- # the package already resides
+- if (!$section) {
+- # debug packages should be found by previous specific version search
+- # NOTE: as above, should/need we search here and add the 'debug_' prefix?
+- # ... probably... as at least mdv-youri-submit-force will process debug packages
+- if ($package-&gt;is_debug() &amp;&amp; $self-&gt;{_verbose}) {
+- print &quot;Warning: debug package $name with version $version-$release not found.\n&quot;;
+- }
+-
+- print &quot;Warning: Looking for any section with a package $name of any version\n&quot;;
+- foreach my $m (keys %{$media-&gt;{$arch}}) {
+- print &quot; .. section '$m' path '&quot;.$media-&gt;{$arch}{$m}.&quot;'\n&quot; if $self-&gt;{_verbose};
+- # NOTE: !$package-&gt;is_debug() test is here to prevent when above FATAL error is removed
+- next if $m !~ /release/ || ($m =~ /debug/ &amp;&amp; !$package-&gt;is_debug());
+- # - prefer source
+- if ($media-&gt;{src}{$m}) {
+- next unless $self-&gt;get_files('', $media-&gt;{src}{$m}, $source_pattern);
+- } else {
+- next unless $self-&gt;get_files('', $media-&gt;{$arch}{$m}, $binary_pattern);
+- }
+- $section = $m;
+- last;
+- }
+- }
+-
+- # FIXME: doing this here is wrong; this way the caller can never know if
+- # a section was actually found or not; should return undef and let the
+- # caller set a default (Note: IIRC PLF|Zarb has this right, see there) -spuk
+- print STDERR &quot;Warning: Can't guess destination: section missing, defaulting to contrib/release\n&quot; unless $section;
+- $section ||= 'contrib/release';
+-
+- # next time we don't need to search everything again
+- $self-&gt;{packages}{$file}{section} = $section;
+-
+- print &quot;Section is '$section'.\n&quot;;
+-
+- return $section;
+-}
+-
+-sub get_upload_newer_revisions {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+- croak &quot;Not a class method&quot; unless ref $self;
+- my $arch = $package-&gt;get_arch();
+- my $name = $package-&gt;get_full_name;
+- $name =~ s/^\@\d+://;
+- my $pattern = $self-&gt;get_package_class()-&gt;get_pattern($package-&gt;get_name(), undef, undef, $arch);
+- my $media = $self-&gt;_get_media_config($target);
+- my @packages;
+- foreach my $state (@{$self-&gt;{_upload_state}}) {
+- foreach my $m (keys %{$media-&gt;{$arch}}) {
+- my $path = &quot;$self-&gt;{_upload_root}/$state/$target/$m&quot;;
+- print &quot;Looking for package $package revisions for $target in $path (pattern $pattern)\n&quot; if $self-&gt;{_verbose};
+- find(
+- sub {
+- s/\d{14}\.[^.]*\.[^.]*\.\d+_//;
+- s/^\@\d+://;
+- return if ! /^$pattern/;
+- return if /\.info$/;
+- print &quot;Find $_\n&quot;;
+- push @packages, $File::Find::name if $package-&gt;check_ranges_compatibility(&quot;== $name&quot;, &quot;&lt; $_&quot;)
+- }, $path);
+- }
+- }
+- return
+- @packages;
+-}
+-
+-sub package_in_svn {
+- my ($self, $srpm_name) = @_;
+- my $ctx = new SVN::Client(
+- auth =&gt; [SVN::Client::get_simple_provider(),
+- SVN::Client::get_simple_prompt_provider(\&amp;simple_prompt,2),
+- SVN::Client::get_username_provider()]
+- );
+-
+- my $svn_entry = $ctx-&gt;ls(&quot;$self-&gt;{_svn}/$srpm_name&quot;, 'HEAD', 0);
+- if ($svn_entry) {
+- print &quot;Package $srpm_name is in the SVN\n&quot;;
+- return 1
+- }
+-}
+-
+-sub get_svn_url {
+- my ($self) = @_;
+- $self-&gt;{_svn}
+-}
+-
+-sub get_revisions {
+- my ($self, $package, $target, $user_context, $app_context, $filter) = @_;
+- croak &quot;Not a class method&quot; unless ref $self;
+- print &quot;Looking for package $package revisions for $target\n&quot; if $self-&gt;{_verbose} &gt; 0;
+-
+- my $arch = $app_context-&gt;{arch} || $user_context-&gt;{arch} || $package-&gt;get_arch();
+- my $media_arch = $arch eq 'noarch' ? $self-&gt;{_noarch} : $arch;
+- my $path = $arch eq 'src' ? &quot;$target/SRPMS/&quot; : &quot;$target/$media_arch/media&quot;;
+- my $media = $self-&gt;_get_section($package, $target, $user_context, $app_context);
+- my $name = $package-&gt;get_name();
+- my @packages = map { $self-&gt;get_package_class()-&gt;new(file =&gt; $_) }
+- $self-&gt;get_files(
+- $self-&gt;{_install_root},
+- &quot;$path/$media&quot;,
+- $self-&gt;get_package_class()-&gt;get_pattern(
+- $name,
+- undef,
+- undef,
+- $package-&gt;get_arch(),
+- )
+- );
+-
+- @packages = grep { $filter-&gt;($_) } @packages if $filter;
+-
+- return
+- sort { $b-&gt;compare($a) } # sort by revision order
+- @packages;
+-}
+-
+-sub reject {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+- croak &quot;Not a class method&quot; unless ref $self;
+-
+-
+-}
+-
+-sub get_archive_dir {
+- my ($self, $package, $target, $user_context, $app_context) = @_;
+- croak &quot;Not a class method&quot; unless ref $self;
+-
+- return
+- $self-&gt;{_archive_root}
+-}
+-
+-
+-# 20060801 warly
+-#
+-# Upload steps
+-# SRPMS are uploaded in /home/mandrake/uploads/todo/$target/$media/group_id
+-#
+-#
+-#
+-
+-=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;
+
+</pre></div>
+
+</body>
+</html> \ No newline at end of file