[m-rev.] for review: canonical_grade bug fix

Peter Ross pro at missioncriticalit.com
Sat Dec 21 23:02:45 AEDT 2002


Hi,


===================================================================


Estimated hours taken: 2
Branches: main

scripts/canonical_grade.sh-subr:
	Fix a bug where passing il or java as the argument to
	./canonical_grade --grade <grade> was returning "hl".
	


Index: scripts/canonical_grade.sh-subr
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/canonical_grade.sh-subr,v
retrieving revision 1.6
diff -u -r1.6 canonical_grade.sh-subr
--- scripts/canonical_grade.sh-subr	1 Sep 2002 06:05:19 -0000	1.6
+++ scripts/canonical_grade.sh-subr	21 Dec 2002 11:58:45 -0000
@@ -35,15 +35,34 @@
 	false)		;;
 esac
 
-case $highlevel_code,$highlevel_data,$GRADE in
-	true,true,none)		
-		GRADE="hl" ;;
-	true,false,none)	
-		GRADE="hlc" ;;
-	false,false,*)
+case $highlevel_code,$highlevel_data,$GRADE,$target in
+	true,true,none,*)		
+		case $target in
+			c|asm)	GRADE="hl" ;;
+			il)	GRADE="il" ;;
+			java)	GRADE="java" ;;
+			*)
+				progname=`basename $0`
+				echo "$progname: unknown target: $target"
+				exit 1
+				;;
+		esac
+		;;
+	true,false,none,*)	
+		case $target in
+			c|asm)	GRADE="hlc" ;;
+			il)	GRADE="ilc" ;;
+			*)
+				progname=`basename $0`
+				echo "$progname: unsupported target: $target"
+				exit 1
+				;;
+		esac
+		;;
+	false,false,*,*)
 		# GRADE was set above
 		;;
-	false,true,*)
+	false,true,*,*)
 		progname=`basename $0`
 		echo "$progname: error: \`--high-level-data' requires \`--high-level-code'" 1>&2
 		exit 1

--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list