aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2020-01-20 11:56:03 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2020-01-20 11:56:03 +0200
commit2dbd1f123e2c9dd5d81513ef0b2d6443bf5edde3 (patch)
treed5f56ec364216c50fb0fb1473e488b1576187556
parentc4bcbcbfd6cce382249f16b1f536484d98842e3d (diff)
downloadacmeman-2dbd1f123e2c9dd5d81513ef0b2d6443bf5edde3.tar.gz
acmeman-2dbd1f123e2c9dd5d81513ef0b2d6443bf5edde3.tar.bz2
Create backup copies of Apache configuration files during setup on Slackware.
-rw-r--r--lib/App/Acmeman/Apache/Layout/slackware.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/App/Acmeman/Apache/Layout/slackware.pm b/lib/App/Acmeman/Apache/Layout/slackware.pm
index d09017a..fd9ea31 100644
--- a/lib/App/Acmeman/Apache/Layout/slackware.pm
+++ b/lib/App/Acmeman/Apache/Layout/slackware.pm
@@ -5,6 +5,7 @@ use Carp;
5use parent 'App::Acmeman::Apache::Layout'; 5use parent 'App::Acmeman::Apache::Layout';
6use Apache::Config::Preproc; 6use Apache::Config::Preproc;
7use App::Acmeman::Log qw(:all); 7use App::Acmeman::Log qw(:all);
8use File::BackupCopy;
8 9
9our $PRIORITY = 10; 10our $PRIORITY = 10;
10 11
@@ -175,7 +176,14 @@ sub run_commands_for_file {
175 error((0+@commands) . " left unmatched in edit queue for file $file"); 176 error((0+@commands) . " left unmatched in edit queue for file $file");
176 error("$file left unchanged"); 177 error("$file left unchanged");
177 } else { 178 } else {
178 # FIXME: backup/rollback 179 my $backup_name = backup_copy($app->filename, error => \my $error);
180 if ($backup_name) {
181 debug(1, "modifying ".$app->filename."; prior version saved in $backup_name");
182 } elsif ($error) {
183 error("can't backup ".$app->filename.": $error");
184 error("file left unchanged");
185 return;
186 }
179 $app->save; 187 $app->save;
180 } 188 }
181} 189}

Return to:

Send suggestions and report system problems to the System administrator.