Skip to content

Commit 3ffc955

Browse files
committed
8300099: Configuration fails to auto-detect build user through $USER in dockers
Reviewed-by: ihse
1 parent e7fa150 commit 3ffc955

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

make/autoconf/basic_tools.m4

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -88,6 +88,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
8888
UTIL_LOOKUP_PROGS(GIT, git)
8989
UTIL_LOOKUP_PROGS(NICE, nice)
9090
UTIL_LOOKUP_PROGS(READLINK, greadlink readlink)
91+
UTIL_LOOKUP_PROGS(WHOAMI, whoami)
9192
9293
# These are only needed on some platforms
9394
UTIL_LOOKUP_PROGS(PATHTOOL, cygpath wslpath)

make/autoconf/jdk-version.m4

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -74,6 +74,11 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
7474
# Outer [ ] to quote m4.
7575
[ USERNAME=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` ]
7676
77+
# $USER may be not defined in dockers, so try to check with $WHOAMI
78+
if test "x$USERNAME" = x && test "x$WHOAMI" != x; then
79+
[ USERNAME=`$WHOAMI | $TR -d -c '[a-z][A-Z][0-9]'` ]
80+
fi
81+
7782
# Setup username (for use in adhoc version strings etc)
7883
UTIL_ARG_WITH(NAME: build-user, TYPE: string,
7984
RESULT: USERNAME,

0 commit comments

Comments
 (0)