summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2010-11-05 15:19:21 -0700
committerStig Thormodsrud <stig@vyatta.com>2010-11-05 15:19:21 -0700
commita60321f3b38c93b200ff2705eebd4d274cda895d (patch)
tree86b3d04e5f6f983dce8f6f2a1059a278632bb9b1 /lib
parent9f32a72037fdc5cb3abbfa97adb4f612920847dc (diff)
downloadvyatta-config-mgmt-a60321f3b38c93b200ff2705eebd4d274cda895d.tar.gz
vyatta-config-mgmt-a60321f3b38c93b200ff2705eebd4d274cda895d.zip
Don't save a rev if the file hasn't changed.
Diffstat (limited to 'lib')
-rw-r--r--lib/Vyatta/ConfigMgmt.pm21
1 files changed, 13 insertions, 8 deletions
diff --git a/lib/Vyatta/ConfigMgmt.pm b/lib/Vyatta/ConfigMgmt.pm
index 6a49af3..a23b82b 100644
--- a/lib/Vyatta/ConfigMgmt.pm
+++ b/lib/Vyatta/ConfigMgmt.pm
@@ -30,7 +30,7 @@ our @EXPORT = qw(cm_commit_add_log cm_commit_get_log cm_get_archive_dir
cm_get_lr_conf_file cm_get_lr_state_file
cm_get_commit_hook_dir cm_write_file cm_read_file
cm_commit_get_file cm_commit_get_file_name
- cm_get_num_revs);
+ cm_get_num_revs cm_get_last_commit_file);
use base qw(Exporter);
use Vyatta::Config;
@@ -40,13 +40,14 @@ use POSIX;
use IO::Zlib;
-my $commit_hook_dir = '/etc/commit/';
-my $config_dir = '/opt/vyatta/etc/config';
-my $archive_dir = "$config_dir/archive";
-my $config_file = "$config_dir/config.boot";
-my $lr_conf_file = "$archive_dir/lr.conf";
-my $lr_state_file = "$archive_dir/lr.state";
-my $commit_log_file = "$archive_dir/commits";
+my $commit_hook_dir = '/etc/commit/';
+my $config_dir = '/opt/vyatta/etc/config';
+my $archive_dir = "$config_dir/archive";
+my $config_file = "$config_dir/config.boot";
+my $lr_conf_file = "$archive_dir/lr.conf";
+my $lr_state_file = "$archive_dir/lr.state";
+my $commit_log_file = "$archive_dir/commits";
+my $last_commit_file = "$archive_dir/config.boot";
sub cm_get_commit_hook_dir {
@@ -65,6 +66,10 @@ sub cm_get_lr_state_file {
return $lr_state_file;
}
+sub cm_get_last_commit_file {
+ return $last_commit_file;
+}
+
sub cm_read_file {
my ($file) = @_;
my @lines;