POC fonctionnel
This commit is contained in:
25
hooks/prebuild/debian/add-package-version-suffix
Executable file
25
hooks/prebuild/debian/add-package-version-suffix
Executable file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cd src
|
||||
|
||||
if [ ! -f debian/changelog ]; then
|
||||
tamarin_info "No changelog. Skipping..."
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ $(tamarin_db get no_version_suffix 'no') == 'yes' ]; then
|
||||
tamarin_info "Not adding version suffix."
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ -d .git ]; then
|
||||
tamarin_info "It seems to be a Git repository. Generating version suffix based on Git history..."
|
||||
commit_count=$(git rev-list --count HEAD)
|
||||
current_commit=$(git log -n 1 --pretty=format:"%h")
|
||||
version_suffix=tamarin${commit_count}~${current_commit}
|
||||
else
|
||||
tamarin_info "Not a Git project. Fallback to timestamp for suffix generation..."
|
||||
version_suffix=tamarin$(date +%Y%m%d%H%M)
|
||||
fi
|
||||
|
||||
sed -i "0,/(\(.*\))/s/(\(.*\))/(\1${version_suffix})/" debian/changelog
|
Reference in New Issue
Block a user