# HG changeset patch # User Simon Howkins # Date 1249652032 -3600 # Node ID aee074ee2646a4d20a64e6c1114fe8689a607bbe # Parent 7297abc8565b9f03add0dee0dc8f2f6ccf4c6b72 Changed preference for selecting package definition files, so that it takes the one from our tree in preference to the one in the package itself. This means that we can just delete items from our tree when we're happy to switch to using the one in the package (as this will vary from package to package). Added sorting of the attributes when outputting the system definition, to match the de facto standard in the system definition we started with. diff -r 7297abc8565b -r aee074ee2646 common/tools/csvToSysDef.pl --- a/common/tools/csvToSysDef.pl Fri Aug 07 14:59:13 2009 +0100 +++ b/common/tools/csvToSysDef.pl Fri Aug 07 14:33:52 2009 +0100 @@ -52,16 +52,16 @@ { # If the sources.csv does not include a sys def for this package, it doesn't get built next unless $package->{sysdef}; - warn "Warning: Package $package->{dst} does not appear on the local system\n" unless -d $package->{dst}; - # Look for the pkg defn in the root of the package tree + # If it's in the "backup" location, use that one (ie our copy overrides the package's own copy) my $pkgDef = "$package->{dst}/$package->{sysdef}"; + $pkgDef =~ s{^/sf/}{}; + $pkgDef =~ s{/[^/]*$}{}; + $pkgDef = "$backupBaseDir/$pkgDef/package_definition.xml"; if (!-f $pkgDef) { - # Not there, so try the "backup" location - $pkgDef =~ s{^/sf/}{}; - $pkgDef =~ s{/[^/]*$}{}; - # TODO: Where will this be on the build machine? - $pkgDef = "$backupBaseDir/$pkgDef/package_definition.xml"; + # Not there, so look for the pkg defn in the root of the package tree + warn "Warning: Package $package->{dst} does not appear on the local system\n" unless -d $package->{dst}; + $pkgDef = "$package->{dst}/$package->{sysdef}"; } die "Unable to locate any package_definition at all for $package->{dst}" unless -f $pkgDef; @@ -81,10 +81,12 @@ #print Data::Dumper->Dump([$outTree->[0]], ["tree"]); # Output total tree -print "\n"; +print "\n"; printTree($outTree->[0]); print "\n"; +exit; + sub mergeTrees { my $baseTree = shift or die; @@ -161,7 +163,18 @@ print "<$tagName"; - foreach my $attr (grep { ! ref $tree->{$_} } keys %$tree) + foreach my $attr ( + sort { + my $order = "name long-name tech_domain level span schema levels filter introduced deprecated purpose class plugin origin-model bldFile mrp version priority"; + my $ixA = index $order, $a; + my $ixB = index $order, $b; + die "$a $b" if $ixA + $ixB == -2; + $ixA - $ixB; + } + grep { + ! ref $tree->{$_} + } + keys %$tree) { print " $attr=\"$tree->{$attr}\""; }