summaryrefslogtreecommitdiffstats
path: root/perl-install/any.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-12-08 16:20:39 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-12-08 16:20:39 +0000
commit3e548c1965333d11337ee4f94643d385da17ac1b (patch)
tree3c20e162d8c2585a53b244615ae775e8ea1501f0 /perl-install/any.pm
parentda22fd04fe09e06bf86b146d1ac66dda45c03f0c (diff)
downloaddrakx-3e548c1965333d11337ee4f94643d385da17ac1b.tar
drakx-3e548c1965333d11337ee4f94643d385da17ac1b.tar.gz
drakx-3e548c1965333d11337ee4f94643d385da17ac1b.tar.bz2
drakx-3e548c1965333d11337ee4f94643d385da17ac1b.tar.xz
drakx-3e548c1965333d11337ee4f94643d385da17ac1b.zip
(rotate_logs): created, rotates ddebug.log and install.log in /root
Diffstat (limited to 'perl-install/any.pm')
-rw-r--r--perl-install/any.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 68d7ae8e9..3e8e04daa 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -249,6 +249,18 @@ sub setAutologin {
{ USER => $user, AUTOLOGIN => bool2yesno($user), EXEC => "/usr/X11R6/bin/startx" });
}
+sub rotate_log {
+ my ($f) = @_;
+ if (-e $f) {
+ my $i = 1;
+ for (; -e "$f$i" || -e "$f$i.gz"; $i++) {}
+ rename $f, "$f$i";
+ }
+}
+sub rotate_logs {
+ my ($prefix) = @_;
+ rotate_log("$prefix/root/$_") foreach qw(ddebug.log install.log);
+}
sub writeandclean_ldsoconf {
my ($prefix) = @_;