Updated README to include new marker type

This commit is contained in:
Internet Addict 2025-04-09 18:37:20 +00:00
parent 30881f4710
commit bb0c18a531

View file

@ -75,7 +75,7 @@ Here are the details of each parameter used in the patching system:
Note: *Type will fallback to t:standard when no type is specified.*
2. **`pref`:** Indicates that the patch is modifying preference settings (e.g., Firefox `prefs.js`).
- When `t:pref` is specified, the script will search for existing preferences in the input file and replace them with the new ones provided in the patch. If not found, it will add the new preference.
- When `t:pref` is specified, the script will search for existing preferences in the input file and replace them with the new ones provided in the patch. If a preference is not found, it will be added to the end of the file.
- **Example:**
```patch
t:pref
@ -101,6 +101,22 @@ Here are the details of each parameter used in the patching system:
i:/patcher/pre-compile-patches/branding
o:/browser/branding/official
```
5. **`marker`:** Modifies a file relative to a specific marker line.
- A line starting with # defines the marker.
- Lines starting with + are inserted immediately after the marker.
- Lines starting with - are removed from the file (after the marker).
- **Example:**
```patch
t:marker
i:/browser/locales/en-US/firefox-l10n.js
o:/browser/locales/en-US/firefox-l10n.js
#static const RedirEntry kRedirMap[] =
+ {"store", "http://localhost:20351/",
+ nsIAboutModule::ALLOW_SCRIPT |
+ nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
+ nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS},
```
### Example Patch Files
@ -109,7 +125,6 @@ t:pref
i:/browser/firefox.js
o:/browser/spitfire.js
-pref("browser.privatebrowsing.autostart", false);
+pref("browser.privatebrowsing.autostart", true);
```
@ -131,13 +146,14 @@ o:/browser/branding/official/new-file.txt
### Summary of Parameters
| Parameter | Required | Purpose | Example |
| ----------- | ---------- | ------------------------------------- | ------------------------------------- |
| `i:` | Yes | Specifies the input file path. | `i:/browser/app/profile/firefox.js` |
| `o:` | Yes | Specifies the output file path. | `o:/browser/app/profile/firefox.js` |
| `t:` | No | Defines the type of patch. | `t:pref`, `t:standard`, `t:new`, or `t:move` |
| `+` | Yes | Adds a line to the output file. | `+MOZ_APP_DISPLAYNAME=Spitfire` |
| `-` | Yes | Removes a line from the input file. | `-MOZ_APP_DISPLAYNAME=Firefox` |
| Parameter | Purpose | Example |
| ----------- | ------------------------------------- | ------------------------------------- |
| `i:` | Specifies the input file path. | `i:/browser/app/profile/firefox.js` |
| `o:` | Specifies the output file path. | `o:/browser/app/profile/firefox.js` |
| `t:` | Defines the type of patch. | `t:pref`, `t:standard`, `t:new`, `t:marker` |
| `+` | Adds a line to the output file. | `+MOZ_APP_DISPLAYNAME=Spitfire` |
| `-` | Removes a line from the input file. | `-MOZ_APP_DISPLAYNAME=Firefox` |
| `#` | Marks a reference line for insertion (used in `marker` type). | `# 'settings',` |
### Workflow