From 2e28c46c2943e2998e44b929dc108b68c7fab237 Mon Sep 17 00:00:00 2001 From: tonnesen Date: Wed, 30 Oct 2002 22:49:21 +0000 Subject: [PATCH] Upgrade script preserves templates now. --- koha.upgrade | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/koha.upgrade b/koha.upgrade index fc60878ab0..51c64a98f7 100644 --- a/koha.upgrade +++ b/koha.upgrade @@ -321,6 +321,36 @@ system("chown -R root.$httpduser $::opacdir"); system("chown -R root.$httpduser $::intranetdir"); +# Copy custom templates and reports back in + +opendir D, "$backupdir/kohafiles-$date/intranet/htdocs/"; +my @dirlist=readdir D; +foreach (@dirlist) { + (next) if (/^\./); + (next) if ($_ eq 'default'); + (next) if ($_ eq 'doc'); + (next) if ($_=~/^koha-/); + (next) if (-e "$::intranetdir/htdocs/$_"); + print "Restoring custom intranet templates $_...\n"; + system("cp -a $backupdir/kohafiles-$date/intranet/htdocs/$_ $::intranetdir/htdocs/"); +} + +opendir D, "$backupdir/kohafiles-$date/opac/htdocs/"; +my @dirlist=readdir D; +foreach (@dirlist) { + (next) if (/^\./); + (next) if ($_ eq 'default'); + (next) if ($_ eq 'doc'); + (next) if ($_=~/^koha-/); + (next) if (-e "$::opacdir/htdocs/$_"); + print "Restoring custom opac template $_...\n"; + system("cp -a $backupdir/kohafiles-$date/opac/htdocs/$_ $::opacdir/htdocs/"); +} + + + + + unless ($::kohalogdir && -e $::kohalogdir) { $::kohalogdir='/var/log/koha'; print "\n\nDirectory for logging by Z39.50 daemon [$::kohalogdir]: "; -- 2.39.5