From 108244b3d67779bb644c4aa473ee4dea6bca5ece Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Thu, 16 Nov 2023 18:39:31 -0700 Subject: [PATCH] use releasever where necessary --- .../empanadas/templates/extraisobuild.tmpl.sh | 6 +++--- .../empanadas/templates/isobuild.tmpl.sh | 6 +++--- .../empanadas/templates/isomock.tmpl.cfg | 2 +- .../empanadas/templates/liveisobuild.tmpl.sh | 6 +++--- iso/empanadas/empanadas/util/iso_utils.py | 16 ++++++++++------ 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/iso/empanadas/empanadas/templates/extraisobuild.tmpl.sh b/iso/empanadas/empanadas/templates/extraisobuild.tmpl.sh index df51333..327b49f 100644 --- a/iso/empanadas/empanadas/templates/extraisobuild.tmpl.sh +++ b/iso/empanadas/empanadas/templates/extraisobuild.tmpl.sh @@ -6,8 +6,8 @@ set -o pipefail # Vars -MOCK_CFG="/var/tmp/lorax-{{ major }}.cfg" -MOCK_ROOT="/var/lib/mock/{{ shortname|lower }}-{{ major }}-{{ arch }}" +MOCK_CFG="/var/tmp/lorax-{{ releasever }}.cfg" +MOCK_ROOT="/var/lib/mock/{{ shortname|lower }}-{{ releasever }}-{{ arch }}" MOCK_RESL="${MOCK_ROOT}/result" MOCK_CHRO="${MOCK_ROOT}/root" MOCK_LOG="${MOCK_RESL}/mock-output.log" @@ -40,7 +40,7 @@ mock \ mock_ret_val=$? if [ $mock_ret_val -eq 0 ]; then - # Copy resulting data to /var/lib/mock/{{ shortname|lower }}-{{ major }}-{{ arch }}/result + # Copy resulting data to /var/lib/mock/{{ shortname|lower }}-{{ releasever }}-{{ arch }}/result mkdir -p "${MOCK_RESL}" cp "${MOCK_CHRO}${BUILDDIR}/${IMAGE_ISO}" "${MOCK_RESL}" cp "${MOCK_CHRO}${BUILDDIR}/${IMAGE_ISO}.manifest" "${MOCK_RESL}" diff --git a/iso/empanadas/empanadas/templates/isobuild.tmpl.sh b/iso/empanadas/empanadas/templates/isobuild.tmpl.sh index 28398e3..60244ee 100644 --- a/iso/empanadas/empanadas/templates/isobuild.tmpl.sh +++ b/iso/empanadas/empanadas/templates/isobuild.tmpl.sh @@ -5,8 +5,8 @@ set -o pipefail # Vars -MOCK_CFG="/var/tmp/lorax-{{ major }}.cfg" -MOCK_ROOT="/var/lib/mock/{{ shortname|lower }}-{{ major }}-{{ arch }}" +MOCK_CFG="/var/tmp/lorax-{{ releasever }}.cfg" +MOCK_ROOT="/var/lib/mock/{{ shortname|lower }}-{{ releasever }}-{{ arch }}" MOCK_RESL="${MOCK_ROOT}/result" MOCK_CHRO="${MOCK_ROOT}/root" MOCK_LOG="${MOCK_RESL}/mock-output.log" @@ -39,7 +39,7 @@ mock \ mock_ret_val=$? if [ $mock_ret_val -eq 0 ]; then - # Copy resulting data to /var/lib/mock/{{ shortname|lower }}-{{ major }}-{{ arch }}/result + # Copy resulting data to /var/lib/mock/{{ shortname|lower }}-{{ releasever }}-{{ arch }}/result mkdir -p "${MOCK_RESL}" cp "${MOCK_CHRO}${BUILDDIR}/${LORAX_TAR}" "${MOCK_RESL}" else diff --git a/iso/empanadas/empanadas/templates/isomock.tmpl.cfg b/iso/empanadas/empanadas/templates/isomock.tmpl.cfg index 6400d1d..5b4f528 100644 --- a/iso/empanadas/empanadas/templates/isomock.tmpl.cfg +++ b/iso/empanadas/empanadas/templates/isomock.tmpl.cfg @@ -1,4 +1,4 @@ -config_opts['root'] = '{{ shortname|lower }}-{{ major }}.{{ minor }}-{{ arch }}' +config_opts['root'] = '{{ shortname|lower }}-{{ releasever }}-{{ arch }}' config_opts['description'] = '{{ fullname }}' config_opts['target_arch'] = '{{ arch }}' config_opts['legal_host_arches'] = ('{{ arch }}',) diff --git a/iso/empanadas/empanadas/templates/liveisobuild.tmpl.sh b/iso/empanadas/empanadas/templates/liveisobuild.tmpl.sh index f5e48ec..ad6ce20 100644 --- a/iso/empanadas/empanadas/templates/liveisobuild.tmpl.sh +++ b/iso/empanadas/empanadas/templates/liveisobuild.tmpl.sh @@ -6,8 +6,8 @@ set -o pipefail # Vars -MOCK_CFG="/var/tmp/live-{{ major }}.cfg" -MOCK_ROOT="/var/lib/mock/{{ shortname|lower }}-{{ major }}-{{ arch }}" +MOCK_CFG="/var/tmp/live-{{ releasever }}.cfg" +MOCK_ROOT="/var/lib/mock/{{ shortname|lower }}-{{ releasever }}-{{ arch }}" MOCK_RESL="${MOCK_ROOT}/result" MOCK_CHRO="${MOCK_ROOT}/root" MOCK_LOG="${MOCK_RESL}/mock-output.log" @@ -44,7 +44,7 @@ mock \ mock_ret_val=$? if [ $mock_ret_val -eq 0 ]; then - # Copy resulting data to /var/lib/mock/{{ shortname|lower }}-{{ major }}-{{ arch }}/result + # Copy resulting data to /var/lib/mock/{{ shortname|lower }}-{{ releasever }}-{{ arch }}/result mkdir -p "${MOCK_RESL}" cp "${MOCK_CHRO}${BUILDDIR}/lmc/${IMAGE_ISO}" "${MOCK_RESL}" else diff --git a/iso/empanadas/empanadas/util/iso_utils.py b/iso/empanadas/empanadas/util/iso_utils.py index ed6dfdb..52ff188 100644 --- a/iso/empanadas/empanadas/util/iso_utils.py +++ b/iso/empanadas/empanadas/util/iso_utils.py @@ -253,7 +253,7 @@ class IsoBuild: mock_sh_template = self.tmplenv.get_template('isobuild.tmpl.sh') iso_template = self.tmplenv.get_template('buildImage.tmpl.sh') - mock_iso_path = '/var/tmp/lorax-' + self.major_version + '.cfg' + mock_iso_path = '/var/tmp/lorax-' + self.release + '.cfg' mock_sh_path = '/var/tmp/isobuild.sh' iso_template_path = '/var/tmp/buildImage.sh' @@ -275,6 +275,7 @@ class IsoBuild: mock_iso_template_output = mock_iso_template.render( arch=self.current_arch, major=self.major_version, + releasever=self.release, fullname=self.fullname, shortname=self.shortname, required_pkgs=required_pkgs, @@ -286,6 +287,7 @@ class IsoBuild: mock_sh_template_output = mock_sh_template.render( arch=self.current_arch, major=self.major_version, + releasever=self.release, isolation=self.mock_isolation, builddir=self.mock_work_root, shortname=self.shortname, @@ -527,7 +529,7 @@ class IsoBuild: if self.release_candidate: rclevel = '-' + self.rclvl - discname = f'{self.shortname}-{self.major_version}.{self.minor_version}{rclevel}-{arch}-boot.iso' + discname = f'{self.shortname}-{self.release}{rclevel}-{arch}-boot.iso' isobootpath = os.path.join(iso_to_go, discname) manifest = f'{isobootpath}.manifest' @@ -846,7 +848,7 @@ class IsoBuild: datestamp = '-' + self.updated_image_date volid = f'{self.shortname}-{self.major_version}-{self.minor_version}{rclevel}-{arch}-{volname}' - isoname = f'{self.shortname}-{self.revision}{rclevel}{datestamp}-{arch}-{image}.iso' + isoname = f'{self.shortname}-{self.release}{rclevel}{datestamp}-{arch}-{image}.iso' generic_isoname = f'{self.shortname}-{arch}-{image}.iso' latest_isoname = f'{self.shortname}-{self.major_version}-latest-{arch}-{image}.iso' @@ -1727,7 +1729,7 @@ class LiveBuild: if self.peridot: kloc = 'peridot' - mock_iso_path = f'/var/tmp/live-{self.major_version}.cfg' + mock_iso_path = f'/var/tmp/live-{self.release}.cfg' mock_sh_path = f'{entries_dir}/liveisobuild-{self.current_arch}-{image}.sh' iso_template_path = f'{entries_dir}/buildLiveImage-{self.current_arch}-{image}.sh' @@ -1745,7 +1747,7 @@ class LiveBuild: log_path_command = f'| tee -a {log_root}/{self.current_arch}-{image}.log' required_pkgs = self.livemap['required_pkgs'] - volid = f'{self.shortname}-{self.major_version}-{self.minor_version}-{image}' + volid = f'{self.shortname}-{self.release}-{image}' isoname = f'{self.shortname}-{self.release}-{image}-{self.current_arch}-{self.date}.iso' @@ -1775,6 +1777,7 @@ class LiveBuild: mock_iso_template_output = mock_iso_template.render( arch=self.current_arch, major=self.major_version, + releasever=self.release, fullname=self.fullname, shortname=self.shortname, required_pkgs=required_pkgs, @@ -1788,6 +1791,7 @@ class LiveBuild: mock_sh_template_output = mock_sh_template.render( arch=self.current_arch, major=self.major_version, + releasever=self.release, isolation=self.mock_isolation, builddir=self.mock_work_root, shortname=self.shortname, @@ -1943,7 +1947,7 @@ class LiveBuild: live_dir_arch = os.path.join(self.live_work_dir, arch) isoname = f'{self.shortname}-{self.release}-{image}-{arch}-{self.date}.iso' isolink = f'{self.shortname}-{self.major_version}-{image}-{arch}-latest.iso' - live_res_dir = f'/var/lib/mock/{self.shortname.lower()}-{self.major_version}-{arch}/result' + live_res_dir = f'/var/lib/mock/{self.shortname.lower()}-{self.release}-{arch}/result' if self.justcopyit: if os.path.exists(os.path.join(live_dir_arch, isoname)):