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

RPM Package does not properly respond to any value for OS/ARCH #309

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 RPM packager refused to package (incompatible candidate). It's likely due to mishap in safety checking.

Expected Behavior

RPM packager allows any target OS and target ARCH value.

Current Behavior

RPM 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 .rpm 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
@hollowaykeanho hollowaykeanho moved this to v2.2.0 in AutomataCI Mar 31, 2024
@hollowaykeanho hollowaykeanho changed the title RPM Package does not properly respond to any value for OS/ARCH RPM Package does not properly respond to any value for OS/ARCH Mar 31, 2024
@hollowaykeanho
Copy link
Member Author

hollowaykeanho commented Mar 31, 2024

diff --git a/automataCI/_package-rpm_unix-any.sh b/automataCI/_package-rpm_unix-any.sh
index c3c24b0..cdf8b6f 100644
--- a/automataCI/_package-rpm_unix-any.sh
+++ b/automataCI/_package-rpm_unix-any.sh
@@ -56,11 +56,11 @@ PACKAGE_Run_RPM() {
         I18N_Check_Availability "RPM"
         RPM_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-rpm_windows-any.ps1 b/automataCI/_package-rpm_windows-any.ps1
index 1e8d364..dc5c985 100644
--- a/automataCI/_package-rpm_windows-any.ps1
+++ b/automataCI/_package-rpm_windows-any.ps1
@@ -47,10 +47,10 @@ function PACKAGE-Run-RPM {
        $null = I18N-Check-Availability "RPM"
        $___process = RPM-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-Skipped
diff --git a/automataCI/services/compilers/rpm.ps1 b/automataCI/services/compilers/rpm.ps1
index 88bdd20..8f69079 100644
--- a/automataCI/services/compilers/rpm.ps1
+++ b/automataCI/services/compilers/rpm.ps1
@@ -464,7 +464,7 @@ function RPM-Is-Available {
 
        # check compatible target os
        switch ($___os) {
-       linux {
+       { $_ -in linux, any } {
                break
        } default {
                return 2
diff --git a/automataCI/services/compilers/rpm.sh b/automataCI/services/compilers/rpm.sh
index ebde475..ea7e947 100644
--- a/automataCI/services/compilers/rpm.sh
+++ b/automataCI/services/compilers/rpm.sh
@@ -475,7 +475,7 @@ RPM_Is_Available() {
 
         # check compatible target cpu architecture
         case "$___os" in
-        linux)
+        linux|any)
                 ;;
         *)
                 return 2

@hollowaykeanho hollowaykeanho added the In Progress Someone is working on the case. label May 21, 2024
@hollowaykeanho
Copy link
Member Author

fixed in 35f510b

@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