diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-08-31 16:03:25 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-08-31 16:03:25 +0000 |
commit | b18b20791cfce5c52a8fb20f2579449b6500da24 (patch) | |
tree | e96e9ec0ec862a1034ca71ae513e01ead2a0f7d1 | |
parent | 53933f59344c68298b3ec9e91291516b19d5aa26 (diff) | |
download | drakx-b18b20791cfce5c52a8fb20f2579449b6500da24.tar drakx-b18b20791cfce5c52a8fb20f2579449b6500da24.tar.gz drakx-b18b20791cfce5c52a8fb20f2579449b6500da24.tar.bz2 drakx-b18b20791cfce5c52a8fb20f2579449b6500da24.tar.xz drakx-b18b20791cfce5c52a8fb20f2579449b6500da24.zip |
- nicely adjust mtime of fontconfig cache files
(otherwise the mtime may be in the future since files are not created with the
chosen timezone, but only in UTC. and fc-cache doesn't like this at all)
-rw-r--r-- | perl-install/install/NEWS | 1 | ||||
-rw-r--r-- | perl-install/install/any.pm | 19 | ||||
-rw-r--r-- | perl-install/install/install2.pm | 7 |
3 files changed, 22 insertions, 5 deletions
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index 8caf033f7..a2eb1d548 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,4 +1,5 @@ - do not set relatime option for mounting nfs +- nicely adjust mtime of fontconfig cache files Version 10.4.183 - 31 August 2007, by Pascal "Pixel" Rigaux diff --git a/perl-install/install/any.pm b/perl-install/install/any.pm index 95b18964f..7af16307b 100644 --- a/perl-install/install/any.pm +++ b/perl-install/install/any.pm @@ -1324,6 +1324,25 @@ sub write_fstab { if !$o->{isUpgrade} || $o->{isUpgrade} =~ /redhat|conectiva/ || $o->{migrate_device_names}; } +sub adjust_files_mtime_to_timezone() { + #- to ensure linuxconf does not cry against those files being in the future + #- to ensure fc-cache works correctly on fonts installed after reboot + + my $timezone_shift = run_program::rooted_get_stdout($::prefix, 'date', '+%z'); + my ($h, $m) = $timezone_shift =~ /\+(..)(..)/ or return; + my $now = time() - ($h * 60 + $m * 60) * 60; + + my @files = ( + (map { "$::prefix/$_" } '/etc/modules.conf', '/etc/crontab', '/etc/sysconfig/mouse', '/etc/sysconfig/network', '/etc/X11/fs/config'), + glob_("$::prefix/var/cache/fontconfig/*"), + ); + log::l("adjust_files_mtime_to_timezone: setting time back $h:$m for files " . join(' ', @files)); + foreach (@files) { + utime $now, $now, $_; + } +} + + sub move_compressed_image_to_disk { my ($o) = @_; diff --git a/perl-install/install/install2.pm b/perl-install/install/install2.pm index dcb162c46..85f42d08e 100644 --- a/perl-install/install/install2.pm +++ b/perl-install/install/install2.pm @@ -613,11 +613,8 @@ sub main { $o->{modules_conf}->write; detect_devices::install_addons($::prefix); - #- to ensure linuxconf does not cry against those files being in the future - foreach ('/etc/modules.conf', '/etc/crontab', '/etc/sysconfig/mouse', '/etc/sysconfig/network', '/etc/X11/fs/config') { - my $now = time() - 24 * 60 * 60; - utime $now, $now, "$::prefix/$_"; - } + install::any::adjust_files_mtime_to_timezone(); + #- make sure failed upgrade will not hurt too much. install::steps::cleanIfFailedUpgrade($o); |