1 ##############################################################################
3 ## compare-config-files
5 ##############################################################################
11 Compares mono build configuration files detecting incompatible changes
.
16 ## winconfig header file.
19 ## config header file.
22 ## The master configuration file, optional.
26 ## Get the content from each config file
27 $mono_winconfig_content = Get-Content $mono_winconfig
28 $mono_config_content = Get-Content $mono_config
30 ## Compare config files.
31 $comparedLines = Compare-Object $mono_winconfig_content $mono_config_content -IncludeEqual
| Sort-Object { $_.InputObject
.ReadCount
}
33 $comparedLines | foreach {
35 if($_.SideIndicator
-ne
"==")
38 $mono_version = (Select-String -InputObject
$_.InputObject
-pattern
'#define VERSION \"(.*)\"')
39 if ($mono_version -eq
$null) {
40 Write-Host "Changes detected, versions doesn't match. Configuration must to be replaced."
46 if ($mono_config_ac -ne
$null -And
$mono_config_ac -ne
"") {
48 $mono_version_ac = (Select-String -path
$mono_config_ac -pattern
'AC_INIT\(mono, \[(.*)\]').Matches
[0].Groups
[1].Value
49 $mono_version = (Select-String -path
$mono_config -pattern
'#define VERSION \"(.*)\"').Matches
[0].Groups
[1].Value
51 if($mono_version_ac -ne
$mono_version)
53 Write-Host "Changes detected, versions doesn't match. Configuration must to be replaced."