Skip to content

Commit e52cd23

Browse files
jmarrerojbtrystram
authored andcommitted
build.sh: use NO_NETWORK:-0 to prevent errors when NO_NETWORK is unbound
1 parent 94afb25 commit e52cd23

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

build.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ srcdir=$(pwd)
3131

3232
configure_yum_repos() {
3333
[ "${arch}" == "riscv64" ] && return # No continuous repo for riscv64 yet
34-
[ "${NO_NETWORK}" == "1" ] && return
34+
[ "${NO_NETWORK:-0}" == "1" ] && return
3535
local version_id
3636
version_id=$(. /etc/os-release && echo ${VERSION_ID})
3737
# Add continuous tag for latest build tools and mark as required so we
@@ -47,7 +47,7 @@ install_rpms() {
4747
# First, a general update; this is best practice. We also hit an issue recently
4848
# where qemu implicitly depended on an updated libusbx but didn't have a versioned
4949
# requires https://bugzilla.redhat.com/show_bug.cgi?id=1625641
50-
[ "${NO_NETWORK}" == "0" ] && yum -y distro-sync
50+
[ "${NO_NETWORK:-0}" == "0" ] && yum -y distro-sync
5151

5252
# xargs is part of findutils, which may not be installed
5353
yum -y install /usr/bin/xargs
@@ -105,7 +105,7 @@ install_rpms() {
105105
# to CoreOS.
106106
install_ocp_tools() {
107107
[ "${arch}" == "riscv64" ] && return # No ocp tools for riscv64
108-
if [ "${NO_NETWORK}" == "0" ]; then
108+
if [ "${NO_NETWORK:-0}" == "0" ]; then
109109
# If $OCP_VERSION is defined we'll grab that specific version.
110110
# Otherwise we'll get the latest.
111111
local url="https://mirror.openshift.com/pub/openshift-v4/${arch}/clients/ocp/latest${OCP_VERSION:+-$OCP_VERSION}/openshift-client-linux.tar.gz"

0 commit comments

Comments
 (0)