Switch Debian packaging to quilt patches

Future Debian package patching guide:
  https://wiki.debian.org/UsingQuilt#Making_a_new_patch
  https://wiki.debian.org/UsingQuilt#Editing_an_existing_patch

Patch by Michael Shuler; Reviewed by Jon Haddad for CASSANDRA-14707
This commit is contained in:
Michael Shuler 2018-09-08 15:16:04 -05:00
parent 8d443805f0
commit f424e03a44
8 changed files with 68 additions and 72 deletions

2
debian/control vendored
View File

@ -3,7 +3,7 @@ Section: misc
Priority: extra
Maintainer: Eric Evans <eevans@apache.org>
Uploaders: Sylvain Lebresne <slebresne@apache.org>
Build-Depends: debhelper (>= 5), openjdk-8-jdk | java8-jdk, ant (>= 1.9), ant-optional (>= 1.9), dh-python, python-dev (>= 2.7), dpatch, bash-completion
Build-Depends: debhelper (>= 5), openjdk-8-jdk | java8-jdk, ant (>= 1.9), ant-optional (>= 1.9), dh-python, python-dev (>= 2.7), quilt, bash-completion
Homepage: http://cassandra.apache.org
Vcs-Git: http://git-wip-us.apache.org/repos/asf/cassandra.git
Vcs-Browser: https://git-wip-us.apache.org/repos/asf?p=cassandra.git

View File

@ -1,36 +0,0 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 001cassandra_yaml_dirs.dpatch by Tyler Hobbs <tyler@datastax.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
@DPATCH@
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' cassandra~/conf/cassandra.yaml cassandra/conf/cassandra.yaml
--- cassandra~/conf/cassandra.yaml 2014-06-05 13:36:22.000000000 -0500
+++ cassandra/conf/cassandra.yaml 2014-06-05 13:39:20.569034040 -0500
@@ -94,13 +94,13 @@
# will spread data evenly across them, subject to the granularity of
# the configured compaction strategy.
# If not set, the default directory is $CASSANDRA_HOME/data/data.
-# data_file_directories:
-# - /var/lib/cassandra/data
+data_file_directories:
+ - /var/lib/cassandra/data
# commit log. when running on magnetic HDD, this should be a
# separate spindle than the data directories.
# If not set, the default directory is $CASSANDRA_HOME/data/commitlog.
-# commitlog_directory: /var/lib/cassandra/commitlog
+commitlog_directory: /var/lib/cassandra/commitlog
# policy for data disk failures:
# stop_paranoid: shut down gossip even for single-sstable errors.
@@ -203,7 +203,7 @@
# saved caches
# If not set, the default directory is $CASSANDRA_HOME/data/saved_caches.
-# saved_caches_directory: /var/lib/cassandra/saved_caches
+saved_caches_directory: /var/lib/cassandra/saved_caches
# commitlog_sync may be either "periodic" or "batch."
# When in batch mode, Cassandra won't ack writes until the commit log

View File

@ -1,31 +0,0 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## cassandra_logdir_fix.dpatch by Michael Shuler <michael@pbandjelly.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
@DPATCH@
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' cassandra~/bin/cassandra cassandra/bin/cassandra
--- cassandra~/bin/cassandra 2015-10-27 14:35:22.000000000 -0500
+++ cassandra/bin/cassandra 2015-10-27 14:41:38.000000000 -0500
@@ -139,7 +139,7 @@
props="$3"
class="$4"
cassandra_parms="-Dlogback.configurationFile=logback.xml"
- cassandra_parms="$cassandra_parms -Dcassandra.logdir=$CASSANDRA_HOME/logs"
+ cassandra_parms="$cassandra_parms -Dcassandra.logdir=/var/log/cassandra"
cassandra_parms="$cassandra_parms -Dcassandra.storagedir=$cassandra_storagedir"
if [ "x$pidpath" != "x" ]; then
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' cassandra~/conf/cassandra-env.sh cassandra/conf/cassandra-env.sh
--- cassandra~/conf/cassandra-env.sh 2015-10-27 14:40:39.000000000 -0500
+++ cassandra/conf/cassandra-env.sh 2015-10-27 14:42:40.647449856 -0500
@@ -204,7 +204,7 @@
esac
#GC log path has to be defined here because it needs to access CASSANDRA_HOME
-JVM_OPTS="$JVM_OPTS -Xloggc:${CASSANDRA_HOME}/logs/gc.log"
+JVM_OPTS="$JVM_OPTS -Xloggc:/var/log/cassandra/gc.log"
# Here we create the arguments that will get passed to the jvm when
# starting cassandra.

View File

@ -1,2 +0,0 @@
001cassandra_yaml_dirs.dpatch
002cassandra_logdir_fix.dpatch

View File

@ -0,0 +1,34 @@
--- a/bin/cassandra
+++ b/bin/cassandra
@@ -171,7 +171,7 @@
props="$3"
class="$4"
cassandra_parms="-Dlogback.configurationFile=logback.xml"
- cassandra_parms="$cassandra_parms -Dcassandra.logdir=$CASSANDRA_HOME/logs"
+ cassandra_parms="$cassandra_parms -Dcassandra.logdir=/var/log/cassandra"
cassandra_parms="$cassandra_parms -Dcassandra.storagedir=$cassandra_storagedir"
if [ "x$pidpath" != "x" ]; then
--- a/conf/cassandra-env.sh
+++ b/conf/cassandra-env.sh
@@ -93,16 +93,16 @@
echo "$JVM_OPTS" | grep -q "^-[X]log:gc"
if [ "$?" = "1" ] ; then # [X] to prevent ccm from replacing this line
# only add -Xlog:gc if it's not mentioned in jvm-server.options file
- mkdir -p ${CASSANDRA_HOME}/logs
- JVM_OPTS="$JVM_OPTS -Xlog:gc=info,heap*=trace,age*=debug,safepoint=info,promotion*=trace:file=${CASSANDRA_HOME}/logs/gc.log:time,uptime,pid,tid,level:filecount=10,filesize=10485760"
+ mkdir -p /var/log/cassandra
+ JVM_OPTS="$JVM_OPTS -Xlog:gc=info,heap*=trace,age*=debug,safepoint=info,promotion*=trace:file=/var/log/cassandra/gc.log:time,uptime,pid,tid,level:filecount=10,filesize=10485760"
fi
else
# Java 8
echo "$JVM_OPTS" | grep -q "^-[X]loggc"
if [ "$?" = "1" ] ; then # [X] to prevent ccm from replacing this line
# only add -Xlog:gc if it's not mentioned in jvm-server.options file
- mkdir -p ${CASSANDRA_HOME}/logs
- JVM_OPTS="$JVM_OPTS -Xloggc:${CASSANDRA_HOME}/logs/gc.log"
+ mkdir -p /var/log/cassandra
+ JVM_OPTS="$JVM_OPTS -Xloggc:/var/log/cassandra/gc.log"
fi
fi

28
debian/patches/cassandra_yaml_dirs.diff vendored Normal file
View File

@ -0,0 +1,28 @@
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -197,13 +197,13 @@
# directories are specified, Cassandra will spread data evenly across
# them by partitioning the token ranges.
# If not set, the default directory is $CASSANDRA_HOME/data/data.
-# data_file_directories:
-# - /var/lib/cassandra/data
+data_file_directories:
+ - /var/lib/cassandra/data
# commit log. when running on magnetic HDD, this should be a
# separate spindle than the data directories.
# If not set, the default directory is $CASSANDRA_HOME/data/commitlog.
-# commitlog_directory: /var/lib/cassandra/commitlog
+commitlog_directory: /var/lib/cassandra/commitlog
# Enable / disable CDC functionality on a per-node basis. This modifies the logic used
# for write path allocation rejection (standard: never reject. cdc: reject Mutation
@@ -366,7 +366,7 @@
# saved caches
# If not set, the default directory is $CASSANDRA_HOME/data/saved_caches.
-# saved_caches_directory: /var/lib/cassandra/saved_caches
+saved_caches_directory: /var/lib/cassandra/saved_caches
# commitlog_sync may be either "periodic", "group", or "batch."
#

2
debian/patches/series vendored Normal file
View File

@ -0,0 +1,2 @@
cassandra_logdir_fix.diff
cassandra_yaml_dirs.diff

5
debian/rules vendored
View File

@ -3,7 +3,7 @@
# Uncomment to enable verbose mode.
#export DH_VERBOSE=1
include /usr/share/dpatch/dpatch.make
include /usr/share/quilt/quilt.make
ANT = /usr/bin/ant
VERSION = $(shell dpkg-parsechangelog | sed -ne 's/^Version: \([^-|~|+]*\).*/\1/p')
@ -13,6 +13,7 @@ test:
$(ANT) test
clean: unpatch
dh_clean build-stamp
dh_testdir
dh_testroot
$(ANT) realclean
@ -24,7 +25,7 @@ clean: unpatch
dh_clean
build: build-stamp
build-stamp: patch-stamp
build-stamp: $(QUILT_STAMPFN)
dh_testdir
printf "version=%s" $(VERSION) > build.properties