ChewKeanHo / AutomataCI

An open-source, redistributable, template-guided, and semi-autonomous CI infrastructure readily available your next project.
Apache License 2.0
18 stars 1 forks source link

IPK Package does not properly respond to `any` value for OS/ARCH #308

Open hollowaykeanho opened 3 months ago

hollowaykeanho commented 3 months ago

Description

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

Expected Behavior

IPK packager allows any target OS and target ARCH value.

Current Behavior

IPK 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 .ipk is not packaged due to incompatible type.

Associated Data Files

No response

hollowaykeanho commented 3 months ago
diff --git a/automataCI/_package-ipk_unix-any.sh b/automataCI/_package-ipk_unix-any.sh
index 193d2bd..6386a30 100644
--- a/automataCI/_package-ipk_unix-any.sh
+++ b/automataCI/_package-ipk_unix-any.sh
@@ -54,11 +54,11 @@ PACKAGE_Run_IPK() {
         I18N_Check_Availability "IPK"
         IPK_Is_Available "$_target_os" "$_target_arch"
         case $? in
-        2|3)
+        2)
                 I18N_Check_Incompatible_Skipped
                 return 0
                 ;;
-        0)
+        0|3)
                 # accepted
                 ;;
         *)
diff --git a/automataCI/_package-ipk_windows-any.ps1 b/automataCI/_package-ipk_windows-any.ps1
index 58de1bb..c03a189 100644
--- a/automataCI/_package-ipk_windows-any.ps1
+++ b/automataCI/_package-ipk_windows-any.ps1
@@ -45,10 +45,10 @@ function PACKAGE-Run-IPK {
        $null = I18N-Check-Availability "IPK"
        $___process = IPK-Is-Available "${_target_os}" "${_target_arch}"
        switch ($___process) {
-       { $_ -in 2, 3 } {
+       2 {
                $null = I18N-Check-Incompatible-Skipped
                return 0
-       } 0 {
+       } {$_ -in 0, 3} {
                # accepted
        } Default {
                $null = I18N-Check-Failed
hollowaykeanho commented 1 month ago

implemented in 997ee73dada4b754dc8465be5935e87fad910f14