Skip to content

chore(utils): make platform.sh POSIX-safe and fix ShellCheck warnings#387

Merged
vnarapar merged 1 commit intoqualcomm-linux:mainfrom
smuppand:infra
Apr 8, 2026
Merged

chore(utils): make platform.sh POSIX-safe and fix ShellCheck warnings#387
vnarapar merged 1 commit intoqualcomm-linux:mainfrom
smuppand:infra

Conversation

@smuppand
Copy link
Copy Markdown
Contributor

@smuppand smuppand commented Apr 7, 2026

This PR applies a small lint-only cleanup to Runner/utils/platform.sh.

What is changed:

  • replace the non-standard function syntax with POSIX-compatible syntax
  • remove use of disown, which is not defined in POSIX sh
  • quote variables used in test and kill calls

Why this is needed:
ShellCheck reports non-POSIX and quoting issues in platform.sh. These changes address those warnings while keeping the existing behavior and flow intact.

@smuppand smuppand requested a review from vnarapar April 7, 2026 01:22
non-POSIX disown usage, and quote variables passed to test and kill.

These changes address ShellCheck warnings without changing the current
runtime flow or behavior.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
# Detect Android userland
ANDROID_PATH=/system/build.prop
if [ -f $ANDROID_PATH ]; then
ANDROID=1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is being used in

if [ "$ANDROID" -eq 1 ]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think platform.sh can be removed along with the recedues in basics.sh if there is no dependency.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is being used in

if [ "$ANDROID" -eq 1 ]; then

I don't see any of the files importing these functions for use.

git grep -nE 'platform\.sh|basic\.sh|pidkiller|SHELL_CMD|ANDROID_PATH' .
Runner/utils/basics.sh:10:. "${TOOLS}/platform.sh"
Runner/utils/platform.sh:7:ANDROID_PATH=/system/build.prop
Runner/utils/platform.sh:8:if [ -f $ANDROID_PATH ]; then
Runner/utils/platform.sh:11:    SHELL_CMD=sh
Runner/utils/platform.sh:15:    SHELL_CMD=bash
Runner/utils/platform.sh:18:function pidkiller()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove platform.sh ?

Copy link
Copy Markdown
Contributor Author

@smuppand smuppand Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove platform.sh ?

Please review the output. The file below still references platform.sh. What steps can we take to remove it? Let it be there for future reference and usage.

Runner/utils/basics.sh:10:. "${TOOLS}/platform.sh"

Copy link
Copy Markdown
Contributor

@vnarapar vnarapar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vnarapar vnarapar merged commit ac2bfd2 into qualcomm-linux:main Apr 8, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants