diff options
author | Mandrake <mandrake@mandriva.com> | 2006-10-26 11:03:46 +0000 |
---|---|---|
committer | Mandrake <mandrake@mandriva.com> | 2006-10-26 11:03:46 +0000 |
commit | 6e168107c4b6e0182184ea107e7accc68672ebb2 (patch) | |
tree | 116e163127094c16548490bbe01669daf266cc9f /lib | |
parent | 0066a019769dbe07d4b4ef716b5bd4f4489ae133 (diff) | |
download | mga-youri-core-6e168107c4b6e0182184ea107e7accc68672ebb2.tar mga-youri-core-6e168107c4b6e0182184ea107e7accc68672ebb2.tar.gz mga-youri-core-6e168107c4b6e0182184ea107e7accc68672ebb2.tar.bz2 mga-youri-core-6e168107c4b6e0182184ea107e7accc68672ebb2.tar.xz mga-youri-core-6e168107c4b6e0182184ea107e7accc68672ebb2.zip |
src is still linked with i586; add functions for cvs queue; add functions to mark arches which are affected during an upload
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Youri/Repository/Mandriva_upload.pm | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/lib/Youri/Repository/Mandriva_upload.pm b/lib/Youri/Repository/Mandriva_upload.pm index 742929e..3f84b80 100644 --- a/lib/Youri/Repository/Mandriva_upload.pm +++ b/lib/Youri/Repository/Mandriva_upload.pm @@ -35,6 +35,7 @@ sub _init { my $self = shift; my %options = ( noarch => 'i586', # noarch packages policy + src => 'i586', install_root => '', test => 0, # test mode verbose => 0, # verbose mode @@ -56,11 +57,13 @@ sub _init { $self->{$target} = []; print "Adding $target ($options{$target}{arch})\n" if $self->{_verbose}; foreach my $value (split ' ', $options{$target}{arch}) { - push @{$self->{_arch}{$target}}, $value + push @{$self->{_arch}{$target}}, $value; + push @{$self->{_extra_arches}}, $value } } $self } + sub get_group_id { my ($user) = @_; my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time); @@ -71,6 +74,27 @@ sub get_group_id { sprintf "$year%02d%02d%02d%02d%02d.$user.$host.${$}_", $mon, $mday, $hour, $min, $sec; } +sub get_target_arch { + my ($self, $target) = $_; + return $self->{_arch}{$target} +} + +sub set_arch_changed { + my ($self, $target, $arch) = @_; + if ($arch eq 'noarch') { + $self->{_arch_changed} = $self->{_arch}{$target} + } elsif ($arch eq 'noarch') { + $self->{_arch_changed} = $self->{_src} + } else { + $self->{_arch_changed}{$arch} = 1 + } +} + +sub get_arch_changed { + my ($self, $target) = @_; + return [ keys %{$self->{_arch_changed}} ] +} + sub _get_media_config { my ($self, $target) = @_; my %media; @@ -90,7 +114,7 @@ sub _get_media_config { my $path = $distrib->getfullpath($media, 'path'); if (!$rpms) { if (-d $path) { - print "MEDIA defining $media in $path\n" if $self->{_verbose}; + print "MEDIA defining $media in $path\n" if $self->{_verbose} > 1; $media{$arch}{$media} = $path } else { print "ERROR $path does not exist for media $media on $arch\n" @@ -98,7 +122,7 @@ sub _get_media_config { } else { my ($media) = split ' ', $rpms; if (-d $path) { - print "MEDIA defining SOURCE media for $media in $path\n" if $self->{_verbose}; + print "MEDIA defining SOURCE media for $media in $path\n" if $self->{_verbose} > 1; $media{src}{$media} = $path } else { print "ERROR $path does not exist for source media $media on $arch\n" @@ -235,6 +259,7 @@ sub _get_section { $arch = $translate_arch{$arch} || $arch; if (!$section) { + my $file = $package->as_file(); $section = $self->{packages}{$package->as_file()}{section} } if ($section && $section !~ /debug_/ && $package->is_debug()) { @@ -290,7 +315,7 @@ sub _get_section { # use defined section if not found $section = $user_context->{section} unless $section; - print STDERR "Can't guess destination: section missing, defaulting to contrib/release" unless $section; + print STDERR "Can't guess destination: section missing, defaulting to contrib/release\n" unless $section; $section ||= 'contrib/release'; return $section; } @@ -393,6 +418,20 @@ sub get_archive_dir { $self->{_archive_root} } +sub get_cvs_queue { + my ($self, $package, $target, $define) = @_; + croak "Not a class method" unless ref $self; + + my $section = _get_section($self, $package, $target, $define); + return if $section !~ /release|non-free/; + if ($section =~ /contrib/) { + return "$self->{_install_root}/cvs_queue/contrib" + } + if ($section !~ /main/) { + return "$self->{_install_root}/cvs_queue/main" + } +} + # 20060801 warly # |