From 784e35a739eccdd900e9ffb3338beeecef08d55d Mon Sep 17 00:00:00 2001 From: ma-ilsi Date: Mon, 9 Oct 2023 13:40:11 -0400 Subject: [PATCH] Build: re-wording for portability and tests Seems like Ubuntu is breaking with the arithmetic syntax which is working fine on macOS. Switching over to a more stretched out and explicit increment. --- sophie.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sophie.sh b/sophie.sh index ed44bd8..1871491 100755 --- a/sophie.sh +++ b/sophie.sh @@ -104,7 +104,7 @@ while read line; do #Identifier cut_count=`expr "$line" : "[^\[]*\["` curr_identifier=`printf "%s" "$line" | cut -c1-"$cut_count" | sed "s/[[:space:]]*\[$//"` - ((cut_count+=1)) + cut_count=$((cut_count+1)) line=`printf "%s" "$line" | cut -c"$cut_count"-` #TODO: refinements are detected as second time requests to alter this identifier and a marker to indicate a refinement is placed. @@ -117,13 +117,13 @@ while read line; do #Filter cut_count=`expr "$line" : "[^=]*=\""` filter=`printf "%s" "$line" | cut -c1-"$cut_count" | sed "s/=\"//"` - ((cut_count+=1)) + cut_count=$((cut_count+1)) line=`printf "%s" "$line" | cut -c"$cut_count"-` #Filter condition cut_count=`expr "$line" : "[^\<\";\>]*\";"` condition=`printf "%s" "$line" | cut -c1-"$cut_count" | sed "s/\";//"` - ((cut_count+=1)) + cut_count=$((cut_count+1)) line=`printf "%s" "$line" | cut -c"$cut_count"-` #Fetching current command that represents matching files @@ -196,7 +196,7 @@ while read line; do #Identifier cut_count=`expr "$line" : ".*\["` curr_identifier=`printf "%s" "$line" | cut -c1-"$cut_count" | sed "s/[[:space:]]*\[$//"` - ((cut_count+=1)) + cut_count=$((cut_count+1)) line=`printf "%s" "$line" | cut -c"$cut_count"-` while [ "$line" != "]" ]; do @@ -207,13 +207,13 @@ while read line; do #Filter cut_count=`expr "$line" : "[^=]*=\""` filter=`printf "%s" "$line" | cut -c1-"$cut_count" | sed "s/=\"//"` - ((cut_count+=1)) + cut_count=$((cut_count+1)) line=`printf "%s" "$line" | cut -c"$cut_count"-` #Filter condition cut_count=`expr "$line" : "[^\<\";\>]*\";"` condition=`printf "%s" "$line" | cut -c1-"$cut_count" | sed "s/\";//"` - ((cut_count+=1)) + cut_count=$((cut_count+1)) line=`printf "%s" "$line" | cut -c"$cut_count"-` #Apply filter after fetching old filter condition @@ -284,24 +284,24 @@ while read line; do #Identifier cut_count=`expr "$line" : ".*\["` curr_identifier=`printf "%s" "$line" | cut -c1-"$cut_count" | sed "s/[[:space:]]*\[$//"` - ((cut_count+=2)) + cut_count=$((cut_count+2)) line=`printf "%s" "$line" | cut -c"$cut_count"-` compliance_identifier=$curr_identifier cut_count=`expr "$line" : "[^ ]*"` compliance_notice_identifier=`printf "%s" "$line" | cut -c1-"$cut_count" | sed "s/ //"` - ((cut_count+=1)) + cut_count=$((cut_count+1)) line=`printf "%s" "$line" | cut -c"$cut_count"-` cut_count=`expr "$line" : ".* "` compliance_preposition=`printf "%s" "$line" | cut -c1-"$cut_count" | sed "s/ //"` - ((cut_count+=1)) + cut_count=$((cut_count+1)) line=`printf "%s" "$line" | cut -c"$cut_count"-` cut_count=`expr "$line" : ".*[^\\]\";"` compliance_files_identifier=`printf "%s" "$line" | cut -c1-"$cut_count" | sed "s/\";//"` - ((cut_count+=1)) + cut_count=$((cut_count+1)) line=`printf "%s" "$line" | cut -c"$cut_count"-` if [ -n "$compliance_files_identifier" ]; then