1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-03 21:00:04 +02:00

update dependencies

This commit is contained in:
s2
2018-10-09 09:51:34 +02:00
parent 4fcc873901
commit da4083f574
1112 changed files with 23205 additions and 21697 deletions

View File

@@ -1,7 +1,7 @@
'use strict'
const common = require('./common')
const execSync = require('child_process').execSync
const downloadArch = require('electron-download/lib/arch')
const semver = require('semver')
const officialArchs = ['ia32', 'x64', 'armv7l', 'arm64', 'mips64el']
@@ -13,9 +13,9 @@ const officialPlatformArchCombos = {
win32: ['ia32', 'x64']
}
const minimumLinuxArchBuildVersions = {
arm64: '1.8.0',
mips64el: '1.8.2-beta.5'
const linuxArchBuildVersions = {
arm64: '>= 1.8.0',
mips64el: '^1.8.2-beta.5'
}
// Maps to module filename for each platform (lazy-required if used)
@@ -40,9 +40,9 @@ function createPlatformArchPairs (opts, selectedPlatforms, selectedArchs, ignore
warnIfAllNotSpecified(opts, `The platform/arch combination ${platform}/${arch} is not currently supported by Electron Packager`)
continue
} else if (platform === 'linux') {
const minimumBuildVersion = minimumLinuxArchBuildVersions[arch]
if (minimumBuildVersion && !officialLinuxBuildExists(opts, minimumBuildVersion)) {
warnIfAllNotSpecified(opts, `Official linux/${arch} support only exists in Electron ${minimumBuildVersion} and above`)
const buildVersion = linuxArchBuildVersions[arch]
if (buildVersion && !officialLinuxBuildExists(opts, buildVersion)) {
warnIfAllNotSpecified(opts, `Official linux/${arch} support only exists in Electron ${buildVersion}`)
continue
}
}
@@ -67,8 +67,8 @@ function validOfficialPlatformArch (opts, platform, arch) {
return officialPlatformArchCombos[platform] && officialPlatformArchCombos[platform].indexOf(arch) !== -1
}
function officialLinuxBuildExists (opts, minimumBuildVersion) {
return semver.gte(opts.electronVersion, minimumBuildVersion)
function officialLinuxBuildExists (opts, buildVersion) {
return semver.satisfies(opts.electronVersion, buildVersion)
}
function allPlatformsOrArchsSpecified (opts) {
@@ -81,46 +81,25 @@ function warnIfAllNotSpecified (opts, message) {
}
}
function hostArch () {
if (process.arch === 'arm') {
switch (process.config.variables.arm_version) {
case '6':
return module.exports.unameArch()
case '7':
return 'armv7l'
default:
common.warning(`Could not determine specific ARM arch. Detected ARM version: ${JSON.stringify(process.config.variables.arm_version)}`)
}
}
return process.arch
}
module.exports = {
allOfficialArchsForPlatformAndVersion: function allOfficialArchsForPlatformAndVersion (platform, electronVersion) {
const archs = officialPlatformArchCombos[platform]
if (platform === 'linux') {
const excludedArchs = Object.keys(minimumLinuxArchBuildVersions)
.filter(arch => !officialLinuxBuildExists({electronVersion: electronVersion}, minimumLinuxArchBuildVersions[arch]))
const excludedArchs = Object.keys(linuxArchBuildVersions)
.filter(arch => !officialLinuxBuildExists({electronVersion: electronVersion}, linuxArchBuildVersions[arch]))
return archs.filter(arch => excludedArchs.indexOf(arch) === -1)
}
return archs
},
createPlatformArchPairs: createPlatformArchPairs,
hostArch: hostArch,
hostArch: downloadArch.host,
officialArchs: officialArchs,
officialPlatformArchCombos: officialPlatformArchCombos,
officialPlatforms: officialPlatforms,
osModules: osModules,
supported: supported,
/**
* Returns the arch name from the `uname` utility.
*/
unameArch: function unameArch () {
/* istanbul ignore next */
return execSync('uname -m').toString().trim()
},
unameArch: downloadArch.uname,
// Validates list of architectures or platforms.
// Returns a normalized array if successful, or throws an Error.
validateListFromOptions: function validateListFromOptions (opts, name) {
@@ -129,7 +108,7 @@ module.exports = {
let list = opts[name]
if (!list) {
if (name === 'arch') {
list = hostArch()
list = module.exports.hostArch()
} else {
list = process[name]
}