mirror of
https://github.com/JasonN3/build-container-installer.git
synced 2025-12-25 10:57:55 +01:00
Split Makfile and move workflow to Makefile (#88)
Co-authored-by: codacy-production[bot] <61871480+codacy-production[bot]@users.noreply.github.com>
This commit is contained in:
parent
662f1a94e4
commit
b669420287
40 changed files with 800 additions and 665 deletions
48
lorax_templates/Makefile
Normal file
48
lorax_templates/Makefile
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
# Converts a post script to a template
|
||||
# $1 = script to convert
|
||||
# $2 = file on ISO to write
|
||||
# $3 = whether to copy the '<%' lines to the template
|
||||
define convert_post_to_tmpl
|
||||
header=0; \
|
||||
skip=0; \
|
||||
while read -r line; \
|
||||
do \
|
||||
if [[ $$line =~ ^\<\% ]]; \
|
||||
then \
|
||||
if [[ '$(3)' == 'true' ]]; \
|
||||
then \
|
||||
echo $$line >> post_$(1).tmpl; \
|
||||
fi; \
|
||||
echo >> post_$(1).tmpl; \
|
||||
else \
|
||||
if [[ $$header == 0 ]]; \
|
||||
then \
|
||||
if [[ $$line =~ ^\#\#\ (.*)$$ ]]; \
|
||||
then \
|
||||
echo "append $(2) \"%post --erroronfail $${BASH_REMATCH[1]}\"" >> post_$(1).tmpl; \
|
||||
skip=1; \
|
||||
else \
|
||||
echo "append $(2) \"%post --erroronfail\"" >> post_$(1).tmpl; \
|
||||
fi; \
|
||||
header=1; \
|
||||
fi; \
|
||||
if [[ $$skip == 0 ]]; \
|
||||
then \
|
||||
echo "append $(2) \"$${line//\"/\\\"}\"" >> post_$(1).tmpl; \
|
||||
fi; \
|
||||
skip=0; \
|
||||
fi; \
|
||||
done < scripts/post/$(1); \
|
||||
echo "append $(2) \"%end\"" >> post_$(1).tmpl
|
||||
endef
|
||||
|
||||
post_%.tmpl: scripts/post/%
|
||||
$(call convert_post_to_tmpl,$*,usr/share/anaconda/post-scripts/$*.ks,true)
|
||||
|
||||
install-deps:
|
||||
|
||||
FILES=$(wildcard post_*)
|
||||
clean:
|
||||
ifneq ($(FILES),)
|
||||
rm -Rf $(FILES)
|
||||
endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue