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/NEWS | 1 + perl-install/install/any.pm | 19 +++++++++++++++++++ perl-install/install/install2.pm | 7 ++----- 3 files changed, 22 insertions(+), 5 deletions(-) (limited to 'perl-install/install') 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); -- cgit v1.2.1