lists/start.sh

43 lines
810 B
Bash
Raw Permalink Normal View History

2025-02-04 12:48:13 +00:00
#!/bin/sh
2025-02-11 04:41:53 +00:00
if [ -d ./pkgs ]
then
rm -rf ./pkgs
fi
2025-02-04 12:48:13 +00:00
2025-02-11 09:18:36 +00:00
if [ -z "$AUTH_HOST" ]
then
export AUTH_HOST=eukara
fi
2025-02-04 12:48:13 +00:00
find ./ -type f -print | grep \\.decl | sort > tmplist1
cat tmplist1
TOTAL_PKGS=$(wc -l tmplist1)
COUNTER=0
cat tmplist1 | while read DECL
do
COUNTER=$((COUNTER+1))
./decl-to-pkg.sh "$DECL"
echo "($COUNTER/$TOTAL_PKGS) $DECL"
done
find ./pkgs/ -type f -print | grep \\.txt | sort > pkglists
cat pkglists | while read PKGLIST
do
OUTPUT="$(basename "$PKGLIST")"
echo "version 2" > tmplist0
cat "$PKGLIST" >> tmplist0
SIG=$(openssl dgst -sha512 -sign ./private-key.pem tmplist0 | openssl enc -A -base64)
2025-02-04 12:48:13 +00:00
head -n 1 tmplist0 > "$OUTPUT"
2025-02-11 05:31:42 +00:00
echo "signature \"$AUTH_HOST\" \"$SIG\"" >> "$OUTPUT"
2025-02-04 12:48:13 +00:00
tail -n +2 tmplist0 >> "$OUTPUT"
rm tmplist0
mv "$OUTPUT" "$PKGLIST"
done
rm tmplist1
rm pkglists