Tamarin/hooks/07-bump-package-version-prebuild

16 lines
461 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
source "${TAMARIN_UTIL}"
if [ ! -f debian/changelog ] || [ ! -d .git ]; then
info "To auto calculate the package version suffix, we need a git environment and a existing changelog !"
exit
fi
commit_count=$(git rev-list --count --first-parent HEAD)
current_commit=$(git log -n 1 --pretty=format:"%h")
version_suffix=tamarin${commit_count}~${current_commit}
sed "0,/(\(.*\))/s/(\(.*\))/(\1-${version_suffix})/" debian/changelog
exit 1