Skip to content

Commit

Permalink
Merge pull request #1253 from RotherOSS/issue-#1147-IsPackageDownload…
Browse files Browse the repository at this point in the history
…able

Issue #1147 is package downloadable
  • Loading branch information
bschmalhofer authored Sep 23, 2021
2 parents 362e9e4 + 16e32a4 commit 1b71c2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions Kernel/Modules/AdminPackageManager.pm
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ sub Run {
PACKAGEACTION:
for my $PackageAction (qw(DownloadLocal Rebuild Reinstall)) {

# provide local download button on when the package allows it
if (
$PackageAction eq 'DownloadLocal'
&& (
Expand Down Expand Up @@ -431,7 +432,7 @@ sub Run {
},
);

# check if is possible to download files
# check whether it is allowed to download files
if (
!defined $Structure{PackageIsDownloadable}
|| (
Expand Down Expand Up @@ -574,7 +575,7 @@ sub Run {
Data => { %Param, %Frontend, },
);

# allow to download only if package is allow to do it
# provide remote download button only when the package allows it
if (
!defined $Structure{PackageIsDownloadable}
|| (
Expand Down Expand Up @@ -732,7 +733,7 @@ sub Run {
},
);

# check if is possible to download files
# check whether it is allowed to download files
if (
!defined $Structure{PackageIsDownloadable}
|| (
Expand Down
5 changes: 3 additions & 2 deletions Kernel/System/Console/Command/Dev/Package/Build.pm
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,14 @@ sub Run {
String => $FileString,
);

# just build it if PackageIsDownloadable flag is enable
# Don't build the opm if the PackageIsDownloadable flag is explicitly disabled.
if (
defined $Structure{PackageIsDownloadable}
&& !$Structure{PackageIsDownloadable}->{Content}
)
{
$Self->PrintError("Package cannot be built.\n");
$Self->PrintError("Package is not built because the flag PackageIsDownloadable is set to 0.\n");

return $Self->ExitCodeError();
}

Expand Down

0 comments on commit 1b71c2f

Please sign in to comment.