bump version to 1.6.1 and refactor platform compatibility handling in update logic

This commit is contained in:
mr. M 2024-11-24 10:17:19 +01:00
parent 4e9b9d3880
commit c49501d8fe
No known key found for this signature in database
GPG key ID: CBD57A2AEDBDA1FB
3 changed files with 13 additions and 47 deletions

View file

@ -1,6 +1,6 @@
{
"name": "@zen-browser/surfer",
"version": "1.6.0",
"version": "1.6.1",
"description": "Simplifying building firefox forks!",
"main": "index.js",
"bin": {

View file

@ -427,31 +427,16 @@ function setUpdateURLs() {
if (compatMode == 'x86_64') {
suffix = '-generic';
}
else if (compatMode == 'x86_64-v3') {
suffix = '';
}
else if (compatMode == 'aarch64') {
suffix = '-aarch64';
}
}
if ((process as any).surferPlatform == 'darwin') {
if (compatMode == 'x86_64') {
suffix = '-generic';
}
else if (compatMode == 'aarch64') {
suffix = '';
}
}
if ((process as any).surferPlatform == 'linux') {
if (compatMode == 'x86_64') {
suffix = '-generic';
}
else if (compatMode == 'x86_64-v3') {
suffix = '';
}
else if (compatMode == 'aarch64') {
suffix = '-aarch64';
}
}
const baseURL = `URL=https://@MOZ_APPUPDATE_HOST@/updates/browser/%BUILD_TARGET%/%CHANNEL%${suffix}/update.xml`
const appIni = join(ENGINE_DIR, 'build', 'application.ini.in')

View file

@ -24,22 +24,17 @@ import {
* https://searchfox.org/mozilla-central/source/taskcluster/gecko_taskgraph/util/partials.py
*/
const ausPlatformsMap = {
linux: [
'Linux_x86_64-gcc3',
'Linux_aarch64-gcc3',
],
macos: [
linux64: ['Linux_x86_64-gcc3'],
linuxArm: ['Linux_aarch64-gcc3'],
macosIntel: [
'Darwin_x86_64-gcc3-u-i386-x86_64',
'Darwin_x86-gcc3-u-i386-x86_64',
'Darwin_x86-gcc3',
'Darwin_x86_64-gcc3',
'Darwin_aarch64-gcc3',
],
windows: [
'WINNT_x86_64-msvc',
'WINNT_x86_64-msvc-x64',
'WINNT_aarch64-msvc-aarch64',
],
macosArm: ['Darwin_aarch64-gcc3'],
win64: ['WINNT_x86_64-msvc', 'WINNT_x86_64-msvc-x64'],
winArm: ['WINNT_aarch64-msvc-aarch64']
}
export async function getPlatformConfig() {
@ -129,36 +124,21 @@ async function writeUpdateFileToDisk(
}
}
) {
let suffix;
let suffix = '';
if ((process as any).surferPlatform == 'win32') {
if (compatMode == 'x86_64') {
suffix = '-generic';
}
else if (compatMode == 'x86_64-v3') {
suffix = '';
}
else if (compatMode == 'aarch64') {
suffix = '-aarch64';
}
}
if ((process as any).surferPlatform == 'linux') {
if (compatMode == 'x86_64') {
suffix = '-generic';
}
else if (compatMode == 'x86_64-v3') {
suffix = '';
}
else if (compatMode == 'aarch64') {
suffix = '-aarch64';
}
}
if ((process as any).surferPlatform == 'darwin') {
if (compatMode == 'x86_64') {
suffix = '-generic';
}
else if (compatMode == 'aarch64') {
suffix = '';
}
}
const xmlPath = join(
DIST_DIR,
@ -176,17 +156,18 @@ async function writeUpdateFileToDisk(
function getTargets(): string[] {
if ((process as any).surferPlatform == 'win32') {
return ausPlatformsMap.windows
return compatMode == 'aarch64' ? ausPlatformsMap.winArm : ausPlatformsMap.win64;
}
if ((process as any).surferPlatform == 'linux') {
return ausPlatformsMap.linux
return compatMode == 'aarch64' ? ausPlatformsMap.linuxArm : ausPlatformsMap.linux64;
}
if ((process as any).surferPlatform == 'darwin') {
return ausPlatformsMap.macos
return compatMode == 'aarch64' ? ausPlatformsMap.macosArm : ausPlatformsMap.macosIntel;
}
return ausPlatformsMap.macos
log.error('Unknown platform')
return [];
}
export async function generateBrowserUpdateFiles() {