Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
5436146c
Commit
5436146c
authored
May 17, 2010
by
Pieter Noordhuis
Browse files
create release.h in make process and add this information to INFO listing
parent
26ef09a8
Changes
3
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
5436146c
...
@@ -12,3 +12,4 @@ mkrelease.sh
...
@@ -12,3 +12,4 @@ mkrelease.sh
release
release
myredis.conf
myredis.conf
misc/*
misc/*
release.h
Makefile
View file @
5436146c
...
@@ -14,6 +14,8 @@ endif
...
@@ -14,6 +14,8 @@ endif
CCOPT
=
$(CFLAGS)
$(CCLINK)
$(ARCH)
$(PROF)
CCOPT
=
$(CFLAGS)
$(CCLINK)
$(ARCH)
$(PROF)
DEBUG
?=
-g
-rdynamic
-ggdb
DEBUG
?=
-g
-rdynamic
-ggdb
GIT_SHA1
:=
$(
shell
sh
-c
'(git show-ref --head --hash=8 2> /dev/null || echo 00000000
)
| head -n1'
)
GIT_DIRTY
:=
$(
shell
sh
-c
'git status -s 2> /dev/null | wc -l'
)
OBJ
=
adlist.o ae.o anet.o dict.o redis.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o
OBJ
=
adlist.o ae.o anet.o dict.o redis.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o
BENCHOBJ
=
ae.o anet.o redis-benchmark.o sds.o adlist.o zmalloc.o
BENCHOBJ
=
ae.o anet.o redis-benchmark.o sds.o adlist.o zmalloc.o
CLIOBJ
=
anet.o sds.o adlist.o redis-cli.o zmalloc.o linenoise.o
CLIOBJ
=
anet.o sds.o adlist.o redis-cli.o zmalloc.o linenoise.o
...
@@ -54,7 +56,7 @@ sds.o: sds.c sds.h zmalloc.h
...
@@ -54,7 +56,7 @@ sds.o: sds.c sds.h zmalloc.h
zipmap.o
:
zipmap.c zmalloc.h
zipmap.o
:
zipmap.c zmalloc.h
zmalloc.o
:
zmalloc.c config.h
zmalloc.o
:
zmalloc.c config.h
redis-server
:
$(OBJ)
redis-server
:
releaseheader
$(OBJ)
$(CC)
-o
$(PRGNAME)
$(CCOPT)
$(DEBUG)
$(OBJ)
$(CC)
-o
$(PRGNAME)
$(CCOPT)
$(DEBUG)
$(OBJ)
@
echo
""
@
echo
""
@
echo
"Hint: To run the test-redis.tcl script is a good idea."
@
echo
"Hint: To run the test-redis.tcl script is a good idea."
...
@@ -74,6 +76,11 @@ redis-check-dump: $(CHECKDUMPOBJ)
...
@@ -74,6 +76,11 @@ redis-check-dump: $(CHECKDUMPOBJ)
redis-check-aof
:
$(CHECKAOFOBJ)
redis-check-aof
:
$(CHECKAOFOBJ)
$(CC)
-o
$(CHECKAOFPRGNAME)
$(CCOPT)
$(DEBUG)
$(CHECKAOFOBJ)
$(CC)
-o
$(CHECKAOFPRGNAME)
$(CCOPT)
$(DEBUG)
$(CHECKAOFOBJ)
releaseheader
:
@
echo
"#define REDIS_GIT_SHA1
\"
$(GIT_SHA1)
\"
"
>
release.h
@
echo
"#define REDIS_GIT_DIRTY
$(GIT_DIRTY)
"
>>
release.h
@
touch
redis.c
# force recompile of redis.c
.c.o
:
.c.o
:
$(CC)
-c
$(CFLAGS)
$(DEBUG)
$(COMPILE_TIME)
$<
$(CC)
-c
$(CFLAGS)
$(DEBUG)
$(COMPILE_TIME)
$<
...
...
redis.c
View file @
5436146c
...
@@ -76,6 +76,7 @@
...
@@ -76,6 +76,7 @@
#include "pqsort.h"
/* Partial qsort for SORT+LIMIT */
#include "pqsort.h"
/* Partial qsort for SORT+LIMIT */
#include "zipmap.h"
/* Compact dictionary-alike data structure */
#include "zipmap.h"
/* Compact dictionary-alike data structure */
#include "sha1.h"
/* SHA1 is used for DEBUG DIGEST */
#include "sha1.h"
/* SHA1 is used for DEBUG DIGEST */
#include "release.h"
/* Release and/or git repository information */
/* Error codes */
/* Error codes */
#define REDIS_OK 0
#define REDIS_OK 0
...
@@ -7175,6 +7176,8 @@ static sds genRedisInfoString(void) {
...
@@ -7175,6 +7176,8 @@ static sds genRedisInfoString(void) {
bytesToHuman
(
hmem
,
zmalloc_used_memory
());
bytesToHuman
(
hmem
,
zmalloc_used_memory
());
info
=
sdscatprintf
(
sdsempty
(),
info
=
sdscatprintf
(
sdsempty
(),
"redis_version:%s
\r\n
"
"redis_version:%s
\r\n
"
"redis_git_sha1:%s
\r\n
"
"redis_git_dirty:%d
\r\n
"
"arch_bits:%s
\r\n
"
"arch_bits:%s
\r\n
"
"multiplexing_api:%s
\r\n
"
"multiplexing_api:%s
\r\n
"
"process_id:%ld
\r\n
"
"process_id:%ld
\r\n
"
...
@@ -7199,6 +7202,8 @@ static sds genRedisInfoString(void) {
...
@@ -7199,6 +7202,8 @@ static sds genRedisInfoString(void) {
"vm_enabled:%d
\r\n
"
"vm_enabled:%d
\r\n
"
"role:%s
\r\n
"
"role:%s
\r\n
"
,
REDIS_VERSION
,
,
REDIS_VERSION
,
REDIS_GIT_SHA1
,
REDIS_GIT_DIRTY
>
0
,
(
sizeof
(
long
)
==
8
)
?
"64"
:
"32"
,
(
sizeof
(
long
)
==
8
)
?
"64"
:
"32"
,
aeGetApiName
(),
aeGetApiName
(),
(
long
)
getpid
(),
(
long
)
getpid
(),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment