fix(autopatch): Updated 4 find strings in replace actions and fixed lorax-templates-almalinux-requires.sh script to handle multiple Requ #1

Merged
eabdullin merged 2 commits from agent-fix/a10s-20260603-022652 into a10s 2026-06-03 09:08:55 +00:00
2 changed files with 12 additions and 10 deletions

View File

@ -1,10 +1,10 @@
actions:
- replace:
- target: "spec"
find: "%define templatedir %{_datadir}/lorax/templates.d/80-rhel"
find: "%define templatedir %{_datadir}/lorax/templates.d/"
replace: |
%define templatedir %{_datadir}/lorax/templates.d/80-rhel
%define almatemplatedir %{_datadir}/lorax/templates.d/70-almalinux
%define templatedir %{_datadir}/lorax/templates.d/
%define almatemplatedir %{templatedir}/70-almalinux
# AlmaLinux support and rebranding
Patch1001: Add-x86_64_v2-support.patch
@ -15,11 +15,11 @@ actions:
find: |
%description
RHEL-specific Lorax templates for creating the boot.iso and live isos are
placed in %{templatedir}
placed in %{templatedir}/80-rhel
replace: |
%description
RHEL-specific Lorax templates for creating the boot.iso and live isos are
placed in %{templatedir}
placed in %{templatedir}/80-rhel
%package -n lorax-templates-almalinux
Summary: AlmaLinux build templates for lorax and livemedia-creator
@ -57,10 +57,12 @@ actions:
- target: "spec"
find: |
mkdir -p $RPM_BUILD_ROOT/%{templatedir}
cp -a 80-rhel/* $RPM_BUILD_ROOT/%{templatedir}
cp -a 80-rhel $RPM_BUILD_ROOT/%{templatedir}
cp -a 70-64k $RPM_BUILD_ROOT/%{templatedir}
replace: |
mkdir -p $RPM_BUILD_ROOT/%{templatedir}
cp -a 80-rhel/* $RPM_BUILD_ROOT/%{templatedir}
cp -a 80-rhel $RPM_BUILD_ROOT/%{templatedir}
cp -a 70-64k $RPM_BUILD_ROOT/%{templatedir}
# Install AlmaLinux templates
mkdir -p $RPM_BUILD_ROOT/%{almatemplatedir}
@ -72,11 +74,11 @@ actions:
find: |
%files
%dir %{templatedir}
%{templatedir}/*
%{templatedir}/80-rhel/*
replace: |
%files
%dir %{templatedir}
%{templatedir}/*
%{templatedir}/80-rhel/*
%files -n lorax-templates-almalinux
%dir %{almatemplatedir}

View File

@ -5,5 +5,5 @@ set -e
# Get the "Requires" from the lorax-templates-rhel.spec file (main package)
# and replace the 'Requires: <Requires>' string for the lorax-templates-almalinux subpackage
requires=$(grep 'Requires:' lorax-templates-rhel.spec | grep -v '<Requires>')
requires=$(grep 'Requires:' lorax-templates-rhel.spec | grep -v '<Requires>' | head -1)
sed -i "s/^Requires:.*<Requires>/$requires/" lorax-templates-rhel.spec