diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2016-08-17 22:58:15 +0200 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2016-08-17 22:58:15 +0200 |
commit | 35d858363a88f1d985ba36cf0e18de6ab0ccfcd1 (patch) | |
tree | 611e856f77effc512aaa317137039bcb9f49060e /.bash_utils/distr.sh | |
parent | move Windows-specific stuff to .appdata/ (diff) | |
download | linux-home-35d858363a88f1d985ba36cf0e18de6ab0ccfcd1.tar.gz linux-home-35d858363a88f1d985ba36cf0e18de6ab0ccfcd1.zip |
move .bashrc_* to .bash_utils/
Diffstat (limited to '.bash_utils/distr.sh')
-rw-r--r-- | .bash_utils/distr.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/.bash_utils/distr.sh b/.bash_utils/distr.sh new file mode 100644 index 0000000..8e7b84c --- /dev/null +++ b/.bash_utils/distr.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +# Copyright (c) 2016 Egor Tensin <Egor.Tensin@gmail.com> +# This file is part of the "Cygwin configuration files" project. +# For details, see https://github.com/egor-tensin/cygwin-home. +# Distributed under the MIT License. + +readonly checksums_path='sha1sums.txt' + +update_checksums() { + sha1sum -- "$@" > "$checksums_path" +} + +update_checksums_distr() ( + set -o errexit -o nounset -o pipefail + + local -a paths + local path + + while IFS= read -d '' -r path; do + paths+=("$path") + done < <( find . -type f -\( -iname '*.exe' -o -iname '*.iso' -\) -print0 ) + + update_checksums "${paths[@]+"${paths[@]}"}" +) + +verify_checksums() { + sha1sum --check "$checksums_path" +} |