From 30dc736f71d6878473d15fc9237976e526ee9b95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denny=20Korsuk=C3=A9witz?= Date: Fri, 25 Oct 2024 08:11:26 +0000 Subject: [PATCH] Fixed Bug - 'Use of uninitialized value' warning on build custom package and there are no permissions to write to the target directory. Thanks to @BuilderNSV for reporting the issue. #610 --- CHANGES.md | 1 + .../Console/Command/Dev/Package/Build.pm | 18 ++++++------------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 6b3e633c051..86eeaa81bd9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,5 @@ # 6.5.12 2024-??-?? + - 2024-10-24 Fixed Bug - 'Use of uninitialized value' warning on build custom package and there are no permissions to write to the target directory. Thanks to @BuilderNSV for reporting the issue. [#610](https://github.com/znuny/Znuny/issues/610) - 2024-10-22 Perl Module Hash::Merge is now be listed in otrs.CheckModules.pl as mandatory. - 2024-10-15 Ticket search for customer ID in customer interface now searches for the raw ID. Thanks to @BuilderNSV for reporting the issue. [#602](https://github.com/znuny/Znuny/issues/602) - 2024-10-10 Updated MIME::Decoder::QuotedPrint from 5.509 to 5.515. diff --git a/Kernel/System/Console/Command/Dev/Package/Build.pm b/Kernel/System/Console/Command/Dev/Package/Build.pm index 74b53d4b338..5b4814090b5 100644 --- a/Kernel/System/Console/Command/Dev/Package/Build.pm +++ b/Kernel/System/Console/Command/Dev/Package/Build.pm @@ -11,6 +11,7 @@ package Kernel::System::Console::Command::Dev::Package::Build; use strict; use warnings; +use utf8; use parent qw(Kernel::System::Console::BaseCommand); @@ -125,12 +126,13 @@ sub Run { my $File = $Kernel::OM->Get('Kernel::System::Main')->FileWrite( Location => $Self->GetArgument('target-directory') . '/' . $Filename, Content => \$Content, - Mode => 'utf8', # binmode|utf8 - Type => 'Local', # optional - Local|Attachment|MD5 - Permission => '644', # unix file permissions + Mode => 'utf8', + Type => 'Local', + Permission => '644', ); + if ( !$File ) { - $Self->PrintError("File $File could not be written.\n"); + $Self->PrintError("File $Filename could not be written.\n"); return $Self->ExitCodeError(); } @@ -138,12 +140,4 @@ sub Run { return $Self->ExitCodeOk(); } -# sub PostRun { -# my ( $Self, %Param ) = @_; -# -# # This will be called after Run() (even in case of exceptions). Perform any cleanups here. -# -# return; -# } - 1;