1
0
Fork 0

Makefile: add git short hash suffix to mock devel builds

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
Jaroslav Škarvada 2015-06-08 16:42:10 +02:00
parent e27fdfdfea
commit 957922d3d7
2 changed files with 5 additions and 1 deletions

View file

@ -63,7 +63,9 @@ mock-build: srpm
rm -f mock-result-dir/*.log
mock-devel-build: srpm
mock -r $(MOCK_CONFIG) --with=snapshot --resultdir=`pwd`/mock-result-dir `ls rpm-build-dir/*$(RPM_VERSION).*.src.rpm | head -n 1`&& \
mock -r $(MOCK_CONFIG) --with=snapshot \
--define "git_short_commit `if [ -n \"$(GIT_SHORT_COMMIT)\" ]; then echo $(GIT_SHORT_COMMIT); else git rev-parse --short=8 --verify HEAD; fi`" \
--resultdir=`pwd`/mock-result-dir `ls rpm-build-dir/*$(RPM_VERSION).*.src.rpm | head -n 1` && \
rm -f mock-result-dir/*.log
createrepo: mock-devel-build

View file

@ -1,7 +1,9 @@
%bcond_with snapshot
%if %{with snapshot}
%if 0%{!?git_short_commit:1}
%global git_short_commit %(git rev-parse --short=8 --verify HEAD)
%endif
%global git_date %(date +'%Y%m%d')
%global git_suffix %{git_date}git%{git_short_commit}
%endif