root/build-tools/mockchain-parallel

115 lines
3.2 KiB
Plaintext
Raw Normal View History

Correct build failure after mock updrade Problem: Mockchain-parallel requires python2-requests, but it is not found. Mockchain-parallel runs inside docker. the Dockerfile does not explicitly list python2-requests as a requires package. The Dockerfile does list mock, which used to resolve to mock-1.4.15-1.el7.noarch, which pulled in python2-requests. Centos/EPEL upgraded to mock-1.4.16-1.el7.noarch 2019-06-04, and it now pulls in python36-requests, rather than python2-requests. Mockchain-parallel also uses functions from yum and mock. Yum remains at python2, mock is now at python3. There is also one api change in the new mock. Whatever solution should allow mockchain-parallel function in both a new or an old container. The difference being the mock version, and the verion of python required to run mock/mockchain. Supporting the old mock will also allow more time for conversion of old build systems that pre-date the conversion to docker. Solution: 1) For now, ship two versions of mock-parallel. One compatible with the new mock (python 3, new api). The second compatible with the older mock (python 2, old api). The old version can eventually be retired, so not worth trying to break out common functions. 2) Remove the dependency on yum. We only needed one function to split an rpm file name into components (package-name, version, release, architecture, epoch). We'll write our own. 3) mockchain-parallel becomes a wrapper that detects which mock is present, and from that determine which version of mock-parallel-* to use, and which python to use. Change-Id: Ia56dfd39e349096b09351e89ad3d4f024e60e4e4 Depends-On: I7c5d9b52eed49cdce02224603b9bfd17e4426558 Closes-Bug: 1831768 Signed-off-by: Scott Little <scott.little@windriver.com>
2019-06-05 19:57:03 -04:00
#!/bin/bash
#
#
Correct build failure after mock updrade Problem: Mockchain-parallel requires python2-requests, but it is not found. Mockchain-parallel runs inside docker. the Dockerfile does not explicitly list python2-requests as a requires package. The Dockerfile does list mock, which used to resolve to mock-1.4.15-1.el7.noarch, which pulled in python2-requests. Centos/EPEL upgraded to mock-1.4.16-1.el7.noarch 2019-06-04, and it now pulls in python36-requests, rather than python2-requests. Mockchain-parallel also uses functions from yum and mock. Yum remains at python2, mock is now at python3. There is also one api change in the new mock. Whatever solution should allow mockchain-parallel function in both a new or an old container. The difference being the mock version, and the verion of python required to run mock/mockchain. Supporting the old mock will also allow more time for conversion of old build systems that pre-date the conversion to docker. Solution: 1) For now, ship two versions of mock-parallel. One compatible with the new mock (python 3, new api). The second compatible with the older mock (python 2, old api). The old version can eventually be retired, so not worth trying to break out common functions. 2) Remove the dependency on yum. We only needed one function to split an rpm file name into components (package-name, version, release, architecture, epoch). We'll write our own. 3) mockchain-parallel becomes a wrapper that detects which mock is present, and from that determine which version of mock-parallel-* to use, and which python to use. Change-Id: Ia56dfd39e349096b09351e89ad3d4f024e60e4e4 Depends-On: I7c5d9b52eed49cdce02224603b9bfd17e4426558 Closes-Bug: 1831768 Signed-off-by: Scott Little <scott.little@windriver.com>
2019-06-05 19:57:03 -04:00
# Copyright (c) 2018 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
Correct build failure after mock updrade Problem: Mockchain-parallel requires python2-requests, but it is not found. Mockchain-parallel runs inside docker. the Dockerfile does not explicitly list python2-requests as a requires package. The Dockerfile does list mock, which used to resolve to mock-1.4.15-1.el7.noarch, which pulled in python2-requests. Centos/EPEL upgraded to mock-1.4.16-1.el7.noarch 2019-06-04, and it now pulls in python36-requests, rather than python2-requests. Mockchain-parallel also uses functions from yum and mock. Yum remains at python2, mock is now at python3. There is also one api change in the new mock. Whatever solution should allow mockchain-parallel function in both a new or an old container. The difference being the mock version, and the verion of python required to run mock/mockchain. Supporting the old mock will also allow more time for conversion of old build systems that pre-date the conversion to docker. Solution: 1) For now, ship two versions of mock-parallel. One compatible with the new mock (python 3, new api). The second compatible with the older mock (python 2, old api). The old version can eventually be retired, so not worth trying to break out common functions. 2) Remove the dependency on yum. We only needed one function to split an rpm file name into components (package-name, version, release, architecture, epoch). We'll write our own. 3) mockchain-parallel becomes a wrapper that detects which mock is present, and from that determine which version of mock-parallel-* to use, and which python to use. Change-Id: Ia56dfd39e349096b09351e89ad3d4f024e60e4e4 Depends-On: I7c5d9b52eed49cdce02224603b9bfd17e4426558 Closes-Bug: 1831768 Signed-off-by: Scott Little <scott.little@windriver.com>
2019-06-05 19:57:03 -04:00
#
# The following tries to choose the best mockchain-parallel-* implementation
# to use, based on the version of /usr/bin/mockchain
#
# We want to use a compatable API, and to use the same python version.
#
Correct build failure after mock updrade Problem: Mockchain-parallel requires python2-requests, but it is not found. Mockchain-parallel runs inside docker. the Dockerfile does not explicitly list python2-requests as a requires package. The Dockerfile does list mock, which used to resolve to mock-1.4.15-1.el7.noarch, which pulled in python2-requests. Centos/EPEL upgraded to mock-1.4.16-1.el7.noarch 2019-06-04, and it now pulls in python36-requests, rather than python2-requests. Mockchain-parallel also uses functions from yum and mock. Yum remains at python2, mock is now at python3. There is also one api change in the new mock. Whatever solution should allow mockchain-parallel function in both a new or an old container. The difference being the mock version, and the verion of python required to run mock/mockchain. Supporting the old mock will also allow more time for conversion of old build systems that pre-date the conversion to docker. Solution: 1) For now, ship two versions of mock-parallel. One compatible with the new mock (python 3, new api). The second compatible with the older mock (python 2, old api). The old version can eventually be retired, so not worth trying to break out common functions. 2) Remove the dependency on yum. We only needed one function to split an rpm file name into components (package-name, version, release, architecture, epoch). We'll write our own. 3) mockchain-parallel becomes a wrapper that detects which mock is present, and from that determine which version of mock-parallel-* to use, and which python to use. Change-Id: Ia56dfd39e349096b09351e89ad3d4f024e60e4e4 Depends-On: I7c5d9b52eed49cdce02224603b9bfd17e4426558 Closes-Bug: 1831768 Signed-off-by: Scott Little <scott.little@windriver.com>
2019-06-05 19:57:03 -04:00
interpreter_path () {
local path=${1}
if [ ! -f ${path} ]; then
return 1
fi
readlink -f $(head -n 1 ${path} | sed 's/^#!//' | awk '{ print $1 }' )
}
get__version__ () {
local path=${1}
local var=""
Correct build failure after mock updrade Problem: Mockchain-parallel requires python2-requests, but it is not found. Mockchain-parallel runs inside docker. the Dockerfile does not explicitly list python2-requests as a requires package. The Dockerfile does list mock, which used to resolve to mock-1.4.15-1.el7.noarch, which pulled in python2-requests. Centos/EPEL upgraded to mock-1.4.16-1.el7.noarch 2019-06-04, and it now pulls in python36-requests, rather than python2-requests. Mockchain-parallel also uses functions from yum and mock. Yum remains at python2, mock is now at python3. There is also one api change in the new mock. Whatever solution should allow mockchain-parallel function in both a new or an old container. The difference being the mock version, and the verion of python required to run mock/mockchain. Supporting the old mock will also allow more time for conversion of old build systems that pre-date the conversion to docker. Solution: 1) For now, ship two versions of mock-parallel. One compatible with the new mock (python 3, new api). The second compatible with the older mock (python 2, old api). The old version can eventually be retired, so not worth trying to break out common functions. 2) Remove the dependency on yum. We only needed one function to split an rpm file name into components (package-name, version, release, architecture, epoch). We'll write our own. 3) mockchain-parallel becomes a wrapper that detects which mock is present, and from that determine which version of mock-parallel-* to use, and which python to use. Change-Id: Ia56dfd39e349096b09351e89ad3d4f024e60e4e4 Depends-On: I7c5d9b52eed49cdce02224603b9bfd17e4426558 Closes-Bug: 1831768 Signed-off-by: Scott Little <scott.little@windriver.com>
2019-06-05 19:57:03 -04:00
if [ ! -f ${path} ]; then
return 1
fi
if file ${path} | grep -q 'Python script'; then
ver=$(grep __VERSION__= ${path} | cut -d '=' -f 2 | sed 's/"//g')
else
ver=$(${path} --version 2> /dev/null)
fi
echo $ver
Correct build failure after mock updrade Problem: Mockchain-parallel requires python2-requests, but it is not found. Mockchain-parallel runs inside docker. the Dockerfile does not explicitly list python2-requests as a requires package. The Dockerfile does list mock, which used to resolve to mock-1.4.15-1.el7.noarch, which pulled in python2-requests. Centos/EPEL upgraded to mock-1.4.16-1.el7.noarch 2019-06-04, and it now pulls in python36-requests, rather than python2-requests. Mockchain-parallel also uses functions from yum and mock. Yum remains at python2, mock is now at python3. There is also one api change in the new mock. Whatever solution should allow mockchain-parallel function in both a new or an old container. The difference being the mock version, and the verion of python required to run mock/mockchain. Supporting the old mock will also allow more time for conversion of old build systems that pre-date the conversion to docker. Solution: 1) For now, ship two versions of mock-parallel. One compatible with the new mock (python 3, new api). The second compatible with the older mock (python 2, old api). The old version can eventually be retired, so not worth trying to break out common functions. 2) Remove the dependency on yum. We only needed one function to split an rpm file name into components (package-name, version, release, architecture, epoch). We'll write our own. 3) mockchain-parallel becomes a wrapper that detects which mock is present, and from that determine which version of mock-parallel-* to use, and which python to use. Change-Id: Ia56dfd39e349096b09351e89ad3d4f024e60e4e4 Depends-On: I7c5d9b52eed49cdce02224603b9bfd17e4426558 Closes-Bug: 1831768 Signed-off-by: Scott Little <scott.little@windriver.com>
2019-06-05 19:57:03 -04:00
}
VC_LESS_THAN=0
VC_EQUAL=1
VC_GREATER_THAN=2
ver_comp () {
local v1=${1}
local v2=${2}
local v_greater=""
if [ "${v1}" == "${v2}" ]; then
echo $VC_EQUAL
return
Correct build failure after mock updrade Problem: Mockchain-parallel requires python2-requests, but it is not found. Mockchain-parallel runs inside docker. the Dockerfile does not explicitly list python2-requests as a requires package. The Dockerfile does list mock, which used to resolve to mock-1.4.15-1.el7.noarch, which pulled in python2-requests. Centos/EPEL upgraded to mock-1.4.16-1.el7.noarch 2019-06-04, and it now pulls in python36-requests, rather than python2-requests. Mockchain-parallel also uses functions from yum and mock. Yum remains at python2, mock is now at python3. There is also one api change in the new mock. Whatever solution should allow mockchain-parallel function in both a new or an old container. The difference being the mock version, and the verion of python required to run mock/mockchain. Supporting the old mock will also allow more time for conversion of old build systems that pre-date the conversion to docker. Solution: 1) For now, ship two versions of mock-parallel. One compatible with the new mock (python 3, new api). The second compatible with the older mock (python 2, old api). The old version can eventually be retired, so not worth trying to break out common functions. 2) Remove the dependency on yum. We only needed one function to split an rpm file name into components (package-name, version, release, architecture, epoch). We'll write our own. 3) mockchain-parallel becomes a wrapper that detects which mock is present, and from that determine which version of mock-parallel-* to use, and which python to use. Change-Id: Ia56dfd39e349096b09351e89ad3d4f024e60e4e4 Depends-On: I7c5d9b52eed49cdce02224603b9bfd17e4426558 Closes-Bug: 1831768 Signed-off-by: Scott Little <scott.little@windriver.com>
2019-06-05 19:57:03 -04:00
fi
Correct build failure after mock updrade Problem: Mockchain-parallel requires python2-requests, but it is not found. Mockchain-parallel runs inside docker. the Dockerfile does not explicitly list python2-requests as a requires package. The Dockerfile does list mock, which used to resolve to mock-1.4.15-1.el7.noarch, which pulled in python2-requests. Centos/EPEL upgraded to mock-1.4.16-1.el7.noarch 2019-06-04, and it now pulls in python36-requests, rather than python2-requests. Mockchain-parallel also uses functions from yum and mock. Yum remains at python2, mock is now at python3. There is also one api change in the new mock. Whatever solution should allow mockchain-parallel function in both a new or an old container. The difference being the mock version, and the verion of python required to run mock/mockchain. Supporting the old mock will also allow more time for conversion of old build systems that pre-date the conversion to docker. Solution: 1) For now, ship two versions of mock-parallel. One compatible with the new mock (python 3, new api). The second compatible with the older mock (python 2, old api). The old version can eventually be retired, so not worth trying to break out common functions. 2) Remove the dependency on yum. We only needed one function to split an rpm file name into components (package-name, version, release, architecture, epoch). We'll write our own. 3) mockchain-parallel becomes a wrapper that detects which mock is present, and from that determine which version of mock-parallel-* to use, and which python to use. Change-Id: Ia56dfd39e349096b09351e89ad3d4f024e60e4e4 Depends-On: I7c5d9b52eed49cdce02224603b9bfd17e4426558 Closes-Bug: 1831768 Signed-off-by: Scott Little <scott.little@windriver.com>
2019-06-05 19:57:03 -04:00
v_greater=$((echo ${v1}; echo ${v2}) | sort -rV | head -n 1)
if [ "${v1}" == "${v_greater}" ]; then
echo $VC_GREATER_THAN
return
Correct build failure after mock updrade Problem: Mockchain-parallel requires python2-requests, but it is not found. Mockchain-parallel runs inside docker. the Dockerfile does not explicitly list python2-requests as a requires package. The Dockerfile does list mock, which used to resolve to mock-1.4.15-1.el7.noarch, which pulled in python2-requests. Centos/EPEL upgraded to mock-1.4.16-1.el7.noarch 2019-06-04, and it now pulls in python36-requests, rather than python2-requests. Mockchain-parallel also uses functions from yum and mock. Yum remains at python2, mock is now at python3. There is also one api change in the new mock. Whatever solution should allow mockchain-parallel function in both a new or an old container. The difference being the mock version, and the verion of python required to run mock/mockchain. Supporting the old mock will also allow more time for conversion of old build systems that pre-date the conversion to docker. Solution: 1) For now, ship two versions of mock-parallel. One compatible with the new mock (python 3, new api). The second compatible with the older mock (python 2, old api). The old version can eventually be retired, so not worth trying to break out common functions. 2) Remove the dependency on yum. We only needed one function to split an rpm file name into components (package-name, version, release, architecture, epoch). We'll write our own. 3) mockchain-parallel becomes a wrapper that detects which mock is present, and from that determine which version of mock-parallel-* to use, and which python to use. Change-Id: Ia56dfd39e349096b09351e89ad3d4f024e60e4e4 Depends-On: I7c5d9b52eed49cdce02224603b9bfd17e4426558 Closes-Bug: 1831768 Signed-off-by: Scott Little <scott.little@windriver.com>
2019-06-05 19:57:03 -04:00
fi
echo $VC_LESS_THAN
}
MOCKCHAIN_PATH="/usr/bin/mockchain"
MOCKCHAIN_PARALLEL_PATH_ROOT="${MY_REPO}/build-tools/mockchain-parallel"
DEFAULT_MOCKCHAIN_PARALLEL_PATH="${MOCKCHAIN_PARALLEL_PATH_ROOT}-1.3.4"
MOCKCHAIN_INTERPRETER_PATH=$(interpreter_path ${MOCKCHAIN_PATH})
MOCKCHAIN_VER=$(get__version__ ${MOCKCHAIN_PATH})
if [ -z "${MOCKCHAIN_VER}" ]; then
MOCKCHAIN_VER=$(rpm -q --queryformat '%{VERSION}' mock)
if [ -z "${MOCKCHAIN_VER}" ]; then
echo "Error: Failed to determine version of '${MOCKCHAIN_PATH}'"
exit 1
fi
Correct build failure after mock updrade Problem: Mockchain-parallel requires python2-requests, but it is not found. Mockchain-parallel runs inside docker. the Dockerfile does not explicitly list python2-requests as a requires package. The Dockerfile does list mock, which used to resolve to mock-1.4.15-1.el7.noarch, which pulled in python2-requests. Centos/EPEL upgraded to mock-1.4.16-1.el7.noarch 2019-06-04, and it now pulls in python36-requests, rather than python2-requests. Mockchain-parallel also uses functions from yum and mock. Yum remains at python2, mock is now at python3. There is also one api change in the new mock. Whatever solution should allow mockchain-parallel function in both a new or an old container. The difference being the mock version, and the verion of python required to run mock/mockchain. Supporting the old mock will also allow more time for conversion of old build systems that pre-date the conversion to docker. Solution: 1) For now, ship two versions of mock-parallel. One compatible with the new mock (python 3, new api). The second compatible with the older mock (python 2, old api). The old version can eventually be retired, so not worth trying to break out common functions. 2) Remove the dependency on yum. We only needed one function to split an rpm file name into components (package-name, version, release, architecture, epoch). We'll write our own. 3) mockchain-parallel becomes a wrapper that detects which mock is present, and from that determine which version of mock-parallel-* to use, and which python to use. Change-Id: Ia56dfd39e349096b09351e89ad3d4f024e60e4e4 Depends-On: I7c5d9b52eed49cdce02224603b9bfd17e4426558 Closes-Bug: 1831768 Signed-off-by: Scott Little <scott.little@windriver.com>
2019-06-05 19:57:03 -04:00
fi
BEST_VER=""
BEST_MOCKCHAIN_PARALLEL_PATH=""
for MOCKCHAIN_PARALLEL_PATH in $(ls -1 ${MOCKCHAIN_PARALLEL_PATH_ROOT}-*); do
MOCKCHAIN_PARALLEL_VER=$(get__version__ ${MOCKCHAIN_PARALLEL_PATH})
if [ -z "${MOCKCHAIN_PARALLEL_VER}" ]; then
echo "Warning: Failed to determine version of '${MOCKCHAIN_PARALLEL_PATH}'"
continue
fi
COMP=$(ver_comp "${MOCKCHAIN_VER}" "${MOCKCHAIN_PARALLEL_VER}")
echo $MOCKCHAIN_PARALLEL_PATH $MOCKCHAIN_PARALLEL_VER $COMP
if [ $COMP -eq $VC_EQUAL ]; then
BEST_VER=${MOCKCHAIN_PARALLEL_VER}
BEST_MOCKCHAIN_PARALLEL_PATH=${MOCKCHAIN_PARALLEL_PATH}
break
fi
if [ $COMP -gt $VC_EQUAL ]; then
if [ "${BEST_VER}" == "" ]; then
BEST_VER=${MOCKCHAIN_PARALLEL_VER}
BEST_MOCKCHAIN_PARALLEL_PATH=${MOCKCHAIN_PARALLEL_PATH}
continue
Correct build failure after mock updrade Problem: Mockchain-parallel requires python2-requests, but it is not found. Mockchain-parallel runs inside docker. the Dockerfile does not explicitly list python2-requests as a requires package. The Dockerfile does list mock, which used to resolve to mock-1.4.15-1.el7.noarch, which pulled in python2-requests. Centos/EPEL upgraded to mock-1.4.16-1.el7.noarch 2019-06-04, and it now pulls in python36-requests, rather than python2-requests. Mockchain-parallel also uses functions from yum and mock. Yum remains at python2, mock is now at python3. There is also one api change in the new mock. Whatever solution should allow mockchain-parallel function in both a new or an old container. The difference being the mock version, and the verion of python required to run mock/mockchain. Supporting the old mock will also allow more time for conversion of old build systems that pre-date the conversion to docker. Solution: 1) For now, ship two versions of mock-parallel. One compatible with the new mock (python 3, new api). The second compatible with the older mock (python 2, old api). The old version can eventually be retired, so not worth trying to break out common functions. 2) Remove the dependency on yum. We only needed one function to split an rpm file name into components (package-name, version, release, architecture, epoch). We'll write our own. 3) mockchain-parallel becomes a wrapper that detects which mock is present, and from that determine which version of mock-parallel-* to use, and which python to use. Change-Id: Ia56dfd39e349096b09351e89ad3d4f024e60e4e4 Depends-On: I7c5d9b52eed49cdce02224603b9bfd17e4426558 Closes-Bug: 1831768 Signed-off-by: Scott Little <scott.little@windriver.com>
2019-06-05 19:57:03 -04:00
fi
Correct build failure after mock updrade Problem: Mockchain-parallel requires python2-requests, but it is not found. Mockchain-parallel runs inside docker. the Dockerfile does not explicitly list python2-requests as a requires package. The Dockerfile does list mock, which used to resolve to mock-1.4.15-1.el7.noarch, which pulled in python2-requests. Centos/EPEL upgraded to mock-1.4.16-1.el7.noarch 2019-06-04, and it now pulls in python36-requests, rather than python2-requests. Mockchain-parallel also uses functions from yum and mock. Yum remains at python2, mock is now at python3. There is also one api change in the new mock. Whatever solution should allow mockchain-parallel function in both a new or an old container. The difference being the mock version, and the verion of python required to run mock/mockchain. Supporting the old mock will also allow more time for conversion of old build systems that pre-date the conversion to docker. Solution: 1) For now, ship two versions of mock-parallel. One compatible with the new mock (python 3, new api). The second compatible with the older mock (python 2, old api). The old version can eventually be retired, so not worth trying to break out common functions. 2) Remove the dependency on yum. We only needed one function to split an rpm file name into components (package-name, version, release, architecture, epoch). We'll write our own. 3) mockchain-parallel becomes a wrapper that detects which mock is present, and from that determine which version of mock-parallel-* to use, and which python to use. Change-Id: Ia56dfd39e349096b09351e89ad3d4f024e60e4e4 Depends-On: I7c5d9b52eed49cdce02224603b9bfd17e4426558 Closes-Bug: 1831768 Signed-off-by: Scott Little <scott.little@windriver.com>
2019-06-05 19:57:03 -04:00
COMP=$(ver_comp ${MOCKCHAIN_PARALLEL_VER} ${BEST_VER})
if [ $COMP -gt $VC_EQUAL ]; then
BEST_VER=${MOCKCHAIN_PARALLEL_VER}
BEST_MOCKCHAIN_PARALLEL_PATH=${MOCKCHAIN_PARALLEL_PATH}
fi
fi
done
Correct build failure after mock updrade Problem: Mockchain-parallel requires python2-requests, but it is not found. Mockchain-parallel runs inside docker. the Dockerfile does not explicitly list python2-requests as a requires package. The Dockerfile does list mock, which used to resolve to mock-1.4.15-1.el7.noarch, which pulled in python2-requests. Centos/EPEL upgraded to mock-1.4.16-1.el7.noarch 2019-06-04, and it now pulls in python36-requests, rather than python2-requests. Mockchain-parallel also uses functions from yum and mock. Yum remains at python2, mock is now at python3. There is also one api change in the new mock. Whatever solution should allow mockchain-parallel function in both a new or an old container. The difference being the mock version, and the verion of python required to run mock/mockchain. Supporting the old mock will also allow more time for conversion of old build systems that pre-date the conversion to docker. Solution: 1) For now, ship two versions of mock-parallel. One compatible with the new mock (python 3, new api). The second compatible with the older mock (python 2, old api). The old version can eventually be retired, so not worth trying to break out common functions. 2) Remove the dependency on yum. We only needed one function to split an rpm file name into components (package-name, version, release, architecture, epoch). We'll write our own. 3) mockchain-parallel becomes a wrapper that detects which mock is present, and from that determine which version of mock-parallel-* to use, and which python to use. Change-Id: Ia56dfd39e349096b09351e89ad3d4f024e60e4e4 Depends-On: I7c5d9b52eed49cdce02224603b9bfd17e4426558 Closes-Bug: 1831768 Signed-off-by: Scott Little <scott.little@windriver.com>
2019-06-05 19:57:03 -04:00
MOCKCHAIN_PARALLEL_INTERPRETER_PATH=${BEST_MOCKCHAIN_PARALLEL_INTERPRETER_PATH}
MOCKCHAIN_PARALLEL_PATH=${BEST_MOCKCHAIN_PARALLEL_PATH}
Correct build failure after mock updrade Problem: Mockchain-parallel requires python2-requests, but it is not found. Mockchain-parallel runs inside docker. the Dockerfile does not explicitly list python2-requests as a requires package. The Dockerfile does list mock, which used to resolve to mock-1.4.15-1.el7.noarch, which pulled in python2-requests. Centos/EPEL upgraded to mock-1.4.16-1.el7.noarch 2019-06-04, and it now pulls in python36-requests, rather than python2-requests. Mockchain-parallel also uses functions from yum and mock. Yum remains at python2, mock is now at python3. There is also one api change in the new mock. Whatever solution should allow mockchain-parallel function in both a new or an old container. The difference being the mock version, and the verion of python required to run mock/mockchain. Supporting the old mock will also allow more time for conversion of old build systems that pre-date the conversion to docker. Solution: 1) For now, ship two versions of mock-parallel. One compatible with the new mock (python 3, new api). The second compatible with the older mock (python 2, old api). The old version can eventually be retired, so not worth trying to break out common functions. 2) Remove the dependency on yum. We only needed one function to split an rpm file name into components (package-name, version, release, architecture, epoch). We'll write our own. 3) mockchain-parallel becomes a wrapper that detects which mock is present, and from that determine which version of mock-parallel-* to use, and which python to use. Change-Id: Ia56dfd39e349096b09351e89ad3d4f024e60e4e4 Depends-On: I7c5d9b52eed49cdce02224603b9bfd17e4426558 Closes-Bug: 1831768 Signed-off-by: Scott Little <scott.little@windriver.com>
2019-06-05 19:57:03 -04:00
if [ -z "${MOCKCHAIN_PARALLEL_PATH}" ]; then
MOCKCHAIN_PARALLEL_PATH="${DEFAULT_MOCKCHAIN_PARALLEL_PATH}"
fi
echo "PYTHONDONTWRITEBYTECODE=true exec ${MOCKCHAIN_PARALLEL_INTERPRETER_PATH} ${MOCKCHAIN_PARALLEL_PATH} $@"
PYTHONDONTWRITEBYTECODE=true exec ${MOCKCHAIN_PARALLEL_INTERPRETER_PATH} ${MOCKCHAIN_PARALLEL_PATH} "$@"