DRSProjects

DocsParbit

Parbit documentation

Development

The two versions are kept in step, function by function, and share the on-disk format described in How it works. A change to one goes into the other,

Layout

Path
parbit.sh the Linux version: a single bash script, no dependencies beyond par2 and GNU tools
parbit.ps1, parbit.bat the Windows version (PowerShell 5.1+) and its launcher
bin/par2.exe par2cmdline for Windows, unmodified (provenance)
tests.sh, tests.ps1 end-to-end tests
tests/fixture-linux/ parity made by parbit.sh, checked by tests.ps1
tests/fixture-windows/ parity made by parbit.ps1, checked by tests.sh (once exported)
make-release.sh builds the release packages

The two versions are kept in step, function by function, and share the on-disk format described in How it works. A change to one goes into the other, with a test in both suites.

Tests

The tests run the real scripts with real par2 in temporary folders, simulating bit rot by overwriting bytes while keeping size and timestamp.

./tests.sh               # Linux: all tests
./tests.sh rename        # only tests whose name contains "rename"
powershell -ExecutionPolicy Bypass -File tests.ps1            # Windows
powershell -ExecutionPolicy Bypass -File tests.ps1 rename
powershell -ExecutionPolicy Bypass -File tests.ps1 -Export    # also write tests\fixture-windows

Cross-system compatibility is tested both ways. tests.ps1 verifies and repairs the Linux-made parity in tests/fixture-linux. tests.ps1 -Export writes Windows-made parity to tests/fixture-windows, which ./tests.sh fixture verifies and repairs on Linux. Both fixtures include a file in a folder with spaces and a file renamed after protection.

Releases

Linux and Windows are released separately from the same commit:

Tag Package
Linux v<version> Parbit-<version>-linux.tar.gz
Windows v<version>-windows Parbit-<version>-windows.zip + par2cmdline source
  1. Update VERSION in parbit.sh and parbit.ps1, and CHANGELOG.md.
  2. Commit. ./make-release.sh refuses to build from uncommitted changes, checks that both versions match, runs tests.sh, and writes the packages, SHA256SUMS and release notes to dist/.
  3. Run tests.ps1 on Windows.
  4. Tag and publish both releases with the files from dist/, as the script prints.

Updating par2.exe

Download the win-x64 zip from the par2cmdline releases, check it against the release's checksums.sha512, replace bin/par2.exe, and update the version, checksums and source URL in bin/README.txt, LICENSE and make-release.sh (the GPL requires shipping the matching source with the Windows package).

Edit this page on GitHub