Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FLATPAK Package does not properly respond to any value for OS/ARCH #310

Open
hollowaykeanho opened this issue Mar 31, 2024 · 2 comments
Open
Assignees
Labels
Bug Case is about a glitch. Done and Pending Release Completed and staging for next release.

Comments

@hollowaykeanho
Copy link
Member

Description

When the target OS/ARCH is having any value, the FLATPAK packager refused to package (incompatible candidate). It's likely due to mishap in safety checking.

Expected Behavior

FLATPAK packager allows any target OS and target ARCH value.

Current Behavior

FLATPAK packager rejects any value for both target's OS and target's ARCH.

Steps to Reproduce [COMPULSORY]

  1. build a polygot shell script that offers to any OS and any ARCH functionalities.
  2. run the CI. notice that .flatpak is not packaged due to incompatible type.

Associated Data Files

No response

@hollowaykeanho hollowaykeanho added the Bug Case is about a glitch. label Mar 31, 2024
@hollowaykeanho hollowaykeanho self-assigned this Mar 31, 2024
@github-project-automation github-project-automation bot moved this to Buckets in AutomataCI Mar 31, 2024
@hollowaykeanho hollowaykeanho moved this from Buckets to v2.2.0 in AutomataCI Mar 31, 2024
@hollowaykeanho
Copy link
Member Author

hollowaykeanho commented Mar 31, 2024

fixed in

diff --git a/automataCI/_package-flatpak_unix-any.sh b/automataCI/_package-flatpak_unix-any.sh
index d5503c8..00bb399 100644
--- a/automataCI/_package-flatpak_unix-any.sh
+++ b/automataCI/_package-flatpak_unix-any.sh
@@ -56,11 +56,12 @@ PACKAGE_Run_FLATPAK() {
         I18N_Check_Availability "FLATPAK"
         FLATPAK_Is_Available "$_target_os" "$_target_arch"
         case $? in
-        2|3)
+        2)
                 I18N_Check_Incompatible_Skipped
                 return 0
                 ;;
-        0)
+        0|3)
+                # accepted
                 ;;
         *)
                 I18N_Check_Failed
diff --git a/automataCI/_package-flatpak_windows-any.ps1 b/automataCI/_package-flatpak_windows-any.ps1
index 12486a6..7a38b0e 100644
--- a/automataCI/_package-flatpak_windows-any.ps1
+++ b/automataCI/_package-flatpak_windows-any.ps1
@@ -46,10 +46,10 @@ function PACKAGE-Run-FLATPAK {
        $null = I18N-Check-Availability "FLATPAK"
        $___process = FLATPAK-Is-Available "${_target_os}" "${_target_arch}"
        switch ($___process) {
-       { $_ -in 2, 3 } {
+       2 {
                $null = I18N-Check-Incompatible-Skipped
                return 0
-       } 0 {
+       } { $_ -in 0, 3 } {
                break
        } Default {
                $null = I18N-Check-Failed
diff --git a/automataCI/services/compilers/flatpak.ps1 b/automataCI/services/compilers/flatpak.ps1
index 9d925b9..9475d06 100644
--- a/automataCI/services/compilers/flatpak.ps1
+++ b/automataCI/services/compilers/flatpak.ps1
@@ -132,7 +132,7 @@ function FLATPAK-Is-Available {
 
        # check compatible target os
        switch ($___os) {
-       linux {
+       { $_ -in linux, any } {
                # accepted
        } Default {
                return 2
diff --git a/automataCI/services/compilers/flatpak.sh b/automataCI/services/compilers/flatpak.sh
index 367cdf5..a017bed 100644
--- a/automataCI/services/compilers/flatpak.sh
+++ b/automataCI/services/compilers/flatpak.sh
@@ -122,7 +122,7 @@ FLATPAK_Is_Available() {
 
         # check compatible target os
         case "$___os" in
-        linux)
+        linux|any)
                 # accepted
                 ;;
         *)
diff --git a/src/.ci/_package-flatpak_unix-any.sh b/src/.ci/_package-flatpak_unix-any.sh
index 76b2d5f..869cdcd 100644
--- a/src/.ci/_package-flatpak_unix-any.sh
+++ b/src/.ci/_package-flatpak_unix-any.sh
@@ -61,14 +61,13 @@ PACKAGE_Assemble_FLATPAK_Content() {
                 return 10 # not applicable
         elif [ $(FS_Is_Target_A_MSI "$_target") -eq 0 ]; then
                 return 10 # not applicable
-        elif [ ! "$_target_os" = "linux" ]; then
+        elif [ ! "$_target_os" = "linux" ] && [ ! "$_target_os" = "any" ]; then
                 return 10 # not applicable
         fi

diff --git a/src/.ci/_package-flatpak_windows-any.ps1 b/src/.ci/_package-flatpak_windows-any.ps1
index 98380b4..37417a4 100644
--- a/src/.ci/_package-flatpak_windows-any.ps1
+++ b/src/.ci/_package-flatpak_windows-any.ps1
@@ -61,13 +61,13 @@ function PACKAGE-Assemble-FLATPAK-Content {
                return 10 # not applicable
        } elseif ($(FS-Is-Target-A-MSI "${_target}") -eq 0) {
                return 10 # not applicable
-       } elseif ($_target_os -ne "linux") {
+       } elseif (($_target_os -ne "linux") -and ($_target_os -ne "any")) {
                return 10 # not applicable
        }

@hollowaykeanho hollowaykeanho changed the title FLATPAK Package does not properly respond to any value for OS/ARCH FLATPAK Package does not properly respond to any value for OS/ARCH Mar 31, 2024
@hollowaykeanho hollowaykeanho added the In Progress Someone is working on the case. label May 21, 2024
@hollowaykeanho
Copy link
Member Author

fixed in e372d4f.

@hollowaykeanho hollowaykeanho added Done and Pending Release Completed and staging for next release. and removed In Progress Someone is working on the case. labels May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Case is about a glitch. Done and Pending Release Completed and staging for next release.
Projects
Status: v3.0.0
Development

No branches or pull requests

1 participant