From d5e014a3db0459e093cbef18589f8916deb5ad8a Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Thu, 3 Oct 2013 18:55:13 +0200 Subject: build-snapshot: Don't rebuild existing snapshots Build snapshot only once if multiple branches point(ed) to the same commit. diff --git a/bin/build-snapshot b/bin/build-snapshot index 18777a5..651edd7 100755 --- a/bin/build-snapshot +++ b/bin/build-snapshot @@ -42,11 +42,14 @@ create_snapshot() version=$(git describe --abbrev=4 'HEAD' | sed 's/release-//') tarball="nagios-plugins-$version.tar.gz" symlink="nagios-plugins-$branch.tar.gz" - make_dist "$version" - cp "$tarball" "$snapshot_dir" - git reset --quiet --hard - git clean --quiet --force -d -x + if [ ! -e "$snapshot_dir/$tarball" ] + then + make_dist "$version" + cp "$tarball" "$snapshot_dir" + git reset --quiet --hard + git clean --quiet --force -d -x + fi cd "$snapshot_dir" test -e "$tarball.sha1" || shasum -a 1 -b "$tarball" >"$tarball.sha1" ln -s -f "$tarball" "$symlink" -- cgit v0.10-9-g596f