Skip to content

Commit

Permalink
Made -prerelease flag in VERSION independent of git access.
Browse files Browse the repository at this point in the history
Also removed prerelease boolean in BUILD_INFO. Users should use
VERSION.prerelease == "" to test for that instead.
  • Loading branch information
ivarne committed Nov 20, 2013
1 parent 8d44c8e commit 61260ad
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.0
0.3.0-prerelease
3 changes: 0 additions & 3 deletions base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ git_branch = $(shell git branch 2>/dev/null | sed -n '/\* /s///p')

last_tag = $(shell git describe --tags --abbrev=0 2>/dev/null)
tagged_commit = $(shell [ $$(git describe --tags --exact-match 2>/dev/null) ] && echo true || echo false)
prerelease = $(shell [ -z "$(last_tag)" -o "$(last_tag)" = "v$(version_string)" ] && echo false || echo true)

origin = $(shell [ -d ../.git/refs/remotes/origin ] && echo "origin/")

Expand Down Expand Up @@ -78,7 +77,6 @@ endif
@echo " branch::String" >> $@
@echo " build_number::Int" >> $@
@echo " date_string::String" >> $@
@echo " prerelease::Bool" >> $@
@echo " tagged_commit::Bool" >> $@
@echo " fork_master_distance::Int" >> $@
@echo " fork_master_timestamp::Int" >> $@
Expand All @@ -93,7 +91,6 @@ endif
'\"$(git_branch)\"', \
$(build_number), \
'\"$(date_string)\"', \
$(prerelease), \
$(tagged_commit), \
$(fork_master_distance), \
$(fork_master_timestamp), \
Expand Down
3 changes: 1 addition & 2 deletions base/version.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,9 @@ end

begin
# Include build number if we've got at least some distance from a tag (e.g. a release)
prerelease = BUILD_INFO.prerelease ? "-prerelease" : ""
build_number = BUILD_INFO.build_number != 0 ? "+$(BUILD_INFO.build_number)" : ""
try
global const VERSION = convert(VersionNumber, "$(BUILD_INFO.version_string)$(prerelease)$(build_number)")
global const VERSION = convert(VersionNumber, "$(BUILD_INFO.version_string)$(build_number)")
catch e
println("while creating Base.VERSION, ignoring error $e")
global const VERSION = VersionNumber(0)
Expand Down

0 comments on commit 61260ad

Please sign in to comment.