Last active
December 29, 2021 12:05
-
-
Save alkavan/2d0f280cfee5dee1222ad32400484190 to your computer and use it in GitHub Desktop.
Generate Debian Release File (stretch)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
do_hash() { | |
HASH_NAME=$1 | |
HASH_CMD=$2 | |
echo "${HASH_NAME}:" | |
for f in $(find -type f); do | |
f=$(echo $f | cut -c3-) # remove ./ prefix | |
if [ "$f" = "Release" ]; then | |
continue | |
fi | |
echo " $(${HASH_CMD} ${f} | cut -d" " -f1) $(wc -c $f)" | |
done | |
} | |
cat << EOF | |
Origin: Example Repository | |
Label: Example | |
Suite: stable | |
Codename: stretch | |
Version: 1.0 | |
Architectures: armhf | |
Components: main | |
Description: An example armhf package repository | |
Date: $(date -Ru) | |
EOF | |
do_hash "MD5Sum" "md5sum" | |
do_hash "SHA1" "sha1sum" | |
do_hash "SHA256" "sha256sum" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment