-
-
Notifications
You must be signed in to change notification settings - Fork 1
how it works
CyberPatchMaker creates delta patches by comparing directory trees and storing full file replacements for changed files.
Every file in the version directory is recursively discovered and hashed with SHA-256. The scanner respects .cyberignore patterns and excludes backup.cyberpatcher/.
A JSON manifest records every file's relative path, size, checksum, and the key file used for version identification.
Source and target manifests are compared to identify added, modified, and deleted files and directories.
For each modified or added file, the full file content is read and stored in the patch. All operations (add/modify/delete files, add/delete directories) are serialized into a compressed JSON file.
The patch JSON is stream-encoded and compressed (zstd by default, configurable levels 1-4) for distribution.
- Load and decompress patch file
- Pre-verify: check key file and all required file hashes match expected source version
-
Create selective backup of files being modified/deleted to
backup.cyberpatcher/ - Apply operations: add new files/directories, replace modified files, delete removed files/directories
- Post-verify: check key file and modified files match expected target version
- On failure: automatic rollback from backup restores original state
- Wrong version detection: key file hash mismatch prevents applying patch to wrong version
- Corruption detection: any modified file in source is caught before changes begin
- Atomic operations: all-or-nothing with automatic rollback on any failure
- Selective backup: only changed files backed up, preserved after success for manual rollback
- Scanning: O(n) where n = number of files
- Typical patch size: 2-20MB for a 5GB application with small changes
- Compression reduces size by ~60% on average