Revert "centos7: delete yum.lock after yum-builddep"

This reverts commit 90aa450e42.

The original commit breaks the build-iso script.

Change-Id: I73c9bc8e502c8401922d107b0b78cd88511a2a4b
Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
This commit is contained in:
Davlet Panech 2021-03-25 09:57:30 -04:00
parent 90aa450e42
commit 290b3ea8d2
6 changed files with 4 additions and 73 deletions

View File

@ -66,8 +66,8 @@ if [ ! -f "$MY_YUM_CONF" ]; then
sed -i "s%LOCAL_BASE%file://%g" "$MY_YUM_CONF"
sed -i "s%MIRROR_BASE%file:///import/mirrors%g" "$MY_YUM_CONF"
sed -i "s%BUILD_ENV%$MY_BUILD_ENVIRONMENT%g" "$MY_YUM_CONF"
sed -i "s%/*MY_BUILD_DIR%$MY_BUILD_DIR%g" "$MY_YUM_CONF"
sed -i "s%/*MY_REPO_DIR%$MY_REPO%g" "$MY_YUM_CONF"
sed -i "s%/MY_BUILD_DIR%$MY_BUILD_DIR%g" "$MY_YUM_CONF"
sed -i "s%/MY_REPO_DIR%$MY_REPO%g" "$MY_YUM_CONF"
else
echo "ERROR: Could not find yum.conf or MOCK_CFG_PROTO"
exit 1

View File

@ -86,8 +86,8 @@ if [ ! -f $FILE ]; then
sed -i "s%LOCAL_BASE%http://127.0.0.1:8088%g" "$FILE"
sed -i "s%MIRROR_BASE%http://127.0.0.1:8088%g" "$FILE"
sed -i "s%BUILD_ENV%$MY_BUILD_ENVIRONMENT%g" "$FILE"
sed -i "s%/*MY_BUILD_DIR%$MY_BUILD_DIR_TOP%g" "$FILE"
sed -i "s%/*MY_REPO_DIR%$MY_REPO%g" "$FILE"
sed -i "s%/MY_BUILD_DIR%$MY_BUILD_DIR_TOP%g" "$FILE"
sed -i "s%/MY_REPO_DIR%$MY_REPO%g" "$FILE"
# Disable all local-* repos for the build-types other than the current one
for bt in std rt; do

View File

@ -5,7 +5,6 @@ config_opts['chroot_setup_cmd'] = 'install @buildsys-build'
config_opts['dist'] = 'el7' # only useful for --resultdir variable subst
config_opts['releasever'] = '7'
config_opts['package_manager'] = 'yum'
config_opts['yum_builddep_command'] = 'MY_REPO_DIR/build-tools/yum-builddep-wrapper'
config_opts['use_bootstrap'] = False
config_opts['use_bootstrap_image'] = False
config_opts['rpmbuild_networking'] = False

View File

@ -5,7 +5,6 @@ config_opts['chroot_setup_cmd'] = 'install @buildsys-build'
config_opts['dist'] = 'el7' # only useful for --resultdir variable subst
config_opts['releasever'] = '7'
config_opts['package_manager'] = 'yum'
config_opts['yum_builddep_command'] = 'MY_REPO_DIR/build-tools/yum-builddep-wrapper'
config_opts['use_bootstrap'] = False
config_opts['use_bootstrap_image'] = False
config_opts['rpmbuild_networking'] = False

View File

@ -5,7 +5,6 @@ config_opts['chroot_setup_cmd'] = 'install @buildsys-build'
config_opts['dist'] = 'el7' # only useful for --resultdir variable subst
config_opts['releasever'] = '7'
config_opts['package_manager'] = 'yum'
config_opts['yum_builddep_command'] = 'MY_REPO_DIR/build-tools/yum-builddep-wrapper'
config_opts['use_bootstrap'] = False
config_opts['use_bootstrap_image'] = False
config_opts['rpmbuild_networking'] = False

View File

@ -1,66 +0,0 @@
#!/bin/bash
# Old versions of yum-builddep leave a stale yum.pid file behind.
# Remove that file if necessary after yum-builddep exits
# find yum-builddep
YUM_BUILDDEP=$(which yum-builddep 2>/dev/null)
# dnf: call it directly
if [[ -z $YUM_BUILDDEP ]] || grep -q -F dnf.cli "$YUM_BUILDDEP" ; then
yum-builddep "$@"
exit $?
fi
# old yum: scan command line for --installroot
ROOT_PREFIX=
YUM_CONF=/etc/yum.conf
find_root_prefix() {
while [[ "$#" -gt 0 ]] ; do
case "$1" in
--installroot)
ROOT_PREFIX="$2"
shift
;;
--installroot=*)
ROOT_PREFIX="${1#*=}"
;;
-c|--config)
YUM_CONF="$2"
shift
;;
--config=*)
YUM_CONF="${1#*=}"
;;
esac
shift
done
if [[ -z "$ROOT_PREFIX" ]] && [[ -f "$YUM_CONF" ]] ; then
ROOT_PREFIX=$(sed -rn 's/^\s*installroot\s*=\s*(\S+)\s*$/\1/p' $YUM_CONF)
fi
}
find_root_prefix "$@"
# ignore signals -- always wait for yum-builddep
trap "" INT TERM HUP PIPE
# run it in the background to get its PID
"$YUM_BUILDDEP" "$@" &
pid="$!"
# wait for it
wait "$pid"
res="$?"
# if yum.pid remains and contains yum-builddep's PID, delete it
if [[ -f "${ROOT_PREFIX}/run/yum.pid" ]] ; then
lock_owner=
read lock_owner <"${ROOT_PREFIX}/run/yum.pid" || :
if [[ -n $lock_owner && $lock_owner == $pid ]] ; then
rm -f "${ROOT_PREFIX}/run/yum.pid"
fi
fi
# done
exit $res