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 /perl-install/install/any.pm | |
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)
Diffstat (limited to 'perl-install/install/any.pm')
-rw-r--r-- | perl-install/install/any.pm | 19 |
1 files changed, 19 insertions, 0 deletions
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) = @_; |