rpmdist.mk: Add check_cvs_sync to build-on-version-diff

This commit is contained in:
Jan Lindemann 2007-08-22 12:31:14 +00:00 committed by Jan Lindemann
commit f7dd1540f4

View file

@ -139,10 +139,9 @@ update-repo.dist: upload.dist
# ------ hash stuff # ------ hash stuff
CHECK_CVS_STATUS_BEFORE_INCREASING_BUILD_NUMBER ?= true CHECK_CVS_SYNC_BEFORE_RPM_RELEAS ?= true
define increase_build_number define check_cvs_sync
if [ "$(CHECK_CVS_STATUS_BEFORE_INCREASING_BUILD_NUMBER)" = true ]; then \
echo + checking cvs ;\ echo + checking cvs ;\
cvs status > cvs_status.tmp 2>&1;\ cvs status > cvs_status.tmp 2>&1;\
if [ $$? != 0 ]; then \ if [ $$? != 0 ]; then \
@ -151,13 +150,18 @@ define increase_build_number
exit 1 ;\ exit 1 ;\
fi ;\ fi ;\
if grep -qi "locally modified" cvs_status.tmp; then \ if grep -qi "locally modified" cvs_status.tmp; then \
echo + tried to increase build number on cvs copy with locally modified files, giving up >&2 ;\ echo + cvs copy has locally modified files, giving up >&2 ;\
exit 1 ;\ exit 1 ;\
fi ;\ fi ;\
if grep -qi "needs" cvs_status.tmp; then \ if grep -qi "needs" cvs_status.tmp; then \
echo + tried to increase build number on out-of-date cvs copy, giving up >&2 ;\ echo + cvs copy is out-of-date, giving up >&2 ;\
exit 1 ;\ exit 1 ;\
fi ;\ fi
endef
define increase_build_number
if [ "$(CHECK_CVS_SYNC_BEFORE_RPM_RELEASE)" = true ]; then \
$(check_cvs_sync) ;\
fi ;\ fi ;\
echo $(MAJOR_MINOR_RELEASE)-$(shell expr $(BUILD_NUMBER) + 1)-dev | tee VERSION ;\ echo $(MAJOR_MINOR_RELEASE)-$(shell expr $(BUILD_NUMBER) + 1)-dev | tee VERSION ;\
echo $(HASH) > HASH ;\ echo $(HASH) > HASH ;\
@ -193,6 +197,7 @@ rpm-next-build:
rpm-release: rpm-update-release rpm-release: rpm-update-release
@if [ "$(VERSION)" != "$(LAST_RPM_VERSION)" ]; then \ @if [ "$(VERSION)" != "$(LAST_RPM_VERSION)" ]; then \
$(check_cvs_sync) ;\
echo "+ version doesn't match latest released rpm version, building a new release" ;\ echo "+ version doesn't match latest released rpm version, building a new release" ;\
make update-repo.dist || exit 1;\ make update-repo.dist || exit 1;\
cp VERSION LAST_RPM_VERSION ;\ cp VERSION LAST_RPM_VERSION ;\