Skip to content

Commit

Permalink
Build: re-wording for portability and tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ma-ilsi committed Oct 9, 2023
1 parent 011c5b4 commit 784e35a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions sophie.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 784e35a

Please sign in to comment.