Here is a tip that someone may come looking for some day that I hope is as useful for you as it was for me. In making some changes to the BridgePoint metamodel recently I found myself in need of a way to easily compare copies of the ooaofooa schema before and after changes. In this case, the schema was produced by tool in the bridgepoint build chain, so the format was what you see in the example below. The problem was that the copies I had were in different order which made it very hard to diff. In case you do not know what I mean by schema, what I mean is the file being specified to xtumlmc_gen_erate’s -import option to create schema elements. The commands in the schema file are “create ROP …” and “create TABLE …”. Examples from the ooaofooa schema are:
CREATE TABLE S_SYS (
useGlobals INTEGER );
CREATE ROP REF_ID R1405 FROM MC EP_PKG ( Direct_Sys_ID )
TO 1 S_SYS ( Sys_ID );
Here are the ilnux commands I used to sort the schema files. Thank you to Cort Starrett for providing this!
$ cat after.sql | grep -v ‘\-\-‘ | tr -d ‘\015’ | tr -d ‘\n’ | sed ‘s/;/;\n/g’ | sort > a1.sql
$ cat before.sql | grep -v ‘\-\-‘ | tr -d ‘\015’ | tr -d ‘\n’ | sed ‘s/;/;\n/g’ | sort > b1.sql
After sorting you can easily then use your favorite diff tool to clearly see changes.