From: Michael Vrable Date: Wed, 8 Aug 2007 23:41:06 +0000 (-0700) Subject: Extract the version number from NEWS if git-describe is not available. X-Git-Url: http://git.vrable.net/?p=cumulus.git;a=commitdiff_plain;h=98d72e33a0c677ba638c599f9739cb929496f9b9;hp=e43854eb2fa6853b6faebfbeee4b22ce1ff24331 Extract the version number from NEWS if git-describe is not available. This should allow building from tarballs (not the git version), and still correctly fill in the version number (so it can be incorporated into generated files). If git-describe does not return a value, the first word from the NEWS file is taken as the version number. --- diff --git a/Makefile b/Makefile index 0363f14..854be80 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,8 @@ OBJS=$(SRCS:.cc=.o) lbs : $(OBJS) $(CXX) $(LDFLAGS) -o $@ $^ -version : - (git-describe || echo "Unknown") >version +version : NEWS + (git-describe || (head -n1 NEWS | cut -d" " -f1)) >version $(OBJS) : version clean : diff --git a/NEWS b/NEWS index e7defe8..f1e2af9 100644 --- a/NEWS +++ b/NEWS @@ -11,7 +11,7 @@ UNRELEASED - Bugfix: Print a help message instead of crashing if no files are specified. -version 0.2.2 [2007-07-27] +0.2.2 [2007-07-27] - Update reference restore.pl script to handle octal/hexadecimal (format change introduced in 0.2). - Better support for mixing multiple backup schemes: the statcache @@ -19,11 +19,11 @@ version 0.2.2 [2007-07-27] where multiple different backups (of different source directories) are made, all sharing the same local database directory. -version 0.2.1 [2007-07-20] +0.2.1 [2007-07-20] - Bugfix: Do not print an error when only one directory is specified to back up. -version 0.2 [2007-07-20] +0.2 [2007-07-20] - SNAPSHOT FORMAT CHANGE: Metadata logs in backups can now contain octal and hexadecimal values. Old restore programs may not be able to read these new backups. The reference restore.pl script @@ -37,5 +37,5 @@ version 0.2 [2007-07-20] - Device major/minor numbers are dumped for block and character devices. -version 0.1 [2007-07-14] +0.1 [2007-07-14] - Initial release.