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

code quality

This commit is contained in:
Jason N. 2024-04-02 16:23:51 -04:00
parent e70f38a552
commit 9abd64f768
4 changed files with 25 additions and 25 deletions

View file

@ -9,7 +9,7 @@ result=0
if [ -z "${add_line_repo}" ] if [ -z "${add_line_repo}" ]
then then
echo "Repo name not updated on add_remote line" echo "Repo name not updated on add_remote line"
echo ${add_line} echo "${add_line}"
result=1 result=1
else else
echo "Repo name found on add_remote line" echo "Repo name found on add_remote line"
@ -18,7 +18,7 @@ fi
if [ -z "${add_line_url}" ] if [ -z "${add_line_url}" ]
then then
echo "Repo url not updated on add_remote line" echo "Repo url not updated on add_remote line"
echo ${add_line} echo "${add_line}"
result=1 result=1
else else
echo "Repo url found on add_remote line" echo "Repo url found on add_remote line"
@ -31,7 +31,7 @@ replace_line_repo=$(echo ${replace_line} | grep ${FLATPAK_REMOTE_NAME})
if [ -z "${replace_line_repo}" ] if [ -z "${replace_line_repo}" ]
then then
echo "Repo name not updated on replace_installed_refs line" echo "Repo name not updated on replace_installed_refs line"
echo ${replace_line} echo "${replace_line}"
result=1 result=1
else else
echo "Repo name found on replace_installed_refs line" echo "Repo name found on replace_installed_refs line"

View file

@ -2,13 +2,13 @@
#set -ex #set -ex
checkisomd5 ../../${ISO_NAME} checkisomd5 "../../${ISO_NAME}"
if [[ $? != 0 ]] if [[ $? != 0 ]]
then then
echo "Found:" echo "Found:"
checkisomd5 --md5sumonly ../../${ISO_NAME} checkisomd5 --md5sumonly "../../${ISO_NAME}"
echo "Expected:" echo "Expected:"
implantisomd5 --force ../../${ISO_NAME} implantisomd5 --force "../../${ISO_NAME}"
fi fi
cd $(dirname ../../${ISO_NAME}) && sha256sum -c $(basename ${ISO_NAME})-CHECKSUM cd $(dirname "../../${ISO_NAME}") && sha256sum -c "$(basename ${ISO_NAME})-CHECKSUM"

View file

@ -3,7 +3,7 @@
makefile = open('../../Makefile.inputs', 'r') makefile = open('../../Makefile.inputs', 'r')
makefile_lines = makefile.readlines() makefile_lines = makefile.readlines()
vars = {} inputs = {}
outputs = {} outputs = {}
errors = 0 errors = 0
@ -16,7 +16,7 @@ for line in makefile_lines:
var_name = parts[0].strip().split(' ')[1].lower() var_name = parts[0].strip().split(' ')[1].lower()
else: else:
var_name = parts[0].strip().lower() var_name = parts[0].strip().lower()
vars[var_name] = {'default_value': parts[1].strip(), 'makefile': True} inputs[var_name] = {'default_value': parts[1].strip(), 'makefile': True}
action = open('../../action.yml', 'r') action = open('../../action.yml', 'r')
action_lines = action.readlines() action_lines = action.readlines()
@ -32,24 +32,24 @@ for line in action_lines:
if line.startswith(' '): if line.startswith(' '):
parts = line.strip().split(':', 1) parts = line.strip().split(':', 1)
if parts[0] == 'description': if parts[0] == 'description':
vars[var_name]['description'] = parts[1].strip() inputs[var_name]['description'] = parts[1].strip()
if parts[0] == 'deprecationMessage': if parts[0] == 'deprecationMessage':
vars[var_name]['deprecated'] = True inputs[var_name]['deprecated'] = True
if parts[0] == 'default': if parts[0] == 'default':
if 'default' in vars[var_name]: if 'default' in inputs[var_name]:
if vars[var_name]['default_value'] != parts[1].strip().strip('"'): if inputs[var_name]['default_value'] != parts[1].strip().strip('"'):
print("ERROR: Default value for " + var_name + " in action.yml does not match Makefile") print("ERROR: Default value for " + var_name + " in action.yml does not match Makefile")
errors += 1 errors += 1
else: else:
vars[var_name]['default_value'] = parts[1].strip().strip('"') inputs[var_name]['default_value'] = parts[1].strip().strip('"')
elif line.startswith(' '): elif line.startswith(' '):
var_name = line.strip().strip(':').lower() var_name = line.strip().strip(':').lower()
if var_name in vars: if var_name in inputs:
vars[var_name][action] = True inputs[var_name][action] = True
else: else:
print("WARNING: " + var_name + " found in action.yml but not Makefile") print("WARNING: " + var_name + " found in action.yml but not Makefile")
vars[var_name] = {} inputs[var_name] = {}
vars[var_name]['action'] = True inputs[var_name]['action'] = True
else: else:
at_inputs = False at_inputs = False
@ -95,10 +95,10 @@ for line in readme_lines:
continue continue
parts = line.split('|') parts = line.split('|')
var_name = parts[1].strip().lower() var_name = parts[1].strip().lower()
if not var_name in vars: if not var_name in inputs:
print("ERROR: " + var_name + " is not listed in action.yml or Makefile") print("ERROR: " + var_name + " is not listed in action.yml or Makefile")
vars[var_name] = {} inputs[var_name] = {}
vars[var_name] inputs[var_name]
var_description = parts[2].strip() var_description = parts[2].strip()
var_default_value = parts[3].strip() var_default_value = parts[3].strip()
var_action = parts[4].strip() var_action = parts[4].strip()

View file

@ -6,7 +6,7 @@ echo "-outdev ${ISO_NAME}"
echo "-boot_image any replay" echo "-boot_image any replay"
echo "-joliet on" echo "-joliet on"
echo "-compliance joliet_long_names" echo "-compliance joliet_long_names"
#pushd ${PWD}/results > /dev/null #pushd "${PWD}/results" > /dev/null
#for file in $(find * -type f) #for file in $(find * -type f)
#do #do
# if [[ "$file" == "images/boot.iso" ]] # if [[ "$file" == "images/boot.iso" ]]
@ -20,7 +20,7 @@ echo "-compliance joliet_long_names"
if [[ -n "${FLATPAK_DIR}" ]] if [[ -n "${FLATPAK_DIR}" ]]
then then
pushd ${FLATPAK_DIR} > /dev/null pushd "${FLATPAK_DIR}" > /dev/null
for file in $(find * -type f) for file in $(find * -type f)
do do
echo "-map $(pwd)/${file} flatpak/${file}" echo "-map $(pwd)/${file} flatpak/${file}"
@ -35,8 +35,8 @@ then
echo "-chmod 0444 /sb_pubkey.der" echo "-chmod 0444 /sb_pubkey.der"
fi fi
pushd ${PWD}/container > /dev/null pushd "${PWD}/container" > /dev/null
for file in $(find ${IMAGE_NAME}-${IMAGE_TAG} -type f) for file in $(find "${IMAGE_NAME}-${IMAGE_TAG}" -type f)
do do
echo "-map $(pwd)/${file} ${file}" echo "-map $(pwd)/${file} ${file}"
echo "-chmod 0444 ${file}" echo "-chmod 0444 ${file}"