mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-08 05:31:53 +00:00
Label name and better handling
This commit is contained in:
@@ -61,40 +61,46 @@ countWarning=0
|
||||
countError=0
|
||||
|
||||
for label in $allLabels; do
|
||||
cmd_output=$( $repo_dir/assemble.sh $label DEBUG=2 INSTALL=force IGNORE_APP_STORE_APPS=yes BLOCKING_PROCESS_ACTION=ignore )
|
||||
#echo "$cmd_output"
|
||||
no_appNewVersion=$( echo $cmd_output | grep -ic "Latest version not specified." )
|
||||
echo "No appNewVersion: $no_appNewVersion (1 for no)"
|
||||
latest_appNewVersion=$( echo $cmd_output | grep -i "Latest version of " | sed -E 's/.* is ([0-9.]*),*.*$/\1/g' )
|
||||
echo "Latest vesion: $latest_appNewVersion"
|
||||
github_label=$( echo $cmd_output | grep -ci "Downloading https://github.com" )
|
||||
echo "github: $github_label (1 for true)"
|
||||
downloaded_version=$( echo $cmd_output | grep -ioE "Downloaded (package.*version|version of.*is) [0-9.]*" | grep -v "is the same as installed" | sed -E 's/.* (is|version) ([0-9.]*).*/\2/g' )
|
||||
echo "Downloaded version: $downloaded_version"
|
||||
exit_status=$( echo $cmd_output | grep exit | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' )
|
||||
echo "Exit: $exit_status"
|
||||
if [[ ${exit_status} -eq 0 ]] ; then
|
||||
if [[ $no_appNewVersion -eq 1 ]]; then
|
||||
echo "${GREEN}$label works fine, but no appNewVersion.${NC}"
|
||||
elif [[ $latest_appNewVersion == $downloaded_version && $github_label -eq 0 ]]; then
|
||||
echo "${GREEN}$label works fine, with version $latest_appNewVersion.${NC}"
|
||||
elif [[ $github_label -eq 1 ]]; then
|
||||
echo "${GREEN}$label works fine, with GitHub version $latest_appNewVersion.${NC}"
|
||||
elif [[ $latest_appNewVersion != $downloaded_version && $github_label -eq 0 ]]; then
|
||||
echo "${YELLOW}$label has version warning, with latest $latest_appNewVersion not matching downloaded $downloaded_version.${NC}"
|
||||
((countWarning++))
|
||||
echo "$cmd_output"
|
||||
label_name=$( $repo_dir/assemble.sh $label DEBUG=2 RETURN_LABEL_NAME=1 | tail -1 )
|
||||
if [[ "$label_name" == "#" ]]; then
|
||||
echo "${RED}Label $label does not exist. Skipping.${NC}"
|
||||
else
|
||||
echo "Label $label: $label_name"
|
||||
cmd_output=$( $repo_dir/assemble.sh $label DEBUG=2 INSTALL=force IGNORE_APP_STORE_APPS=yes BLOCKING_PROCESS_ACTION=ignore )
|
||||
#echo "$cmd_output"
|
||||
no_appNewVersion=$( echo $cmd_output | grep -ic "Latest version not specified." )
|
||||
echo "No appNewVersion: $no_appNewVersion (1 for no)"
|
||||
latest_appNewVersion=$( echo $cmd_output | grep -i "Latest version of " | sed -E 's/.* is ([0-9.]*),*.*$/\1/g' )
|
||||
echo "Latest version: $latest_appNewVersion"
|
||||
github_label=$( echo $cmd_output | grep -ci "Downloading https://github.com" )
|
||||
echo "GitHub: $github_label (1 for true)"
|
||||
downloaded_version=$( echo $cmd_output | grep -ioE "Downloaded (package.*version|version of.*is) [0-9.]*" | grep -v "is the same as installed" | sed -E 's/.* (is|version) ([0-9.]*).*/\2/g' )
|
||||
echo "Downloaded version: $downloaded_version"
|
||||
exit_status=$( echo $cmd_output | grep exit | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' )
|
||||
echo "Exit: $exit_status"
|
||||
if [[ ${exit_status} -eq 0 ]] ; then
|
||||
if [[ $no_appNewVersion -eq 1 ]]; then
|
||||
echo "${GREEN}$label works fine, but no appNewVersion.${NC}"
|
||||
elif [[ $latest_appNewVersion == $downloaded_version && $github_label -eq 0 ]]; then
|
||||
echo "${GREEN}$label works fine, with version $latest_appNewVersion.${NC}"
|
||||
elif [[ $github_label -eq 1 ]]; then
|
||||
echo "${GREEN}$label works fine, with GitHub version $latest_appNewVersion.${NC}"
|
||||
elif [[ $latest_appNewVersion != $downloaded_version && $github_label -eq 0 ]]; then
|
||||
echo "${YELLOW}$label has version warning, with latest $latest_appNewVersion not matching downloaded $downloaded_version.${NC}"
|
||||
((countWarning++))
|
||||
echo "$cmd_output"
|
||||
else
|
||||
echo "${RED}$label NOT WORKING:${NC}"
|
||||
((countError++))
|
||||
errorLabels+=( "$label" )
|
||||
echo "$cmd_output"
|
||||
fi
|
||||
else
|
||||
echo "${RED}$label NOT WORKING:${NC}"
|
||||
((countError++))
|
||||
errorLabels+=( "$label" )
|
||||
echo "$cmd_output"
|
||||
fi
|
||||
else
|
||||
echo "${RED}$label NOT WORKING:${NC}"
|
||||
((countError++))
|
||||
errorLabels+=( "$label" )
|
||||
echo "$cmd_output"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user