Skip to content

Commit eacea8b

Browse files
committed
please.sh create-sdk-artifact: use sensible default for architecture
Previously, we defaulted to the appropriate bitness based on the presence of certain tell-tale directories. When we deprecated the `--bitness` option, we dropped that default. Let's move that logic over to the `--architecture` option. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 440eee4 commit eacea8b

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

please.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3091,11 +3091,11 @@ publish_sdk () { #
30913091
git --git-dir="$sdk64"/usr/src/build-extra/.git push origin "$tag"
30923092
}
30933093
3094-
create_sdk_artifact () { # [--out=<directory>] [--git-sdk=<directory>] [--architecture=(x86_64|i686|aarch64)] [--bitness=(32|64)] [--force] <name>
3094+
create_sdk_artifact () { # [--out=<directory>] [--git-sdk=<directory>] [--architecture=(x86_64|i686|aarch64|auto)] [--bitness=(32|64)] [--force] <name>
30953095
git_sdk_path=/
30963096
output_path=
30973097
force=
3098-
architecture=
3098+
architecture=auto
30993099
bitness=
31003100
keep_worktree=
31013101
while case "$1" in
@@ -3166,6 +3166,20 @@ create_sdk_artifact () { # [--out=<directory>] [--git-sdk=<directory>] [--archit
31663166
;;
31673167
*) die "Unhandled bitness: %s\n" "$bitness";;
31683168
esac
3169+
elif test auto = "$architecture"
3170+
then
3171+
if git -C "$git_sdk_path" rev-parse --quiet --verify HEAD:clangarm64 2>/dev/null
3172+
then
3173+
architecture=aarch64
3174+
elif git -C "$git_sdk_path" rev-parse --quiet --verify HEAD:usr/i686-pc-msys 2>/dev/null
3175+
then
3176+
architecture=i686
3177+
elif git -C "$git_sdk_path" rev-parse --quiet --verify HEAD:usr/x86_64-pc-msys 2>/dev/null
3178+
then
3179+
architecture=x86_64
3180+
else
3181+
die "'%s' is neither 32-bit nor 64-bit SDK?!?" "$git_sdk_path"
3182+
fi
31693183
elif test -z "$architecture"
31703184
then
31713185
die "Either --architecture or --bitness must be provided for this function to work."

0 commit comments

Comments
 (0)