From b18b20791cfce5c52a8fb20f2579449b6500da24 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 31 Aug 2007 16:03:25 +0000 Subject: - 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) --- perl-install/install/any.pm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'perl-install/install/any.pm') 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) = @_; -- cgit v1.2.1