From 971b366e02ae9a4cdfb80309928c1064b2ad7d7f76e24cbb0e75b5f448f68354 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sun, 16 Oct 2011 18:35:31 +0000 Subject: [PATCH] Accepting request 87357 from home:vintozver:branches:server:database OBS-URL: https://build.opensuse.org/request/show/87357 OBS-URL: https://build.opensuse.org/package/show/server:database/redis?expand=0&rev=21 --- redis-2.2.14.tar.gz | 3 + redis-2.2.7.tar.gz | 3 - redis-initscript.patch | 219 +++++++++++++++++++++----------------- redis-linkargsorder.patch | 49 --------- redis.spec | 8 +- skip-aof-test.patch | 32 +++--- 6 files changed, 147 insertions(+), 167 deletions(-) create mode 100644 redis-2.2.14.tar.gz delete mode 100644 redis-2.2.7.tar.gz delete mode 100644 redis-linkargsorder.patch diff --git a/redis-2.2.14.tar.gz b/redis-2.2.14.tar.gz new file mode 100644 index 0000000..d626b37 --- /dev/null +++ b/redis-2.2.14.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:212d8e6f8f3bdfee71697d6e1ec41caa3365d24d57108992d221f722eb45402d +size 455988 diff --git a/redis-2.2.7.tar.gz b/redis-2.2.7.tar.gz deleted file mode 100644 index 53518e2..0000000 --- a/redis-2.2.7.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a3497a6ee23b678585f92e81da2239e2ef12ff1524bb7216bfe3e9395d1e0a2b -size 448151 diff --git a/redis-initscript.patch b/redis-initscript.patch index e9c06fc..5b45093 100644 --- a/redis-initscript.patch +++ b/redis-initscript.patch @@ -1,97 +1,122 @@ ---- - utils/redis_init_script | 67 +++++++++++++++++++++++++++++++++++++----------- - 1 file changed, 53 insertions(+), 14 deletions(-) - -Index: utils/redis_init_script -=================================================================== ---- utils/redis_init_script.orig -+++ utils/redis_init_script -@@ -1,35 +1,74 @@ - #!/bin/sh -+# -+# /etc/init.d/redis -+# -+### BEGIN INIT INFO -+# Provides: redis -+# Required-Start: $syslog $remote_fs -+# Should-Start: -+# Required-Stop: $syslog $remote_fs -+# Should-Stop: -+# Default-Start: 3 4 5 -+# Default-Stop: 0 1 2 6 -+# Short-Description: Redis server -+# Description: Starts and stops the Redis daemon -+### END INIT INFO -+ -+. /etc/rc.status - - REDISPORT=6379 --EXEC=/usr/local/bin/redis-server -+EXEC=/usr/sbin/redis-server - --PIDFILE=/var/run/redis_${REDISPORT}.pid --CONF="/etc/redis/${REDISPORT}.conf" -+LOGFILE=/var/log/redis.log -+PIDFILE=/var/run/redis.pid -+CONF=/etc/redis.conf - - case "$1" in - start) -- if [ -f $PIDFILE ] -- then -- echo -n "$PIDFILE exists, process is already running or crashed\n" -- else -- echo -n "Starting Redis server...\n" -- $EXEC $CONF -+ if [ ! -r $LOGFILE ]; then -+ touch $LOGFILE -+ chown redis:redis $LOGFILE -+ fi -+ # Create a pidfile the server can write into. -+ if [ ! -r $PIDFILE ]; then -+ touch $PIDFILE -+ chown redis:redis $PIDFILE - fi -+ echo -n "Starting service Redis " -+ /sbin/startproc -u redis -g redis -p $PIDFILE -s -e $EXEC $CONF >/dev/null 2>&1 -+ rc_status -v - ;; - stop) - if [ ! -f $PIDFILE ] - then -- echo -n "$PIDFILE does not exist, process is not running\n" -+ echo -n "$PIDFILE does not exist, process is not running" -+ rc_failed - else -+ echo -n "Stopping service Redis..." -+ echo -e "SHUTDOWN\r" | /usr/bin/netcat localhost $REDISPORT & - PID=$(cat $PIDFILE) -- echo -n "Stopping ...\n" -- echo -n "SHUTDOWN\r\n" | nc localhost $REDISPORT & - while [ -x /proc/${PIDFILE} ] - do -- echo "Waiting for Redis to shutdown ..." - sleep 1 - done -- echo "Redis stopped" - fi -+ rc_status -v -+ ;; -+ restart) -+ $0 stop -+ $0 start - ;; -+ reload) -+ $0 restart -+ ;; -+ status) -+ echo -n "Checking for service Redis: " -+ /sbin/checkproc -p $PIDFILE $EXEC -+ rc_status -v -+ ;; -+ *) -+ echo $"Usage: $0 {start|stop|status|restart|reload}" -+ exit 1 - esac -+rc_exit -+ +*** utils/redis_init_script.orig 2011-09-21 19:12:56.000000000 +0300 +--- utils/redis_init_script 2011-10-10 18:34:43.000000000 +0300 +*************** +*** 1,42 **** + #!/bin/sh + # +! # Simple Redis init.d script conceived to work on Linux systems +! # as it does use of the /proc filesystem. + + REDISPORT=6379 +! EXEC=/usr/local/bin/redis-server +! CLIEXEC=/usr/local/bin/redis-cli + + PIDFILE=/var/run/redis_${REDISPORT}.pid +! CONF="/etc/redis/${REDISPORT}.conf" + + case "$1" in + start) +! if [ -f $PIDFILE ] +! then +! echo "$PIDFILE exists, process is already running or crashed" +! else +! echo "Starting Redis server..." +! $EXEC $CONF + fi + ;; + stop) + if [ ! -f $PIDFILE ] + then +! echo "$PIDFILE does not exist, process is not running" + else +! PID=$(cat $PIDFILE) +! echo "Stopping ..." + $CLIEXEC -p $REDISPORT shutdown +! while [ -x /proc/${PID} ] + do +- echo "Waiting for Redis to shutdown ..." + sleep 1 + done +- echo "Redis stopped" + fi + ;; +! *) +! echo "Please use start or stop as first argument" + ;; + esac +--- 1,75 ---- + #!/bin/sh + # +! # /etc/init.d/redis +! # +! ### BEGIN INIT INFO +! # Provides: redis +! # Required-Start: $syslog $remote_fs +! # Should-Start: +! # Required-Stop: $syslog $remote_fs +! # Should-Stop: +! # Default-Start: 3 4 5 +! # Default-Stop: 0 1 2 6 +! # Short-Description: Redis server +! # Description: Starts and stops the Redis daemon +! ### END INIT INFO +! +! . /etc/rc.status + + REDISPORT=6379 +! EXEC=/usr/sbin/redis-server +! CLIEXEC=/usr/sbin/redis-cli + ++ CONF=/etc/redis/${REDISPORT}.conf + PIDFILE=/var/run/redis_${REDISPORT}.pid +! LOGFILE=/var/log/redis_${REDISPORT}.log + + case "$1" in + start) +! if [ ! -r $LOGFILE ]; then +! touch $LOGFILE +! chown redis:redis $LOGFILE +! fi +! # Create a pidfile the server can write into. +! if [ ! -r $PIDFILE ]; then +! touch $PIDFILE +! chown redis:redis $PIDFILE + fi ++ echo -n "Starting service Redis " ++ /sbin/startproc -u redis -g redis -p $PIDFILE -s -e $EXEC $CONF >/dev/null 2>&1 ++ rc_status -v + ;; + stop) + if [ ! -f $PIDFILE ] + then +! echo -n "$PIDFILE does not exist, process is not running" +! rc_failed + else +! echo -n "Stopping service Redis..." + $CLIEXEC -p $REDISPORT shutdown +! PID=$(cat $PIDFILE) +! while [ -x /proc/${PIDFILE} ] + do + sleep 1 + done + fi ++ rc_status -v + ;; +! restart) +! $0 stop +! $0 start + ;; ++ reload) ++ $0 restart ++ ;; ++ status) ++ echo -n "Checking for service Redis: " ++ /sbin/checkproc -p $PIDFILE $EXEC ++ rc_status -v ++ ;; ++ *) ++ echo $"Usage: $0 {start|stop|status|restart|reload}" ++ exit 1 + esac ++ rc_exit ++ diff --git a/redis-linkargsorder.patch b/redis-linkargsorder.patch deleted file mode 100644 index a7914b6..0000000 --- a/redis-linkargsorder.patch +++ /dev/null @@ -1,49 +0,0 @@ ---- - src/Makefile | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -Index: src/Makefile -=================================================================== ---- src/Makefile.orig -+++ src/Makefile -@@ -19,7 +19,7 @@ ifeq ($(USE_TCMALLOC),yes) - CCLINK+= -ltcmalloc - CFLAGS+= -DUSE_TCMALLOC - endif --CCOPT= $(CFLAGS) $(CCLINK) $(ARCH) $(PROF) -+CCOPT= $(CFLAGS) $(ARCH) $(PROF) - - PREFIX= /usr/local - INSTALL_BIN= $(PREFIX)/bin -@@ -111,26 +111,26 @@ dependencies: - cd ../deps/linenoise && $(MAKE) ARCH="$(ARCH)" - - redis-server: $(OBJ) -- $(CC) -o $(PRGNAME) $(CCOPT) $(DEBUG) $(OBJ) -+ $(CC) -o $(PRGNAME) $(CCOPT) $(DEBUG) $(OBJ) $(CCLINK) - - redis-benchmark: dependencies $(BENCHOBJ) - cd ../deps/hiredis && $(MAKE) static -- $(CC) -o $(BENCHPRGNAME) $(CCOPT) $(DEBUG) $(BENCHOBJ) ../deps/hiredis/libhiredis.a -+ $(CC) -o $(BENCHPRGNAME) $(CCOPT) $(DEBUG) $(BENCHOBJ) $(CCLINK) ../deps/hiredis/libhiredis.a - - redis-benchmark.o: - $(CC) -c $(CFLAGS) -I../deps/hiredis $(DEBUG) $(COMPILE_TIME) $< - - redis-cli: dependencies $(CLIOBJ) -- $(CC) -o $(CLIPRGNAME) $(CCOPT) $(DEBUG) $(CLIOBJ) ../deps/hiredis/libhiredis.a ../deps/linenoise/linenoise.o -+ $(CC) -o $(CLIPRGNAME) $(CCOPT) $(DEBUG) $(CLIOBJ) $(CCLINK) ../deps/hiredis/libhiredis.a ../deps/linenoise/linenoise.o - - redis-cli.o: - $(CC) -c $(CFLAGS) -I../deps/hiredis -I../deps/linenoise $(DEBUG) $(COMPILE_TIME) $< - - redis-check-dump: $(CHECKDUMPOBJ) -- $(CC) -o $(CHECKDUMPPRGNAME) $(CCOPT) $(DEBUG) $(CHECKDUMPOBJ) -+ $(CC) -o $(CHECKDUMPPRGNAME) $(CCOPT) $(DEBUG) $(CHECKDUMPOBJ) $(CCLINK) - - redis-check-aof: $(CHECKAOFOBJ) -- $(CC) -o $(CHECKAOFPRGNAME) $(CCOPT) $(DEBUG) $(CHECKAOFOBJ) -+ $(CC) -o $(CHECKAOFPRGNAME) $(CCOPT) $(DEBUG) $(CHECKAOFOBJ) $(CCLINK) - - .c.o: - $(CC) -c $(CFLAGS) $(DEBUG) $(COMPILE_TIME) $< diff --git a/redis.spec b/redis.spec index 74d1064..e277934 100644 --- a/redis.spec +++ b/redis.spec @@ -18,7 +18,7 @@ %define _log_dir %{_var}/log/%{name} Name: redis -Version: 2.2.7 +Version: 2.2.14 Release: 1 # License: BSD License @@ -32,8 +32,7 @@ Source4: redis.sysconfig # Patch0: %{name}-initscript.patch Patch1: %{name}-conf.patch -Patch2: %{name}-linkargsorder.patch -Patch3: skip-aof-test.patch +Patch2: skip-aof-test.patch # BuildRoot: %{_tmppath}/%{name}-%{version}-build # for init script @@ -63,11 +62,10 @@ HTML documentation for redis database. %setup -q %patch0 %patch1 -%patch2 # skip-aof-test.patch # Failures: - Fixed AOF: Server should have been started: Expected '1' to equal or match '0' -%patch3 -p1 +%patch2 -p1 mv doc html diff --git a/skip-aof-test.patch b/skip-aof-test.patch index 93438bc..b192f18 100644 --- a/skip-aof-test.patch +++ b/skip-aof-test.patch @@ -1,13 +1,19 @@ -Index: redis-2.2.7/tests/test_helper.tcl -=================================================================== ---- redis-2.2.7.orig/tests/test_helper.tcl -+++ redis-2.2.7/tests/test_helper.tcl -@@ -121,7 +121,7 @@ proc execute_everything {} { - execute_tests "unit/cas" - execute_tests "unit/quit" - execute_tests "integration/replication" -- execute_tests "integration/aof" -+# execute_tests "integration/aof" - # execute_tests "integration/redis-cli" - execute_tests "unit/pubsub" - +*** redis-2.2.14/tests/test_helper.tcl.orig 2011-10-11 10:49:53.526776515 +0300 +--- redis-2.2.14/tests/test_helper.tcl 2011-10-11 10:50:30.166776516 +0300 +*************** +*** 122,128 **** + execute_tests "unit/cas" + execute_tests "unit/quit" + execute_tests "integration/replication" +! execute_tests "integration/aof" + # execute_tests "integration/redis-cli" + execute_tests "unit/pubsub" + execute_tests "unit/slowlog" +--- 122,128 ---- + execute_tests "unit/cas" + execute_tests "unit/quit" + execute_tests "integration/replication" +! # execute_tests "integration/aof" + # execute_tests "integration/redis-cli" + execute_tests "unit/pubsub" + execute_tests "unit/slowlog"