versioning suggestion

Michael E Brown <[email protected]>
Newsgroups gmane.linux.failsafe
Message-ID <[email protected]>
With the recent threads about who's RPMS are up to which versions, I have
a slight suggestion.

What I have done to fix this problem in the past is to have a few special
files in CVS called MAJOR-VERSION, MINOR-VERSION, and PATCHLEVEL. These
files contain numbers, and there is a special Makefile target for each of
them: increment_major, increment_minor, increment_patchlevel. Each of
these targets looks similar to this:

.PHONY: increment_major
patchlevel=$(shell head -n 1 PATCHLEVEL)
increment_patchlevel:
	cvs update PATCHLEVEL
	echo $$(( $(patchlevel) + 1 )) > PATCHLEVEL
	cvs commit -m "scripted auto-update of PATCHLEVEL by $$USER"

... cut other increment_* definitions ...

CFLAGS += -DMAJOR_VERSION=$(major_version)
CFLAGS += -DMINOR_VERSION=$(minor_version)
CFLAGS += -DPATCHLEVEL=$(patchlevel)

And then, (here is the beauty of the system...) you have a makefile target
called "release" or something like that which pulls this all together:


.PHONY: release
release:
	make increment_patchlevel
	#make rpms...
	#make tarballs...
	#make docs...
	# anything else that goes with a release...
	make increment_patchlevel

What this makefile fragment does is make sure that no two people will ever
build releases with identical version numbers. You might skip version
numbers, but nobody will ever really stomp on each other. And the best
thing, you can always tell who's RPMS are the freshest.

This system only every automatically increments the patchlevel. It is up
to the humans to increment the major and minor versions. But it does
provide a really convenient way to do this.

--
Michael
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.