Update file executable_install-program

This commit is contained in:
Brian Zalewski 2023-01-05 04:28:13 +00:00
parent eec1273fd8
commit 1860d1483f

View file

@ -161,7 +161,7 @@ async function generateInstallOrders(pkgsToInstall) {
} else if (softwarePackages[packageKey]['_' + currentSelector + ':' + osType + ':' + preference]) { } else if (softwarePackages[packageKey]['_' + currentSelector + ':' + osType + ':' + preference]) {
pref = osType + ':' + preference pref = osType + ':' + preference
} }
log('info', 'Skipping Package', `${pkg} is being skipped because of the _when:${pref} condition`) log('info', 'Filter', `${pkg} is being skipped because of the _when:${pref} condition`)
continue pkgFor continue pkgFor
} }
} else if (scopedPkgManager) { } else if (scopedPkgManager) {
@ -169,7 +169,7 @@ async function generateInstallOrders(pkgsToInstall) {
await $scopedPkgManager await $scopedPkgManager
} catch (e) { } catch (e) {
const pref = preference const pref = preference
log('info', 'Skipping Package', `${pkg} is being skipped because of the _when:${pref} condition`) log('info', 'Filter', `${pkg} is being skipped because of the _when:${pref} condition`)
continue pkgFor continue pkgFor
} }
} else if (scopedSystem) { } else if (scopedSystem) {
@ -182,14 +182,14 @@ async function generateInstallOrders(pkgsToInstall) {
} else if (softwarePackages[packageKey]['_' + currentSelector + ':' + osType]) { } else if (softwarePackages[packageKey]['_' + currentSelector + ':' + osType]) {
pref = osType pref = osType
} }
log('info', 'Skipping Package', `${pkg} is being skipped because of the _when:${pref} condition`) log('info', 'Filter', `${pkg} is being skipped because of the _when:${pref} condition`)
continue pkgFor continue pkgFor
} }
} else if (normalCheck) { } else if (normalCheck) {
try { try {
await $(normalCheck) await $(normalCheck)
} catch (e) { } catch (e) {
log('info', 'Skipping Package', `${pkg} is being skipped because of the _when condition`) log('info', 'Filter', `${pkg} is being skipped because of the _when condition`)
continue pkgFor continue pkgFor
} }
} }
@ -222,8 +222,7 @@ async function generateInstallOrders(pkgsToInstall) {
} else if (softwarePackages[packageKey]['_' + currentSelector + ':' + osType + ':' + preference]) { } else if (softwarePackages[packageKey]['_' + currentSelector + ':' + osType + ':' + preference]) {
pref = osType + ':' + preference pref = osType + ':' + preference
} }
log('info', 'Skipping Package', `${pkg} is being skipped because of the _bin:${pref} condition`) log('info', 'Filter', `${bin} already in PATH (via _bin:${pref})`)
log('info', 'Skipping Package', `${bin} is already in the PATH`)
continue pkgFor continue pkgFor
} }
} else if (scopedPkgManager) { } else if (scopedPkgManager) {
@ -233,8 +232,7 @@ async function generateInstallOrders(pkgsToInstall) {
: scopedPkgManager.map((x) => which.sync(x, { nothrow: true })).every((y) => !!y) : scopedPkgManager.map((x) => which.sync(x, { nothrow: true })).every((y) => !!y)
if (bin) { if (bin) {
const pref = preference const pref = preference
log('info', 'Skipping Package', `${pkg} is being skipped because of the _bin:${pref} condition`) log('info', 'Filter', `${bin} already in PATH (via _bin:${pref})`)
log('info', 'Skipping Package', `${bin} is already in the PATH`)
continue pkgFor continue pkgFor
} }
} else if (scopedSystem) { } else if (scopedSystem) {
@ -249,8 +247,7 @@ async function generateInstallOrders(pkgsToInstall) {
} else if (softwarePackages[packageKey]['_' + currentSelector + ':' + osType]) { } else if (softwarePackages[packageKey]['_' + currentSelector + ':' + osType]) {
pref = osType pref = osType
} }
log('info', 'Skipping Package', `${pkg} is being skipped because of the _bin:${pref} condition`) log('info', 'Filter', `${bin} already in PATH (via _bin:${pref})`)
log('info', 'Skipping Package', `${bin} is already in the PATH`)
continue pkgFor continue pkgFor
} }
} else if (normalCheck) { } else if (normalCheck) {
@ -259,8 +256,7 @@ async function generateInstallOrders(pkgsToInstall) {
? which.sync(normalCheck, { nothrow: true }) ? which.sync(normalCheck, { nothrow: true })
: normalCheck.map((x) => which.sync(x, { nothrow: true })).every((y) => !!y) : normalCheck.map((x) => which.sync(x, { nothrow: true })).every((y) => !!y)
if (bin) { if (bin) {
log('info', 'Skipping Package', `${pkg} is being skipped because of the _bin condition`) log('info', 'Filter', `${bin} already in PATH (via _bin)`)
log('info', 'Skipping Package', `${bin} is already in the PATH`)
continue pkgFor continue pkgFor
} }
} }
@ -277,42 +273,43 @@ async function generateInstallOrders(pkgsToInstall) {
softwarePackages[packageKey]['_' + currentSelector + ':' + osID] || softwarePackages[packageKey]['_' + currentSelector + ':' + osID] ||
softwarePackages[packageKey]['_' + currentSelector + ':' + osType] softwarePackages[packageKey]['_' + currentSelector + ':' + osType]
normalCheck = softwarePackages[packageKey]['_' + currentSelector] normalCheck = softwarePackages[packageKey]['_' + currentSelector]
const dependenciesTag = 'Dependencies'
if (doubleScoped) { if (doubleScoped) {
let pref let pref
if (softwarePackages[packageKey]['_' + currentSelector + ':' + preference + ':' + osID]) { if (softwarePackages[packageKey]['_' + currentSelector + ':' + preference + ':' + osID]) {
pref = preference + ':' + osID pref = preference + ':' + osID
log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.${pref}`) log('info', dependenciesTag, `Installing dependencies for ${packageKey}.${pref}`)
await generateInstallOrders(softwarePackages[packageKey][pref]) await generateInstallOrders(softwarePackages[packageKey][pref])
} else if (softwarePackages[packageKey]['_' + currentSelector + ':' + preference + ':' + osType]) { } else if (softwarePackages[packageKey]['_' + currentSelector + ':' + preference + ':' + osType]) {
pref = preference + ':' + osType pref = preference + ':' + osType
log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.${pref}`) log('info', dependenciesTag, `Installing dependencies for ${packageKey}.${pref}`)
await generateInstallOrders(softwarePackages[packageKey][pref]) await generateInstallOrders(softwarePackages[packageKey][pref])
} else if (softwarePackages[packageKey]['_' + currentSelector + ':' + osID + ':' + preference]) { } else if (softwarePackages[packageKey]['_' + currentSelector + ':' + osID + ':' + preference]) {
pref = osID + ':' + preference pref = osID + ':' + preference
log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.${pref}`) log('info', dependenciesTag, `Installing dependencies for ${packageKey}.${pref}`)
await generateInstallOrders(softwarePackages[packageKey][pref]) await generateInstallOrders(softwarePackages[packageKey][pref])
} else if (softwarePackages[packageKey]['_' + currentSelector + ':' + osType + ':' + preference]) { } else if (softwarePackages[packageKey]['_' + currentSelector + ':' + osType + ':' + preference]) {
pref = osType + ':' + preference pref = osType + ':' + preference
log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.${pref}`) log('info', dependenciesTag, `Installing dependencies for ${packageKey}.${pref}`)
await generateInstallOrders(softwarePackages[packageKey][pref]) await generateInstallOrders(softwarePackages[packageKey][pref])
} }
} else if (scopedPkgManager) { } else if (scopedPkgManager) {
const pref = preference const pref = preference
log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.${pref}`) log('info', dependenciesTag, `Installing dependencies for ${packageKey}.${pref}`)
await generateInstallOrders(softwarePackages[packageKey][pref]) await generateInstallOrders(softwarePackages[packageKey][pref])
} else if (scopedSystem) { } else if (scopedSystem) {
let pref let pref
if (softwarePackages[packageKey]['_' + currentSelector + ':' + osID]) { if (softwarePackages[packageKey]['_' + currentSelector + ':' + osID]) {
pref = osID pref = osID
log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.${pref}`) log('info', dependenciesTag, `Installing dependencies for ${packageKey}.${pref}`)
await generateInstallOrders(softwarePackages[packageKey][pref]) await generateInstallOrders(softwarePackages[packageKey][pref])
} else if (softwarePackages[packageKey]['_' + currentSelector + ':' + osType]) { } else if (softwarePackages[packageKey]['_' + currentSelector + ':' + osType]) {
pref = osType pref = osType
log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.${pref}`) log('info', dependenciesTag, `Installing dependencies for ${packageKey}.${pref}`)
await generateInstallOrders(softwarePackages[packageKey][pref]) await generateInstallOrders(softwarePackages[packageKey][pref])
} }
} else if (normalCheck) { } else if (normalCheck) {
log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.deps`) log('info', dependenciesTag, `Installing dependencies for ${packageKey}.deps`)
await generateInstallOrders(softwarePackages[packageKey]['_deps']) await generateInstallOrders(softwarePackages[packageKey]['_deps'])
} }
if (softwarePackages[packageKey][preference + ':' + osID]) { if (softwarePackages[packageKey][preference + ':' + osID]) {
@ -373,7 +370,7 @@ async function updateInstallMaps(preference, packages, scopedPreference, pkg, pa
if (!installOrders[preference]) { if (!installOrders[preference]) {
installOrders[preference] = [] installOrders[preference] = []
} }
log('info', 'Install Orders', `Found a match for the package \`${pkg}\` (${packageKey} via ${scopedPreference})`) log('info', 'Match', `Found a match for the package \`${pkg}\` (${packageKey} via ${scopedPreference})`)
const newPackages = packages[scopedPreference] const newPackages = packages[scopedPreference]
const newPkgs = typeof newPackages === 'string' ? [newPackages] : newPackages const newPkgs = typeof newPackages === 'string' ? [newPackages] : newPackages
if (preference === 'snap' && softwarePackages[pkg]['_snapClassic'] === true) { if (preference === 'snap' && softwarePackages[pkg]['_snapClassic'] === true) {