Просмотр исходного кода

rewrite the +CVS thingy to better support snapshots

Torbjorn Svensson 20 лет назад
Родитель
Сommit
60220810f3
4 измененных файлов с 14 добавлено и 4 удалено
  1. 10 1
      Makefile
  2. 2 1
      docs/Changelog
  3. 1 1
      docs/Makefile
  4. 1 1
      modules/Pisg.pm

+ 10 - 1
Makefile

@@ -3,7 +3,14 @@
 all: release
 all: release
 
 
 # Ugly hack to get the version number from Pisg.pm
 # Ugly hack to get the version number from Pisg.pm
-VERSION := $(shell grep "version =>" modules/Pisg.pm | sed 's/[^"]*"\([^"]*\)".*/\1/')
+VER = $(shell grep "version =>" modules/Pisg.pm | sed 's/[^"]*"\([^"]*\)+CVS".*/\1/')
+
+# append +CVS.. if SNAPSHOT is defined
+ifeq ($(SNAPSHOT),)
+	VERSION = $(VER)
+else
+	VERSION = $(VER)+CVS_$(shell date +%Y%m%d)
+endif
 
 
 DIRNAME = pisg-$(VERSION)
 DIRNAME = pisg-$(VERSION)
 
 
@@ -140,6 +147,8 @@ release: docs
 	cp $(PARSER_MODULES) $(DIRNAME)/$(MODULESDIR)/Pisg/Parser
 	cp $(PARSER_MODULES) $(DIRNAME)/$(MODULESDIR)/Pisg/Parser
 	cp $(FORMAT_MODULES) $(DIRNAME)/$(MODULESDIR)/Pisg/Parser/Format
 	cp $(FORMAT_MODULES) $(DIRNAME)/$(MODULESDIR)/Pisg/Parser/Format
 
 
+	perl -i -pe 's/^(.*version => ")[^"]*(".*)/$${1}$(VERSION)$${2}/' $(DIRNAME)/$(MODULESDIR)/Pisg.pm
+
 	tar zcfv newrelease/$(TARFILE) $(DIRNAME)
 	tar zcfv newrelease/$(TARFILE) $(DIRNAME)
 	zip -r pisg $(DIRNAME)
 	zip -r pisg $(DIRNAME)
 	mv pisg.zip newrelease/$(ZIPFILE)
 	mv pisg.zip newrelease/$(ZIPFILE)

+ 2 - 1
docs/Changelog

@@ -36,7 +36,8 @@ pisg (0.69) - ??
      + Fix Makefile to support the +CVS string and include it in releasename
      + Fix Makefile to support the +CVS string and include it in releasename
      + Fix charts to not include "NULL" tracks. 
      + Fix charts to not include "NULL" tracks. 
    * Features:
    * Features:
-     + Add "+CVS" to versionstring if ./CVS is found
+     + Add "+CVS" to versionstring and remove it in Makefile when running
+       'make release'. This makes snapshot easier.
    * Parsers:
    * Parsers:
      + Add support for both the 1.0.5(stable) and the 1.1.0(devel) log format 
      + Add support for both the 1.0.5(stable) and the 1.1.0(devel) log format 
        of dircproxy.
        of dircproxy.

+ 1 - 1
docs/Makefile

@@ -1,6 +1,6 @@
 all: pisg-doc.txt pisg-doc.html pisg.1
 all: pisg-doc.txt pisg-doc.html pisg.1
 
 
-VERSION := $(shell grep "version =>" ../modules/Pisg.pm | sed 's/[^"]*"\([^"]*\)".*/\1/')
+VERSION := $(shell grep "version =>" ../modules/Pisg.pm | sed 's/[^"]*"\([^"]*\)+CVS".*/\1/')
 
 
 pisg-doc.xml: .version
 pisg-doc.xml: .version
 .version: ../modules/Pisg.pm
 .version: ../modules/Pisg.pm

+ 1 - 1
modules/Pisg.pm

@@ -219,7 +219,7 @@ sub get_default_config_settings
         modules_dir => '',         # set in get_cmdline_options
         modules_dir => '',         # set in get_cmdline_options
         cchannels => '',           # set in get_cmdline_options
         cchannels => '',           # set in get_cmdline_options
 
 
-        version => "0.68" . (-d "$self->{search_path}/CVS" ? '+CVS' : ''),
+        version => "0.68+CVS",
     };
     };
 
 
     # This enables us to use the search_path in other modules
     # This enables us to use the search_path in other modules