File: makeinit.ps1

package info (click to toggle)
cyrus-sasl2 2.1.28%2Bdfsg1-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,836 kB
  • sloc: ansic: 47,406; sh: 4,949; xml: 1,423; makefile: 735; python: 332
file content (23 lines) | stat: -rw-r--r-- 1,099 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$mechanism = @("anonymous", "crammd5", "digestmd5", "scram", "gssapiv2", "kerberos4", "login", "ntlm", "otp", "passdss", "plain", "srp", "gs2")
$pluginsDir = "..\plugins\"

for ($i = 0; $i -le $mechanism.Count - 1; $i++)
{
	$targetFilename = "$pluginsDir$($mechanism[$i])_init.c"
	if (-Not (Test-Path -Path $targetFilename) -Or (Get-ChildItem $targetFilename).CreationTime -lt (Get-ChildItem "init_mechanism.c").CreationTime) {
		(gc init_mechanism.c) -replace 'MECHANISM', $mechanism[$i] | Set-Content $targetFilename
		Write-Host " * Make init for  '" $mechanism[$i] "'"
	}
}

$auxprop = @("sasldb", "sql", "ldapdb")
for ($i = 0; $i -le $auxprop.Count - 1; $i++)
{
	$targetFilename = "$pluginsDir$($auxprop[$i])_init.c"
	if (-Not (Test-Path -Path $targetFilename) -Or (Get-ChildItem $targetFilename).CreationTime -lt (Get-ChildItem "init_auxprop.c").CreationTime) {
		(gc init_auxprop.c) -replace 'AUXPROP_REPLACE', $auxprop[$i] | Set-Content $targetFilename
		Write-Host " * Make init for  '" $auxprop[$i] "'"
	}
}

"SASL_CANONUSER_PLUG_INIT( ldapdb )" | Add-Content "$($pluginsDir)ldapdb_init.c"