Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #5218, Compile age in banner #5281

Merged
merged 1 commit into from
Jan 2, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ function input_color()
return get(text_colors, c, default_color_input)
end

banner() = print(have_color ? banner_color : banner_plain)

exit(n) = ccall(:jl_exit, Void, (Int32,), n)
exit() = exit(0)
quit() = exit()
Expand Down
86 changes: 44 additions & 42 deletions base/version.jl
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ end

## julia version info

begin
# Include build number if we've got at least some distance from a tag (e.g. a release)
build_number = BUILD_INFO.build_number != 0 ? "+$(BUILD_INFO.build_number)" : ""
try
Expand All @@ -190,47 +189,50 @@ catch e
global const VERSION = VersionNumber(0)
end

if BUILD_INFO.tagged_commit
const commit_string = BUILD_INFO.TAGGED_RELEASE_BANNER
elseif BUILD_INFO.commit == ""
const commit_string = ""
else
local days = int(floor((ccall(:clock_now, Float64, ()) - BUILD_INFO.fork_master_timestamp) / (60 * 60 * 24)))
if BUILD_INFO.fork_master_distance == 0
const commit_string = "Commit $(BUILD_INFO.commit_short) ($(days) days old master)"
function banner()
if BUILD_INFO.tagged_commit
commit_string = BUILD_INFO.TAGGED_RELEASE_BANNER
elseif BUILD_INFO.commit == ""
commit_string = ""
else
const commit_string = "$(BUILD_INFO.branch)/$(BUILD_INFO.commit_short) (fork: $(BUILD_INFO.fork_master_distance) commits, $(days) days)"
days = int(floor((ccall(:clock_now, Float64, ()) - BUILD_INFO.fork_master_timestamp) / (60 * 60 * 24)))
if BUILD_INFO.fork_master_distance == 0
commit_string = "Commit $(BUILD_INFO.commit_short) ($(days) days old master)"
else
commit_string = "$(BUILD_INFO.branch)/$(BUILD_INFO.commit_short) (fork: $(BUILD_INFO.fork_master_distance) commits, $(days) days)"
end
end
commit_date = BUILD_INFO.date_string != "" ? " ($(BUILD_INFO.date_string))": ""

if have_color
tx = "\033[0m\033[1m" # text
jl = "\033[0m\033[1m" # julia
d1 = "\033[34m" # first dot
d2 = "\033[31m" # second dot
d3 = "\033[32m" # third dot
d4 = "\033[35m" # fourth dot

print("""\033[1m $(d3)_
$(d1)_ $(jl)_$(tx) $(d2)_$(d3)(_)$(d4)_$(tx) | A fresh approach to technical computing
$(d1)(_)$(jl) | $(d2)(_)$(tx) $(d4)(_)$(tx) | Documentation: http://docs.julialang.org
$(jl)_ _ _| |_ __ _$(tx) | Type \"help()\" to list help topics
$(jl)| | | | | | |/ _` |$(tx) |
$(jl)| | |_| | | | (_| |$(tx) | Version $(VERSION)$(commit_date)
$(jl)_/ |\\__'_|_|_|\\__'_|$(tx) | $(commit_string)
$(jl)|__/$(tx) | $(Sys.MACHINE)

\033[0m""")
else
print("""
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type \"help()\" to list help topics
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version $(VERSION)$(commit_date)
_/ |\\__'_|_|_|\\__'_| | $(commit_string)
|__/ | $(Sys.MACHINE)

""")
end
end
commit_date = BUILD_INFO.date_string != "" ? " ($(BUILD_INFO.date_string))": ""

const banner_plain =
"""
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type \"help()\" to list help topics
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version $(VERSION)$(commit_date)
_/ |\\__'_|_|_|\\__'_| | $(commit_string)
|__/ | $(Sys.MACHINE)

"""
local tx = "\033[0m\033[1m" # text
local jl = "\033[0m\033[1m" # julia
local d1 = "\033[34m" # first dot
local d2 = "\033[31m" # second dot
local d3 = "\033[32m" # third dot
local d4 = "\033[35m" # fourth dot
const banner_color =
"\033[1m $(d3)_
$(d1)_ $(jl)_$(tx) $(d2)_$(d3)(_)$(d4)_$(tx) | A fresh approach to technical computing
$(d1)(_)$(jl) | $(d2)(_)$(tx) $(d4)(_)$(tx) | Documentation: http://docs.julialang.org
$(jl)_ _ _| |_ __ _$(tx) | Type \"help()\" to list help topics
$(jl)| | | | | | |/ _` |$(tx) |
$(jl)| | |_| | | | (_| |$(tx) | Version $(VERSION)$(commit_date)
$(jl)_/ |\\__'_|_|_|\\__'_|$(tx) | $(commit_string)
$(jl)|__/$(tx) | $(Sys.MACHINE)

\033[0m"
end # begin