mirror of
https://github.com/zen-browser/surfer.git
synced 2025-07-07 08:55:33 +02:00
✨ Include internal debug logs
This commit is contained in:
parent
09e0d3b3eb
commit
57cfc69f1c
5 changed files with 120 additions and 5 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -109,3 +109,6 @@ site/
|
|||
|
||||
docs/public/
|
||||
.gluon
|
||||
|
||||
# Patch generation
|
||||
.moz-central
|
||||
|
|
|
@ -16,4 +16,8 @@ yarn.lock
|
|||
.vscode/
|
||||
.github/
|
||||
.eslintrc.js
|
||||
jest.config.js
|
||||
jest.config.js
|
||||
|
||||
# Patch generation
|
||||
.moz-central
|
||||
patches.sh
|
57
patches.sh
Executable file
57
patches.sh
Executable file
|
@ -0,0 +1,57 @@
|
|||
#!/bin/sh
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
action=$1
|
||||
|
||||
# Make sure the user has specified the location of mozilla-central in their
|
||||
# environment. Some people (i.e. trickypr) prefer to clone it into other places
|
||||
if [ ! -f .moz-central ]
|
||||
then
|
||||
echo "Please make sure you specify the location of your checkout of `mozilla-central`"
|
||||
echo "inside of the `.moz-central` file."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mozilla_centeral_repo=$(cat .moz-central)
|
||||
last_patch=`exec ls -1 ./template/patches.optional | sed 's/-.*//g' | sort -n | tail -1`
|
||||
next_patch=`expr 1 + ${last_patch:=0}`
|
||||
root_pwd=$PWD
|
||||
|
||||
if [ $action = "import" ]
|
||||
then
|
||||
echo "Importing:"
|
||||
echo
|
||||
|
||||
cd $mozilla_centeral_repo
|
||||
for file in $root_pwd/template/patches.optional/*.patch
|
||||
do
|
||||
echo " $file..."
|
||||
# --forward is used to skip the patch if it has already been applied
|
||||
patch -p1 --forward < $file
|
||||
done
|
||||
|
||||
cd $root_pwd
|
||||
elif [ $action = "export" ]
|
||||
then
|
||||
if [ -x "$2" ]
|
||||
then
|
||||
echo "Please provide a file name. Usage: $0 $action <filename>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Exporting: ${@:2}"
|
||||
echo
|
||||
|
||||
cd $mozilla_centeral_repo
|
||||
git add ${@:2}
|
||||
git commit
|
||||
git format-patch --start-number $next_patch -1 -o $root_pwd/template/patches.optional
|
||||
cd $root_pwd
|
||||
else
|
||||
echo "Usage: $0 import|export"
|
||||
echo
|
||||
echo " import: Import all patches in ./template/patches.optional"
|
||||
echo " export: Exports a specific patch. Usage: $0 export <filename>"
|
||||
fi
|
|
@ -13,6 +13,7 @@ import { existsSync, writeFileSync } from 'fs'
|
|||
import { patchCountFile } from '../../middleware/patch-check'
|
||||
import { checkHash } from '../../utils'
|
||||
import { log } from '../../log'
|
||||
import { templateDir } from '../setupProject'
|
||||
|
||||
type ListrTaskGroup = Listr.ListrTask<unknown>
|
||||
|
||||
|
@ -95,8 +96,32 @@ function importGitPatch(): ListrTaskGroup {
|
|||
)
|
||||
}
|
||||
|
||||
export async function applyPatches(): Promise<void> {
|
||||
await new Listr([importMelonPatches(), importFolders(), importGitPatch()], {
|
||||
renderer: log.isDebug ? 'verbose' : 'default',
|
||||
}).run()
|
||||
function importInternalPatch(): ListrTaskGroup {
|
||||
const patches = sync('*.patch', {
|
||||
nodir: true,
|
||||
cwd: join(templateDir, 'patches.optional'),
|
||||
}).map((path) => ({
|
||||
name: path,
|
||||
path: join(templateDir, 'patches.optional', path),
|
||||
}))
|
||||
|
||||
return patchMethod<gitPatch.IGitPatch>(
|
||||
'gluon',
|
||||
patches,
|
||||
async (patch) => await gitPatch.apply(patch.path)
|
||||
)
|
||||
}
|
||||
|
||||
export async function applyPatches(): Promise<void> {
|
||||
await new Listr(
|
||||
[
|
||||
importInternalPatch(),
|
||||
importMelonPatches(),
|
||||
importFolders(),
|
||||
importGitPatch(),
|
||||
],
|
||||
{
|
||||
renderer: log.isDebug ? 'verbose' : 'default',
|
||||
}
|
||||
).run()
|
||||
}
|
||||
|
|
26
template/patches.optional/0001-Reduce-update-info.patch
Normal file
26
template/patches.optional/0001-Reduce-update-info.patch
Normal file
|
@ -0,0 +1,26 @@
|
|||
From d1a2aac4daffb822afcee499ee329304dd53a520 Mon Sep 17 00:00:00 2001
|
||||
From: trickypr <trickypr@icloud.com>
|
||||
Date: Thu, 23 Jun 2022 16:13:36 +1000
|
||||
Subject: [PATCH] Reduce update info
|
||||
|
||||
The default mozilla update config will send a bunch of unnessisary
|
||||
config to the update server, which just increases the complexity of the
|
||||
updates that gluon needs to generate.
|
||||
---
|
||||
build/application.ini.in | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/build/application.ini.in b/build/application.ini.in
|
||||
index 6df13230a4..797006c4ee 100644
|
||||
--- a/build/application.ini.in
|
||||
+++ b/build/application.ini.in
|
||||
@@ -52,5 +52,5 @@ ServerURL=@MOZ_CRASHREPORTER_URL@/submit?id=@MOZ_APP_ID@&version=@MOZ_APP_VERSIO
|
||||
|
||||
#if MOZ_UPDATER
|
||||
[AppUpdate]
|
||||
-URL=https://@MOZ_APPUPDATE_HOST@/update/6/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%SYSTEM_CAPABILITIES%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml
|
||||
+URL=http://@MOZ_APPUPDATE_HOST@/update/browser/%BUILD_TARGET%/%CHANNEL%/update.xml
|
||||
#endif
|
||||
--
|
||||
2.36.1
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue