summaryrefslogtreecommitdiffstats
path: root/perl-install/install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/install')
-rw-r--r--perl-install/install/NEWS2
-rw-r--r--perl-install/install/pkgs.pm17
-rw-r--r--perl-install/install/share/list.xml5
-rw-r--r--perl-install/install/share/symlinks1
4 files changed, 16 insertions, 9 deletions
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index 9b81fc2ce..f93446a51 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,4 +1,6 @@
- internal
+ o use urpm::select::get_preferred to choose preferred packages
+ (need urpmi library >= 4.10.1)
o computeGroupSize: do direct requires before choices
(eg for epiphany: require libmozilla-firefox2.0.0.6 before choosing
package providing libmozjs.so)
diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm
index 7df037c87..3ee676a61 100644
--- a/perl-install/install/pkgs.pm
+++ b/perl-install/install/pkgs.pm
@@ -11,6 +11,7 @@ BEGIN {
use URPM;
use URPM::Resolve;
use URPM::Signature;
+use urpm::select;
use common;
use install::any;
use install::media qw(getFile_ getAndSaveFile_ packageMedium);
@@ -21,12 +22,6 @@ use fs;
use fs::loopback;
use c;
-our %preferred = map { $_ => undef }
- qw(libmesagl1 lib64mesagl1 grub nail
- perl-base openjade ctags glibc glibc-devel curl sane-backends postfix
- gcc gcc-cpp gcc-c++ proftpd vim-minimal db1 libxpm4 zlib1
- libkdebase4 libkdepim2-ktnef-devel libkdepim2-korganizer libkdebase4-konsole libkdebase4-kmenuedit
- libncurses5 harddrake cups free-kde-config);
#- lower bound on the left ( aka 90 means [90-100[ )
our %compssListDesc = (
@@ -196,9 +191,10 @@ sub packageCallbackChoices {
sub packageCallbackChoices_ {
my ($urpm, $choices) = @_;
- if (my $prefer = find { $_->arch ne 'src' && exists $preferred{$_->name} } @$choices) {
- log::l("packageCallbackChoices: prefered choice " . $prefer->name . " from ", join(",", map { $_->name } @$choices));
- $prefer;
+
+ my ($prefer, $_other) = urpm::select::get_preferred($urpm, $choices, '');
+ if (@$prefer) {
+ @$prefer;
} elsif ($choices->[0]->name =~ /^kernel-(.*source-|.*-devel-)/) {
my @l = grep {
if ($_->name =~ /^kernel-.*source-stripped-(.*)/) {
@@ -324,6 +320,9 @@ sub empty_packages() {
#- add additional fields used by DrakX.
@$packages{qw(count media)} = (0, []);
+ $packages->{log} = \&log::l;
+ $packages->{prefer_vendor_list} = '/etc/urpmi/prefer.vendor.list';
+
$packages;
}
diff --git a/perl-install/install/share/list.xml b/perl-install/install/share/list.xml
index 42ff937b5..33221f99b 100644
--- a/perl-install/install/share/list.xml
+++ b/perl-install/install/share/list.xml
@@ -112,6 +112,7 @@
</filter>
<from>
+ /etc/urpmi/prefer.vendor.list
/etc/mke2fs.conf
/etc/fonts/fonts.conf
/etc/protocols
@@ -330,6 +331,10 @@
ARCH-linux/URPM/Resolve.pm
ARCH-linux/URPM/Signature.pm
ARCH-linux/auto/URPM/URPM.so
+ urpm/msg.pm
+ urpm/select.pm
+ urpm/util.pm
+ urpm/sys.pm
<if set="DEBUG_INSTALL">
ARCH-linux/Term/ReadLine/Gnu.pm
ARCH-linux/Term/ReadLine/Gnu/XS.pm
diff --git a/perl-install/install/share/symlinks b/perl-install/install/share/symlinks
index 07f969a06..8b33f7c3a 100644
--- a/perl-install/install/share/symlinks
+++ b/perl-install/install/share/symlinks
@@ -5,6 +5,7 @@
/etc/group
/etc/passwd
/etc/termcap
+/etc/urpmi
/lib
/lib64
/usr