summaryrefslogtreecommitdiff
path: root/scripts/VyattaConfig.pm
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2007-12-20 17:26:50 -0800
committerAn-Cheng Huang <ancheng@vyatta.com>2007-12-20 17:26:50 -0800
commitab19102a564790b94c1919430fbdeb38a8c23377 (patch)
tree05bbb1cc27a3a4d0d5a91acddda968357834f27c /scripts/VyattaConfig.pm
parent07c75b9c792b8ff48d07de77628c3619893eaf74 (diff)
downloadvyatta-cfg-ab19102a564790b94c1919430fbdeb38a8c23377.tar.gz
vyatta-cfg-ab19102a564790b94c1919430fbdeb38a8c23377.zip
Fixed 'isDeleted' method, related to Bug 2340 fix.
Diffstat (limited to 'scripts/VyattaConfig.pm')
-rw-r--r--scripts/VyattaConfig.pm27
1 files changed, 9 insertions, 18 deletions
diff --git a/scripts/VyattaConfig.pm b/scripts/VyattaConfig.pm
index 03869dc..ecaf545 100644
--- a/scripts/VyattaConfig.pm
+++ b/scripts/VyattaConfig.pm
@@ -241,27 +241,18 @@ sub existsOrig {
# is the "node" deleted. node is relative. returns true or false
sub isDeleted {
my ($self, $node) = @_;
- my $endnode = undef;
- my $filepath = undef;
- my @nodes = ();
-
- # split the string into an array
- (@nodes) = split /\s+/, $node;
-
- # take the last node off the string
- $endnode = pop @nodes;
- # and modify it to match the whiteout name
- $endnode = ".wh.$endnode";
-
- # setup the path with the rest of the nodes
- # use the change_dir
$node =~ s/\//%2F/g;
$node =~ s/\s+/\//g;
- $filepath = "$self->{_changes_only_dir_base}$self->{_current_dir_level}/$node";
- # if the file exists, the node was deleted
- if (-f "$filepath") { return 1; }
- else { return 0; }
+ my $filepathAct
+ = "$self->{_active_dir_base}$self->{_current_dir_level}/$node";
+ my $filepathNew
+ = "$self->{_new_config_dir_base}$self->{_current_dir_level}/$node";
+
+ if ((-e $filepathAct) && !(-e $filepathNew)) {
+ return 1;
+ }
+ return 0;
}
## listDeleted("level")