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

Package CI job's TARGET_OS and TARGET_ARCH can pick up extensions (e.g. .sh) from chained types (e.g. .sh.ps1) #311

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

Comments

@hollowaykeanho
Copy link
Member

Description

as titled.

Expected Behavior

both are not picking up anymore extensions.

Current Behavior

both only picks up the extension in chained extensions mode.

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 Discussion Matter is still in discussion. No commitment yet. Bug Case is about a glitch. labels 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 hollowaykeanho removed the Discussion Matter is still in discussion. No commitment yet. label Mar 31, 2024
@hollowaykeanho
Copy link
Member Author

Fix:

diff --git a/automataCI/package_unix-any.sh b/automataCI/package_unix-any.sh
index e176889..06648a1 100644
--- a/automataCI/package_unix-any.sh
+++ b/automataCI/package_unix-any.sh
@@ -155,7 +155,9 @@ for i in "${PROJECT_PATH_ROOT}/${PROJECT_PATH_BUILD}"/*; do
         TARGET_OS="${TARGET_FILENAME##*_}"
         TARGET_FILENAME="${TARGET_FILENAME%%_*}"
         TARGET_ARCH="${TARGET_OS##*-}"
+        TARGET_ARCH="${TARGET_ARCH%%.*}"
         TARGET_OS="${TARGET_OS%%-*}"
+        TARGET_OS="${TARGET_OS%%.*}"
 
         if [ "$(STRINGS_Is_Empty "$TARGET_OS")" -eq 0 ] ||
                 [ "$(STRINGS_Is_Empty "$TARGET_ARCH")" -eq 0 ] ||
diff --git a/automataCI/package_windows-any.ps1 b/automataCI/package_windows-any.ps1
index 1981979..472a25e 100644
--- a/automataCI/package_windows-any.ps1
+++ b/automataCI/package_windows-any.ps1
@@ -170,7 +170,9 @@ foreach ($file in (Get-ChildItem -Path "${env:PROJECT_PATH_ROOT}\${env:PROJECT_P
        $TARGET_OS = $TARGET_FILENAME -replace ".*_"
        $TARGET_FILENAME = $TARGET_FILENAME -replace "_.*"
        $TARGET_ARCH = $TARGET_OS -replace ".*-"
+       $TARGET_ARCH = $TARGET_ARCH -replace "\..*$"
        $TARGET_OS = $TARGET_OS -replace "-.*"
+       $TARGET_OS = $TARGET_OS -replace "\..*$"
 
        if (($(STRINGS-Is-Empty "${TARGET_OS}") -eq 0) -or
                ($(STRINGS-Is-Empty "${TARGET_ARCH}") -eq 0) -or

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

fixed in 004aaae

@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