From 290b3ea8d2b91a3eb4845e9df856119a13ecb2a9 Mon Sep 17 00:00:00 2001 From: Davlet Panech Date: Thu, 25 Mar 2021 09:57:30 -0400 Subject: [PATCH] Revert "centos7: delete yum.lock after yum-builddep" This reverts commit 90aa450e427e21e6dbe3fc230c089e909ad19f29. The original commit breaks the build-iso script. Change-Id: I73c9bc8e502c8401922d107b0b78cd88511a2a4b Signed-off-by: Davlet Panech --- build-tools/create-yum-conf | 4 +- build-tools/modify-build-cfg | 4 +- .../repo_files/mock.cfg.centos7.all.proto | 1 - .../repo_files/mock.cfg.centos7.distro.proto | 1 - build-tools/repo_files/mock.cfg.centos7.proto | 1 - build-tools/yum-builddep-wrapper | 66 ------------------- 6 files changed, 4 insertions(+), 73 deletions(-) delete mode 100755 build-tools/yum-builddep-wrapper diff --git a/build-tools/create-yum-conf b/build-tools/create-yum-conf index c7b7e259..80b4ecf7 100755 --- a/build-tools/create-yum-conf +++ b/build-tools/create-yum-conf @@ -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 diff --git a/build-tools/modify-build-cfg b/build-tools/modify-build-cfg index e8665ed7..78658623 100755 --- a/build-tools/modify-build-cfg +++ b/build-tools/modify-build-cfg @@ -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 diff --git a/build-tools/repo_files/mock.cfg.centos7.all.proto b/build-tools/repo_files/mock.cfg.centos7.all.proto index 95ed980c..6d9eb63e 100644 --- a/build-tools/repo_files/mock.cfg.centos7.all.proto +++ b/build-tools/repo_files/mock.cfg.centos7.all.proto @@ -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 diff --git a/build-tools/repo_files/mock.cfg.centos7.distro.proto b/build-tools/repo_files/mock.cfg.centos7.distro.proto index 95ed980c..6d9eb63e 100644 --- a/build-tools/repo_files/mock.cfg.centos7.distro.proto +++ b/build-tools/repo_files/mock.cfg.centos7.distro.proto @@ -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 diff --git a/build-tools/repo_files/mock.cfg.centos7.proto b/build-tools/repo_files/mock.cfg.centos7.proto index 2ca56fdc..779c5b59 100644 --- a/build-tools/repo_files/mock.cfg.centos7.proto +++ b/build-tools/repo_files/mock.cfg.centos7.proto @@ -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 diff --git a/build-tools/yum-builddep-wrapper b/build-tools/yum-builddep-wrapper deleted file mode 100755 index 4f82d2d2..00000000 --- a/build-tools/yum-builddep-wrapper +++ /dev/null @@ -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