summaryrefslogtreecommitdiff
path: root/scripts/VyattaConfigOutput.pm
diff options
context:
space:
mode:
authorrbalocca <rbalocca@vyatta.com>2008-04-24 13:33:46 -0700
committerrbalocca <rbalocca@vyatta.com>2008-04-24 13:33:46 -0700
commita309f120a9ff472d45544a9101226334e426e76a (patch)
treebfdb25a51f42443587668e8fd5ba0597b0d744d9 /scripts/VyattaConfigOutput.pm
parentc29e34d11a22eecbaa50fa134965f2fa036f47f3 (diff)
parent7fd560b72df1b327b4b47a6232dfcf16d6fae52c (diff)
downloadvyatta-cfg-a309f120a9ff472d45544a9101226334e426e76a.tar.gz
vyatta-cfg-a309f120a9ff472d45544a9101226334e426e76a.zip
Merge branch 'glendale'
Diffstat (limited to 'scripts/VyattaConfigOutput.pm')
-rwxr-xr-xscripts/VyattaConfigOutput.pm25
1 files changed, 24 insertions, 1 deletions
diff --git a/scripts/VyattaConfigOutput.pm b/scripts/VyattaConfigOutput.pm
index 2a152ee..2766b64 100755
--- a/scripts/VyattaConfigOutput.pm
+++ b/scripts/VyattaConfigOutput.pm
@@ -1,5 +1,25 @@
-# Perl module for generating output of the configuration.
+#!/usr/bin/perl
+
+# Author: An-Cheng Huang <ancheng@vyatta.com>
+# Date: 2007
+# Description: Perl module for generating output of the configuration.
+
+# **** License ****
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
#
+# This code was originally developed by Vyatta, Inc.
+# Portions created by Vyatta are Copyright (C) 2006, 2007, 2008 Vyatta, Inc.
+# All Rights Reserved.
+# **** End License ****
+
+
# outputNewConfig()
# prints the "new" config, i.e., the active config with any un-committed
# changes. 'diff' notation is also generated to indicate the changes.
@@ -12,6 +32,7 @@ package VyattaConfigOutput;
use strict;
use lib '/opt/vyatta/share/perl5/';
use VyattaConfig;
+use Sort::Versions;
# whether to show default values
my $show_all = 0;
@@ -170,6 +191,7 @@ sub displayDeletedOrigChildren {
$dont_show_as_deleted);
} elsif (scalar($#cnames) >= 0) {
if ($is_tag) {
+ @cnames = sort versioncmp @cnames;
foreach my $cname (@cnames) {
if ($cname eq 'node.val') {
# should not happen
@@ -224,6 +246,7 @@ sub displayChildren {
displayValues([ @cur_path, $child ], $prefix, $child);
} elsif (scalar($#cnames) >= 0) {
if ($is_tag) {
+ @cnames = sort versioncmp @cnames;
foreach my $cname (@cnames) {
if ($cname eq 'node.val') {
# should not happen