Tweaks to support 32- and 64-bit VMs better
[training-lab.git] / scripts / generate_MANIFEST
1 #!/bin/sh
2 #
3 # generate_MANIFEST
4 #
5 # Simple helper script. Generate a MANIFEST file for stuff to
6 # download. Each line is a file, described in the format:
7 #
8 # <FILENAME>:<MODE>:<BYTES>:<SHA256>
9 #
10 # Apart from the MANIFEST itself, all files offered up for download
11 # should be compressed with gzip. In each case, the runtime script
12 # will download $FILENAME.gz, decompress it and then validate the
13 # checksum
14
15 for FILENAME in $@; do
16     MODE=$(stat -c%a $FILENAME)
17     SHA_FILE=$(sha256sum $FILENAME | awk '{print $1}')
18     SIZE_FILE=$(stat -c%s $FILENAME)
19     echo "$FILENAME:$MODE:$SIZE_FILE:$SHA_FILE"
20 done