Makefile: add git short hash suffix to mock devel builds
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
parent
e27fdfdfea
commit
957922d3d7
2 changed files with 5 additions and 1 deletions
4
Makefile
4
Makefile
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue