diff --git a/make/rpmdist.mk b/make/rpmdist.mk index b5712e02..a07e1a1d 100644 --- a/make/rpmdist.mk +++ b/make/rpmdist.mk @@ -139,25 +139,29 @@ update-repo.dist: upload.dist # ------ hash stuff -CHECK_CVS_STATUS_BEFORE_INCREASING_BUILD_NUMBER ?= true +CHECK_CVS_SYNC_BEFORE_RPM_RELEAS ?= true + +define check_cvs_sync + echo + checking cvs ;\ + cvs status > cvs_status.tmp 2>&1;\ + if [ $$? != 0 ]; then \ + cat cvs_status.tmp ;\ + echo -e "\n======== cvs status failed, giving up." >&2 ;\ + exit 1 ;\ + fi ;\ + if grep -qi "locally modified" cvs_status.tmp; then \ + echo + cvs copy has locally modified files, giving up >&2 ;\ + exit 1 ;\ + fi ;\ + if grep -qi "needs" cvs_status.tmp; then \ + echo + cvs copy is out-of-date, giving up >&2 ;\ + exit 1 ;\ + fi +endef define increase_build_number - if [ "$(CHECK_CVS_STATUS_BEFORE_INCREASING_BUILD_NUMBER)" = true ]; then \ - echo + checking cvs ;\ - cvs status > cvs_status.tmp 2>&1;\ - if [ $$? != 0 ]; then \ - cat cvs_status.tmp ;\ - echo -e "\n======== cvs status failed, giving up." >&2 ;\ - exit 1 ;\ - fi ;\ - 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 ;\ - exit 1 ;\ - fi ;\ - if grep -qi "needs" cvs_status.tmp; then \ - echo + tried to increase build number on out-of-date cvs copy, giving up >&2 ;\ - exit 1 ;\ - fi ;\ + if [ "$(CHECK_CVS_SYNC_BEFORE_RPM_RELEASE)" = true ]; then \ + $(check_cvs_sync) ;\ fi ;\ echo $(MAJOR_MINOR_RELEASE)-$(shell expr $(BUILD_NUMBER) + 1)-dev | tee VERSION ;\ echo $(HASH) > HASH ;\ @@ -193,6 +197,7 @@ rpm-next-build: rpm-release: rpm-update-release @if [ "$(VERSION)" != "$(LAST_RPM_VERSION)" ]; then \ + $(check_cvs_sync) ;\ echo "+ version doesn't match latest released rpm version, building a new release" ;\ make update-repo.dist || exit 1;\ cp VERSION LAST_RPM_VERSION ;\