@@ -4,36 +4,36 @@ import { promises as fs, constants as fsConstants } from 'fs';
4
4
import { downloadMongoDb , DownloadOptions } from '../download-mongodb' ;
5
5
import { BuildVariant , getDistro , getArch } from '../config' ;
6
6
7
- export async function downloadCsfleLibrary ( variant : BuildVariant | 'host' ) : Promise < string > {
7
+ export async function downloadCryptLibrary ( variant : BuildVariant | 'host' ) : Promise < string > {
8
8
const opts : DownloadOptions = { } ;
9
9
opts . arch = variant === 'host' ? undefined : getArch ( variant ) ;
10
10
opts . distro = variant === 'host' ? undefined : lookupReleaseDistro ( variant ) ;
11
11
opts . enterprise = true ;
12
- opts . csfle = true ;
13
- console . info ( 'mongosh: downloading latest csfle shared library for inclusion in package:' , JSON . stringify ( opts ) ) ;
12
+ opts . crypt_shared = true ;
13
+ console . info ( 'mongosh: downloading latest crypt shared library for inclusion in package:' , JSON . stringify ( opts ) ) ;
14
14
15
15
let libdir = '' ;
16
- const csfleTmpTargetDir = path . resolve ( __dirname , '..' , '..' , '..' , '..' , 'tmp' , 'csfle -store' , variant ) ;
16
+ const cryptTmpTargetDir = path . resolve ( __dirname , '..' , '..' , '..' , '..' , 'tmp' , 'crypt -store' , variant ) ;
17
17
// Download mongodb for latest server version. Fall back to the 6.0.0-rcX
18
18
// version if no stable version is available.
19
19
let error : Error | undefined ;
20
20
for ( const version of [ 'stable' , '>= 6.0.0-rc5' ] ) {
21
21
try {
22
- libdir = await downloadMongoDb ( csfleTmpTargetDir , version , opts ) ;
22
+ libdir = await downloadMongoDb ( cryptTmpTargetDir , version , opts ) ;
23
23
break ;
24
24
} catch ( e : any ) {
25
25
error = e ;
26
26
}
27
27
}
28
28
if ( ! libdir ) throw error ;
29
- const csfleLibrary = path . join (
29
+ const cryptLibrary = path . join (
30
30
libdir ,
31
- ( await fs . readdir ( libdir ) ) . find ( filename => filename . match ( / ^ m o n g o _ c s f l e _ v 1 \. ( s o | d y l i b | d l l ) $ / ) ) as string
31
+ ( await fs . readdir ( libdir ) ) . find ( filename => filename . match ( / ^ m o n g o _ c r y p t _ v 1 \. ( s o | d y l i b | d l l ) $ / ) ) as string
32
32
) ;
33
33
// Make sure that the binary exists and is readable.
34
- await fs . access ( csfleLibrary , fsConstants . R_OK ) ;
35
- console . info ( 'mongosh: downloaded' , csfleLibrary ) ;
36
- return csfleLibrary ;
34
+ await fs . access ( cryptLibrary , fsConstants . R_OK ) ;
35
+ console . info ( 'mongosh: downloaded' , cryptLibrary ) ;
36
+ return cryptLibrary ;
37
37
}
38
38
39
39
function lookupReleaseDistro ( variant : BuildVariant ) : string {
0 commit comments