shithub: mc

Download patch

ref: b1739a7f310d9540f309afda175af2ae5a1dcca9
parent: cc907e3658dc2b9d2687de53edf75021ff7a4535
author: Ori Bernstein <ori@eigenstate.org>
date: Tue Apr 14 06:39:06 EDT 2015

Clean up sysselect.sh.

    Get rid of mongo if statements.

--- a/sysselect.sh
+++ b/sysselect.sh
@@ -19,25 +19,18 @@
 fi
 
 # check for system prefixes on .myr src
-if test -f "$1+$sys-$arch.myr"; then
-	echo "$1+$sys-$arch.myr"
-elif test -f $1+$posixy-$arch.myr; then
-	echo $1+$posixy-$arch.myr
-elif test -f "$1+$sys.myr"; then
-	echo "$1+$sys.myr"
-elif test -f $1+$posixy.myr; then
-	echo $1+$posixy.myr
-elif test -f $1+$arch; then
-	echo $1+$arch.myr
-# check for system prefixes on .s src
-elif test -f "$1+$sys-$arch.s"; then
-	echo "$1+$sys-$arch.s"
-elif test -f $1+$posixy-$arch.s; then
-	echo $1+$posixy-$arch.s
-elif test -f "$1+$sys.s"; then
-	echo "$1+$sys.s"
-elif test -f $1+$posixy.s; then
-	echo $1+$posixy.s
-elif test -f $1+$arch; then
-	echo $1+$arch.s
-fi
+for suffix in myr s; do
+	for platform in $posixy-$sys-$arch \
+		$posixy-$sys \
+		$posixy-$arch \
+		$posixy \
+		$sys-$arch \
+		$sys \
+		$arch
+	do
+		if test -f $1+$platform.$suffix; then
+			echo $1+$platform.$suffix 
+		fi
+	done
+done
+