diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-08-29 12:05:35 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-08-29 12:05:35 +0000 |
commit | 3d0144ebd145ea610b2d0286e42fef4e24c5bc45 (patch) | |
tree | a990fba4e859b411705afd8ee03623ce54a97179 | |
parent | e7b1331c202efedff015e1d7978cefb4afb3e1aa (diff) | |
download | drakx-backup-do-not-use-3d0144ebd145ea610b2d0286e42fef4e24c5bc45.tar drakx-backup-do-not-use-3d0144ebd145ea610b2d0286e42fef4e24c5bc45.tar.gz drakx-backup-do-not-use-3d0144ebd145ea610b2d0286e42fef4e24c5bc45.tar.bz2 drakx-backup-do-not-use-3d0144ebd145ea610b2d0286e42fef4e24c5bc45.tar.xz drakx-backup-do-not-use-3d0144ebd145ea610b2d0286e42fef4e24c5bc45.zip |
we don't want drakxtools-backend to depend on perl-URPM
-rw-r--r-- | perl-install/bootloader.pm | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 4a192868c..ba29d7896 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -18,7 +18,6 @@ use detect_devices; use partition_table::raw; use run_program; use modules; -use URPM; #-##################################################################################### #- Functions @@ -470,6 +469,18 @@ sub _do_the_symlink { or cp_af("$::prefix/boot/$long_name", "$::prefix$link"); } +sub cmp_kernel_versions { + my ($va, $vb) = @_; + my $rel_a = $va =~ s/-(.*)$// && $1; + my $rel_b = $vb =~ s/-(.*)$// && $1; + ($va, $vb) = map { [ split /[.-]/ ] } $va, $vb; + my $r = 0; + mapn_ { + $r ||= $_[0] <=> $_[1]; + } $va, $vb; + $r || $rel_a <=> $rel_b || $rel_a cmp $rel_b; +} + sub add_kernel { my ($bootloader, $kernel_str, $v, $b_nolink, $b_no_initrd) = @_; @@ -482,7 +493,7 @@ sub add_kernel { #- normalize append and handle special options { my ($simple, $dict) = unpack_append("$bootloader->{perImageAppend} $v->{append}"); - if (-e "$::prefix/sbin/udev" && $kernel_str->{version} =~ /(2\.\d+\.\d+)/ && URPM::rpmvercmp($1, '2.6.8') >= 0) { + if (-e "$::prefix/sbin/udev" && cmp_kernel_versions($kernel_str->{version_no_ext}, '2.6.8') >= 0) { log::l("it is a recent kernel, so we remove any existing devfs= kernel option to enable udev"); @$dict = grep { $_->[0] ne 'devfs' } @$dict; } @@ -662,7 +673,7 @@ sub get_kernel_labels { my ($kernels, $b_prefer_24) = @_; my @kernels_str = - sort { URPM::rpmvercmp($b->{version_no_ext}, $a->{version_no_ext}) } + sort { cmp_kernel_versions($b->{version_no_ext}, $a->{version_no_ext}) } grep { -d "$::prefix/lib/modules/$_->{version}" } map { vmlinuz2kernel_str($_) } @$kernels; |