1
0
Fork 0
mirror of https://github.com/JasonN3/build-container-installer.git synced 2025-12-25 10:57:55 +01:00

dynamically generate template

This commit is contained in:
Jason Nagin 2025-05-05 10:20:51 -04:00 committed by GitHub
parent d6d8536caf
commit 3b727b819f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 36 deletions

View file

@ -39,6 +39,10 @@ endef
post_%.tmpl: scripts/post/%
$(call convert_post_to_tmpl,$*,usr/share/anaconda/post-scripts/$*.ks,true)
install_include_post.tmpl:
echo '<%page />' > install_include_post.tmpl
for file in $(patsubst post_%.tmpl, %, $(filter post_%, $(notdir $(_LORAX_TEMPLATES)))); do echo "append usr/share/anaconda/interactive-defaults.ks \"%include /usr/share/anaconda/post-scripts/$${file}.ks\"" >> install_include_post.tmpl; done
install-deps:
FILES=$(wildcard post_*)

View file

@ -1,20 +0,0 @@
<%page args="version"/>
<%
import os
def list_files(directory):
try:
files = os.listdir(directory)
return files
except OSError as e:
return [f"Error: {e}"] # Return error message as a list
directory_to_list = "scripts/post"
file_list = list_files(directory_to_list)
%>
% if int(version) >= 42:
% for file_name in file_list:
append usr/share/anaconda/interactive-defaults.ks "%include /usr/share/anaconda/post-scripts/${file_name}.ks"
% endfor
% endif