chore: initialize Calculet NPU research archive
This commit is contained in:
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
if [ "$#" -ne 2 ]; then
|
||||
echo "usage: $0 BUNDLE DESTINATION" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
bundle=$1
|
||||
destination=$2
|
||||
|
||||
git bundle verify "$bundle"
|
||||
git clone "$bundle" "$destination"
|
||||
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
repo_root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
output_dir=${1:-"$repo_root/reassembled"}
|
||||
|
||||
mkdir -p "$output_dir"
|
||||
|
||||
find "$repo_root/archives" -mindepth 1 -maxdepth 1 -type d -name '*.parts' -print | sort |
|
||||
while IFS= read -r parts_dir; do
|
||||
archive_name=$(basename "$parts_dir" .parts)
|
||||
destination="$output_dir/$archive_name"
|
||||
echo "Reassembling $archive_name"
|
||||
find "$parts_dir" -type f -name 'part-*' -print | sort | xargs cat > "$destination"
|
||||
done
|
||||
|
||||
for archive in "$repo_root"/archives/*; do
|
||||
if [ -f "$archive" ]; then
|
||||
archive_name=$(basename "$archive")
|
||||
[ -e "$output_dir/$archive_name" ] || ln -s "$archive" "$output_dir/$archive_name"
|
||||
fi
|
||||
done
|
||||
|
||||
(cd "$output_dir" && shasum -a 256 -c "$repo_root/checksums/main-archives.sha256")
|
||||
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
repo_root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
|
||||
cd "$repo_root"
|
||||
git lfs fsck
|
||||
shasum -a 256 -c checksums/published-files.sha256
|
||||
shasum -a 256 -c checksums/archive-parts.sha256
|
||||
awk '
|
||||
NR == FNR { expected[$2] = $1; next }
|
||||
!($2 in expected) || expected[$2] != $1 { bad = 1 }
|
||||
{ delete expected[$2] }
|
||||
END {
|
||||
for (name in expected) bad = 1
|
||||
exit bad
|
||||
}
|
||||
' checksums/main-archives.sha256 checksums/reassembled-archives.sha256
|
||||
|
||||
echo "Repository files and LFS objects verified."
|
||||
echo "Run ./scripts/reassemble-archives.sh /path/to/output for whole-archive verification."
|
||||
Reference in New Issue
Block a user