diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2020-01-20 11:56:03 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2020-01-20 11:56:03 +0200 |
commit | 2dbd1f123e2c9dd5d81513ef0b2d6443bf5edde3 (patch) | |
tree | d5f56ec364216c50fb0fb1473e488b1576187556 | |
parent | c4bcbcbfd6cce382249f16b1f536484d98842e3d (diff) | |
download | acmeman-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.pm | 10 |
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; | |||
5 | use parent 'App::Acmeman::Apache::Layout'; | 5 | use parent 'App::Acmeman::Apache::Layout'; |
6 | use Apache::Config::Preproc; | 6 | use Apache::Config::Preproc; |
7 | use App::Acmeman::Log qw(:all); | 7 | use App::Acmeman::Log qw(:all); |
8 | use File::BackupCopy; | ||
8 | 9 | ||
9 | our $PRIORITY = 10; | 10 | our $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 | } |