summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorKent Sutherland <git@ksuther.com>2014-06-09 01:55:41 -0400
committerKent Sutherland <git@ksuther.com>2014-06-09 01:55:41 -0400
commit3675d9ec925d71293a05505eb7aa8d9985b23ffd (patch)
treef0d8474783912831d95d770f496bd4368a95bfcc /scripts
parentd109d6c9b6996c1cb8f23a09c93e177c4ca71156 (diff)
downloadlibical-git-3675d9ec925d71293a05505eb7aa8d9985b23ffd.tar.gz
mkderivedproperties.pl now creates enum_map using the order specified in derived-data/properties.pl. This is necessary because icalproperty_enum_to_string is sensitive to the order of the items in enum_map. Fixes failed regression tests in regression-classify.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/mkderivedproperties.pl12
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/mkderivedproperties.pl b/scripts/mkderivedproperties.pl
index 222eedd5..58d6179e 100755
--- a/scripts/mkderivedproperties.pl
+++ b/scripts/mkderivedproperties.pl
@@ -61,7 +61,7 @@ sub insert_code {
if($opt_c){
- my @props = sort keys %propmap;
+ my @props = sort {$propmap{$a}->{"kindEnum"} <=> $propmap{$b}->{"kindEnum"}} keys %propmap;
my $count = scalar(@props);
@@ -86,7 +86,7 @@ if($opt_c){
print "{ICAL_${uc}_PROPERTY,\"\",ICAL_NO_VALUE}};\n\n";
$count = 1;
- my $out = "";
+ my %lines;
foreach $value (sort keys %valuemap) {
@@ -118,7 +118,9 @@ if($opt_c){
$str = "";
}
- $out.=" {ICAL_${ucv}_PROPERTY,ICAL_${ucv}_${uce},\"$str\" }, /*$idx*/\n";
+ # Place each property into a hash based on the index specified in value-types.csv
+ # The lines are printed so they're in the same order as the indices
+ $lines{$idx} = " {ICAL_${ucv}_PROPERTY,ICAL_${ucv}_${uce},\"$str\" }, /*$idx*/\n";
$count++;
}
@@ -128,7 +130,9 @@ if($opt_c){
$count++;
print "static const struct icalproperty_enum_map enum_map[$count] = {\n";
- print $out;
+ foreach $line (sort keys %lines) {
+ print $lines{$line};
+ }
print " {ICAL_NO_PROPERTY,0,\"\"}\n};\n\n";