feat: add script to update patches (#1138)

This commit is contained in:
Baptiste Augrain 2022-06-20 10:34:50 +02:00 committed by GitHub
parent 55d502d659
commit 3fa8eee9fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 3 deletions

21
build/update_patches.sh Executable file
View file

@ -0,0 +1,21 @@
#!/bin/bash
cd vscode || { echo "'vscode' dir not found"; exit 1; }
git add .
git reset -q --hard HEAD
for file in ../patches/*.patch; do
if [ -f "${file}" ]; then
echo applying patch: "${file}"
git apply --ignore-whitespace "${file}"
if [ $? -ne 0 ]; then
echo failed to apply patch "${file}"
git apply --reject "${file}"
read -p "Press any key when the conflict have been resolved..." -n1 -s
git diff > "${file}"
fi
git add .
git reset -q --hard HEAD
fi
done

View file

@ -8,7 +8,11 @@
- [Windows](#dependencies-windows)
- [Build Scripts](#build-scripts)
- [Build in Docker](#build-docker)
- [X64](#build-docker-x64)
- [ARM 32bits](#build-docker-arm32)
- [Patch Update Process](#patch-update-process)
- [Semi-Automated](#patch-update-process-semiauto)
- [Manual](#patch-update-process-manual)
## <a id="dependencies"></a>Dependencies
@ -55,7 +59,7 @@ Each platform has its build helper script in the directory `build`.
To build for Linux, you can alternatively build VSCodium in docker
### X64
### <a id="build-docker-x64"></a>X64
Firstly, create the container with:
```
@ -80,7 +84,7 @@ export VSCODE_ARCH=x64
./build.sh
```
### ARM 32bits
### <a id="build-docker-arm32"></a>ARM 32bits
Firstly, create the container with:
```
@ -107,8 +111,20 @@ export npm_config_force_process_config="true"
## <a id="patch-update-process"></a>Patch Update Process
## <a id="patch-update-process-semiauto"></a>Semi-Automated
- run `./build/build_<os>.sh`, if a patch is failing then,
- open vscode directory in vscodium
- run `./build/update_patches.sh`
- when the script pause at `Press any key when the conflict have been resolved...`, open `vscode` directory in **VSCodium**
- fix all the `*.rej` files
- run `yarn watch`
- run `./script/code.sh` until everything ok
- press any key to continue the script `update_patches.sh`
## <a id="patch-update-process-manual"></a>Manual
- run `./build/build_<os>.sh`, if a patch is failing then,
- open `vscode` directory in **VSCodium**
- revert all changes
- run `git apply --reject ../patches/<name>.patch`
- fix all the `*.rej` files