-
Notifications
You must be signed in to change notification settings - Fork 1
/
generate-apt.sh
executable file
·32 lines (30 loc) · 1 KB
/
generate-apt.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
set -euo pipefail
PATH_TO_READ="${1}"
RELEASE="${2}"
cat <<EOF
Origin: Northwood Labs Repository
Suite: ${RELEASE}
Version: 1.0
Codename: stable
Date: $(date -Ru || true)
Acquire-By-Hash: yes
Architectures: amd64 arm64 all
Components: main
Description: Northwood Labs Repository
EOF
echo "MD5Sum:"
# shellcheck disable=2016
find "${PATH_TO_READ}" -type f -name "Packages*" -print0 | xargs -0 -I% bash -c '
echo " $(md5sum "%" | cut --delimiter=" " --fields=1) $(wc --bytes "%" | sed -r "s,/s3/apt/dists/([^/]+)/,,")"
'
echo "SHA1:"
# shellcheck disable=2016
find "${PATH_TO_READ}" -type f -name "Packages*" -print0 | xargs -0 -I% bash -c '
echo " $(sha1sum "%" | cut --delimiter=" " --fields=1) $(wc --bytes "%" | sed -r "s,/s3/apt/dists/([^/]+)/,,")"
'
echo "SHA256:"
# shellcheck disable=2016
find "${PATH_TO_READ}" -type f -name "Packages*" -print0 | xargs -0 -I% bash -c '
echo " $(sha256sum "%" | cut --delimiter=" " --fields=1) $(wc --bytes "%" | sed -r "s,/s3/apt/dists/([^/]+)/,,")"
'