@@ -99,12 +99,12 @@ async function llvmBinaryDeps_(_majorVersion: number) {
99
99
for ( const dep of [ "libtinfo5" , "libtinfo6" ] ) {
100
100
/* eslint-disable no-await-in-loop */
101
101
try {
102
+ await installAptPack ( [ { name : dep } ] )
103
+ } catch ( _err ) {
102
104
try {
103
- await installAptPack ( [ { name : dep } ] )
104
- } catch ( err ) {
105
105
if ( dep === "libtinfo5" ) {
106
106
// Manually install libtinfo5 if the package is not available
107
- info ( `Failed to install ${ dep } ${ err } \nManually installing the package` )
107
+ info ( `Failed to install ${ dep } \nManually installing the package` )
108
108
const arch = x86_64 . includes ( process . arch )
109
109
? "amd64"
110
110
: arm64 . includes ( process . arch )
@@ -114,16 +114,17 @@ async function llvmBinaryDeps_(_majorVersion: number) {
114
114
const fileName = `libtinfo5_6.3-2ubuntu0.1_${ arch } .deb`
115
115
const url = `http://launchpadlibrarian.net/666971015/${ fileName } `
116
116
const dl = new DownloaderHelper ( url , tmpdir ( ) , { fileName } )
117
- dl . on ( "error" , ( dlErr ) => {
118
- throw new Error ( `Failed to download ${ url } : ${ dlErr } ` )
117
+ dl . on ( "error" , async ( dlErr ) => {
118
+ info ( `Failed to download ${ url } : ${ dlErr } ` )
119
+ await dl . stop ( )
119
120
} )
120
121
await dl . start ( )
121
122
// Install the downloaded package via dpkg
122
123
execRootSync ( "dpkg" , [ "-i" , join ( tmpdir ( ) , fileName ) ] )
123
124
}
125
+ } catch ( _errFallback ) {
126
+ info ( `Failed to install ${ dep } . Ignoring` )
124
127
}
125
- } catch ( err ) {
126
- info ( `Failed to install ${ dep } . Ignoring` )
127
128
}
128
129
/* eslint-enable no-await-in-loop */
129
130
}
0 commit comments