summaryrefslogtreecommitdiffstats
path: root/resources/scripts/helpers/build/release
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2015-06-08 07:48:52 (EDT)
committer Francis Rowe <info@gluglug.org.uk>2015-06-08 07:48:52 (EDT)
commit2a0b3f33325ee1e30005e9f039a30eb7de621688 (patch)
tree6e638138abc62f32e5daab75eb7cfef709ef18bc /resources/scripts/helpers/build/release
parent5c6c9806f35878215e11b26c7e6d56357363778b (diff)
downloadlibreboot-2a0b3f33325ee1e30005e9f039a30eb7de621688.zip
libreboot-2a0b3f33325ee1e30005e9f039a30eb7de621688.tar.gz
libreboot-2a0b3f33325ee1e30005e9f039a30eb7de621688.tar.bz2
build/release/sha512sums: only create sums in ${versiondir}/
Diffstat (limited to 'resources/scripts/helpers/build/release')
-rwxr-xr-xresources/scripts/helpers/build/release/sha512sums21
1 files changed, 16 insertions, 5 deletions
diff --git a/resources/scripts/helpers/build/release/sha512sums b/resources/scripts/helpers/build/release/sha512sums
index 8bb1c26..ef02413 100755
--- a/resources/scripts/helpers/build/release/sha512sums
+++ b/resources/scripts/helpers/build/release/sha512sums
@@ -19,11 +19,22 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-# create sha512sum manifest
-cd release/
-printf "Creating manifest of SHA512 sums in sha512sum.txt...\n"
-for file in $(find -type f); do sha512sum $file >> sha512sum.txt; done
+version="$(git describe --tags HEAD)"
+versiondir="release/${version}"
+
+if [ ! -d "${versiondir}/" ]; then
+
+ printf "build/release/sha512sums: directory %s/ does not exist. You haven't generated any archives yet.\n" "${versiondir}"
+ exit 1
+
+fi
+
+# delete the old file
+rm -f "${versiondir}/sha512sum.txt"
+
+# create sha512sum file
+printf "Creating list of SHA512 sums in %s/sha512sum.txt...\n" "${versiondir}"
+(cd "${versiondir}/" && for file in $(find -type f); do sha512sum $file >> sha512sum.txt; done)
printf "...done.\n"
-cd ../
printf "\n"