diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-04-25 12:26:16 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-04-25 12:26:16 +0000 |
commit | 126777bc019a54afb4ec51299f2cf9d2841698aa (patch) | |
tree | 97f76e571902ead55ba138f1156a4b4f00b9b779 /perl-install/patch/patch-rh9-mdk10.pl | |
parent | f1f67448efc714873378dfeb8279fae68054a90a (diff) | |
download | drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar.gz drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar.bz2 drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar.xz drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.zip |
re-sync after the big svn loss
Diffstat (limited to 'perl-install/patch/patch-rh9-mdk10.pl')
-rw-r--r-- | perl-install/patch/patch-rh9-mdk10.pl | 116 |
1 files changed, 0 insertions, 116 deletions
diff --git a/perl-install/patch/patch-rh9-mdk10.pl b/perl-install/patch/patch-rh9-mdk10.pl deleted file mode 100644 index 92c4e58ab..000000000 --- a/perl-install/patch/patch-rh9-mdk10.pl +++ /dev/null @@ -1,116 +0,0 @@ - -warn "PATCHING\n"; -log::l("PATCHING\n"); - -use install_any; - -undef *find_root_parts; -*find_root_parts = sub { - my ($fstab, $prefix) = @_; - map { - my $handle = any::inspect($_, $prefix); - my $s = $handle && cat_("$handle->{dir}/etc/redhat-release"); - if ($s) { - chomp($s); - $s =~ s/\s+for\s+\S+//; - log::l("find_root_parts found $_->{device}: $s"); - { release => $s, part => $_ }; - } else { () } - } @$fstab; -}; - - -use pkgs; -package pkgs; - -my $old_compare_pkg = \&URPM::Package::compare_pkg; -undef *URPM::Package::compare_pkg; -*URPM::Package::compare_pkg = sub { - my ($lpkg, $rpkg) = @_; - my $c = ($lpkg->release =~ /mdk$/ ? 1 : 0) - ($rpkg->release =~ /mdk$/ ? 1 : 0); - if ($c) { - my $lpkg_ver = $lpkg->version . '-' . $lpkg->release; - my $rpkg_ver = $rpkg->version . '-' . $rpkg->release; - log::l($lpkg->name . ' ' . $rpkg->name . ': prefering ' . ($c == 1 ? "$lpkg_ver over $rpkg_ver" : "$rpkg_ver over $lpkg_ver")); - return $c; - } - &$old_compare_pkg; -}; - -my $old_compare = \&URPM::Package::compare; -undef *URPM::Package::compare; -*URPM::Package::compare = sub { - my ($lpkg, $rpkg_ver) = @_; - my $c = ($lpkg->release =~ /mdk$/ ? 1 : 0) - ($rpkg_ver =~ /mdk$/ ? 1 : 0); - if ($c) { - my $lpkg_ver = $lpkg->version . '-' . $lpkg->release; - log::l($lpkg->name . ' ' . ': prefering ' . ($c == 1 ? "$lpkg_ver over $rpkg_ver" : "$rpkg_ver over $lpkg_ver")); - return $c; - } - &$old_compare; -}; - -use install2; -package install2; -my $old_choosePackages = \&choosePackages; -undef *choosePackages; -*choosePackages = sub { - my @should_not_be_dirs = qw(/usr/X11R6/lib/X11/xkb /usr/share/locale/zh_TW/LC_TIME /usr/include/GL); - my @should_be_dirs = qw(/etc/X11/xkb); - foreach (@should_not_be_dirs) { - my $f = "$::prefix$_"; - rm_rf($f) if !-l $f && -d $f; - } - foreach (@should_be_dirs) { - my $f = "$::prefix$_"; - rm_rf($f) if -l $f || !-d $f; - } - unlink "$::prefix/etc/X11/XF86Config"; - unlink "$::prefix/etc/X11/XF86Config-4"; - - &$old_choosePackages; -}; - -use fs; -package fs; - -my $old = \&read_fstab; -undef *read_fstab; -*read_fstab = sub { - my @l = &$old; - - my %label2device = map { - my $dev = devices::make($_->{device}); - if (my ($label) = `tune2fs -l $dev 2>/dev/null` =~ /volume name:\s*(\S+)/) { - log::l("device $_->{device} has label $label"); - $label => $_->{device}; - } else { - (); - } - } fsedit::read_proc_partitions([]); - - foreach (@l) { - my ($label) = ($_->{device_LABEL} || $_->{device}) =~ /^LABEL=(.*)/ or next; - if ($label2device{$label}) { - $_->{device} = $label2device{$label}; - } else { - log::l("can't find label $label"); - } - } - - @l; -}; - -use any; -package any; - -undef *fix_broken_alternatives; -*fix_broken_alternatives = sub { - #- fix bad update-alternatives that may occurs after upgrade (and sometimes for install too). - -d "$::prefix/etc/alternatives" or return; - - foreach (all("$::prefix/etc/alternatives")) { - log::l("setting alternative $_"); - run_program::rooted($::prefix, 'update-alternatives', '--auto', $_); - } -}; |