diff --git a/ChangeLog b/ChangeLog deleted file mode 100644 index 798ca28..0000000 --- a/ChangeLog +++ /dev/null @@ -1,44 +0,0 @@ -* Mar Jan 16 2016 Dejan Muhamedagic and others -- stable release 1.0 -- systemd: add booth-arbitrator.service (bsc#967036) -- main: improve address matching procedure - -* Mon Jan 11 2016 Dejan Muhamedagic and others -- release candidate 1.0 rc1 -- main: prevent segfault on no arguments -- ticket: term 0 is a valid term (bsc#952426) -- main: add 'other' as possible site reference -- arbitrator: mark expired tickets as lost (bsc#956321) -- geo attributes support -- booth-keygen: key generate auxiliary program -- ticket: prevent running external program twice -- ticket: make sure that we're the leader if granting ticket (bsc#940037) -- docs: add booth processing FSM dot graphs -- main: add booth peers command -- main: don't allow zero poll timeout (bsc#938820) -- pcmk: don't log error when ticket not in CIB -- client: fix memory leak in ticket list -- client: fix memory growing indefinitely on new client connect -- extprog: ignore running external program on revoke -- client: make sure that the client is still there to be notified -- client: don't allow SIGPIPE to kill the server (if the client leaves too early) -- extprog: preserve child exit status -- extprog: run programs asynchronously -- clients: fix memory leak when removing client -- transport: use non-blocking read -- hmac based authentication support -- ticket: ignore late MY_INDEX requests -- contrib: add geo-cluster.fwd (suse firewall rules) -- ticket: restart elections after last candidate disappears -- ticket: add -C option (wait for commit) -- raft: handle duplicate ticket release requests -- booth-site: exit early in start if daemon cannot start -- raft: ignore messages with invalid term (lower than already committed) -- raft: better control of term increment -- ticket: allow finer resolution time in messages -- use subsecond timers internally -- booth-arbitrator: fix exit codes for all actions -- booth-arbitrator: set the right LSB exit code in status -- booth-arbitrator: fix stop exit code (bnc#914306) -- booth-arbitrator: update exit codes -- main: use /proc/self/oom_score_adj instead of oom_adj (bnc#914037) diff --git a/Makefile.am b/Makefile.am index f06e088..22b8a65 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,236 +1,247 @@ # Copyright (c) 2009 Red Hat, Inc. # # Authors: Andrew Beekhof # Steven Dake (sdake@redhat.com) # # This software licensed under BSD license, the text of which follows: # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # - Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # - Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # - Neither the name of the MontaVista Software, Inc. nor the names of its # contributors may be used to endorse or promote products derived from this # software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF # THE POSSIBILITY OF SUCH DAMAGE. SPEC = $(PACKAGE_NAME).spec TARFILE = $(PACKAGE_NAME)-$(VERSION).tar.gz EXTRA_DIST = autogen.sh conf/booth.conf.example \ script/booth-keygen script/lsb script/ocf script/service-runnable.in \ script/unit-test.py.in script/wireshark-dissector.lua \ test/arbtests.py test/assertions.py test/booth_path test/boothrunner.py \ test/boothtestenv.py.in test/clientenv.py test/clienttests.py test/live_test.sh \ test/runtests.py.in test/serverenv.py test/servertests.py test/sitetests.py \ test/utils.py \ unit-tests \ contrib \ $(SPEC).in booth-rpmlintrc \ - .version build-aux/git-version-gen build-aux/PKG_CHECK_VAR.m4 + .version build-aux/git-version-gen build-aux/PKG_CHECK_VAR.m4 \ + build-aux/gitlog-to-changelog build-aux/release.mk AUTOMAKE_OPTIONS = foreign MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure depcomp \ config.guess config.sub missing install-sh \ autoheader automake autoconf test_lense.sh \ compile dist_doc_DATA = AUTHORS README COPYING README.upgrade-from-v0.1 README-testing boothconfdir = ${BOOTHSYSCONFDIR} boothconf_DATA = conf/booth.conf.example boothsitedir = $(ocfdir)/resource.d/pacemaker boothsite_SCRIPTS = script/ocf/booth-site boothocfdir = $(ocfdir)/resource.d/booth boothocf_SCRIPTS = script/ocf/sharedrsc script/ocf/geostore boothocflibdir = $(ocfdir)/lib/booth boothocflib_DATA = script/ocf/geo_attr.sh bootharbitratordir = ${INITDDIR} bootharbitrator_SCRIPTS = script/lsb/booth-arbitrator boothnoarchdir = $(datadir)/$(PACKAGE_NAME) nodist_boothnoarch_SCRIPTS = script/service-runnable sbin_SCRIPTS = script/booth-keygen pkgconfigdir = $(datadir)/pkgconfig pkgconfig_DATA = booth.pc TESTS = test/runtests.py SUBDIRS = src docs conf coverity: cov-build --dir=cov make cov-analyze --dir cov --concurrency --wait-for-license cov-format-errors --dir cov install-exec-local: $(INSTALL) -d $(DESTDIR)/${boothconfdir} $(INSTALL) -d $(DESTDIR)/${bootharbitratordir} $(INSTALL) -d $(DESTDIR)/${boothsitedir} $(INSTALL) -d $(DESTDIR)/${boothocfdir} $(INSTALL) -d $(DESTDIR)/${BOOTH_LIB_DIR} -m 750 -chown $(CRM_DAEMON_USER):$(CRM_DAEMON_GROUP) $(DESTDIR)/${BOOTH_LIB_DIR} $(INSTALL) -d $(DESTDIR)/${BOOTH_CORE_DIR} -m 750 -chown $(CRM_DAEMON_USER):$(CRM_DAEMON_GROUP) $(DESTDIR)/${BOOTH_CORE_DIR} install-exec-hook: ln -sf ${sbindir}/boothd $(DESTDIR)/${sbindir}/booth ln -sf ${sbindir}/boothd $(DESTDIR)/${sbindir}/geostore uninstall-local: rmdir $(DESTDIR)/${boothconfdir} || :; rmdir $(DESTDIR)/${bootharbitratordir} || :; rmdir $(DESTDIR)/${boothsitedir} || :; rmdir $(DESTDIR)/${BOOTH_CORE_DIR} || :; rmdir $(DESTDIR)/${BOOTH_LIB_DIR} || :; test: check lint: for dir in src; do make -C $$dir lint; done clean-local: rm -rf test/*.pyc test/__pycache__ test/runtests.py test/boothtestenv.py cov* $(SPEC) dist-clean-local: rm -f autoconf automake autoheader # release/versioning BUILT_SOURCES = .version .version: echo $(VERSION) > $@-t && mv $@-t $@ -dist-hook: +dist-hook: gen-ChangeLog echo $(VERSION) > $(distdir)/.tarball-version test/runtests.py: test/runtests.py.in test/boothtestenv.py rm -f $@-t $@ mkdir -p ${abs_top_builddir}/test sed \ -e 's#PYTHON_SHEBANG#${PYTHON_SHEBANG}#g' \ -e 's#TEST_SRC_DIR#${abs_top_srcdir}/test#g' \ -e 's#TEST_BUILD_DIR#${abs_top_builddir}/test#g' \ $< > $@-t; chmod a-w $@-t chmod u+x $@-t mv $@-t $@ test/boothtestenv.py: test/boothtestenv.py.in rm -f $@-t $@ mkdir -p ${abs_top_builddir}/test sed \ -e 's#TEST_SRC_DIR#${abs_top_srcdir}/test#g' \ -e 's#TEST_BUILD_DIR#${abs_top_builddir}/test#g' \ $< > $@-t; chmod a-w $@-t mv $@-t $@ ## make rpm/srpm section. $(abs_builddir)/booth-rpmlintrc: cat $(abs_srcdir)/booth-rpmlintrc > booth-rpmlintrc $(SPEC): $(SPEC).in .version config.status $(abs_builddir)/booth-rpmlintrc rm -f $@-t $@ date="$(shell LC_ALL=C date "+%a %b %d %Y")" && \ gvgver="`cd $(abs_srcdir); build-aux/git-version-gen --fallback $(VERSION) .tarball-version .gitarchivever`" && \ if [ "$$gvgver" = "`echo $$gvgver | sed 's/-/./'`" ];then \ rpmver="$$gvgver" && \ alphatag="" && \ dirty="" && \ numcomm="0"; \ else \ gitver="`echo $$gvgver | sed 's/\(.*\)\./\1-/'`" && \ rpmver=`echo $$gitver | sed 's/-.*//g'` && \ alphatag=`echo $$gvgver | sed 's/[^-]*-\([^-]*\).*/\1/'` && \ numcomm=`echo $$gitver | sed 's/[^-]*-\([^-]*\).*/\1/'` && \ dirty="" && \ if [ "`echo $$gitver | sed 's/^.*-dirty$$//g'`" = "" ];then \ dirty="dirty"; \ fi \ fi && \ if [ "$$numcomm" = "0" ]; then numcomm=""; fi && \ if [ -n "$$numcomm" ]; then numcomm="%global numcomm $$numcomm"; fi && \ if [ "$$alphatag" = "$$gitver" ]; then alphatag=""; fi && \ if [ -n "$$alphatag" ]; then alphatag="%global alphatag $$alphatag"; fi && \ if [ -n "$$dirty" ]; then dirty="%global dirty dirty"; fi && \ sed \ -e "s#@version@#$$rpmver#g" \ -e "s#@ALPHATAG@#$$alphatag#g" \ -e "s#@NUMCOMM@#$$numcomm#g" \ -e "s#@DIRTY@#$$dirty#g" \ -e "s#@date@#$$date#g" \ $(abs_srcdir)/$@.in > $@-t; sed -i -e "s#@uname@#$(CRM_DAEMON_USER)#g" $@-t sed -i -e "s#@gname@#$(CRM_DAEMON_GROUP)#g" $@-t if BUILD_ASCIIDOC_HTML_MAN sed -i -e "s#@bcond_html_man@#bcond_without#g" $@-t else sed -i -e "s#@bcond_html_man@#bcond_with#g" $@-t endif if IS_ASCIIDOC sed -i -e "s#@asciidoc@#asciidoc#g" $@-t else sed -i -e "s#@asciidoc@#asciidoctor#g" $@-t endif if LOGGING_LIBQB sed -i -e "s#@bcond_glue@#bcond_with#g" $@-t else sed -i -e "s#@bcond_glue@#bcond_without#g" $@-t endif if PYTHON_IS_VERSION3 sed -i -e "s#@bcond_python3@#bcond_without#g" $@-t else sed -i -e "s#@bcond_python3@#bcond_with#g" $@-t endif if RUN_BUILD_TESTS sed -i -e "s#@bcond_run_build_tests@#bcond_without#g" $@-t else sed -i -e "s#@bcond_run_build_tests@#bcond_with#g" $@-t endif chmod a-w $@-t mv $@-t $@ rm -f $@-t* $(TARFILE): $(MAKE) dist RPMBUILDOPTS = --define "_sourcedir $(abs_builddir)" \ --define "_specdir $(abs_builddir)" \ --define "_builddir $(abs_builddir)" \ --define "_srcrpmdir $(abs_builddir)" \ --define "_rpmdir $(abs_builddir)" srpm: clean $(MAKE) $(SPEC) $(TARFILE) rpmbuild $(RPMBUILDOPTS) --nodeps -bs $(SPEC) rpm: clean $(MAKE) $(SPEC) $(TARFILE) rpmbuild $(RPMBUILDOPTS) -ba $(SPEC) + +gen_start_date = 2000-01-01 +.PHONY: gen-ChangeLog +gen-ChangeLog: + if test -d $(abs_srcdir)/.git; then \ + LC_ALL=C $(top_srcdir)/build-aux/gitlog-to-changelog \ + --since=$(gen_start_date) > $(distdir)/cl-t; \ + rm -f $(distdir)/ChangeLog; \ + mv $(distdir)/cl-t $(distdir)/ChangeLog; \ + fi diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog new file mode 100755 index 0000000..7660af5 --- /dev/null +++ b/build-aux/gitlog-to-changelog @@ -0,0 +1,191 @@ +eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}' + & eval 'exec perl -wS "$0" $argv:q' + if 0; +# Convert git log output to ChangeLog format. + +my $VERSION = '2009-10-30 13:46'; # UTC +# The definition above must lie within the first 8 lines in order +# for the Emacs time-stamp write hook (at end) to update it. +# If you change this file with Emacs, please let the write hook +# do its job. Otherwise, update this string manually. + +# Copyright (C) 2008-2010 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program 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 this program. If not, see . + +# Written by Jim Meyering + +use strict; +use warnings; +use Getopt::Long; +use POSIX qw(strftime); + +(my $ME = $0) =~ s|.*/||; + +# use File::Coda; # http://meyering.net/code/Coda/ +END { + defined fileno STDOUT or return; + close STDOUT and return; + warn "$ME: failed to close standard output: $!\n"; + $? ||= 1; +} + +sub usage ($) +{ + my ($exit_code) = @_; + my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR); + if ($exit_code != 0) + { + print $STREAM "Try `$ME --help' for more information.\n"; + } + else + { + print $STREAM < ChangeLog + $ME -- -n 5 foo > last-5-commits-to-branch-foo + +EOF + } + exit $exit_code; +} + +# If the string $S is a well-behaved file name, simply return it. +# If it contains white space, quotes, etc., quote it, and return the new string. +sub shell_quote($) +{ + my ($s) = @_; + if ($s =~ m![^\w+/.,-]!) + { + # Convert each single quote to '\'' + $s =~ s/\'/\'\\\'\'/g; + # Then single quote the string. + $s = "'$s'"; + } + return $s; +} + +sub quoted_cmd(@) +{ + return join (' ', map {shell_quote $_} @_); +} + +{ + my $since_date = '1970-01-01 UTC'; + my $format_string = '%s%n%b%n'; + GetOptions + ( + help => sub { usage 0 }, + version => sub { print "$ME version $VERSION\n"; exit }, + 'since=s' => \$since_date, + 'format=s' => \$format_string, + ) or usage 1; + + my @cmd = (qw (git log --log-size), "--since=$since_date", + '--pretty=format:%ct %an <%ae>%n%n'.$format_string, @ARGV); + open PIPE, '-|', @cmd + or die ("$ME: failed to run `". quoted_cmd (@cmd) ."': $!\n" + . "(Is your Git too old? Version 1.5.1 or later is required.)\n"); + + my $prev_date_line = ''; + while (1) + { + defined (my $in = ) + or last; + $in =~ /^log size (\d+)$/ + or die "$ME:$.: Invalid line (expected log size):\n$in"; + my $log_nbytes = $1; + + my $log; + my $n_read = read PIPE, $log, $log_nbytes; + $n_read == $log_nbytes + or die "$ME:$.: unexpected EOF\n"; + + my @line = split "\n", $log; + my $author_line = shift @line; + defined $author_line + or die "$ME:$.: unexpected EOF\n"; + $author_line =~ /^(\d+) (.*>)$/ + or die "$ME:$.: Invalid line " + . "(expected date/author/email):\n$author_line\n"; + + my $date_line = sprintf "%s $2\n", strftime ("%F", localtime ($1)); + # If this line would be the same as the previous date/name/email + # line, then arrange not to print it. + if ($date_line ne $prev_date_line) + { + $prev_date_line eq '' + or print "\n"; + print $date_line; + } + $prev_date_line = $date_line; + + # Omit "Signed-off-by..." lines. + @line = grep !/^Signed-off-by: .*>$/, @line; + + # If there were any lines + if (@line == 0) + { + warn "$ME: warning: empty commit message:\n $date_line\n"; + } + else + { + # Remove leading and trailing blank lines. + while ($line[0] =~ /^\s*$/) { shift @line; } + while ($line[$#line] =~ /^\s*$/) { pop @line; } + + # Prefix each non-empty line with a TAB. + @line = map { length $_ ? "\t$_" : '' } @line; + + print "\n", join ("\n", @line), "\n"; + } + + defined ($in = ) + or last; + $in ne "\n" + and die "$ME:$.: unexpected line:\n$in"; + } + + close PIPE + or die "$ME: error closing pipe from " . quoted_cmd (@cmd) . "\n"; + # FIXME-someday: include $PROCESS_STATUS in the diagnostic +} + +# Local Variables: +# mode: perl +# indent-tabs-mode: nil +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "my $VERSION = '" +# time-stamp-format: "%:y-%02m-%02d %02H:%02M" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "'; # UTC" +# End: diff --git a/build-aux/release.mk b/build-aux/release.mk new file mode 100644 index 0000000..355442b --- /dev/null +++ b/build-aux/release.mk @@ -0,0 +1,55 @@ +# to build official release tarballs, handle tagging and publish. + +# example: +# make -f build-aux/release.mk all version=1.1 release=yes + +project=booth + +all: checks setup tag tarballs sha256 + +checks: +ifeq (,$(version)) + @echo ERROR: need to define version= + @exit 1 +endif + @if [ ! -d .git ]; then \ + echo This script needs to be executed from top level cluster git tree; \ + exit 1; \ + fi + + @if ! grep "fallback $(version)" configure.ac > /dev/null; then \ + echo "Don't forget update fallback version in configure.ac before release"; \ + exit 1; \ + fi + +setup: checks + ./autogen.sh + ./configure --without-glue + make maintainer-clean + +tag: setup ./tag-$(version) + +tag-$(version): +ifeq (,$(release)) + @echo Building test release $(version), no tagging +else + git tag -a -m "v$(version) release" v$(version) HEAD + @touch $@ +endif + +tarballs: tag + ./autogen.sh + ./configure --without-glue + BOOTH_RUNTESTS_ROOT_USER=1 make distcheck DISTCHECK_CONFIGURE_FLAGS="--without-glue" + +sha256: tarballs $(project)-$(version).sha256 + +$(project)-$(version).sha256: +ifeq (,$(release)) + @echo Building test release $(version), no sha256 +else + sha256sum $(project)-$(version)*tar* | sort -k2 > $@ +endif + +clean: + rm -rf $(project)-* tag-*