From 6fb537bbc5d19236ec981e24e290f80d491baa64 Mon Sep 17 00:00:00 2001 From: Antoine Ginies Date: Mon, 13 Dec 2010 21:42:05 +0000 Subject: use perl-URPM to create idx --- BCD/Media.pm | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'BCD/Media.pm') diff --git a/BCD/Media.pm b/BCD/Media.pm index 3b5878a..aa50fad 100644 --- a/BCD/Media.pm +++ b/BCD/Media.pm @@ -14,7 +14,7 @@ use Data::Dumper; use BCD::Common qw(:DEFAULT $isoconf $wd $name $arch $version $based_on $repo $builddir $distrib_path $error_color $DISTRIB $THEME $tmp_rpmsrate $NB_FORK $dir_deps @list_of_removed); our @ISA = qw(Exporter); -our @EXPORT = qw(main_media list_media use_gendistrib list_medias_available check_repo_hdlist rpmcheck_launch solve_doble_issue clean_urpmq_log get_srpms_list find_all_kernel, create_mediacfg); +our @EXPORT = qw(main_media list_media use_gendistrib list_medias_available check_repo_hdlist rpmcheck_launch solve_doble_issue clean_urpmq_log get_srpms_list find_all_kernel, create_mediacfg parse_synthesis); our @EXPORT_OK = qw($rpmcheck_list_pkg $file_rpmcheck_log); my $verbose; @@ -108,6 +108,7 @@ sub use_gendistrib { print_color("$LOG < 2009.1 or mes5 detected", $color); print_color("$LOG move hdlists and synthesys from $builddir/media/$destmedia/media_info to $builddir/media/media_info/", $color); system("rm -vf $builddir/media/media_info/*_$media->{name}.cz"); + system("rm -vf $builddir/media/media_info/*_main.cz"); system("rm -vf $builddir/media/media_info/pubkey_$media->{name}"); system("cp -avf $builddir/media/$destmedia/media_info/hdlist.cz $builddir/media/media_info/hdlist_$media->{name}.cz"); system("cp -avf $builddir/media/$destmedia/media_info/pubkey $builddir/media/media_info/pubkey_$media->{name}"); @@ -177,6 +178,20 @@ name=$media->{desc} close $MEDIACFG; } +sub parse_synthesis { + my ($path) = @_; + my $urpm = new URPM; + my %hash_rpms; + foreach (<$path/*.cz>) { + $urpm->parse_synthesis($_, keep_all_tags => 0); + $urpm->traverse(sub { my ($p) = @_; + $hash_rpms{ $p->name } = [ $p->version, $p->release, ]; + } + ); + } + return %hash_rpms; +} + # based on a similar functions in pkgs.pm sub get_list_from_CAT { #4 META_CLASS"desktop" mandriva-xfce-config-One @@ -490,7 +505,7 @@ sub do_fork { if ($previous_urqpm_querie =~ /EMPTY/) { $verbose and print_color("$LOG can't found the urpmq transaction for $pkg", $color); } else { - $verbose and print_color("$LOG found the urpmq transaction for $pkg, i will use $previous_urqpm_querie", $color); + $verbose and print_color("$LOG found the urpmq transaction for $pkg, i will use $previous_urqpm_querie, and copy it to $list-$pkg", $color); system("touch $dir_deps/bypass-$pkg"); system("cp -f $previous_urqpm_querie $list-$pkg"); #system("cp -f $dir_deps/$isoconf->{tocopy_file}_todo_$media->{name}-$pkg $dir_deps/$list_filename-$pkg"); @@ -548,7 +563,7 @@ sub concatenate_files { foreach my $totest (cat_($exclude->{file})) { chomp($totest); if (! $totest) { next }; - system("rm -vf $chroot_path/urpmq/$isoconf->{tocopy_file}_todo_*$totest"); + system("rm -vf $chroot_path/urpmq/$isoconf->{tocopy_file}_todo_*-$totest"); } } } -- cgit v1.2.1