From e875862d502d15c3ffb60a1964281b38f13ebc29 Mon Sep 17 00:00:00 2001 From: Scott Little Date: Wed, 2 Dec 2020 20:00:21 +0000 Subject: [PATCH] Revert "Fix selection of a release specific mock prototype" This reverts commit 72d1905384714a1b61ed0a21b079e29eb1b76e94. Reason for revert: Breaks when 'Add support CentOS-8/dnf/mock-2.6 based builds' was reverted from root Change-Id: I05c337fc8d054253b56b2ed9dba874ca278cbbdd --- toCOPY/generate-centos-repo.sh | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/toCOPY/generate-centos-repo.sh b/toCOPY/generate-centos-repo.sh index f2044bbb..deedaa75 100755 --- a/toCOPY/generate-centos-repo.sh +++ b/toCOPY/generate-centos-repo.sh @@ -128,16 +128,11 @@ timestamp="$(date +%F_%H%M)" mock_cfg_prefix="mock.cfg" mock_cfg_default_suffix="proto" mock_cfg_suffix="${mock_cfg_default_suffix}" -mock_cfg_distro="" -mock_cfg_src_prefix=${mock_cfg_prefix} +if [ -f /etc/os-release ]; then + mock_cfg_distro="$(source /etc/os-release; echo ${ID}${VERSION_ID}.proto)" +fi mock_cfg_dir=$MY_REPO/build-tools/repo_files mock_cfg_dest_dir=$MY_REPO/centos-repo -if [ -f /etc/os-release ]; then - mock_cfg_distro="$(source /etc/os-release; echo ${ID}${VERSION_ID})" - if [ ! -z "${mock_cfg_distro}" ]; then - mock_cfg_src_prefix=${mock_cfg_prefix}.${mock_cfg_distro} - fi -fi comps_xml_file=$MY_REPO/build-tools/repo_files/comps.xml comps_xml_dest_dir=$MY_REPO/centos-repo/Binary @@ -417,7 +412,7 @@ copy_with_backup () { if [ ! -d ${dest_dir} ]; then dest_file="$2" - dest_dir=$(dirname ${dest_file}) + dest_dir=$(dir_name ${dest_file}) if [ ! -d ${dest_dir} ]; then echo "destination directory '${dest_dir}' does not exist!" exit 1 @@ -473,13 +468,13 @@ done echo "Copying mock.cfg.proto file." # First look for layer specific file to copy. -mock_cfg_file="${mock_cfg_dir}/${mock_cfg_src_prefix}.${layer}.${mock_cfg_suffix}" +mock_cfg_file="${mock_cfg_dir}/${mock_cfg_prefix}.${layer}.${mock_cfg_suffix}" if [ -f "$mock_cfg_file" ]; then copy_with_backup ${mock_cfg_file} ${mock_cfg_dest_dir}/${mock_cfg_prefix}.${layer}.${mock_cfg_default_suffix} fi # Always copy the default -mock_cfg_file=${mock_cfg_dir}/${mock_cfg_src_prefix}.${mock_cfg_suffix} +mock_cfg_file=${mock_cfg_dir}/${mock_cfg_prefix}.${mock_cfg_suffix} copy_with_backup ${mock_cfg_file} ${mock_cfg_dest_dir}/${mock_cfg_prefix}.${mock_cfg_default_suffix}