diff options
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/Makefile | 2 | ||||
-rw-r--r-- | perl-install/install2.pm | 9 | ||||
-rw-r--r-- | perl-install/install_any.pm | 71 | ||||
-rw-r--r-- | perl-install/install_steps.pm | 10 | ||||
-rw-r--r-- | perl-install/install_steps_gtk.pm | 3 | ||||
-rw-r--r-- | perl-install/install_steps_interactive.pm | 67 | ||||
-rw-r--r-- | perl-install/pkgs.pm | 207 | ||||
-rw-r--r-- | perl-install/share/compssUsers | 112 |
8 files changed, 179 insertions, 302 deletions
diff --git a/perl-install/Makefile b/perl-install/Makefile index 0b3b180dd..7767e65d6 100644 --- a/perl-install/Makefile +++ b/perl-install/Makefile @@ -122,7 +122,7 @@ endif cd share ; cp *.xpm $(DEST)/usr/share cd share ; cp isdndb.net $(DEST)/usr/share/isdn_db.txt cd share ; cp -a themes $(DEST)/usr/share/gtk - cd share ; cp compssUsers compssUsers.desktop compssList $(ROOTDEST)/Mandrake/base + cd share ; cp compssUsers compssUsers.desktop rpmsrate $(ROOTDEST)/Mandrake/base if [ -f ../modules/modules.cz* ]; then \ cp -f ../modules/modules.cz* $(DEST)/lib/; \ diff --git a/perl-install/install2.pm b/perl-install/install2.pm index 46e73c477..5aadf8382 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -319,15 +319,6 @@ sub choosePackages { #- always setPackages as it may have to copy hdlist files and depslist file. $o->setPackages; - #- for the first time, select package to upgrade. - #- TOCHECK this may not be the best place for that as package are selected at some other point. - if ($_[1] == 1) { - $o->selectPackagesToUpgrade if $o->{isUpgrade}; - - $o->{compssUsersChoice}{$_} = 1 foreach @{$o->{compssUsersSorted}}, 'Miscellaneous'; - # $o->{compssUsersChoice}{KDE} = 0 if $o->{lang} =~ /ja|el|ko|th|vi|zh/; #- gnome handles much this fonts much better - } - $o->choosePackages($o->{packages}, $o->{compss}, $o->{compssUsers}, $_[1] == 1); #- check pre-condition where base backage has to be selected. diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index fa16bdcaf..31426c666 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -271,7 +271,7 @@ sub getAvailableSpace_raw { die "missing root partition"; } -sub setPackages($) { +sub setPackages { my ($o) = @_; require pkgs; @@ -283,60 +283,51 @@ sub setPackages($) { push @{$o->{default_packages}}, "kernel-secure" if $o->{security} > 3; push @{$o->{default_packages}}, "kernel-smp" if $o->{security} <= 3 && detect_devices::hasSMP(); #- no need for kernel-smp if we have kernel-secure which is smp push @{$o->{default_packages}}, "kernel-pcmcia-cs" if $o->{pcmcia}; - push @{$o->{default_packages}}, "apmd" if $o->{pcmcia}; push @{$o->{default_packages}}, "raidtools" if $o->{raid} && !is_empty_array_ref($o->{raid}{raid}); push @{$o->{default_packages}}, "reiserfs-utils" if grep { isReiserfs($_) } @{$o->{fstab}}; - push @{$o->{default_packages}}, "cdrecord" if detect_devices::burners(); push @{$o->{default_packages}}, "alsa", "alsa-utils" if modules::get_alias("snd-slot-0") =~ /^snd-card-/; pkgs::getDeps($o->{prefix}, $o->{packages}); pkgs::selectPackage($o->{packages}, pkgs::packageByName($o->{packages}, 'basesystem') || die("missing basesystem package"), 1); - #- some program that may be crazy on some conditions (hack waiting for Aurora to work if no fb). - $o->{allowFB} && (!detect_devices::matching_desc('Rage LT') && - !detect_devices::matching_desc('SiS') && - !detect_devices::matching_desc('Rage Mobility')) - or push @pkgs::skip_list, 'Aurora'; +# #- some program that may be crazy on some conditions (hack waiting for Aurora to work if no fb). +# $o->{allowFB} && (!detect_devices::matching_desc('Rage LT') && +# !detect_devices::matching_desc('SiS') && +# !detect_devices::matching_desc('Rage Mobility')) +# or push @pkgs::skip_list (*deprecated*), 'Aurora'; #- must be done after selecting base packages (to save memory) pkgs::getProvides($o->{packages}); $o->{compss} = pkgs::readCompss($o->{prefix}, $o->{packages}); #- must be done after getProvides - $o->{compssListLevels} = pkgs::readCompssList($o->{packages}, lang::unpack_langs($o->{langs})); + pkgs::read_rpmsrate($o->{packages}, getFile("Mandrake/base/rpmsrate")); ($o->{compssUsers}, $o->{compssUsersSorted}, $o->{compssUsersIcons}, $o->{compssUsersDescr}) = - pkgs::readCompssUsers($o->{packages}, $o->{compss}, $o->{meta_class}); - - my @l = (); - push @l, 'xawtv', 'kwintv' if grep { $_->{driver} eq 'bttv' } detect_devices::probeall(); - push @l, "drakprofile", "draksync", "irda-utils" if $o->{pcmcia}; - push @l, "Glide_V5" if detect_devices::matching_desc('Voodoo 5'); - push @l, "Glide_V3-DRI" if detect_devices::matching_desc('Voodoo (3|Banshee)'); - push @l, "Device3Dfx", "XFree86-glide-module" if detect_devices::matching_desc('Voodoo'); - pkgs::packageSetValues([ map { $_ + 50 } @{pkgs::packageValues($_)} ]) - foreach grep {$_} map { pkgs::packageByName($o->{packages}, $_) } @l; - - #- add OpenGL games that are only usefull if a 3D accelerated card is installed. - my @gl = (); - if (detect_devices::matching_desc('Matrox.* G[24]00') || - detect_devices::matching_desc('Riva.*128') || - detect_devices::matching_desc('Rage X[CL]') || - detect_devices::matching_desc('Rage Mobility (?:P\/M|L) ') || - detect_devices::matching_desc('3D Rage (?:LT|Pro)') || - detect_devices::matching_desc('Voodoo [35]') || - detect_devices::matching_desc('Voodoo Banshee') || - detect_devices::matching_desc('8281[05].* CGC') || - detect_devices::matching_desc('Radeon ') || - detect_devices::matching_desc('Rage 128')) { - push @gl, "xscreensaver-gl", "Mesa-demos", "xmms-mesa"; - push @gl, "bzflag" if (!detect_devices::matching_desc('Riva.*128') && - !detect_devices::matching_desc('Rage X[CL]') && - !detect_devices::matching_desc('Rage Mobility (?:P\/M|L) ') && - !detect_devices::matching_desc('3D Rage (?:LT|Pro)')); - push @gl, "csmash", "gltron", "spacecup", "chromium", "tuxracer", "openuniverse"; + pkgs::readCompssUsers($o->{packages}, $o->{meta_class}); + + $o->{compssUsersChoice}{SYSTEM} = 1; + $o->{compssUsersChoice}{$_} = 1 foreach map { @{$o->{compssUsers}{$_}} } @{$o->{compssUsersSorted}}; + + foreach (@{lang::unpack_langs(lang::pack_langs($o->{langs}))}) { + push @{$o->{default_packages}}, pkgs::packageByName($o->{packages}, "locales-$_") || next; + $o->{compssUsersChoice}{qq(LOCALES"$_")} = 1; } - pkgs::packageSetValues([ map { $_ + 60 } @{pkgs::packageValues($_)} ]) - foreach grep {$_} map { pkgs::packageByName($o->{packages}, $_) } @gl; + +# if (detect_devices::matching_desc('Matrox.* G[24]00') || +# detect_devices::matching_desc('Riva.*128') || +# detect_devices::matching_desc('Rage X[CL]') || +# detect_devices::matching_desc('Rage Mobility (?:P\/M|L) ') || +# detect_devices::matching_desc('3D Rage (?:LT|Pro)') || +# detect_devices::matching_desc('Voodoo [35]') || +# detect_devices::matching_desc('Voodoo Banshee') || +# detect_devices::matching_desc('8281[05].* CGC') || +# detect_devices::matching_desc('Radeon ') || +# detect_devices::matching_desc('Rage 128')) { +# } + + #- for the first time, select package to upgrade. + #- TOCHECK this may not be the best place for that as package are selected at some other point. + $o->selectPackagesToUpgrade if $o->{isUpgrade}; } else { #- this has to be done to make sure necessary files for urpmi are #- present. diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index db92fb75e..1bc80e53b 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -263,17 +263,13 @@ sub choosePackages { my $availableCorrected = pkgs::invCorrectSize($available / sqr(1024)) * sqr(1024); log::l(sprintf "available size %dMB (corrected %dMB)", $available / sqr(1024), $availableCorrected / sqr(1024)); - foreach (values %{$packages->{names}}) { - pkgs::packageSetFlagSkip($_, 0); - } - #- avoid destroying user selection of packages. TOCHECK if ($first_time) { pkgs::unselectAllPackages($packages); pkgs::selectPackage($o->{packages}, pkgs::packageByName($o->{packages}, $_) || next) foreach @{$o->{default_packages}}; - add2hash_($o, { compssListLevel => $::expert ? 90 : 80 }) unless $::auto_install; - pkgs::setSelectedFromCompssList($o->{compssListLevels}, $packages, $o->{compssListLevel}, $availableCorrected, $o->{installClass}) if exists $o->{compssListLevel}; + add2hash_($o, { compssListLevel => $::expert ? 5 : 4 }) unless $::auto_install; + pkgs::setSelectedFromCompssList($packages, $o->{compssUsersChoice}, $o->{compssListLevel}, $availableCorrected) if exists $o->{compssListLevel}; } $availableCorrected; @@ -428,7 +424,7 @@ Consoles 1,3,4,7 may also contain interesting information"; if ($o->{compssUsersChoice}{KDE} && -x "$o->{prefix}/usr/bin/kdm") { log::l("setting desktop to KDE"); output($f, "KDE\n"); - } elsif ($o->{compssUsersChoice}{Gnome} && -x "$o->{prefix}/usr/bin/gdm") { + } elsif ($o->{compssUsersChoice}{GNOME} && -x "$o->{prefix}/usr/bin/gdm") { log::l("setting desktop to GNOME"); output($f, "GNOME\n"); } diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm index 5b50b75a8..5042f14e5 100644 --- a/perl-install/install_steps_gtk.pm +++ b/perl-install/install_steps_gtk.pm @@ -346,9 +346,8 @@ sub choosePackagesTree { pkgs::extractHeaders($o->{prefix}, [$p], pkgs::packageMedium($p)); pkgs::packageHeader($p) or die; - my $ind = $o->{compssListLevels}{$o->{installClass}}; my $imp = translate($pkgs::compssListDesc{pkgs::packageFlagBase($p) ? - 100 : round_down(pkgs::packageValues($p)->[$ind], 10)}); + 5 : pkgs::packageRate($p)}); gtktext_insert($info_widget, $@ ? _("Bad package") : _("Name: %s\n", pkgs::packageName($p)) . diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index ea6d9826b..8c226b1f9 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -434,17 +434,17 @@ sub choosePackages { my $min_size = pkgs::selectedSize($packages); $min_size < $availableC or die _("Your system has not enough space left for installation or upgrade (%d > %d)", $min_size, $availableC); - my $min_mark = $::beginner ? 25 : $::expert ? 0 : 1; - my $def_mark = 59; #- 59 is for packages that need gl hw acceleration. + my $min_mark = $::beginner ? 2 : 1; + my $def_mark = 4; #-TODO: was 59, 59 is for packages that need gl hw acceleration. my $b = pkgs::saveSelected($packages); - pkgs::setSelectedFromCompssList($o->{compssListLevels}, $packages, $def_mark, 0, $o->{installClass}); + pkgs::setSelectedFromCompssList($packages, $o->{compssUsersChoice}, $def_mark, 0); my $def_size = pkgs::selectedSize($packages) + 1; #- avoid division by zero. - my ($ind, $level) = pkgs::setSelectedFromCompssList($o->{compssListLevels}, $packages, $min_mark, 0, $o->{installClass}); + my $level = pkgs::setSelectedFromCompssList($packages, $o->{compssUsersChoice}, $min_mark, 0); my $max_size = pkgs::selectedSize($packages) + 1; #- avoid division by zero. pkgs::restoreSelected($b); - $o->chooseGroups($packages, $compssUsers, $min_mark, $ind, \$individual, $max_size) unless $::beginner || $::corporate; + $o->chooseGroups($packages, $compssUsers, $min_mark, \$individual, $max_size) unless $::beginner || $::corporate; my $size2install = min($availableC, do { my $max = round_up(min($max_size, $availableC) / sqr(1024), 100); @@ -475,11 +475,11 @@ sub choosePackages { } }); if (!$size2install) { #- special case for desktop - $o->chooseGroups($packages, $compssUsers, $min_mark, $ind) or goto &choosePackages; + $o->chooseGroups($packages, $compssUsers, $min_mark) or goto &choosePackages; $size2install = $availableC; } ($o->{packages_}{ind}) = - pkgs::setSelectedFromCompssList($o->{compssListLevels}, $packages, $min_mark, $size2install, $o->{installClass}); + pkgs::setSelectedFromCompssList($packages, $o->{compssUsersChoice}, $min_mark, $size2install); $o->choosePackagesTree($packages, $compss) if $individual; } @@ -491,61 +491,44 @@ sub chooseSizeToInstall { sub choosePackagesTree {} sub chooseGroups { - my ($o, $packages, $compssUsers, $min_level, $ind, $individual, $max_size) = @_; + my ($o, $packages, $compssUsers, $min_level, $individual, $max_size) = @_; my %size; - my $base = pkgs::selectedSize($packages); - foreach (@{$o->{compssUsersSorted}}) { - my $b = pkgs::saveSelected($packages); - pkgs::packageValues($_)->[$ind] < $min_level or pkgs::selectPackage($packages, $_) foreach @{$compssUsers->{$_}}; - $size{$_} = pkgs::selectedSize($packages) - $base; - pkgs::restoreSelected($b); - } +# my $base = pkgs::selectedSize($packages); +# foreach (@{$o->{compssUsersSorted}}) { +# my $b = pkgs::saveSelected($packages); +# pkgs::packageRate($_) < $min_level or pkgs::selectPackage($packages, $_) foreach @{$compssUsers->{$_}}; +# $size{$_} = pkgs::selectedSize($packages) - $base; +# pkgs::restoreSelected($b); +# } my @groups = @{$o->{compssUsersSorted}}; - if ($o->{meta_class} ne 'desktop') { - push @groups, __("Miscellaneous"); - - my $b = pkgs::saveSelected($packages); - foreach (@{$o->{compssUsersSorted}}) { - pkgs::packageValues($_)->[$ind] < $min_level or pkgs::selectPackage($packages, $_) foreach @{$compssUsers->{$_}}; - } - $size{Miscellaneous} = $max_size - pkgs::selectedSize($packages); - pkgs::restoreSelected($b); + my %val; + foreach (@groups) { + $val{$_} = ! grep { ! $o->{compssUsersChoice}{$_} } @{$compssUsers->{$_}}; } - @groups = grep { $size{$_} = round_down($size{$_} / sqr(1024), 10) } @groups; #- don't display the empty or small one (eg: because all packages are below $min_level) +# @groups = grep { $size{$_} = round_down($size{$_} / sqr(1024), 10) } @groups; #- don't display the empty or small one (eg: because all packages are below $min_level) my $all; $o->ask_many_from_list('', _("Package Group Selection"), { list => \@groups, help => sub { translate($o->{compssUsersDescr}{$_}) }, - ref => sub { \$o->{compssUsersChoice}{$_} }, + ref => sub { \$val{$_} }, icon2f => sub { my $f = "/usr/share/icons/" . ($o->{compssUsersIcons}{$_} || 'default'); -e "$f.xpm" or $f .= "_section"; -e "$f.xpm" or $f = '/usr/share/icons/default_section'; "$f.xpm"; }, - label => sub { translate($_) . ($size{$_} ? sprintf " (%d%s)", $size{$_}, _("MB") : '') }, + label => sub { translate($_) . ($size{$_} ? sprintf " (%d%s)", $size{$_}, _("MB") : '') }, }, $o->{meta_class} eq 'desktop' ? { list => [ _("All") ], ref => sub { \$all }, shadow => 0 } : (), $individual ? { list => [ _("Individual package selection") ], ref => sub { $individual } } : (), ) or return; if ($all) { - $o->{compssUsersChoice}{$_} = 1 foreach @{$o->{compssUsersSorted}}, "Miscellaneous"; - } - unless ($o->{compssUsersChoice}{Miscellaneous}) { - my %l; - $l{@{$compssUsers->{$_}}} = () foreach @{$o->{compssUsersSorted}}; - exists $l{$_} or pkgs::packageSetFlagSkip($_, 1) foreach values %{$packages->{names}}; - } - foreach (@{$o->{compssUsersSorted}}) { - $o->{compssUsersChoice}{$_} or pkgs::skipSetWithProvides($packages, @{$compssUsers->{$_}}); - } - foreach (@{$o->{compssUsersSorted}}) { - $o->{compssUsersChoice}{$_} or next; - foreach (@{$compssUsers->{$_}}) { - pkgs::packageSetFlagSkip($_, 0); - } + $o->{compssUsersChoice}{$_} = 1 foreach map { @{$compssUsers->{$_}} } @{$o->{compssUsersSorted}}; + } else { + $o->{compssUsersChoice}{$_} = 0 foreach map { @{$compssUsers->{$_}} } grep { !$val{$_} } keys %val; + $o->{compssUsersChoice}{$_} = 1 foreach map { @{$compssUsers->{$_}} } grep { $val{$_} } keys %val; } 1; } diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 40dba3cf3..7df6cf8ab 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -2,7 +2,7 @@ package pkgs; # $Id$ use diagnostics; use strict; -use vars qw(*LOG %compssListDesc @skip_list %by_lang @preferred $limitMinTrans); +use vars qw(*LOG @preferred $limitMinTrans %compssListDesc); use common qw(:common :file :functional :system); use install_any; @@ -15,80 +15,19 @@ use loopback; use lang; use c; -#- lower bound on the left ( aka 90 means [90-100[ ) -%compssListDesc = ( - 100 => __("mandatory"), #- do not use it, it's for base packages - 90 => __("must have"), #- every install have these packages (unless hand de-selected in expert, or not enough room) - 80 => __("important"), #- every beginner/custom install have these packages (unless not enough space) - #- has minimum X install (XFree86 + icewm)(normal) - 70 => __("very nice"), #- KDE(normal) - 60 => __("nice"), #- gnome(normal) - 50 => __("interesting"), - 40 => __("interesting"), - 30 => __("maybe"), - 20 => __("maybe"), - 10 => __("maybe"),#__("useless"), - 0 => __("maybe"),#__("garbage"), -#- if the package requires locales-LANG and LANG is chosen, rating += 90 -#- if the package is in %by_lang and the corresponding LANG is chosen, rating += 90 (see %by_lang below) - -10 => __("i18n (important)"), #- every install in the corresponding lang have these packages - -20 => __("i18n (very nice)"), #- every beginner/custom install in the corresponding lang have theses packages - -30 => __("i18n (nice)"), -); -#- HACK: rating += 50 for some packages (like kapm, cf install_any::setPackages) - -%by_lang = ( - 'ar' => [ 'acon' ], -#'be_BE.CP1251' => [ 'fonts-ttf-cyrillic' ], -#'bg_BG' => [ 'fonts-ttf-cyrillic' ], - 'cs' => [ 'XFree86-ISO8859-2', 'XFree86-ISO8859-2-75dpi-fonts' ], -# 'cy' => iso8859-14 fonts -# 'el' => greek fonts -# 'eo' => iso8859-3 fonts - 'fa' => [ 'acon' ], - 'he' => [ 'acon' ], - 'hr' => [ 'XFree86-ISO8859-2', 'XFree86-ISO8859-2-75dpi-fonts' ], - 'hu' => [ 'XFree86-ISO8859-2', 'XFree86-ISO8859-2-75dpi-fonts' ], - 'hy' => [ 'fonts-ttf-armenian' ], - 'ja' => [ 'rxvt-CLE', 'fonts-ttf-japanese', 'kterm' ], -# 'ka' => georgian fonts - 'ko' => [ 'rxvt-CLE', 'fonts-ttf-korean' ], - 'lt' => [ 'fonts-type1-baltic' ], - 'lv' => [ 'fonts-type1-baltic' ], - 'mi' => [ 'fonts-type1-baltic' ], -# 'mk' => [ 'fonts-ttf-cyrillic' ], - 'pl' => [ 'XFree86-ISO8859-2', 'XFree86-ISO8859-2-75dpi-fonts' ], - 'ro' => [ 'XFree86-ISO8859-2', 'XFree86-ISO8859-2-75dpi-fonts' ], -# 'ru' => [ 'XFree86-cyrillic-fonts', 'fonts-ttf-cyrillic' ], - 'ru' => [ 'XFree86-cyrillic-fonts' ], - 'ru_RU.KOI8-R' => [ 'XFree86-cyrillic-fonts' ], - 'sk' => [ 'XFree86-ISO8859-2', 'XFree86-ISO8859-2-75dpi-fonts' ], - 'sl' => [ 'XFree86-ISO8859-2', 'XFree86-ISO8859-2-75dpi-fonts' ], -# 'sp' => [ 'fonts-ttf-cyrillic' ], - 'sr' => [ 'XFree86-ISO8859-2', 'XFree86-ISO8859-2-75dpi-fonts' ], -# 'th' => thai fonts - 'tr' => [ 'XFree86-ISO8859-9', 'XFree86-ISO8859-9-75dpi-fonts' ], -#'uk_UA' => [ 'fonts-ttf-cyrillic' ], -# 'vi' => vietnamese fonts - 'yi' => [ 'acon' ], - 'zh' => [ 'rxvt-CLE', 'taipeifonts', 'fonts-ttf-big5', 'fonts-ttf-gb2312' ], - 'zh_CN.GB2312' => [ 'rxvt-CLE', 'fonts-ttf-gb2312' ], - 'zh_TW.Big5' => [ 'rxvt-CLE', 'taipeifonts', 'fonts-ttf-big5' ], -); -@skip_list = qw( -XFree86-8514 XFree86-AGX XFree86-Mach32 XFree86-Mach64 XFree86-Mach8 XFree86-Mono -XFree86-P9000 XFree86-S3 XFree86-S3V XFree86-SVGA XFree86-W32 XFree86-I128 -XFree86-Sun XFree86-SunMono XFree86-Sun24 XFree86-3DLabs -MySQL MySQL_GPL mod_php3 midgard postfix metroess metrotmpl -kernel-linus kernel-secure kernel-BOOT -hackkernel hackkernel-BOOT hackkernel-headers -hackkernel-pcmcia-cs hackkernel-smp hackkernel-smp-fb -autoirpm autoirpm-icons numlock -); @preferred = qw(perl-GTK postfix wu-ftpd ghostscript-X vim-minimal kernel ispell-en); +#- lower bound on the left ( aka 90 means [90-100[ ) +%compssListDesc = ( + 5 => __("must have"), + 4 => __("important"), + 3 => __("very nice"), + 2 => __("nice"), + 1 => __("maybe"), +); + #- constant for small transaction. $limitMinTrans = 8; @@ -107,7 +46,6 @@ my $PKGS_SELECTED = 0x00ffffff; my $PKGS_FORCE = 0x01000000; my $PKGS_INSTALLED = 0x02000000; my $PKGS_BASE = 0x04000000; -my $PKGS_SKIP = 0x08000000; my $PKGS_UPGRADE = 0x20000000; #- package to ignore, typically in Application CD. @@ -140,7 +78,6 @@ sub packageFlagSelected { $_[0]->[$FLAGS] & $PKGS_SELECTED } sub packageFlagForce { $_[0]->[$FLAGS] & $PKGS_FORCE } sub packageFlagInstalled { $_[0]->[$FLAGS] & $PKGS_INSTALLED } sub packageFlagBase { $_[0]->[$FLAGS] & $PKGS_BASE } -sub packageFlagSkip { $_[0]->[$FLAGS] & $PKGS_SKIP } sub packageFlagUpgrade { $_[0]->[$FLAGS] & $PKGS_UPGRADE } sub packageSetFlagSelected { $_[0]->[$FLAGS] &= ~$PKGS_SELECTED; $_[0]->[$FLAGS] |= $_[1] & $PKGS_SELECTED; } @@ -148,15 +85,13 @@ sub packageSetFlagSelected { $_[0]->[$FLAGS] &= ~$PKGS_SELECTED; $_[0]->[$FLAGS sub packageSetFlagForce { $_[1] ? ($_[0]->[$FLAGS] |= $PKGS_FORCE) : ($_[0]->[$FLAGS] &= ~$PKGS_FORCE); } sub packageSetFlagInstalled { $_[1] ? ($_[0]->[$FLAGS] |= $PKGS_INSTALLED) : ($_[0]->[$FLAGS] &= ~$PKGS_INSTALLED); } sub packageSetFlagBase { $_[1] ? ($_[0]->[$FLAGS] |= $PKGS_BASE) : ($_[0]->[$FLAGS] &= ~$PKGS_BASE); } -sub packageSetFlagSkip { $_[1] ? ($_[0]->[$FLAGS] |= $PKGS_SKIP) : ($_[0]->[$FLAGS] &= ~$PKGS_SKIP); } sub packageSetFlagUpgrade { $_[1] ? ($_[0]->[$FLAGS] |= $PKGS_UPGRADE) : ($_[0]->[$FLAGS] &= ~$PKGS_UPGRADE); } sub packageMedium { $_[0]->[$MEDIUM] } sub packageProvides { map { $_[0]->{depslist}[$_] || die "unkown package id $_" } unpack "s*", $_[1]->[$PROVIDES] } -sub packageValues { [ unpack "s*", $_[0]->[$VALUES] ] } -sub packageSetValues { $_[0]->[$VALUES] = pack "s*", @{$_[1]} } +sub packageRate { substr($_[0]->[$VALUES], 0, 1) } sub packageHeader { $_[0]->[$HEADER] } sub packageFreeHeader { c::headerFree(delete $_[0]->[$HEADER]) } @@ -245,11 +180,6 @@ sub packageById { my ($packages, $id) = @_; $packages->{depslist}[$id] or log::l("unknown package id $id") && undef; } -sub allPackages { - my ($packages) = @_; - my %skip_list; @skip_list{@skip_list} = (); - grep { !exists $skip_list{packageName($_)} } values %{$packages->{names}}; -} sub packagesOfMedium { my ($packages, $mediumName) = @_; my $medium = $packages->{mediums}{$mediumName}; @@ -396,11 +326,6 @@ sub unselectAllPackagesIncludingUpgradable($) { } } -sub skipSetWithProvides { - my ($packages, @l) = @_; - packageSetFlagSkip($_, 1) foreach grep { $_ } map { $_, packageProvides($packages, $_) } @l; -} - sub psUpdateHdlistsDeps { my ($prefix, $method) = @_; my $listf = install_any::getFile('Mandrake/base/hdlists') or die "no hdlists found"; @@ -670,43 +595,66 @@ sub readCompss { \@compss; } -sub readCompssList { - my ($packages, $langs) = @_; - my $f = install_any::getFile('Mandrake/base/compssList') or die "can't find compssList"; - my @levels = split ' ', <$f>; - - local $_; +sub read_rpmsrate { + my ($packages, $f) = @_; + my $line_nb = 0; + my (@l); while (<$f>) { - /^\s*$/ || /^#/ and next; - my ($name, @values) = split; - my $p = packageByName($packages, $name) or log::l("unknown entry $name (in compssList)"), next; - $p->[$VALUES] = pack "s*", @values; - } - - my %done; - foreach (@$langs) { - my $p = packageByName($packages, "locales-$_") or next; - foreach ($p, packageProvides($packages, $p), map { packageByName($packages, $_) } @{$by_lang{$_} || []}) { - next if !$_ || $done{$_}; $done{$_} = 1; - $_->[$VALUES] = pack "s*", map { $_ + 90 } ($_->[$VALUES] ? (unpack "s*", $_->[$VALUES]) : ((0) x @levels)); + $line_nb++; + /\t/ and die "tabulations not allowed at line $line_nb\n"; + s/#.*//; # comments + + my ($indent, $data) = /(\s*)(.*)/; + next if !$data; # skip empty lines + + @l = grep { $_->[0] < length $indent } @l; + + my @m = @l ? @{$l[$#l][1]} : (); + my ($t, $flag, @l2); + while ($data =~ + /^(( + [1-5] + | + (?: (?: !\s*)? [0-9A-Z_]+(?:".*?")?) + (?: \s*\|\|\s* (?: !\s*)? [0-9A-Z_]+(?:".*?")?)* + ) + (?:\s+|$) + )(.*)/x) { + ($t, $flag, $data) = ($1,$2,$3); + while ($flag =~ s,^\s*(("[^"]*"|[^"\s]*)*)\s+,$1,) {} + my $ok = 0; + $flag = join('||', grep { + if (my ($inv, $p) = /^(!)?PCI"(.*)"/) { + ($inv xor detect_devices::matching_desc($p)) and $ok = 1; + 0; + } else { + 1; + } + } split '\|\|', $flag); + push @m, $ok ? 'TRUE' : $flag || 'FALSE'; + push @l2, [ length $indent, [ @m ] ]; + $indent .= $t; + } + if ($data) { + # has packages on same line + my ($rate) = grep { /^\d$/ } @m or die sprintf qq(missing rate for "%s" at line %d (flags are %s)\n), $data, $line_nb, join('&&', @m); + foreach (split ' ', $data) { + #-log::l("rpmsrate: $_ = ", join(" && ", @m)); + my $p = packageByName($packages, $_) or log::l("unknown package $_"), next; + $p->[$VALUES] = join("\t", $rate, grep { !/^\d$/ } @m); + } + push @l, @l2; + } else { + push @l, [ $l2[0][0], $l2[$#l2][1] ]; } } - my $l = { map_index { $_ => $::i } @levels }; } sub readCompssUsers { - my ($packages, $compss, $meta_class) = @_; + my ($packages, $meta_class) = @_; my (%compssUsers, %compssUsersIcons, , %compssUsersDescr, @sorted, $l); my (%compss); - foreach (@$compss) { - local ($_, $a) = m|(.*)/(.*)|; - do { push @{$compss{$_}}, $a } while s|/[^/]+||; - } - my $map = sub { - $l or return; - $_ = $packages->{names}{$_} or log::l("unknown package $_ (in compssUsers)") foreach @$l; - }; my $file = 'Mandrake/base/compssUsers'; my $f = $meta_class && install_any::getFile("$file.$meta_class") || install_any::getFile($file) or die "can't find $file"; local $_; @@ -715,7 +663,6 @@ sub readCompssUsers { s/#.*//; if (/^(\S.*)/) { - &$map; my ($icon, $descr); /^(.*?)\s*\[icon=(.*?)\](.*)/ and $_ = "$1$3", $icon = $2; /^(.*?)\s*\[descr=(.*?)\](.*)/ and $_ = "$1$3", $descr = $2; @@ -723,30 +670,20 @@ sub readCompssUsers { $compssUsersDescr{$_} = $descr; push @sorted, $_; $compssUsers{$_} = $l = []; - } elsif (/\s+\+(\S+)/) { - push @$l, $1; } elsif (/^\s+(.*?)\s*$/) { - push @$l, @{$compss{$1} || log::l("unknown category $1 (in compssUsers)") && []}; + push @$l, $1; } } - &$map; \%compssUsers, \@sorted, \%compssUsersIcons, \%compssUsersDescr; } sub setSelectedFromCompssList { - my ($compssListLevels, $packages, $min_level, $max_size, $install_class) = @_; - my $ind = $compssListLevels->{$install_class}; defined $ind or log::l("unknown install class $install_class in compssList"), return; + my ($packages, $compssUsersChoice, $min_level, $max_size, $install_class) = @_; + $compssUsersChoice->{TRUE} = 1; #- ensure TRUE is set my $nb = selectedSize($packages); - my @packages = allPackages($packages); - my @places = do { - #- special case for /^k/ aka kde stuff - my @values = map { my @v = unpack "s*", $_->[$VALUES]; $v[$ind] } @packages; - sort { $values[$b] <=> $values[$a] } 0 .. $#packages; - }; - foreach (@places) { - my $p = $packages[$_]; - next if packageFlagSkip($p); - last if (unpack "s*", $p->[$VALUES])[$ind] < $min_level; + foreach my $p (sort { substr($a,0,1) <=> substr($b,0,1) } values %{$packages->{names}}) { + my ($rate, @flags) = split "\t", $p->[$VALUES]; + next if !$rate || $rate < $min_level || grep { !grep { /^!(.*)/ ? !$compssUsersChoice->{$1} : $compssUsersChoice->{$_} } split('\|\|') } @flags; #- determine the packages that will be selected when #- selecting $p. the packages are not selected. @@ -760,7 +697,7 @@ sub setSelectedFromCompssList { } if ($max_size && $nb > $max_size) { $nb = $old_nb; - $min_level = (unpack "s*", $p->[$VALUES])[$ind]; + $min_level = packageRate($p); last; } @@ -768,7 +705,7 @@ sub setSelectedFromCompssList { selectPackage($packages, $p); } log::l("setSelectedFromCompssList: reached size $nb, up to indice $min_level (less than $max_size)"); - $ind, $min_level; + $min_level; } #- usefull to know the size it would take for a given min_level/max_size @@ -1119,8 +1056,8 @@ sub selectPackagesToUpgrade($$$;$$) { close OUTPUT; open STDIN, "<&INPUT_CHILD"; open STDOUT, ">&OUTPUT_CHILD"; - exec "parsehdlist", "--interactive", map { "/tmp/$_->{hdlist}" } values %{$packages->{mediums}}; - c::_exit(1); + exec "parsehdlist", "--interactive", map { "/tmp/$_->{hdlist}" } values %{$packages->{mediums}} + or c::_exit(1); } #- let the parent known about what we found here! diff --git a/perl-install/share/compssUsers b/perl-install/share/compssUsers index a141bb9aa..834207d41 100644 --- a/perl-install/share/compssUsers +++ b/perl-install/share/compssUsers @@ -1,96 +1,76 @@ KDE [icon=kde] [descr=The K Desktop Environment, the basic graphical environment with a collection of accompanying tools] - Graphical desktop/KDE + KDE Gnome [icon=gnome] [descr=A graphical environment with user-friendly set of applications and desktop tools] - Graphical desktop/GNOME - Graphical desktop/Sawfish - +XFree86-75dpi-fonts - +fonts-ttf-west_european + GNOME Other Graphical Desktops [icon=windowmanager] [descr=Icewm, Window Maker, Enlightenment, Fvwm, etc] - Graphical desktop/Window Maker - Graphical desktop/Enlightenment - Graphical desktop/FVWM based - Graphical desktop/Icewm - Graphical desktop/Other - +XFree86 - +XFree86-75dpi-fonts + GRAPHICAL_DESKTOP Internet Tools [icon=networking] [descr=Set of tools to read and send mail and news (pine, mutt, tin..) and to browse the Web] - Networking/WWW - Networking/Mail - Networking/News - Applications/Networking + NETWORKING_WWW + NETWORKING_MAIL + NETWORKING_NEWS Communication facilities [icon=chat] [descr=Chat (IRC or instant messaging) programs such as xchat, licq, gaim, and file transfer tools] - Communications - Networking/Chat - Networking/File transfer - Networking/IRC - Networking/Instant messaging - Network + COMMUNICATIONS + NETWORKING_CHAT + NETWORKING_FILE_TRANSFER + NETWORKING_IRC + NETWORKING_INSTANT_MESSAGING Office [icon=office] [descr=Office programs: wordprocessors (kword, abiword), spreadsheets (kspread, gnumeric), pdf viewers, etc] - Office - Publishing - Archiving/Cd burning - Applications + OFFICE + PUBLISHING Multimedia [icon=multimedia] [descr=Sound and video playing/editing programs] - Sound - Video - Multimedia/sound - Applications/Sound - Applications/Multimedia + SOUND + VIDEO Graphics Manipulation [icon=graphics] [descr=Graphics programs such as The Gimp] - Graphics + GRAPHICS Games [icon=arcade] [descr=Amusement programs: arcade, boards, strategy, etc] - Games + GAMES Documentation [icon=documentation] [descr=Books and Howto's on Linux and Free Software] - Books + BOOKS Databases [icon=documentation] [descr=Databases clients and servers (mysql and postgresql)] - Databases - Applications/Databases + DATABASES Development C/C++ [icon=editors] [descr=C and C++ development libraries, programs and include files] - Development/C - Development/C++ - -Development other [icon=editors] [descr=Python, Perl, libraries, tools] - Development/Python - Development/Libraries - Development/Databases - Development/Java - Development/Perl - Development/Tools - Development/Other - -Development applications [icon=editors] [descr=KDE, QT, Gnome, GTK+] - Development/Kernel - Development/KDE and QT - Development/GNOME and GTK+ + DEVELOPMENT + +#Development other [icon=editors] [descr=Python, Perl, libraries, tools] +# Development/Python +# Development/Libraries +# Development/Databases +# Development/Java +# Development/Perl +# Development/Tools +# Development/Other +# +#Development applications [icon=editors] [descr=KDE, QT, Gnome, GTK+] +# Development/Kernel +# Development/KDE and QT +# Development/GNOME and GTK+ Console Tools [icon=terminals] [descr=editors, shells, file tools, terminals] - Editors - Terminals - Text tools - Shells - File tools - Networking/Remote access + EDITORS + TERMINALS + TEXT_TOOLS + SHELLS + FILE_TOOLS + NETWORKING_REMOTE_ACCESS Utilities [icon=configuration] [descr=Archiving, emulators, monitoring] - Monitoring - Toys - Emulators - Accessibility - Archiving - Networking/Other - X11/Applications + MONITORING + EMULATORS + ACCESSIBILITY + ARCHIVING + NETWORKING_OTHER Sciences [icon=sciences] [descr=Scientific applications] - Sciences + SCIENCES |