From 03c64c87a41ccc28721683cbac51fdbc1519ff02 Mon Sep 17 00:00:00 2001 From: Jerome Gaillard Date: Mon, 4 Oct 2021 15:28:07 +0000 Subject: [PATCH] Fix script for package check to work on macOS The behaviour of shell parameter expansion on linux and macOS is different: - on linux "\/" in the replaced string is interpreted as simply "/" - on macOS it is interpreted as the full string "\/" For example, "android.package.example" would be changed to: - "android/package/example" on linux - "android\/package\/example" on macOS The character / is not a special character for pattern matching in bash, so it doesn't need to be escaped. Hence using / instead of \/ in the replaced string works on both linux and macOS. Change-Id: Id6a5cf32afc53d5ffd989c0ac8aa0b9e0fcbaf82 Fixes: 201947033 --- scripts/package-check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/package-check.sh b/scripts/package-check.sh index d7e602f31..9f4a9da21 100755 --- a/scripts/package-check.sh +++ b/scripts/package-check.sh @@ -42,7 +42,7 @@ while [[ $# -ge 1 ]]; do fi # Transform to a slash-separated path and add a trailing slash to enforce # package name boundary. - prefixes+=("${package//\./\/}/") + prefixes+=("${package//\.//}/") shift done