File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -61,13 +61,16 @@ SPACE :=
61
61
SPACE +=
62
62
ifneq ($(CFG_GIT ) ,)
63
63
ifneq ($(wildcard $(subst $(SPACE ) ,\$(SPACE ) ,$(CFG_GIT_DIR ) ) ) ,)
64
- CFG_VER_DATE = $(shell git --git-dir='$(CFG_GIT_DIR ) ' log -1 --pretty=format:'% ci ')
64
+ CFG_VER_DATE = $(shell git --git-dir='$(CFG_GIT_DIR ) ' log -1 --date=short -- pretty=format:'% cd ')
65
65
CFG_VER_HASH = $(shell git --git-dir='$(CFG_GIT_DIR ) ' rev-parse HEAD)
66
66
CFG_SHORT_VER_HASH = $(shell git --git-dir='$(CFG_GIT_DIR ) ' rev-parse --short=9 HEAD)
67
67
CFG_VERSION += ($(CFG_SHORT_VER_HASH ) $(CFG_VER_DATE ) )
68
68
endif
69
69
endif
70
70
71
+ CFG_BUILD_DATE = $(shell date +% F)
72
+ CFG_VERSION += (built $(CFG_BUILD_DATE ) )
73
+
71
74
# Windows exe's need numeric versions - don't use anything but
72
75
# numbers and dots here
73
76
CFG_VERSION_WIN = $(CFG_RELEASE_NUM )
@@ -317,6 +320,7 @@ endif
317
320
ifdef CFG_VER_HASH
318
321
export CFG_VER_HASH
319
322
endif
323
+ export CFG_BUILD_DATE
320
324
export CFG_VERSION
321
325
export CFG_VERSION_WIN
322
326
export CFG_RELEASE
Original file line number Diff line number Diff line change @@ -276,6 +276,10 @@ pub fn commit_date_str() -> Option<&'static str> {
276
276
option_env ! ( "CFG_VER_DATE" )
277
277
}
278
278
279
+ pub fn build_date_str ( ) -> Option < & ' static str > {
280
+ option_env ! ( "CFG_BUILD_DATE" )
281
+ }
282
+
279
283
/// Prints version information and returns None on success or an error
280
284
/// message on panic.
281
285
pub fn version ( binary : & str , matches : & getopts:: Matches ) {
@@ -287,6 +291,7 @@ pub fn version(binary: &str, matches: &getopts::Matches) {
287
291
println ! ( "binary: {}" , binary) ;
288
292
println ! ( "commit-hash: {}" , unw( commit_hash_str( ) ) ) ;
289
293
println ! ( "commit-date: {}" , unw( commit_date_str( ) ) ) ;
294
+ println ! ( "build-date: {}" , unw( build_date_str( ) ) ) ;
290
295
println ! ( "host: {}" , config:: host_triple( ) ) ;
291
296
println ! ( "release: {}" , unw( release_str( ) ) ) ;
292
297
}
You can’t perform that action at this time.
0 commit comments