78c3b7627f
On 52bd496, we stopped to rm -rf debian/ on build_deb.sh, since now we have prebuilt debian/ directory. However, it might cause .deb build error when we modified debian package source, since it never cleanup. To prevent build error, we need to cleanup build/debian on reloc/build_deb.sh, before extracting contents from relocatable package.
33 lines
758 B
Bash
Executable File
33 lines
758 B
Bash
Executable File
#!/bin/bash -e
|
|
|
|
. /etc/os-release
|
|
print_usage() {
|
|
echo "build_deb.sh --reloc-pkg build/scylla-jmx-package.tar.gz"
|
|
echo " --reloc-pkg specify relocatable package path"
|
|
exit 1
|
|
}
|
|
|
|
RELOC_PKG=$(readlink -f build/scylla-jmx-package.tar.gz)
|
|
OPTS=""
|
|
while [ $# -gt 0 ]; do
|
|
case "$1" in
|
|
"--reloc-pkg")
|
|
OPTS="$OPTS $1 $(readlink -f $2)"
|
|
RELOC_PKG=$2
|
|
shift 2
|
|
;;
|
|
*)
|
|
print_usage
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [[ ! $OPTS =~ --reloc-pkg ]]; then
|
|
OPTS="$OPTS --reloc-pkg $RELOC_PKG"
|
|
fi
|
|
rm -rf build/debian
|
|
mkdir -p build/debian/scylla-package
|
|
tar -C build/debian/scylla-package -xpf $RELOC_PKG
|
|
cd build/debian/scylla-package
|
|
exec ./scylla-jmx/dist/debian/build_deb.sh $OPTS
|