Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.3.0
hooks:
- id: check-merge-conflict
- id: check-symlinks
Expand All @@ -14,15 +14,15 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/fsfe/reuse-tool
rev: v0.12.1
rev: v1.0.0
hooks:
- id: reuse
- repo: https://github.com/psf/black
rev: 21.5b1
rev: 22.8.0
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
- repo: https://github.com/markdownlint/markdownlint
Expand Down
10 changes: 7 additions & 3 deletions bin/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,19 @@ def set_readonly(path):
subprocess.run(["b2sum", *files_list], stdout=tmpf, check=True)
subprocess.run(
["gpg", "-as", "--clearsign", "-u", KEYID, "-o", checksum_path, tmpf.name],
check=True
check=True,
)
set_readonly(checksum_path)
set_readonly(".")

# Create encrypted tarball
tarball_path = os.path.join(out_dir, f"{IDENT}.archive")
with tempfile.NamedTemporaryFile(dir=out_dir) as tmpf:
subprocess.run(["tar", "-c", "--zstd", "B2SUMS", *files_list], stdout=tmpf, check=True)
subprocess.run(["gpg", "-e", "-r", KEYID, "-o", tarball_path, tmpf.name], check=True)
subprocess.run(
["tar", "-c", "--zstd", "B2SUMS", *files_list], stdout=tmpf, check=True
)
subprocess.run(
["gpg", "-e", "-r", KEYID, "-o", tarball_path, tmpf.name], check=True
)
set_readonly(tarball_path)
print(f"Encrypted archive: {tarball_path}")