diff options
author | Patrick Eigensatz | 2018-02-13 16:51:45 +0100 |
---|---|---|
committer | Patrick Eigensatz | 2018-02-13 16:53:43 +0100 |
commit | 692a0a5da49ee318c39f425c726e448450e4edb9 (patch) | |
tree | 3a70ba6ee232a627311b596e31dfb84accbcd563 | |
parent | f1f7ea662782ef92cbf629e96961cc633daa4894 (diff) | |
download | aur-692a0a5da49ee318c39f425c726e448450e4edb9.tar.gz |
prepare_release.sh: A script to compare the GitHub distributed file with the original sources...
... and get the correct sha256sum of the distributed .tar.gz
-rwxr-xr-x | prepare_release.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/prepare_release.sh b/prepare_release.sh new file mode 100755 index 000000000000..ad140d487da2 --- /dev/null +++ b/prepare_release.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# Script to get the correct sha256sum of +# GitHub's released .tar.gz + +VERSION=0.5 + +DOWNLOAD_SRC="https://github.com/pentix/qjournalctl/archive/v$VERSION.tar.gz" +ORIGINAL_PATH="/path/to/src/qjournalctl" +TMP_DIR="/tmp" +SHA256SUMS=$(mktemp) + + +# Collect SHA256 sums of files in git +cd $ORIGINAL_PATH +git ls-tree -r master --name-only | xargs sha256sum > $SHA256SUMS + +# Download release version +cd $TMP_DIR +wget $DOWNLOAD_SRC > /dev/null 2>&1 + +# Extract... +tar xzf v$VERSION.tar.gz +cd qjournalctl-$VERSION + +# ...and compare the sums +sha256sum --check < $SHA256SUMS + +if [ $? -eq 0 ] +then + HASH=$(sha256sum $TMP_DIR/v$VERSION.tar.gz) + echo -e "\n\n[OK] $HASH" + rm "$TMP_DIR/v$VERSION.tar.gz" +else + echo -e "\n\n[ERROR] Problems verifying the .tar.gz contents" + echo -e "\n\n[WARN] Did not delete $TMP_DIR/v$VERSION.tar.gz" + exit 1 +fi + |