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}" ]
then
echo "Repo name not updated on add_remote line"
echo ${add_line}
echo "${add_line}"
result=1
else
echo "Repo name found on add_remote line"
@ -18,7 +18,7 @@ fi
if [ -z "${add_line_url}" ]
then
echo "Repo url not updated on add_remote line"
echo ${add_line}
echo "${add_line}"
result=1
else
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}" ]
then
echo "Repo name not updated on replace_installed_refs line"
echo ${replace_line}
echo "${replace_line}"
result=1
else
echo "Repo name found on replace_installed_refs line"

View file

@ -2,13 +2,13 @@
#set -ex
checkisomd5 ../../${ISO_NAME}
checkisomd5 "../../${ISO_NAME}"
if [[ $? != 0 ]]
then
echo "Found:"
checkisomd5 --md5sumonly ../../${ISO_NAME}
checkisomd5 --md5sumonly "../../${ISO_NAME}"
echo "Expected:"
implantisomd5 --force ../../${ISO_NAME}
implantisomd5 --force "../../${ISO_NAME}"
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_lines = makefile.readlines()
vars = {}
inputs = {}
outputs = {}
errors = 0
@ -16,7 +16,7 @@ for line in makefile_lines:
var_name = parts[0].strip().split(' ')[1].lower()
else:
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_lines = action.readlines()
@ -32,24 +32,24 @@ for line in action_lines:
if line.startswith(' '):
parts = line.strip().split(':', 1)
if parts[0] == 'description':
vars[var_name]['description'] = parts[1].strip()
inputs[var_name]['description'] = parts[1].strip()
if parts[0] == 'deprecationMessage':
vars[var_name]['deprecated'] = True
inputs[var_name]['deprecated'] = True
if parts[0] == 'default':
if 'default' in vars[var_name]:
if vars[var_name]['default_value'] != parts[1].strip().strip('"'):
if 'default' in inputs[var_name]:
if inputs[var_name]['default_value'] != parts[1].strip().strip('"'):
print("ERROR: Default value for " + var_name + " in action.yml does not match Makefile")
errors += 1
else:
vars[var_name]['default_value'] = parts[1].strip().strip('"')
inputs[var_name]['default_value'] = parts[1].strip().strip('"')
elif line.startswith(' '):
var_name = line.strip().strip(':').lower()
if var_name in vars:
vars[var_name][action] = True
if var_name in inputs:
inputs[var_name][action] = True
else:
print("WARNING: " + var_name + " found in action.yml but not Makefile")
vars[var_name] = {}
vars[var_name]['action'] = True
inputs[var_name] = {}
inputs[var_name]['action'] = True
else:
at_inputs = False
@ -95,10 +95,10 @@ for line in readme_lines:
continue
parts = line.split('|')
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")
vars[var_name] = {}
vars[var_name]
inputs[var_name] = {}
inputs[var_name]
var_description = parts[2].strip()
var_default_value = parts[3].strip()
var_action = parts[4].strip()

View file

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