40 lines
886 B
Bash
Executable File
40 lines
886 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
SOURCE_MANIFEST="SOURCE_MANIFEST.sha256"
|
|
FILE_MANIFEST="FILE_MANIFEST.sha256"
|
|
SOURCE_TMP="${SOURCE_MANIFEST}.tmp"
|
|
FILE_TMP="${FILE_MANIFEST}.tmp"
|
|
|
|
find . -type f \
|
|
! -path "./${SOURCE_MANIFEST}" \
|
|
! -path "./${SOURCE_TMP}" \
|
|
! -path "./${FILE_MANIFEST}" \
|
|
! -path "./${FILE_TMP}" \
|
|
! -path "./.git/*" \
|
|
! -path "./target/*" \
|
|
! -name '*.pyc' \
|
|
! -path '*/__pycache__/*' \
|
|
-print0 \
|
|
| sort -z \
|
|
| xargs -0 sha256sum > "$SOURCE_TMP"
|
|
|
|
mv "$SOURCE_TMP" "$SOURCE_MANIFEST"
|
|
sha256sum -c "$SOURCE_MANIFEST"
|
|
|
|
find . -type f \
|
|
! -path "./${FILE_MANIFEST}" \
|
|
! -path "./${FILE_TMP}" \
|
|
! -path "./.git/*" \
|
|
! -path "./target/*" \
|
|
! -name '*.pyc' \
|
|
! -path '*/__pycache__/*' \
|
|
-print0 \
|
|
| sort -z \
|
|
| xargs -0 sha256sum > "$FILE_TMP"
|
|
|
|
mv "$FILE_TMP" "$FILE_MANIFEST"
|
|
sha256sum -c "$FILE_MANIFEST"
|