pf-tools/pf-tools: give hint of files to convert next

parmelan-guest at users.alioth.debian.org parmelan-guest at users.alioth.debian.org
Mon Aug 11 16:04:05 UTC 2014


details:   http://hg.debian.org/hg/pf-tools/pf-tools/rev/f02ac51ae9ba
changeset: 1308:f02ac51ae9ba
user:      shad
date:      Mon Aug 11 18:04:00 2014 +0200
description:
give hint of files to convert next

diffstat:

 tools/Translate_old_config |  12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diffs (42 lines):

diff -r ef9e72e07750 -r f02ac51ae9ba tools/Translate_old_config
--- a/tools/Translate_old_config	Fri Aug 08 18:02:12 2014 +0200
+++ b/tools/Translate_old_config	Mon Aug 11 18:04:00 2014 +0200
@@ -95,6 +95,7 @@
 my $current_section;
 my %sectionorder  = ();
 my $sectionnumber = 1;
+my @included_list;
 open my $FILE, q{<}, $options->{'input'}
     or croak qq{Can't open '$options->{'input'}': $OS_ERROR};
 while (<$FILE>) {
@@ -122,6 +123,7 @@
     elsif ( $_ =~ m{\A \@include \s* (.*) \z}msx ) {
         if ( $options->{'type'} eq 'config' ) {
             $current_section = qq{include-$1};
+            push @included_list, $current_section;
         }
         else {
             if ( $options->{'site'} eq q{UNDEFINED} ) {
@@ -266,6 +268,7 @@
 
 if ( $options->{'type'} eq 'config' ) {
     foreach my $section (
+        #sort testsort
         sort { $sectionorder{$a} <=> $sectionorder{$b} }
         keys %{$trans}
         )
@@ -419,5 +422,14 @@
 }
 $output_fh->close();
 
+if ( $options->{'output'} ) {
+    foreach my $included_file ( @included_list ) {
+        print qq{You may want to run :\n$PROGRAM_NAME -o $options->{'type'} };
+        print (($options->{'site'} ne q{UNDEFINED}) ? qq{-s $options->{'site'} -i } : q{-i });
+        print dirname ($options->{'input'}) .qq{/$included_file -o };
+        print dirname ($options->{'output'}) .qq{/$included_file\n};
+    }
+}
+
 exit 0;
 



More information about the pf-tools-commits mailing list