diff --git a/SCYLLA-VERSION-GEN b/SCYLLA-VERSION-GEN deleted file mode 100755 index 38fd07cb60..0000000000 --- a/SCYLLA-VERSION-GEN +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh - -PRODUCT=scylla -VERSION=666.development - -if test -f version -then - SCYLLA_VERSION=$(cat version | awk -F'-' '{print $1}') - SCYLLA_RELEASE=$(cat version | awk -F'-' '{print $2}') -else - DATE=$(date --utc +%Y%m%d) - GIT_COMMIT=$(git log --pretty=format:'%h' -n 1) - SCYLLA_VERSION=$VERSION - SCYLLA_RELEASE=$DATE.$GIT_COMMIT -fi - -usage() { - echo "usage: $0" - echo " [--version product-version-release] # override p-v-r" - exit 1 -} - -OVERRIDE= -while [[ $# > 0 ]]; do - case "$1" in - --version) - OVERRIDE="$2" - shift 2 - ;; - *) - usage - ;; - esac -done - -if [[ -n "$OVERRIDE" ]]; then - # regular expression for p-v-r: alphabetic+dashes for product, trailing non-dashes - # for release, everything else for version - RE='^([-a-z]+)-(.+)-([^-]+)$' - PRODUCT="$(sed -E "s/$RE/\\1/" <<<"$OVERRIDE")" - SCYLLA_VERSION="$(sed -E "s/$RE/\\2/" <<<"$OVERRIDE")" - SCYLLA_RELEASE="$(sed -E "s/$RE/\\3/" <<<"$OVERRIDE")" -fi - -echo "$SCYLLA_VERSION-$SCYLLA_RELEASE" -mkdir -p build -echo "$SCYLLA_VERSION" > build/SCYLLA-VERSION-FILE -echo "$SCYLLA_RELEASE" > build/SCYLLA-RELEASE-FILE -echo "$PRODUCT" > build/SCYLLA-PRODUCT-FILE diff --git a/tools/bin/cassandra-stress b/bin/cassandra-stress similarity index 100% rename from tools/bin/cassandra-stress rename to bin/cassandra-stress diff --git a/tools/bin/cassandra-stressd b/bin/cassandra-stressd similarity index 100% rename from tools/bin/cassandra-stressd rename to bin/cassandra-stressd diff --git a/tools/bin/cassandra.in.sh b/bin/cassandra.in.sh similarity index 100% rename from tools/bin/cassandra.in.sh rename to bin/cassandra.in.sh diff --git a/dist/common/cassandra.in.sh b/dist/common/cassandra.in.sh deleted file mode 100644 index a21fd1ad38..0000000000 --- a/dist/common/cassandra.in.sh +++ /dev/null @@ -1,116 +0,0 @@ -# Settings for Scylla -SCYLLA_HOME=/var/lib/scylla -SCYLLA_CONF=/etc/scylla - -CASSANDRA_CONF="$SCYLLA_CONF/cassandra" - -# Scylla adaption. Some one will still have to find us SCYLLA_HOME -# or place us there. - -CONFIG_FILE_REALPATH=`realpath $SCYLLA_CONF/scylla.yaml` -CONFIGURATION_FILE_OPT="-Dcassandra.config=file://$CONFIG_FILE_REALPATH" - -CASSANDRA_HOME=/opt/scylladb/share/cassandra - -# The java classpath (required) -if [ -n "$CLASSPATH" ]; then - CLASSPATH=$CLASSPATH:$CASSANDRA_CONF -else - CLASSPATH=$CASSANDRA_CONF -fi - -for jar in /opt/scylladb/share/cassandra/lib/*.jar; do - CLASSPATH=$CLASSPATH:$jar -done - -for jar in /opt/scylladb/share/cassandra/*.jar; do - CLASSPATH=$CLASSPATH:$jar -done - -CLASSPATH="$CLASSPATH:$SCYLLA_CONF:$EXTRA_CLASSPATH" - -# set JVM javaagent opts to avoid warnings/errors -if [ "$JVM_VENDOR" != "OpenJDK" -o "$JVM_VERSION" \> "1.6.0" ] \ - || [ "$JVM_VERSION" = "1.6.0" -a "$JVM_PATCH_VERSION" -ge 23 ] -then - JAVA_AGENT="$JAVA_AGENT -javaagent:$CASSANDRA_HOME/lib/jamm-0.3.2.jar" -fi - -# -# Java executable and per-Java version JVM settings -# - -# Use JAVA_HOME if set, otherwise look for java in PATH -if [ -n "$JAVA_HOME" ]; then - # Why we can't have nice things: Solaris combines x86 and x86_64 - # installations in the same tree, using an unconventional path for the - # 64bit JVM. Since we prefer 64bit, search the alternate path first, - # (see https://issues.apache.org/jira/browse/CASSANDRA-4638). - for java in "$JAVA_HOME"/bin/amd64/java "$JAVA_HOME"/bin/java; do - if [ -x "$java" ]; then - JAVA="$java" - break - fi - done -else - JAVA=java -fi - -if [ -z $JAVA ] ; then - echo Unable to find java executable. Check JAVA_HOME and PATH environment variables. >&2 - exit 1; -fi - -# Determine the sort of JVM we'll be running on. -java_ver_output=`"${JAVA:-java}" -version 2>&1` -jvmver=`echo "$java_ver_output" | grep '[openjdk|java] version' | awk -F'"' 'NR==1 {print $2}' | cut -d\- -f1` -JVM_VERSION=${jvmver%_*} - -JAVA_VERSION=11 -if [ "$JVM_VERSION" = "1.8.0" ] ; then - JVM_PATCH_VERSION=${jvmver#*_} - if [ "$JVM_VERSION" \< "1.8" ] || [ "$JVM_VERSION" \> "1.8.2" ] ; then - echo "Cassandra 4.0 requires either Java 8 (update 151 or newer) or Java 11 (or newer). Java $JVM_VERSION is not supported." - exit 1; - fi - if [ "$JVM_PATCH_VERSION" -lt 151 ] ; then - echo "Cassandra 4.0 requires either Java 8 (update 151 or newer) or Java 11 (or newer). Java 8 update $JVM_PATCH_VERSION is not supported." - exit 1; - fi - JAVA_VERSION=8 -elif [ "$JVM_VERSION" \< "11" ] ; then - echo "Cassandra 4.0 requires either Java 8 (update 151 or newer) or Java 11 (or newer)." - exit 1; -fi - -jvm=`echo "$java_ver_output" | grep -A 1 '[openjdk|java] version' | awk 'NR==2 {print $1}'` -case "$jvm" in - OpenJDK) - JVM_VENDOR=OpenJDK - # this will be "64-Bit" or "32-Bit" - JVM_ARCH=`echo "$java_ver_output" | awk 'NR==3 {print $2}'` - ;; - "Java(TM)") - JVM_VENDOR=Oracle - # this will be "64-Bit" or "32-Bit" - JVM_ARCH=`echo "$java_ver_output" | awk 'NR==3 {print $3}'` - ;; - *) - # Help fill in other JVM values - JVM_VENDOR=other - JVM_ARCH=unknown - ;; -esac - -# Read user-defined JVM options from jvm-server.options file -JVM_OPTS_FILE=$CASSANDRA_CONF/jvm${jvmoptions_variant:--clients}.options -if [ $JAVA_VERSION -ge 11 ] ; then - JVM_DEP_OPTS_FILE=$CASSANDRA_CONF/jvm11${jvmoptions_variant:--clients}.options -else - JVM_DEP_OPTS_FILE=$CASSANDRA_CONF/jvm8${jvmoptions_variant:--clients}.options -fi - -for opt in `grep "^-" $JVM_OPTS_FILE` `grep "^-" $JVM_DEP_OPTS_FILE` -do - JVM_OPTS="$JVM_OPTS $opt" -done diff --git a/dist/debian/debian/README.Debian b/dist/debian/README.Debian similarity index 100% rename from dist/debian/debian/README.Debian rename to dist/debian/README.Debian diff --git a/dist/debian/changelog.template b/dist/debian/changelog similarity index 100% rename from dist/debian/changelog.template rename to dist/debian/changelog diff --git a/dist/debian/compat b/dist/debian/compat new file mode 100644 index 0000000000..b4de394767 --- /dev/null +++ b/dist/debian/compat @@ -0,0 +1 @@ +11 diff --git a/dist/debian/control b/dist/debian/control new file mode 100644 index 0000000000..cb2feac169 --- /dev/null +++ b/dist/debian/control @@ -0,0 +1,13 @@ +Source: cassandra-stress +Section: misc +Priority: extra +Maintainer: Dusan Malusev +Homepage: http://www.scylladb.com +Standards-Version: 3.9.5 +Rules-Requires-Root: no + +Package: cassandra-stress +Architecture: all +Recommends: ntp | time-daemon +Description: Cassandra Stress Tool +Depends: openjdk-11-jre-headless | openjdk-11-jre | oracle-java11-set-default, procps, libsnappy-java, libsnappy-jni diff --git a/dist/debian/control.template b/dist/debian/control.template deleted file mode 100644 index fa2454b71c..0000000000 --- a/dist/debian/control.template +++ /dev/null @@ -1,23 +0,0 @@ -Source: %{product}-tools -Section: misc -Priority: extra -Maintainer: Takuya ASADA -Homepage: http://www.scylladb.com -Standards-Version: 3.9.5 -Rules-Requires-Root: no - -Package: %{product}-tools -Architecture: all -Depends: %{product}-conf, %{product}-tools-core, ${misc:Depends} -Recommends: ntp | time-daemon -Conflicts: cassandra -Breaks: %{product}-server (<< 5.5) -Description: Scylla database tools - Scylla is a highly scalable, eventually consistent, distributed, - partitioned row DB. - -Package: %{product}-tools-core -Architecture: all -Depends: openjdk-8-jre-headless | openjdk-8-jre | oracle-java8-set-default | adoptopenjdk-8-hotspot-jre | openjdk-11-jre-headless | openjdk-11-jre | oracle-java11-set-default, procps -Description: Scylla database tools core files - Core files for scylla database tools diff --git a/dist/debian/debian/copyright b/dist/debian/copyright similarity index 100% rename from dist/debian/debian/copyright rename to dist/debian/copyright diff --git a/dist/debian/debian/TODO b/dist/debian/debian/TODO deleted file mode 100644 index 2978deb3ee..0000000000 --- a/dist/debian/debian/TODO +++ /dev/null @@ -1,2 +0,0 @@ - - * don't embed jars for which debian packages exist diff --git a/dist/debian/debian/compat b/dist/debian/debian/compat deleted file mode 100644 index ec635144f6..0000000000 --- a/dist/debian/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/dist/debian/debian/scylla-tools.install b/dist/debian/debian/scylla-tools.install deleted file mode 100644 index f276664fe5..0000000000 --- a/dist/debian/debian/scylla-tools.install +++ /dev/null @@ -1,15 +0,0 @@ -opt/scylladb/share/cassandra/bin/nodetool -opt/scylladb/share/cassandra/bin/sstableloader -opt/scylladb/share/cassandra/bin/cassandra-stress -opt/scylladb/share/cassandra/bin/cassandra-stressd -opt/scylladb/share/cassandra/bin/sstabledump -opt/scylladb/share/cassandra/bin/sstablelevelreset -opt/scylladb/share/cassandra/bin/sstablemetadata -opt/scylladb/share/cassandra/bin/sstablerepairedset -usr/bin/sstableloader -usr/bin/cassandra-stress -usr/bin/cassandra-stressd -usr/bin/sstabledump -usr/bin/sstablelevelreset -usr/bin/sstablemetadata -usr/bin/sstablerepairedset diff --git a/dist/debian/debian_files_gen.py b/dist/debian/debian_files_gen.py deleted file mode 100755 index 7895114562..0000000000 --- a/dist/debian/debian_files_gen.py +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# Copyright (C) 2020 ScyllaDB -# - -# -# This file is part of Scylla. -# -# Scylla is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Scylla is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Scylla. If not, see . -# - -import string -import os -import shutil -import re -from pathlib import Path - -class DebianFilesTemplate(string.Template): - delimiter = '%' - -scriptdir = os.path.dirname(__file__) - -with open(os.path.join(scriptdir, 'changelog.template')) as f: - changelog_template = f.read() - -with open(os.path.join(scriptdir, 'control.template')) as f: - control_template = f.read() - -with open('build/SCYLLA-PRODUCT-FILE') as f: - product = f.read().strip() - -with open('build/SCYLLA-VERSION-FILE') as f: - version = f.read().strip().replace('.rc', '~rc').replace('_', '-') - -with open('build/SCYLLA-RELEASE-FILE') as f: - release = f.read().strip() - -if os.path.exists('build/debian/debian'): - shutil.rmtree('build/debian/debian') -shutil.copytree('dist/debian/debian', 'build/debian/debian') - -if product != 'scylla': - for p in Path('build/debian/debian').glob('scylla-*'): - # pat1: scylla-server.service - # -> scylla-enterprise-server.scylla-server.service - # pat2: scylla-server.scylla-fstrim.service - # -> scylla-enterprise-server.scylla-fstrim.service - # pat3: scylla-conf.install - # -> scylla-enterprise-conf.install - - if m := re.match(r'^scylla(-[^.]+)\.service$', p.name): - p.rename(p.parent / f'{product}{m.group(1)}.{p.name}') - elif m := re.match(r'^scylla(-[^.]+\.scylla-[^.]+\.[^.]+)$', p.name): - p.rename(p.parent / f'{product}{m.group(1)}') - else: - p.rename(p.parent / p.name.replace('scylla', product, 1)) - -s = DebianFilesTemplate(changelog_template) -changelog_applied = s.substitute(product=product, version=version, release=release, revision='1', codename='stable') - -s = DebianFilesTemplate(control_template) -control_applied = s.substitute(product=product) - -with open('build/debian/debian/changelog', 'w') as f: - f.write(changelog_applied) - -with open('build/debian/debian/control', 'w') as f: - f.write(control_applied) - diff --git a/dist/debian/debian/rules b/dist/debian/rules similarity index 100% rename from dist/debian/debian/rules rename to dist/debian/rules diff --git a/dist/debian/debian/scylla-tools-core.install b/dist/debian/scylla-tools-core.install similarity index 63% rename from dist/debian/debian/scylla-tools-core.install rename to dist/debian/scylla-tools-core.install index df5a48cd1f..d6c9fb35e2 100644 --- a/dist/debian/debian/scylla-tools-core.install +++ b/dist/debian/scylla-tools-core.install @@ -5,6 +5,3 @@ etc/scylla/cassandra/jvm*.options usr/bin/scylla-sstableloader opt/scylladb/share/cassandra/bin/cassandra.in.sh opt/scylladb/share/cassandra/lib/*.jar -opt/scylladb/share/cassandra/doc/cql3/CQL.css -opt/scylladb/share/cassandra/doc/cql3/CQL.html -opt/scylladb/share/cassandra/bin/scylla-sstableloader diff --git a/dist/debian/scylla-tools.install b/dist/debian/scylla-tools.install new file mode 100644 index 0000000000..0f6280720e --- /dev/null +++ b/dist/debian/scylla-tools.install @@ -0,0 +1,4 @@ +opt/scylladb/share/cassandra/bin/cassandra-stress +opt/scylladb/share/cassandra/bin/cassandra-stressd +usr/bin/cassandra-stress +usr/bin/cassandra-stressd diff --git a/dist/debian/debian/source/format b/dist/debian/source/format similarity index 100% rename from dist/debian/debian/source/format rename to dist/debian/source/format diff --git a/dist/debian/debian/source/options b/dist/debian/source/options similarity index 100% rename from dist/debian/debian/source/options rename to dist/debian/source/options diff --git a/dist/redhat/cassandra-stress.spec b/dist/redhat/cassandra-stress.spec new file mode 100644 index 0000000000..d098ac0579 --- /dev/null +++ b/dist/redhat/cassandra-stress.spec @@ -0,0 +1,54 @@ +Name: cassandra-stress +Version: %{version} +Release: %{release}%{?dist} +Summary: Scylla Cassandra Stress +Group: Applications/Databases + +License: Apache +URL: http://www.scylladb.com/ +Source0: %{reloc_pkg} +BuildArch: noarch +Requires: +AutoReqProv: no + +%description + +%package core +License: Apache +URL: http://www.scylladb.com/ +BuildArch: noarch +Summary: Core files for Scylla tools +Version: %{version} +Release: %{release}%{?dist} +Requires: jre-11-headless + +%global __brp_python_bytecompile %{nil} +%global __brp_mangle_shebangs %{nil} + +%prep +%setup -q -n scylla-tools + + +%build + +%install +rm -rf $RPM_BUILD_ROOT +./install.sh --root "$RPM_BUILD_ROOT" + +%files +/opt/scylladb/share/cassandra-stress/bin/cassandra-stress +/opt/scylladb/share/cassandra-stress/bin/cassandra-stressd +%{_bindir}/cassandra-stress +%{_bindir}/cassandra-stressd + +%files core +%{_sysconfdir}/scylla/cassandra-stress/cassandra-env.sh +%{_sysconfdir}/scylla/cassandra-stress/logback.xml +%{_sysconfdir}/scylla/cassandra-stress/logback-tools.xml +%{_sysconfdir}/scylla/cassandra-stress/jvm*.options +/opt/scylladb/share/cassandra-stress/bin/cassandra.in.sh +/opt/scylladb/share/cassandra-stress/lib/*.jar + +%changelog +* Fri Aug 7 2015 Takuya ASADA Takuya ASADA +- inital version of scylla-tools.spec diff --git a/dist/redhat/scylla-tools.spec b/dist/redhat/scylla-tools.spec deleted file mode 100644 index 08a9ad5fad..0000000000 --- a/dist/redhat/scylla-tools.spec +++ /dev/null @@ -1,73 +0,0 @@ -Name: %{product}-tools -Version: %{version} -Release: %{release}%{?dist} -Summary: Scylla Tools -Group: Applications/Databases - -License: Apache -URL: http://www.scylladb.com/ -Source0: %{reloc_pkg} -BuildArch: noarch -Requires: %{product}-conf %{product}-tools-core -AutoReqProv: no -Conflicts: cassandra - -%description - -%package core -License: Apache -URL: http://www.scylladb.com/ -BuildArch: noarch -Summary: Core files for Scylla tools -Version: %{version} -Release: %{release}%{?dist} -Requires: jre-11-headless - -%global __brp_python_bytecompile %{nil} -%global __brp_mangle_shebangs %{nil} - -%description core -Core files for scylla tools. - -%prep -%setup -q -n scylla-tools - - -%build - -%install -rm -rf $RPM_BUILD_ROOT -./install.sh --root "$RPM_BUILD_ROOT" - -%files -/opt/scylladb/share/cassandra/bin/nodetool -/opt/scylladb/share/cassandra/bin/sstableloader -/opt/scylladb/share/cassandra/bin/cassandra-stress -/opt/scylladb/share/cassandra/bin/cassandra-stressd -/opt/scylladb/share/cassandra/bin/sstabledump -/opt/scylladb/share/cassandra/bin/sstablelevelreset -/opt/scylladb/share/cassandra/bin/sstablemetadata -/opt/scylladb/share/cassandra/bin/sstablerepairedset -%{_bindir}/sstableloader -%{_bindir}/cassandra-stress -%{_bindir}/cassandra-stressd -%{_bindir}/sstabledump -%{_bindir}/sstablelevelreset -%{_bindir}/sstablemetadata -%{_bindir}/sstablerepairedset - -%files core -%{_sysconfdir}/scylla/cassandra/cassandra-env.sh -%{_sysconfdir}/scylla/cassandra/logback.xml -%{_sysconfdir}/scylla/cassandra/logback-tools.xml -%{_sysconfdir}/scylla/cassandra/jvm*.options -%{_bindir}/scylla-sstableloader -/opt/scylladb/share/cassandra/bin/cassandra.in.sh -/opt/scylladb/share/cassandra/lib/*.jar -/opt/scylladb/share/cassandra/doc/cql3/CQL.css -/opt/scylladb/share/cassandra/doc/cql3/CQL.html -/opt/scylladb/share/cassandra/bin/scylla-sstableloader - -%changelog -* Fri Aug 7 2015 Takuya ASADA Takuya ASADA -- inital version of scylla-tools.spec diff --git a/git-archive-all-license.txt b/git-archive-all-license.txt deleted file mode 100644 index 18ca7ef642..0000000000 --- a/git-archive-all-license.txt +++ /dev/null @@ -1,3 +0,0 @@ -License: MIT - -https://github.com/Kentzo/git-archive-all diff --git a/reloc/build_reloc.sh b/reloc/build_reloc.sh deleted file mode 100755 index a5ca53060b..0000000000 --- a/reloc/build_reloc.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash -e - -. /etc/os-release - -print_usage() { - echo "build_reloc.sh --clean --nodeps" - echo " --clean clean build directory" - echo " --nodeps skip installing dependencies" - echo " --version V product-version-release string (overriding SCYLLA-VERSION-GEN)" - exit 1 -} - -CLEAN= -NODEPS= -VERSION_OVERRIDE= -while [ $# -gt 0 ]; do - case "$1" in - "--clean") - CLEAN=yes - shift 1 - ;; - "--nodeps") - NODEPS=yes - shift 1 - ;; - "--version") - VERSION_OVERRIDE="$2" - shift 2 - ;; - *) - print_usage - ;; - esac -done - -VERSION=$(./SCYLLA-VERSION-GEN ${VERSION_OVERRIDE:+ --version "$VERSION_OVERRIDE"}) -# the former command should generate build/SCYLLA-PRODUCT-FILE and some other version -# related files -PRODUCT=`cat build/SCYLLA-PRODUCT-FILE` -DEST="build/$PRODUCT-tools-$VERSION.noarch.tar.gz" - -is_redhat_variant() { - [ -f /etc/redhat-release ] -} -is_debian_variant() { - [ -f /etc/debian_version ] -} - - -if [ ! -e reloc/build_reloc.sh ]; then - echo "run build_reloc.sh in top of scylla dir" - exit 1 -fi - -if [ "$CLEAN" = "yes" ]; then - rm -rf build target -fi - -if [ -f "$DEST" ]; then - rm "$DEST" -fi - -if [ -z "$NODEPS" ]; then - sudo ./install-dependencies.sh -fi - -printf "version=%s" $VERSION > build.properties - -# Our ant build.xml requires JAVA8_HOME to be set. In case it wasn't (e.g., -# dbuild sets it), let's try some common possibilities -if [ -z "$JAVA8_HOME" ]; then - for i in /usr/lib/jvm/java-1.8.0 - do - if [ -e "$i" ]; then - export JAVA8_HOME="$i" - break - fi - done -fi - -ant jar -dist/debian/debian_files_gen.py -scripts/create-relocatable-package.py --version $VERSION "$DEST" diff --git a/reloc/build_deb.sh b/scripts/build_deb.sh similarity index 61% rename from reloc/build_deb.sh rename to scripts/build_deb.sh index 8f66a7a2e0..be04ceeecb 100755 --- a/reloc/build_deb.sh +++ b/scripts/build_deb.sh @@ -1,14 +1,15 @@ #!/bin/bash -e . /etc/os-release + print_usage() { - echo "build_deb.sh --reloc-pkg build/scylla-tools-package.tar.gz" + echo "build_deb.sh --reloc-pkg build/cassandra-stress.tar.gz" echo " --reloc-pkg specify relocatable package path" echo " --builddir specify Debian package build path" exit 1 } -RELOC_PKG=build/scylla-tools-package.tar.gz +RELOC_PKG=build/cassandra-stress.tar.gz BUILDDIR=build/debian while [ $# -gt 0 ]; do case "$1" in @@ -26,16 +27,14 @@ while [ $# -gt 0 ]; do esac done -RELOC_PKG=$(readlink -f $RELOC_PKG) -rm -rf "$BUILDDIR"/scylla-package "$BUILDDIR"/scylla-package.orig "$BUILDDIR"/debian +RELOC_PKG=$(readlink -f "$RELOC_PKG") +rm -rf "$BUILDDIR/scylla-package" "$BUILDDIR/scylla-package.orig" "$BUILDDIR/debian" mkdir -p "$BUILDDIR"/scylla-package -tar -C "$BUILDDIR"/scylla-package -xpf $RELOC_PKG +tar -C "$BUILDDIR"/scylla-package -xpf "$RELOC_PKG" cd "$BUILDDIR"/scylla-package mv scylla-tools/debian debian PKG_NAME=$(dpkg-parsechangelog --show-field Source) -# XXX: Drop revision number from version string. -# Since it always '1', this should be okay for now. PKG_VERSION=$(dpkg-parsechangelog --show-field Version |sed -e 's/-1$//') -ln -fv $RELOC_PKG ../"$PKG_NAME"_"$PKG_VERSION".orig.tar.gz +ln -fv "$RELOC_PKG" ../"$PKG_NAME"_"$PKG_VERSION".orig.tar.gz debuild -rfakeroot -us -uc diff --git a/scripts/build_reloc.sh b/scripts/build_reloc.sh new file mode 100755 index 0000000000..740121db9a --- /dev/null +++ b/scripts/build_reloc.sh @@ -0,0 +1,79 @@ +#!/bin/bash -e + +# shellcheck disable=SC1091 +. /etc/os-release + +print_usage() { + echo "build_reloc.sh --clean " + echo " --clean clean build directory" + echo " --dest DEST specify relocatable package path" + echo " --version V " + exit 1 +} + +is_redhat_variant() { + [ -f /etc/redhat-release ] +} + +is_debian_variant() { + [ -f /etc/debian_version ] +} + +CLEAN= +VERSION= +DEST="build/cassandra-stress-$VERSION.noarch.tar.gz" + +while [ $# -gt 0 ]; do + case "$1" in + "--clean") + CLEAN=yes + shift 1 + ;; + "--version") + VERSION="$2" + shift 2 + ;; + "--dest") + DEST="$2" + shift 2 + ;; + *) + print_usage + ;; + esac +done + + +if [ ! -e reloc/build_reloc.sh ]; then + echo "run build_reloc.sh in top of scylla dir" + exit 1 +fi + +if [ "$CLEAN" = "yes" ]; then + rm -rf build target +fi + +if [ -f "$DEST" ]; then + rm "$DEST" +fi + +printf "version=%s" "$VERSION" > build.properties + +ant artifacts || exit 1 + +scripts/create-relocatable-package.py --version "$VERSION" "$DEST" + +tar -zvf "$DEST" \ + --transform='s|^build/lib/jars|lib|' \ + --transform="s|^build/apache-cassandra-$VERSION.jar|apache-cassandra-$VERSION.jar|" \ + --transform="s|^build/apache-cassandra-$VERSION.jar|apache-cassandra-$VERSION.jar|" \ + conf/ \ + bin/ \ + build/lib/jars \ + "build/lib/jars/apache-cassandra-$VERSION.jar" \ + "build/lib/jars/apache-cassandra-thrift-$VERSION.jar" \ + README.md \ + CHANGELOG.md \ + LICENSE.txt \ + NEWS.txt \ + NOTICE.txt \ diff --git a/reloc/build_rpm.sh b/scripts/build_rpm.sh similarity index 76% rename from reloc/build_rpm.sh rename to scripts/build_rpm.sh index 63fae20d62..c2de38690d 100755 --- a/reloc/build_rpm.sh +++ b/scripts/build_rpm.sh @@ -1,12 +1,14 @@ #!/bin/bash -e . /etc/os-release + print_usage() { echo "build_rpm.sh --reloc-pkg build/scylla-tools-package.tar.gz" echo " --reloc-pkg specify relocatable package path" echo " --builddir specify rpmbuild directory" exit 1 } + RELOC_PKG=build/scylla-tools-package.tar.gz BUILDDIR=build/redhat while [ $# -gt 0 ]; do @@ -25,21 +27,20 @@ while [ $# -gt 0 ]; do esac done -RELOC_PKG=$(readlink -f $RELOC_PKG) -RPMBUILD=$(readlink -f $BUILDDIR) +RELOC_PKG=$(readlink -f "$RELOC_PKG") +RPMBUILD=$(readlink -f "$BUILDDIR") mkdir -p "$BUILDDIR" -tar -C "$BUILDDIR" -xpf $RELOC_PKG scylla-tools/SCYLLA-RELEASE-FILE scylla-tools/SCYLLA-RELOCATABLE-FILE scylla-tools/SCYLLA-VERSION-FILE scylla-tools/SCYLLA-PRODUCT-FILE scylla-tools/dist/redhat +tar -C "$BUILDDIR" -xpf "$RELOC_PKG" scylla-tools/SCYLLA-RELEASE-FILE scylla-tools/SCYLLA-RELOCATABLE-FILE scylla-tools/SCYLLA-VERSION-FILE scylla-tools/SCYLLA-PRODUCT-FILE scylla-tools/dist/redhat cd "$BUILDDIR"/scylla-tools RELOC_PKG_BASENAME=$(basename "$RELOC_PKG") SCYLLA_VERSION=$(cat SCYLLA-VERSION-FILE) SCYLLA_RELEASE=$(cat SCYLLA-RELEASE-FILE) -VERSION=$SCYLLA_VERSION-$SCYLLA_RELEASE PRODUCT=$(cat SCYLLA-PRODUCT-FILE) mkdir -p $RPMBUILD/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} -ln -fv $RELOC_PKG $RPMBUILD/SOURCES/ +ln -fv "$RELOC_PKG" "$RPMBUILD/SOURCES/" parameters=( -D"version $SCYLLA_VERSION" @@ -48,6 +49,6 @@ parameters=( -D"reloc_pkg $RELOC_PKG_BASENAME" ) -cp dist/redhat/scylla-tools.spec $RPMBUILD/SPECS +cp dist/redhat/scylla-tools.spec "$RPMBUILD/SPECS" # this rpm can be install on both fedora / centos7, so drop distribution name from the file name rpmbuild -ba "${parameters[@]}" --define '_binary_payload w2.xzdio' --define "_topdir $RPMBUILD" --undefine "dist" $RPMBUILD/SPECS/scylla-tools.spec diff --git a/scripts/create-relocatable-package.py b/scripts/create-relocatable-package.py index 5e4f550f35..c64f2c507c 100755 --- a/scripts/create-relocatable-package.py +++ b/scripts/create-relocatable-package.py @@ -21,22 +21,19 @@ # along with Scylla. If not, see . # -import argparse -import io -import os -import tarfile -import pathlib +from argparse import ArgumentParser +from tarfile import TarFile, open as taropen -RELOC_PREFIX='scylla-tools' +RELOC_PREFIX='cassandra-stress' def reloc_add(self, name, arcname=None, recursive=True, *, filter=None): if arcname: - return self.add(name, arcname="{}/{}".format(RELOC_PREFIX, arcname)) + return self.add(name, arcname=f"{RELOC_PREFIX}/{arcname}") else: - return self.add(name, arcname="{}/{}".format(RELOC_PREFIX, name)) + return self.add(name, arcname=f"{RELOC_PREFIX}/{name}") -tarfile.TarFile.reloc_add = reloc_add +TarFile.reloc_add = reloc_add -ap = argparse.ArgumentParser(description='Create a relocatable scylla package.') +ap = ArgumentParser(description='Create a relocatable scylla package.') ap.add_argument('--version', required=True, help='Tools version') ap.add_argument('dest', @@ -47,17 +44,12 @@ def reloc_add(self, name, arcname=None, recursive=True, *, filter=None): version = args.version output = args.dest -ar = tarfile.open(output, mode='w|gz') +ar = taropen(output, mode='w|gz') # relocatable package format version = 2 with open('build/.relocatable_package_version', 'w') as f: f.write('2\n') ar.add('build/.relocatable_package_version', arcname='.relocatable_package_version') -pathlib.Path('build/SCYLLA-RELOCATABLE-FILE').touch() -ar.reloc_add('build/SCYLLA-RELOCATABLE-FILE', arcname='SCYLLA-RELOCATABLE-FILE') -ar.reloc_add('build/SCYLLA-RELEASE-FILE', arcname='SCYLLA-RELEASE-FILE') -ar.reloc_add('build/SCYLLA-VERSION-FILE', arcname='SCYLLA-VERSION-FILE') -ar.reloc_add('build/SCYLLA-PRODUCT-FILE', arcname='SCYLLA-PRODUCT-FILE') ar.reloc_add('dist') ar.reloc_add('conf') ar.reloc_add('bin') @@ -65,9 +57,9 @@ def reloc_add(self, name, arcname=None, recursive=True, *, filter=None): ar.reloc_add('lib') ar.reloc_add('doc') ar.reloc_add('install.sh') -ar.reloc_add('build/apache-cassandra-{}.jar'.format(version), arcname='lib/apache-cassandra-{}.jar'.format(version)) -ar.reloc_add('build/apache-cassandra-thrift-{}.jar'.format(version), arcname='lib/apache-cassandra-thrift-{}.jar'.format(version)) -ar.reloc_add('build/scylla-tools-{}.jar'.format(version), arcname='lib/scylla-tools-{}.jar'.format(version)) +ar.reloc_add(f'build/apache-cassandra-{version}.jar', arcname=f'lib/apache-cassandra-{version}.jar') +ar.reloc_add(f'build/apache-cassandra-thrift-{version}.jar', arcname=f'lib/apache-cassandra-thrift-{version}.jar') +ar.reloc_add(f'build/scylla-tools-{version}.jar', arcname=f'lib/scylla-tools-{version}.jar') ar.reloc_add('build/tools/lib/stress.jar', arcname='lib/stress.jar') ar.reloc_add('README.md') ar.reloc_add('CHANGES.txt') diff --git a/scripts/git-archive-all b/scripts/git-archive-all deleted file mode 100755 index 3552c6b5ed..0000000000 --- a/scripts/git-archive-all +++ /dev/null @@ -1,494 +0,0 @@ -#! /usr/bin/env python -# coding=utf-8 - -from __future__ import print_function -from __future__ import unicode_literals - -__version__ = "1.9" - -import logging -from os import extsep, path, readlink, curdir -from subprocess import CalledProcessError, Popen, PIPE -import sys -import tarfile -from zipfile import ZipFile, ZipInfo, ZIP_DEFLATED - - -class GitArchiver(object): - """ - GitArchiver - - Scan a git repository and export all tracked files, and submodules. - Checks for .gitattributes files in each directory and uses 'export-ignore' - pattern entries for ignore files in the archive. - - >>> archiver = GitArchiver(main_repo_abspath='my/repo/path') - >>> archiver.create('output.zip') - """ - LOG = logging.getLogger('GitArchiver') - - def __init__(self, prefix='', exclude=True, force_sub=False, extra=None, main_repo_abspath=None): - """ - @param prefix: Prefix used to prepend all paths in the resulting archive. - Extra file paths are only prefixed if they are not relative. - E.g. if prefix is 'foo' and extra is ['bar', '/baz'] the resulting archive will look like this: - / - baz - foo/ - bar - @type prefix: string - - @param exclude: Determines whether archiver should follow rules specified in .gitattributes files. - @type exclude: bool - - @param force_sub: Determines whether submodules are initialized and updated before archiving. - @type force_sub: bool - - @param extra: List of extra paths to include in the resulting archive. - @type extra: list - - @param main_repo_abspath: Absolute path to the main repository (or one of subdirectories). - If given path is path to a subdirectory (but not a submodule directory!) it will be replaced - with abspath to top-level directory of the repository. - If None, current cwd is used. - @type main_repo_abspath: string - """ - if extra is None: - extra = [] - - if main_repo_abspath is None: - main_repo_abspath = path.abspath('') - elif not path.isabs(main_repo_abspath): - raise ValueError("You MUST pass absolute path to the main git repository.") - - try: - self.run_shell("[ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1", main_repo_abspath) - except Exception as e: - raise ValueError("Not a git repository (or any of the parent directories).") - - main_repo_abspath = path.abspath(self.read_git_shell('git rev-parse --show-toplevel', main_repo_abspath).rstrip()) - - self.prefix = prefix - self.exclude = exclude - self.extra = extra - self.force_sub = force_sub - self.main_repo_abspath = main_repo_abspath - - def create(self, output_path, dry_run=False, output_format=None): - """ - Create the archive at output_file_path. - - Type of the archive is determined either by extension of output_file_path or by output_format. - Supported formats are: gz, zip, bz2, xz, tar, tgz, txz - - @param output_path: Output file path. - @type output_path: string - - @param dry_run: Determines whether create should do nothing but print what it would archive. - @type dry_run: bool - - @param output_format: Determines format of the output archive. If None, format is determined from extension - of output_file_path. - @type output_format: string - """ - if output_format is None: - file_name, file_ext = path.splitext(output_path) - output_format = file_ext[len(extsep):].lower() - self.LOG.debug("Output format is not explicitly set, determined format is {}.".format(output_format)) - - if not dry_run: - if output_format == 'zip': - archive = ZipFile(path.abspath(output_path), 'w') - - def add_file(file_path, arcname): - if not path.islink(file_path): - archive.write(file_path, arcname, ZIP_DEFLATED) - else: - i = ZipInfo(arcname) - i.create_system = 3 - i.external_attr = 0xA1ED0000 - archive.writestr(i, readlink(file_path)) - elif output_format in ['tar', 'bz2', 'gz', 'xz', 'tgz', 'txz']: - if output_format == 'tar': - t_mode = 'w' - elif output_format == 'tgz': - t_mode = 'w:gz' - elif output_format == 'txz': - t_mode = 'w:xz' - else: - t_mode = 'w:{}'.format(output_format) - - archive = tarfile.open(path.abspath(output_path), t_mode) - add_file = lambda file_path, arcname: archive.add(file_path, arcname) - else: - raise RuntimeError("Unknown format: {}".format(output_format)) - - def archiver(file_path, arcname): - self.LOG.debug("Compressing {} => {}...".format(file_path, arcname)) - add_file(file_path, arcname) - else: - archive = None - archiver = lambda file_path, arcname: self.LOG.info("{} => {}".format(file_path, arcname)) - - self.archive_all_files(archiver) - - if archive is not None: - archive.close() - - def get_exclude_patterns(self, repo_abspath, repo_file_paths): - """ - Returns exclude patterns for a given repo. It looks for .gitattributes files in repo_file_paths. - - Resulting dictionary will contain exclude patterns per path (relative to the repo_abspath). - E.g. {('.', 'Catalyst', 'Editions', 'Base'), ['Foo*', '*Bar']} - - @type repo_abspath: string - @param repo_abspath: Absolute path to the git repository. - - @type repo_file_paths: list - @param repo_file_paths: List of paths relative to the repo_abspath that are under git control. - - @rtype: dict - @return: Dictionary representing exclude patterns. - Keys are tuples of strings. Values are lists of strings. - Returns None if self.exclude is not set. - """ - if not self.exclude: - return None - - def read_attributes(attributes_abspath): - patterns = [] - if path.isfile(attributes_abspath): - attributes = open(attributes_abspath, 'r').readlines() - patterns = [] - for line in attributes: - tokens = line.strip().split() - if "export-ignore" in tokens[1:]: - patterns.append(tokens[0]) - return patterns - - exclude_patterns = {(): []} - - # There may be no gitattributes. - try: - global_attributes_abspath = self.read_shell("git config --get core.attributesfile", repo_abspath).rstrip() - exclude_patterns[()] = read_attributes(global_attributes_abspath) - except: - # And it's valid to not have them. - pass - - for attributes_abspath in [path.join(repo_abspath, f) for f in repo_file_paths if f.endswith(".gitattributes")]: - # Each .gitattributes affects only files within its directory. - key = tuple(self.get_path_components(repo_abspath, path.dirname(attributes_abspath))) - exclude_patterns[key] = read_attributes(attributes_abspath) - - local_attributes_abspath = path.join(repo_abspath, ".git", "info", "attributes") - key = tuple(self.get_path_components(repo_abspath, repo_abspath)) - - if key in exclude_patterns: - exclude_patterns[key].extend(read_attributes(local_attributes_abspath)) - else: - exclude_patterns[key] = read_attributes(local_attributes_abspath) - - return exclude_patterns - - def is_file_excluded(self, repo_abspath, repo_file_path, exclude_patterns): - """ - Checks whether file at a given path is excluded. - - @type repo_abspath: string - @param repo_abspath: Absolute path to the git repository. - - @type repo_file_path: string - @param repo_file_path: Path to a file within repo_abspath. - - @type exclude_patterns: dict - @param exclude_patterns: Exclude patterns with format specified for get_exclude_patterns. - - @rtype: bool - @return: True if file should be excluded. Otherwise False. - """ - if exclude_patterns is None or not len(exclude_patterns): - return False - - from fnmatch import fnmatch - - file_name = path.basename(repo_file_path) - components = self.get_path_components(repo_abspath, path.join(repo_abspath, path.dirname(repo_file_path))) - - is_excluded = False - # We should check all patterns specified in intermediate directories to the given file. - # At the end we should also check for the global patterns (key '()' or empty tuple). - while not is_excluded: - key = tuple(components) - if key in exclude_patterns: - patterns = exclude_patterns[key] - for p in patterns: - if fnmatch(file_name, p) or fnmatch(repo_file_path, p): - self.LOG.debug("Exclude pattern matched {}: {}".format(p, repo_file_path)) - is_excluded = True - - if not len(components): - break - - components.pop() - - return is_excluded - - def archive_all_files(self, archiver): - """ - Archive all files using archiver. - - @param archiver: Function that accepts 2 arguments: abspath to file on the system and relative path within archive. - """ - for file_path in self.extra: - archiver(path.abspath(file_path), path.join(self.prefix, file_path)) - - for file_path in self.walk_git_files(): - archiver(path.join(self.main_repo_abspath, file_path), path.join(self.prefix, file_path)) - - def walk_git_files(self, repo_path=''): - """ - An iterator method that yields a file path relative to main_repo_abspath - for each file that should be included in the archive. - Skips those that match the exclusion patterns found in - any discovered .gitattributes files along the way. - - Recurs into submodules as well. - - @type repo_path: string - @param repo_path: Path to the git submodule repository relative to main_repo_abspath. - - @rtype: iterator - @return: Iterator to traverse files under git control relative to main_repo_abspath. - """ - repo_abspath = path.join(self.main_repo_abspath, repo_path) - repo_file_paths = self.read_git_shell("git ls-files --cached --full-name --no-empty-directory", repo_abspath).splitlines() - exclude_patterns = self.get_exclude_patterns(repo_abspath, repo_file_paths) - - for repo_file_path in repo_file_paths: - # Git puts path in quotes if file path has unicode characters. - repo_file_path = repo_file_path.strip('"') # file path relative to current repo - file_name = path.basename(repo_file_path) - main_repo_file_path = path.join(repo_path, repo_file_path) # file path relative to the main repo - - # Only list symlinks and files that don't start with git. - if file_name.startswith(".git") or (not path.islink(main_repo_file_path) and path.isdir(main_repo_file_path)): - continue - - if self.is_file_excluded(repo_abspath, repo_file_path, exclude_patterns): - continue - - yield main_repo_file_path - - if self.force_sub: - self.run_shell("git submodule init", repo_abspath) - self.run_shell("git submodule update", repo_abspath) - - for submodule_path in self.read_shell("git submodule --quiet foreach 'pwd -P'", repo_abspath).splitlines(): - # Shell command returns absolute paths to submodules. - submodule_path = path.relpath(submodule_path, self.main_repo_abspath) - for file_path in self.walk_git_files(submodule_path): - yield file_path - - @staticmethod - def get_path_components(repo_abspath, abspath): - """ - Split given abspath into components relative to repo_abspath. - These components are primarily used as unique keys of files and folders within a repository. - - E.g. if repo_abspath is '/Documents/Hobby/ParaView/' and abspath is - '/Documents/Hobby/ParaView/Catalyst/Editions/Base/', function will return: - ['.', 'Catalyst', 'Editions', 'Base'] - - First element is always '.' (concrete symbol depends on OS). - - @param repo_abspath: Absolute path to the git repository. Normalized via os.path.normpath. - @type repo_abspath: string - - @param abspath: Absolute path to a file within repo_abspath. Normalized via os.path.normpath. - @type abspath: string - - @return: List of path components. - @rtype: list - """ - repo_abspath = path.normpath(repo_abspath) - abspath = path.normpath(abspath) - - if not path.isabs(repo_abspath): - raise ValueError("repo_abspath MUST be absolute path.") - - if not path.isabs(abspath): - raise ValueError("abspath MUST be absoulte path.") - - if not path.commonprefix([repo_abspath, abspath]): - raise ValueError("abspath (\"{}\") MUST have common prefix with repo_abspath (\"{}\")".format(abspath, repo_abspath)) - - components = [] - - while not abspath == repo_abspath: - abspath, tail = path.split(abspath) - - if tail: - components.insert(0, tail) - - components.insert(0, curdir) - return components - - @staticmethod - def run_shell(cmd, cwd=None): - """ - Runs shell command. - - @type cmd: string - @param cmd: Command to be executed. - - @type cwd: string - @param cwd: Working directory. - - @rtype: int - @return: Return code of the command. - - @raise CalledProcessError: Raises exception if return code of the command is non-zero. - """ - p = Popen(cmd, shell=True, cwd=cwd) - p.wait() - - if p.returncode: - raise CalledProcessError(returncode=p.returncode, cmd=cmd) - - return p.returncode - - @staticmethod - def read_shell(cmd, cwd=None, encoding='utf-8'): - """ - Runs shell command and reads output. - - @type cmd: string - @param cmd: Command to be executed. - - @type cwd: string - @param cwd: Working directory. - - @type encoding: string - @param encoding: Encoding used to decode bytes returned by Popen into string. - - @rtype: string - @return: Output of the command. - - @raise CalledProcessError: Raises exception if return code of the command is non-zero. - """ - p = Popen(cmd, shell=True, stdout=PIPE, cwd=cwd) - output, _ = p.communicate() - output = output.decode(encoding) - - if p.returncode: - if sys.version_info > (2,6): - raise CalledProcessError(returncode=p.returncode, cmd=cmd, output=output) - else: - raise CalledProcessError(returncode=p.returncode, cmd=cmd) - - return output - - @staticmethod - def read_git_shell(cmd, cwd=None): - """ - Runs git shell command, reads output and decodes it into unicode string - - @type cmd: string - @param cmd: Command to be executed. - - @type cwd: string - @param cwd: Working directory. - - @rtype: string - @return: Output of the command. - - @raise CalledProcessError: Raises exception if return code of the command is non-zero. - """ - p = Popen(cmd, shell=True, stdout=PIPE, cwd=cwd) - output, _ = p.communicate() - output = output.decode('unicode_escape').encode('raw_unicode_escape').decode('utf-8') - - if p.returncode: - if sys.version_info > (2,6): - raise CalledProcessError(returncode=p.returncode, cmd=cmd, output=output) - else: - raise CalledProcessError(returncode=p.returncode, cmd=cmd) - - return output - - -if __name__ == '__main__': - from optparse import OptionParser - - parser = OptionParser(usage="usage: %prog [-v] [--prefix PREFIX] [--no-exclude] [--force-submodules] [--extra EXTRA1 [EXTRA2]] [--dry-run] OUTPUT_FILE", - version="%prog {}".format(__version__)) - - parser.add_option('--prefix', - type='string', - dest='prefix', - default=None, - help="prepend PREFIX to each filename in the archive. OUTPUT_FILE name is used by default to avoid tarbomb. You can set it to '' in order to explicitly request tarbomb") - - parser.add_option('-v', '--verbose', - action='store_true', - dest='verbose', - help='enable verbose mode') - - parser.add_option('--no-exclude', - action='store_false', - dest='exclude', - default=True, - help="don't read .gitattributes files for patterns containing export-ignore attrib") - - parser.add_option('--force-submodules', - action='store_true', - dest='force_sub', - help="force a git submodule init && git submodule update at each level before iterating submodules") - - parser.add_option('--extra', - action='append', - dest='extra', - default=[], - help="any additional files to include in the archive") - - parser.add_option('--dry-run', - action='store_true', - dest='dry_run', - help="don't actually archive anything, just show what would be done") - - options, args = parser.parse_args() - - if len(args) != 1: - parser.error("You must specify exactly one output file") - - output_file_path = args[0] - - if path.isdir(output_file_path): - parser.error("You cannot use directory as output") - - # avoid tarbomb - if options.prefix is not None: - options.prefix = path.join(options.prefix, '') - else: - import re - - output_name = path.basename(output_file_path) - output_name = re.sub('(\.zip|\.tar|\.tgz|\.txz|\.gz|\.bz2|\.xz|\.tar\.gz|\.tar\.bz2|\.tar\.xz)$', '', output_name) or "Archive" - options.prefix = path.join(output_name, '') - - try: - handler = logging.StreamHandler(sys.stdout) - handler.setFormatter(logging.Formatter('%(message)s')) - GitArchiver.LOG.addHandler(handler) - GitArchiver.LOG.setLevel(logging.DEBUG if options.verbose else logging.INFO) - archiver = GitArchiver(options.prefix, - options.exclude, - options.force_sub, - options.extra) - archiver.create(output_file_path, options.dry_run) - except Exception as e: - parser.exit(2, "{}\n".format(e)) - - sys.exit(0) diff --git a/tools/bin/cassandra-stress.bat b/tools/bin/cassandra-stress.bat deleted file mode 100644 index 5c2ecfaade..0000000000 --- a/tools/bin/cassandra-stress.bat +++ /dev/null @@ -1,22 +0,0 @@ -@REM Licensed to the Apache Software Foundation (ASF) under one or more -@REM contributor license agreements. See the NOTICE file distributed with -@REM this work for additional information regarding copyright ownership. -@REM The ASF licenses this file to You under the Apache License, Version 2.0 -@REM (the "License"); you may not use this file except in compliance with -@REM the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, software -@REM distributed under the License is distributed on an "AS IS" BASIS, -@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@REM See the License for the specific language governing permissions and -@REM limitations under the License. - -@echo off -if "%OS%" == "Windows_NT" setlocal - -pushd "%~dp0" -call cassandra.in.bat -if NOT DEFINED STRESS_HOME set STRESS_HOME=%CD%\.. -"%JAVA_HOME%\bin\java" %CASSANDRA_PARAMS% -cp %CASSANDRA_CLASSPATH% org.apache.cassandra.stress.Stress %* diff --git a/tools/bin/cassandra.in.bat b/tools/bin/cassandra.in.bat deleted file mode 100644 index 0fdd31a682..0000000000 --- a/tools/bin/cassandra.in.bat +++ /dev/null @@ -1,45 +0,0 @@ -@REM -@REM Licensed to the Apache Software Foundation (ASF) under one or more -@REM contributor license agreements. See the NOTICE file distributed with -@REM this work for additional information regarding copyright ownership. -@REM The ASF licenses this file to You under the Apache License, Version 2.0 -@REM (the "License"); you may not use this file except in compliance with -@REM the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, software -@REM distributed under the License is distributed on an "AS IS" BASIS, -@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@REM See the License for the specific language governing permissions and -@REM limitations under the License. - -@echo off -if NOT DEFINED CASSANDRA_HOME set CASSANDRA_HOME=%CD%\..\.. -if NOT DEFINED CASSANDRA_CONF set CASSANDRA_CONF="%CASSANDRA_HOME%\conf" - -REM JAVA_HOME can optionally be set here -REM set JAVA_HOME="" - -REM ***** CLASSPATH library setting ***** - -REM Ensure that any user defined CLASSPATH variables are not used on startup -set CLASSPATH=%CASSANDRA_CONF% - -REM For each jar in the CASSANDRA_HOME lib directory call append to build the CLASSPATH variable. -for %%i in ("%CASSANDRA_HOME%\lib\*.jar") do call :append "%%i" -for %%i in ("%CASSANDRA_HOME%\tools\lib\*.jar") do call :append "%%i" -for %%i in ("%CASSANDRA_HOME%\build\*.jar") do call :append "%%i" -goto :okClasspath - -:append -set CLASSPATH=%CLASSPATH%;%1 -goto :eof - -:okClasspath - -REM Include the build\classes\main directory so it works in development -set CASSANDRA_CLASSPATH=%CLASSPATH%;%CASSANDRA_CONF%;"%CASSANDRA_HOME%\build\classes\main";"%CASSANDRA_HOME%\build\classes\thrift";"%CASSANDRA_HOME%\build\classes\stress" - -REM Add the default storage location. Can be overridden in conf\cassandra.yaml -set CASSANDRA_PARAMS=%CASSANDRA_PARAMS% "-Dcassandra.storagedir=%CASSANDRA_HOME%\data"