From: Sven Schöling Date: Thu, 22 May 2014 13:04:12 +0000 (+0200) Subject: scripts/dbupgrade2_tool.pl: bei --create --type pl auch package stub anlegen X-Git-Tag: release-3.2.0beta~442 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=ac12b2841afd63b6a9cc771750c510a7df4f1090;p=kivitendo-erp.git scripts/dbupgrade2_tool.pl: bei --create --type pl auch package stub anlegen --- diff --git a/scripts/dbupgrade2_tool.pl b/scripts/dbupgrade2_tool.pl index 5ed9c27c1..7b614a8ec 100755 --- a/scripts/dbupgrade2_tool.pl +++ b/scripts/dbupgrade2_tool.pl @@ -299,6 +299,23 @@ sub create_upgrade { print $fh "$comment \@description: $description\n"; print $fh "$comment \@depends: @depends\n"; print $fh "$comment \@encoding: $encoding\n"; + + if ($type eq 'pl') { + print $fh "package SL::DBUpgrade2::$filename;\n"; + print $fh "\n"; + print $fh "use strict;\n"; + print $fh "use utf8;\n" if $encoding =~ /utf.?8/i; + print $fh "\n"; + print $fh "use parent qw(SL::DBUpgrade2::Base);\n"; + print $fh "\n"; + print $fh "sub run {\n"; + print $fh " my (\$self) = \@_;\n"; + print $fh "\n"; + print $fh "}\n"; + print $fh "\n"; + print $fh "1;\n"; + } + close $fh; print "File $full_filename created.\n";