]>
xenbits.xensource.com Git - pvdrivers/win/xenvkbd.git/commit
Scripted replacement of Copyright notices in source
Due to a transfer of copyright ownership from Citrix to Cloud Software Group,
the copyright notices in all source files should be updated.
Using the powershell script below replace "Copyright (c) Citrix Systems, Inc."
with "Copyright (c) Xen Project." and "Copyright (c) Cloud Software Group, Inc."
Function Multiline-Replace {
param(
[string]$Filename,
[string]$ToReplace,
[array]$ReplaceWith
)
$content = Get-Content $Filename
$replace = $false
$output = ""
$content | ForEach {
$line = $_
if ($line.Contains($ToReplace)) {
$replace = $true
$ReplaceWith | ForEach {
$output += $line.Replace($ToReplace, $_) + "`n"
}
} else {
$output += $line + "`n"
}
}
if ($replace) {
Write-Host "Replacing: " $Filename
$output | Set-Content $Filename
} else {
Write-Host "Ignoring: " $Filename
}
}
Function Replace-Filestrings {
param(
[array]$FilleTypes,
[string]$ToReplace,
[array]$Replacements,
[array]$ExcludeList
)
$FileTypes | ForEach {
Get-ChildItem $_ -Recurse | ForEach-Object {
$filename = $_
if (($ExcludeList | %{ $filename -Like $_ }) -Contains $True) {
Write-Host "Excluding: " $filename
} else {
Multiline-Replace $_ $ToReplace $Replacements
}
}
}
}
$ExcludeList = @("*include\xen\*", "*\obj\*")
$Replace = "Copyright (c) Citrix Systems Inc."
$Replacements = @("/* Copyright (c) Xen Project.", " * Copyright (c) Cloud Software Group, Inc.")
$FileTypes = @("*.c", "*.h", "*.rc")
Replace-Filestrings $FileTypes ('/* ' + $Replace) $Replacements $ExcludeList
$Replacements = @("; // Copyright (c) Xen Project.", "; // Copyright (c) Cloud Software Group, Inc.")
$FileTypes = @("*.mc")
Replace-Filestrings $FileTypes ('; // ' + $Replace) $Replacements $ExcludeList
$Replacements = @("; Copyright (c) Xen Project.", "; Copyright (c) Cloud Software Group, Inc.")
$FileTypes = @("*.inf", "*.def")
Replace-Filestrings $FileTypes ('; ' + $Replace) $Replacements $ExcludeList
$Replacements = @("Copyright (c) Xen Project.", "Copyright (c) Cloud Software Group, Inc.")
$FileTypes = @("LICENSE")
Replace-Filestrings $FileTypes $Replace $Replacements $ExcludeList
Signed-off-by: Owen Smith <owen.smith@citrix.com>
Manually fixed whitespace at end of files.
Signed-off-by: Owen Smith <owen.smith@citrix.com>
45 files changed: