]> xenbits.xensource.com Git - pvdrivers/win/xenvbd.git/commit
Scripted replacement of Copyright notices in source
authorOwen Smith <owen.smith@citrix.com>
Thu, 23 Feb 2023 09:51:30 +0000 (09:51 +0000)
committerPaul Durrant <pdurrant@amazon.com>
Thu, 23 Mar 2023 17:01:06 +0000 (17:01 +0000)
commit37d0476136567a53e69a7b6ad38b6a082d1601a1
tree78027085885bc5d55fd46110f2cc9c9b4c2178fc
parent324833ae4037b974a6187c25f257797a292c02eb
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>
Amended commit comment. Fixed whitespace.

Signed-off-by: Paul Durrant <paul@xen.org>
95 files changed:
LICENSE
include/cache_interface.h
include/debug_interface.h
include/emulated_interface.h
include/evtchn_interface.h
include/gnttab_interface.h
include/names.h
include/store_interface.h
include/suspend_interface.h
include/unplug_interface.h
include/xen-errno.h
include/xen-types.h
include/xen-version.h
include/xen-warnings.h
include/xen.h
include/xencdb.h
include/xencrsh_interface.h
include/xenvbd-ntstrsafe.h
include/xenvbd-storport.h
src/coinst/coinst.c
src/coinst/xenvbd_coinst.def
src/coinst/xenvbd_coinst.rc
src/common/util.h
src/xencrsh/assert.h
src/xencrsh/austere.c
src/xencrsh/austere.h
src/xencrsh/buffer.c
src/xencrsh/buffer.h
src/xencrsh/driver.c
src/xencrsh/driver.h
src/xencrsh/evtchn.c
src/xencrsh/evtchn.h
src/xencrsh/fdo.c
src/xencrsh/fdo.h
src/xencrsh/frontend.c
src/xencrsh/frontend.h
src/xencrsh/gnttab.c
src/xencrsh/gnttab.h
src/xencrsh/hvm.c
src/xencrsh/hvm.h
src/xencrsh/hypercall.h
src/xencrsh/hypercall_stub.c
src/xencrsh/log.c
src/xencrsh/log.h
src/xencrsh/pdo.c
src/xencrsh/pdo.h
src/xencrsh/pdoinquiry.c
src/xencrsh/pdoinquiry.h
src/xencrsh/queue.c
src/xencrsh/queue.h
src/xencrsh/ring.h
src/xencrsh/srbext.h
src/xencrsh/store.c
src/xencrsh/store.h
src/xencrsh/xencrsh.def
src/xencrsh/xencrsh.rc
src/xendisk/assert.h
src/xendisk/debug.h
src/xendisk/driver.c
src/xendisk/driver.h
src/xendisk/fdo.c
src/xendisk/fdo.h
src/xendisk/mutex.h
src/xendisk/pdo.c
src/xendisk/pdo.h
src/xendisk/registry.c
src/xendisk/registry.h
src/xendisk/thread.c
src/xendisk/thread.h
src/xendisk/types.h
src/xendisk/xendisk.rc
src/xenvbd.inf
src/xenvbd/adapter.c
src/xenvbd/adapter.h
src/xenvbd/assert.h
src/xenvbd/base64.c
src/xenvbd/base64.h
src/xenvbd/debug.h
src/xenvbd/driver.c
src/xenvbd/driver.h
src/xenvbd/frontend.c
src/xenvbd/frontend.h
src/xenvbd/granter.c
src/xenvbd/granter.h
src/xenvbd/registry.c
src/xenvbd/registry.h
src/xenvbd/ring.c
src/xenvbd/ring.h
src/xenvbd/srbext.h
src/xenvbd/target.c
src/xenvbd/target.h
src/xenvbd/thread.c
src/xenvbd/thread.h
src/xenvbd/types.h
src/xenvbd/xenvbd.rc