From 611e82f79cbf92ee22a4d6803e1eac45eb4469f3 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Sun, 22 Mar 2009 10:31:09 +0000 Subject: dahdi-perl: "allow" hand-editing of generated files Rework the text added by dahdi_genconf generators to say that you can hand-edit files. But just don't complain if they get mysteriously overriden when it is run again :-) (closes issue #14569) Reported by: jtodd git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@6215 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- xpp/perl_modules/Dahdi/Config/Gen/Chandahdi.pm | 4 +++- xpp/perl_modules/Dahdi/Config/Gen/System.pm | 4 +++- xpp/perl_modules/Dahdi/Config/Gen/Unicall.pm | 4 +++- xpp/perl_modules/Dahdi/Config/Gen/Users.pm | 2 ++ 4 files changed, 11 insertions(+), 3 deletions(-) (limited to 'xpp') diff --git a/xpp/perl_modules/Dahdi/Config/Gen/Chandahdi.pm b/xpp/perl_modules/Dahdi/Config/Gen/Chandahdi.pm index 1f39a7a..8845544 100644 --- a/xpp/perl_modules/Dahdi/Config/Gen/Chandahdi.pm +++ b/xpp/perl_modules/Dahdi/Config/Gen/Chandahdi.pm @@ -140,7 +140,9 @@ sub generate($) { print "Generating $file\n" if $genopts->{verbose}; open(F, ">$file") || die "$0: Failed to open $file: $!\n"; my $old = select F; - printf "; Autogenerated by %s on %s -- do not hand edit\n", $0, scalar(localtime); + printf "; Autogenerated by $0 on %s\n", scalar(localtime); + print "; If you edit this file and execute $0 again,\n"; + print "; your manual changes will be LOST.\n"; print <<"HEAD"; ; Dahdi Channels Configurations (chan_dahdi.conf) ; diff --git a/xpp/perl_modules/Dahdi/Config/Gen/System.pm b/xpp/perl_modules/Dahdi/Config/Gen/System.pm index f805b65..6ec705f 100644 --- a/xpp/perl_modules/Dahdi/Config/Gen/System.pm +++ b/xpp/perl_modules/Dahdi/Config/Gen/System.pm @@ -111,7 +111,9 @@ sub generate($$$) { print "Generating $file\n" if $genopts->{verbose}; open(F, ">$file") || die "$0: Failed to open $file: $!\n"; my $old = select F; - printf "# Autogenerated by %s on %s -- do not hand edit\n", $0, scalar(localtime); + printf "# Autogenerated by $0 on %s\n", scalar(localtime); + print "# If you edit this file and execute $0 again,\n"; + print "# your manual changes will be LOST.\n"; print <<"HEAD"; # Dahdi Configuration File # diff --git a/xpp/perl_modules/Dahdi/Config/Gen/Unicall.pm b/xpp/perl_modules/Dahdi/Config/Gen/Unicall.pm index 1a796f4..cb6bff0 100644 --- a/xpp/perl_modules/Dahdi/Config/Gen/Unicall.pm +++ b/xpp/perl_modules/Dahdi/Config/Gen/Unicall.pm @@ -32,7 +32,9 @@ sub generate($) { print "Generating $file\n" if $genopts->{verbose}; open(F, ">$file") || die "$0: Failed to open $file: $!\n"; my $old = select F; - printf "; Autogenerated by %s on %s -- do not hand edit\n", $0, scalar(localtime); + printf "; Autogenerated by $0 on %s\n", scalar(localtime); + print "; If you edit this file and execute $0 again,\n"; + print "; your manual changes will be LOST.\n"; print "; This file should be #included in unicall.conf\n\n"; foreach my $span (@spans) { next unless $span->is_digital(); diff --git a/xpp/perl_modules/Dahdi/Config/Gen/Users.pm b/xpp/perl_modules/Dahdi/Config/Gen/Users.pm index e9d8ab9..8bf5833 100644 --- a/xpp/perl_modules/Dahdi/Config/Gen/Users.pm +++ b/xpp/perl_modules/Dahdi/Config/Gen/Users.pm @@ -88,6 +88,8 @@ sub generate($) { ;! Filename: @{[basename($file)]} ($file) ;! Generator: $0 ;! Creation Date: @{[scalar(localtime)]} +;! If you edit this file and execute $0 again,\n"; +;! your manual changes will be LOST.\n"; ;! [general] ; -- cgit v1.2.3