4 # A record is an IE heading
5 RS =
"-- =+\n-- IE: [A-Z][A-Za-z0-9-]+"
14 print "Usage: " ARGV[0] "module.asn module-modified.asn"
15 print "Creates cr-module.asn and cr-module-modified.asn only including IEs"
16 print "that are different between module.asn and module-modified.asb"
29 if (ie_header
!= "") {
30 split(ie_header
, header_fields
, "-- IE: ")
31 ie_name = header_fields
[2]
33 module_ie
[file
][i
] = ie_name
34 module_ie_def
[file
][i
] = ie_header
$0
48 stripped_origin =
"stripped_" ARGV[1]
49 stripped_modified =
"stripped_" ARGV[2]
54 # Process IEs of the original .asn
55 while (module_ie
["origin"][i_origin
] != "") {
56 i_modified_search = i_modified
58 # Search possibly until the end in the modified .asn for the same IE name
59 while ((module_ie
["modified"][i_modified_search
] != "") &&
60 (module_ie
["modified"][i_modified_search
] != module_ie
["origin"][i_origin
])) { i_modified_search
++ }
62 # If the IE of the original .asn was found in the modified .asn
63 if (module_ie
["modified"][i_modified_search
] == module_ie
["origin"][i_origin
]) {
65 # Any IE in the modified .asn that was skipped is new, write it to the stripped modified file
67 while (i
< i_modified_search
) {
68 print module_ie_def
["modified"][i
] > stripped_modified
72 # If they are different
73 if (module_ie_def
["modified"][i_modified_search
] != module_ie_def
["origin"][i_origin
]) {
74 print module_ie_def
["origin"][i_origin
] > stripped_origin
75 print module_ie_def
["modified"][i_modified_search
] > stripped_modified
78 # Continue where we are
79 i_modified = i_modified_search
+ 1
83 # The IE of the original .asn was entirely deleted
85 print module_ie_def
["origin"][i_origin
] > stripped_origin
91 while (module_ie
["modified"][i_modified
] != "") {
92 print module_ie_def
["modified"][i_modified
] > stripped_modified