rsbackup-3.0/0000775000175000017500000000000012635241747010204 500000000000000rsbackup-3.0/scripts/0000775000175000017500000000000012635241746011672 500000000000000rsbackup-3.0/scripts/dist0000775000175000017500000000526512561432221012477 00000000000000#! /bin/sh # # This file is part of rsbackup # Copyright (C) 2010, 2011, 2013-15 Richard Kettlewell # # 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 . set -e # s COMMAND... # # Echo a command then execute it. s() { echo "$@" >&2 "$@" } hostname=$(uname -n) # r HOST COMMAND... # # Echo a command then execute it remotely. r() { h=$1 shift echo "$h:" "$@" >&2 case "$h" in chroot:* ) ( cd schroot -pc${h#chroot:} -- bash -c "$@" ) ;; * ) ssh $h "$@" ;; esac } # build HOST ARCH # # Create a .deb on HOST for architecture ARCH, then copy it back here # and add it to the list of build products. build() { host=$1 arch=$2 debs="" for b in $binpkgs; do debs="$debs ${b}_${version}_${arch}.deb" done echo echo "Build on $host for $arch" echo r $host "mkdir -p _builds" r $host "cd _builds && rm -rf ${source} ${archive} ${debs}" case "$host" in chroot:* ) cp ${archive} $HOME/_builds/. ;; * ) s scp ${archive} $host:_builds/. ;; esac r $host "cd _builds && tar xfz ${archive}" r $host "cd _builds/${source} && debian/rules build" r $host "cd _builds/${source} && fakeroot debian/rules binary" for deb in $debs; do case "$host" in chroot:* ) cp $HOME/_builds/$deb products/ ;; * ) s scp $host:_builds/$deb products/ ;; esac done echo echo "Built $debs" echo } rm -rf products mkdir products # Build the source archive s make -C doc html s make distcheck srcpkg=rsbackup # source package name binpkgs="rsbackup" # binary packages version=$(make echo-version) # get version number source=${srcpkg}-${version} # source directory archive=${srcpkg}-${version}.tar.gz # tarball # Build .deb files s build araminta amd64 # jessie #s build chroot:wheezy32 i386 # wheezy cp ${archive} doc/*.html doc/*.css products/. rm -f products/*.in.html mv products//CHANGES.html products/rsbackup-CHANGES.html lintian -i -I products/*.deb cd products for f in *.tar.gz *.deb; do echo echo "* Signing $f ..." echo gpg -a -b "$f" done cd .. ls -l products rsbackup-3.0/scripts/fakeshell.sh0000664000175000017500000001652012367444200014100 00000000000000# Copyright © 2014 Richard Kettlewell. # # 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 . # # fake_init [OPTIONS] # # Creates fake workspace directory. # # Options: # --autoclean Clean up workspace on exit (default) # --no-autoclean Don't clean up worksapce on exit # fake_init() { local autoclean=true if [ ! -z "${fake_work}" ]; then echo "ERROR: fake_init already called" >&2 exit 1 fi while [ $# -gt 0 ]; do case "$1" in --autoclean ) autoclean=true shift ;; --no-autoclean ) autoclean=false shift ;; * ) echo "ERROR: fake_init: unknown option '$1'" >&2 exit 1 ;; esac done fake_work=`mktemp -d ${TMPDIR:-/tmp}/tmp.XXXXXXXXXX` PATH="${fake_work}/faked:${PATH}" export PATH if $autoclean; then trap fake_cleanup EXIT INT HUP TERM fi } # # fake_reset # # Clears the set of faked commands. Use this before each test. # fake_reset() { if [ -z "${fake_work}" ]; then echo "ERROR: fake_init not called" >&2 exit 1 fi rm -rf "${fake_work}/faked" "${fake_work}/checks" mkdir "${fake_work}/faked" "${fake_work}/checks" fake_failed=false } # # fake_cmd [OPTIONS] NAME [CMD] [--must-args ARGS] # # Create a faked command called NAME which executes CMD. # The default value of CMD is 'true'. # # Options: # --must-run This command must be run (see fake_check) # --must-not-run This command must not be run (see fake_check) # --must-args Require a specific argument sequence # fake_cmd() { local name cmd must_run must_not_run must_args arg argno limit must_run=false must_not_run=false must_args=false if [ ! -d "${fake_work}/faked" ]; then echo "ERROR: fake_reset not called" >&2 exit 1 fi while [ $# -gt 0 ]; do case "$1" in --must-run ) must_run=true shift ;; --must-not-run ) must_not_run=true shift ;; -* ) echo "ERROR: fake_cmd: unknown option '$1'" >&2 exit 1 ;; * ) break ;; esac done name="$1" shift if [ $# -gt 0 ] && [ "$1" != --must-args ]; then cmd="$1" shift else cmd=true fi if [ $# -gt 0 ] && [ "$1" = --must-args ]; then must_args=true shift else must_args=false fi echo "#! /usr/bin/env bash" > "${fake_work}/faked/${name}" echo "set -e" >> "${fake_work}/faked/${name}" # echo "echo \$0 \"\$@\" >&2" >> "${fake_work}/faked/${name}" if $must_run; then echo "ERROR: ${name}: was not run" > "${fake_work}/checks/${name}.run" echo "rm -f ${fake_work}/checks/${name}.run" \ >> "${fake_work}/faked/${name}" fi if $must_not_run; then echo "echo ERROR: ${name}: was run unexpectedly >> ${fake_work}/checks/${name}.errors" \ >> "${fake_work}/faked/${name}" fi if $must_args; then echo "if [ \$# != $# ]; then" >> "${fake_work}/faked/${name}" echo " echo ERROR: ${name}: expected $# args got \$# >> ${fake_work}/checks/${name}.errors" \ >> "${fake_work}/faked/${name}" echo "fi" >> "${fake_work}/faked/${name}" n=1 limit=$# while [ $n -le $limit ]; do echo "if [ \"\$$n\" != \"$1\" ]; then" \ >> "${fake_work}/faked/${name}" echo " echo ERROR: ${name}: arg $n: expected $1 got \$$n >> ${fake_work}/checks/${name}.errors" \ >> "${fake_work}/faked/${name}" echo "fi" >> "${fake_work}/faked/${name}" n=$(($n+1)) shift done fi echo "$cmd" >> "${fake_work}/faked/${name}" chmod +x "${fake_work}/faked/${name}" } # # fake_run [OPTIONS] [--] COMMAND ... # # Runs a command and checks its exit status. # Default is to insist that it exists with status 0. # # Options: # --must-exit STATUS must exit with a particular status # --must-output STRING must write a particular string to stdout # --must-output-empty must write nothing to stdout # # fake_run() { local must_exit must_output must_output_set must_output_empty status must_exit=0 must_output_set=false must_output_empty=false while [ $# -gt 0 ]; do case "$1" in --must-exit ) shift must_exit="$1" shift ;; --must-output ) shift must_output="$1" must_output_set=true shift ;; --must-output-empty ) must_output_empty=true shift ;; -- ) shift break ;; -* ) echo "ERROR: fake_run: unknown option '$1'" >&2 exit 1 ;; * ) break ;; esac done if $must_output_set || $must_output_empty; then if $must_output_empty; then touch "${fake_work}/expected" else echo "$must_output" > "${fake_work}/expected" fi set +e "$@" > "${fake_work}/got" status=$? set -e else set +e "$@" status=$? set -e fi if [ $status != $must_exit ]; then echo "ERROR: $1 exited with status $status (expected $must_exit)" >&2 exit 1 fi if $must_output_set || $must_output_empty; then if ! diff -ruN "${fake_work}/expected" "${fake_work}/got" \ > "${fake_work}/diff"; then echo "ERROR: $1 gave unexpected output" >&2 cat "${fake_work}/diff" >&2 exit 1 fi fi } # fake_check [OPTIONS] # # Reports any --must-* violations (see fake_cmd). # # Options: # --expected-fail Don't terminate on failure # fake_check() { local fatal failed fatal=true failed=false if [ ! -d "${fake_work}/faked" ]; then echo "ERROR: fake_reset not called" >&2 exit 1 fi while [ $# -gt 0 ]; do case "$1" in --expected-fail ) fatal=false shift ;; * ) echo "ERROR: fake_check: unknown option '$1'" >&2 exit 1 ;; esac done for f in "${fake_work}/checks/"*; do if [ -f "${f}" ]; then cat "${f}" >&2 failed=true fi done if $fatal && $failed; then exit 1 fi } # # fake_cleanup # # Remove workspace directory. Run by default on termination by default # (see fake_init). # fake_cleanup() { if [ -z "${fake_work}" ]; then rm -rf "${fake_work}" unset fake_work fi } rsbackup-3.0/scripts/txt2src0000775000175000017500000000163612103242262013137 00000000000000#! /usr/bin/perl -w # Copyright © 2011 Richard Kettlewell. # # 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 . use strict; my $symbol = shift; (print "char $symbol\[] =\n") or die "$!\n"; while(<>) { s/[\"\\]/\\$&/g; s/\n/\\n/g; (print "\"$_\"\n") or die "$!\n"; } (print ";\n") or die "$!\n"; (close STDOUT) or die "$!\n"; rsbackup-3.0/scripts/htmlman0000775000175000017500000000414211646266233013200 00000000000000#! /bin/sh # # This file is part of DisOrder # Copyright (C) 2004, 2005, 2007, 2008, 2010 Richard Kettlewell # # 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 . # set -e stdhead=false extension="html" GNUSED=${GNUSED:-sed} while test $# -gt 0; do case "$1" in -stdhead ) stdhead=true ;; -extension ) shift extension=$1 ;; -- ) shift break ;; -* ) echo >&2 "ERROR: unknown option $1" exit 1 ;; * ) break ;; esac shift done for page; do title=$(basename $page) output=$page.$extension echo "$page -> $output" >&2 exec > $output.new echo "" echo " " if $stdhead; then echo "@quiethead@#" fi echo " $title" echo " " echo " " if $stdhead; then echo "@stdmenu{}@#" fi printf "
"
  # this is kind of painful using only BREs
  nroff -Tascii -man "$page" | ${GNUSED} \
                        '1d;$d;
                         1,/./{/^$/d};
                         s/&/\&/g;
                         s//\>/g;
                         s/@/\@/g;
                         s!\(.\)\1!\1!g;
                         s!\(&[#0-9a-z][0-9a-z]*;\)\1!\1!g;
                         s!_\(.\)!\1!g;
                         s!_\(&[#0-9a-z][0-9a-z]*;\)!\1!g;
                         s!<\1>!!g'
  echo "
" if $stdhead; then echo "@credits" fi echo " " echo "" mv $output.new $output done rsbackup-3.0/src/0000775000175000017500000000000012635241746010772 500000000000000rsbackup-3.0/src/PruneNever.cc0000664000175000017500000000207212620463022013276 00000000000000// Copyright © 2015 Richard Kettlewell. // // 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 . #include #include "rsbackup.h" #include "Prune.h" /** @brief The @c never pruning policy */ class PruneNever: public PrunePolicy { public: PruneNever(): PrunePolicy("never") {} void validate(const Volume *) const override {} void prunable(std::vector &, std::map &, int) const override { } } prune_never; rsbackup-3.0/src/EventLoop.h0000664000175000017500000002045712626574404013006 00000000000000//-*-C++-*- // Copyright © 2015 Richard Kettlewell. // // 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 . #ifndef EVENTLOOP_H #define EVENTLOOP_H /** @file EventLoop.h * @brief Asynchronous operations * * To manage asynchronous operations: * - create a single @ref EventLoop object * - create file descriptors and subprocesses * - create @ref Reactor objects to handle I/O, timeouts and subprocesses * - attach the reactor objects to the event loop * - use @ref EventLoop::wait to start processing events * * Note that the event loop should be created before any subprocesses are * created; otherwise the signal handling will not work properly. */ #include class EventLoop; class Reactor; /** @brief An object that reacts to asynchronous events * * Reactors must be attached to an @ref EventLoop to be used, using one of the * following methods: * - @ref EventLoop::whenReadable * - @ref EventLoop::whenWritable * - @ref EventLoop::whenTimeout * - @ref EventLoop::whenWaited * * Normally you would implement at least one of the @c on... methods. Those * that are not implemented will raise @c std::logic_error. However they will * not be called unless attached to an event loop. */ class Reactor { public: /** @brief Destructor */ virtual ~Reactor() = default; /** @brief Called when a file descriptor is readable * @param e Calling event loop * @param fd File descriptor * @param ptr Bytes read from @p fd * @param n Number of bytes at @p ptr * * This will be called when bytes are read from @p fd, or when it reaches end * of file, if @ref EventLoop::whenReadable was used to attach this reactor * to an event loop. * * @p n will be 0 at EOF. (Currently) the implementation must cancel reads * (using @ref EventLoop::cancelRead) even at EOF, or the event loop will * just call it again. */ virtual void onReadable(EventLoop *e, int fd, const void *ptr, size_t n); /** @brief Called when a file descriptor cannot be read due to error * @param e Calling event loop * @param fd File descriptor * @param errno_value @c errno value * * This will be called when an error occurs while reading @p fd, if @ref * EventLoop::whenReadable was used to attach this reactor to an event loop. * * (Currently) the implementation must cancel reads (using @ref * EventLoop::cancelRead) even on error, or the event loop will just call it * again. */ virtual void onReadError(EventLoop *e, int fd, int errno_value); /** @brief Called when a file descriptor is writable * @param e Calling event loop * @param fd File descriptor * * This will be called when @p fd is writable, if @ref * EventLoop::whenWritable was used to attach this reactor to an event loop. * * The implementation is responsible for performing the write and for * cancelling further writes (using @ref EventLoop::cancelWrite) if there is * nothing more to write or on error. */ virtual void onWritable(EventLoop *e, int fd); /** @brief Called when a timeout occurs * @param e Calling event loop * @param now (Monotonic) timestamp (see @ref EventLoop::getTimestamp) * * This will be called when a time limit is reached, if @ref * EventLoop::whenTimeout was used to attach this reactor to an event loop. * * @p now may be after the time limit, but never before. */ virtual void onTimeout(EventLoop *e, const struct timespec &now); /** @brief Called when a subprocess terminates * @param e Calling event loop * @param pid Subprocess * @param status Wait status * @param ru Resource usage * * This will be called when a subprocess terminates, if @ref * EventLoop::whenWaited was used to attach this reactor to an event loop. * * (In contrast to the read/write methods) the event loop stops waiting for * the process before this call is made. */ virtual void onWait(EventLoop *e, pid_t pid, int status, const struct rusage &ru); }; /** @brief An event loop supporting asynchronous I/O * * Event loops allow multiple file descriptors and subprocesses to be managed * together. All I/O, subprocess and timeout events are reflected in calls to * methods of the @ref Reactor class. * * (Currently) only one event loop object may exist at a time. This limitation * is due to the signal handling strategy. */ class EventLoop: private Reactor { public: /** @brief Construct an event loop */ EventLoop(); EventLoop(const EventLoop &) = delete; EventLoop &operator=(const EventLoop &) = delete; /** @brief Destroy an event loop */ ~EventLoop() override; /** @brief Notify reactor when a file descriptor is readable * @param fd File descriptor to monitor * @param r Reactor to notify * * The reactor is notified by calling @ref Reactor::onReadable and @ref * Reactor::onReadError. */ void whenReadable(int fd, Reactor *r); /** @brief Stop monitoring a file descriptor for readability * @param fd File descriptor to stop monitoring */ void cancelRead(int fd); /** @brief Notify reactor when a file descriptor is writable * @param fd File descriptor to monitor * @param r Reactor to notify * * The reactor is notified by calling @ref Reactor::onWritable. */ void whenWritable(int fd, Reactor *r); /** @brief Stop monitoring a file descriptor for writability * @param fd File descriptor to stop monitoring */ void cancelWrite(int fd); /** @brief Notify a reactor at a future time * @param t (Monotonic) timestamp to wait for (see @ref EventLoop::getTimestamp) * @param r Reactor to notify * * The reactor is notified by calling @ref Reactor::onTimeout. */ void whenTimeout(const struct timespec &t, Reactor *r); /** @brief Notify a reactor when a subprocess terminates * @param pid Subprocess * @param r Reactor to notify * * The reactor is notified by calling @ref Reactor::onWait. * * Note that the event loop should be created before any subprocesses are * created; otherwise the signal handling will not work properly. */ void whenWaited(pid_t pid, Reactor *r); /** @brief Stop monitoring a subprocess * @param pid Subprocess to stop monitoring */ void cancelWait(pid_t pid); /** @brief Wait until there is nothing left to wait for * * This does not return until all readers and writers have been cancelled and * all subprocesses have been waited for. It does not wait for unreached * tmieouts, however. */ void wait(); /** @brief Get the current (monotonic) time * @param now Timestamp * * The value of @p now does not reflect calendar/wall-clock time. Instead it * uses the system's monotonic clock, if possible. */ static void getTimestamp(struct timespec &now); private: /** @brief File descriptors monitored for reading */ std::map readers; /** @brief File descriptors monitored for writing */ std::map writers; /** @brief Timeouts */ std::multimap timeouts; /** @brief Subprocesses */ std::map waiters; /** @brief Set if reactors change * * This variable allows the event loop to detect that one of the * EventLoop::readers, EventLoop::writers, EventLoop::timeouts or * EventLoop::waiters has changed, and therefore to stop relying on * iterators that refer to them. */ bool reconf; /** @brief Signal handler */ static void signalled(int); /** @brief Signal pipe * * @ref EventLoop::signalled writes bytes to the pipe to wake up the event * loop when a signal occurs. Handled signals are disabled except when * actually waiting for events. */ static int sigpipe[2]; void onReadable(EventLoop *e, int fd, const void *ptr, size_t n) override; }; #endif /* EVENTLOOP_H */ rsbackup-3.0/src/test-lock.cc0000664000175000017500000000263612561407203013123 00000000000000// Copyright © 2015 Richard Kettlewell. // // 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 . #include #include "FileLock.h" #include #include #include #include #include int main(void) { int p[2]; char buf[1]; int rc; char path[] = "lock.XXXXXX"; assert(mkstemp(path)); assert(pipe(p) >= 0); FileLock a(path); assert(a.acquire()); switch(pid_t child = fork()) { case -1: abort(); case 0: { FileLock b(path); assert(!b.acquire(false)); assert(write(p[1], "", 1) == 1); assert(b.acquire(true)); _exit(0); } default: while((rc = read(p[0], buf, 1)) < 0 && errno == EINTR) ; assert(rc == 1); a.release(); int w; assert(wait(&w) == child); assert(w == 0); break; } unlink(path); return 0; } rsbackup-3.0/src/HTML.cc0000664000175000017500000001341112621742121011751 00000000000000// Copyright © 2011, 2014, 2015 Richard Kettlewell. // // 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 . #include #include "Document.h" #include "Utils.h" #include "Errors.h" #include #include #include // HTML support --------------------------------------------------------------- void Document::quoteHtml(std::ostream &os, const std::string &s) { // We need the string in UTF-32 in order to quote it correctly std::u32string u; toUnicode(u, s); // SGML-quote anything that might be interpreted as a delimiter, and anything // outside of ASCII for(auto w: u) { switch(w) { default: if(w >= 127) { case '&': case '<': case '"': case '\'': os << "&#" << w << ";"; break; } else os << (char)w; } } } void Document::Node::renderHtmlOpenTag(std::ostream &os, const char *name, ...) const { va_list ap; os << '<' << name; if(style.size()) os << " class=" << style; char buffer[64]; if(fgcolor != -1) { snprintf(buffer, sizeof buffer, "#%06x", fgcolor); os << " color=\"" << buffer << "\""; } if(bgcolor != -1) { snprintf(buffer, sizeof buffer, "#%06x", bgcolor); os << " bgcolor=\"" << buffer << "\""; } va_start(ap, name); const char *attributeName, *attributeValue; while((attributeName = va_arg(ap, const char *))) { attributeValue = va_arg(ap, const char *); os << " " << attributeName << "=\""; quoteHtml(os, attributeValue); os << "\""; } os << '>'; va_end(ap); } void Document::Node::renderHtmlCloseTag(std::ostream &os, const char *name, bool newline) const { os << ""; if(newline) os << '\n'; } void Document::LinearContainer::renderHtmlContents(std::ostream &os) const { for(Node *node: nodes) node->renderHtml(os); } void Document::String::renderHtml(std::ostream &os) const { Document::quoteHtml(os, text); } void Document::LinearContainer::renderHtml(std::ostream &os) const { renderHtmlOpenTag(os, "div", (char *)nullptr); renderHtmlContents(os); renderHtmlCloseTag(os, "div"); } void Document::Paragraph::renderHtml(std::ostream &os) const { renderHtmlOpenTag(os, "p", (char *)nullptr); renderHtmlContents(os); renderHtmlCloseTag(os, "p"); } void Document::Verbatim::renderHtml(std::ostream &os) const { renderHtmlOpenTag(os, "pre", (char *)nullptr); renderHtmlContents(os); renderHtmlCloseTag(os, "pre"); } void Document::List::renderHtml(std::ostream &os) const { switch(type) { case OrderedList: renderHtmlOpenTag(os, "ol", (char *)nullptr); break; case UnorderedList: renderHtmlOpenTag(os, "ul", (char *)nullptr); break; } renderHtmlContents(os); switch(type) { case OrderedList: renderHtmlCloseTag(os, "ol"); break; case UnorderedList: renderHtmlCloseTag(os, "ul"); break; } } void Document::ListEntry::renderHtml(std::ostream &os) const { renderHtmlOpenTag(os, "li", (char *)nullptr); renderHtmlContents(os); renderHtmlCloseTag(os, "li"); } void Document::Heading::renderHtml(std::ostream &os) const { if(level > 6) throw std::runtime_error("heading level too high"); char tag[64]; snprintf(tag, sizeof tag, "h%d", level); renderHtmlOpenTag(os, tag, (char *)nullptr); renderHtmlContents(os); renderHtmlCloseTag(os, tag); } void Document::Cell::renderHtml(std::ostream &os) const { const char *const tag = heading ? "th" : "td"; char ws[64], hs[64]; snprintf(ws, sizeof ws, "%d", w); snprintf(hs, sizeof hs, "%d", h); if(w > 1 && h > 1) renderHtmlOpenTag(os, tag, "colspan", ws, "rowspan", hs, (char *)nullptr); else if(w > 1) renderHtmlOpenTag(os, tag, "colspan", ws, (char *)nullptr); else if(h > 1) renderHtmlOpenTag(os, tag, "rowspan", hs, (char *)nullptr); else renderHtmlOpenTag(os, tag, (char *)nullptr); renderHtmlContents(os); renderHtmlCloseTag(os, tag); } void Document::Table::renderHtml(std::ostream &os) const { renderHtmlOpenTag(os, "table", (char *)nullptr); const int w = width(), h = height(); for(int row = 0; row < h; ++row) { renderHtmlOpenTag(os, "tr", (char *)nullptr); for(int col = 0; col < w;) { int skip = 0; for(const Cell *cell: cells) { if(cell->y == row && cell->x == col) { cell->renderHtml(os); skip = cell->w; break; } } if(!skip) { if(!occupied(col, row)) { renderHtmlOpenTag(os, "td", (char *)nullptr); renderHtmlCloseTag(os, "td"); } skip = 1; } col += skip; } renderHtmlCloseTag(os, "tr"); } renderHtmlCloseTag(os, "table"); } void Document::RootContainer::renderHtml(std::ostream &os) const { renderHtmlOpenTag(os, "body", (char *)nullptr); renderHtmlContents(os); renderHtmlCloseTag(os, "body"); } void Document::renderHtml(std::ostream &os) const { os << "\n"; os << "\n"; os << ""; quoteHtml(os, title); os << "\n"; if(htmlStyleSheet.size()) { os << "\n"; } os << "\n"; content.renderHtml(os); os << "\n"; } rsbackup-3.0/src/Date.h0000664000175000017500000001105612621641630011732 00000000000000//-*-C++-*- // Copyright © 2011, 2012, 2014 Richard Kettlewell. // // 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 . #ifndef DATE_H #define DATE_H /** @file Date.h * @brief %Date manipulation */ #include #include /** @brief A (proleptic) Gregorian date * * Don't try years before 1CE. */ class Date { public: /** @brief Constructor */ Date(): Date(0, 1, 1) {} /** @brief Constructor * @param dateString Date in YYYY-MM-DD format */ Date(const std::string &dateString); /** @brief Constructor * @param y_ Year * @param m_ Month from 1 * @param d_ Day from 1 */ Date(int y_, int m_, int d_): y(y_), m(m_), d(d_) {} /** @brief Constructor * @param when Moment in time */ Date(time_t when); /** @brief Different between two dates in days * @param that Other date */ int operator-(const Date &that) const; /** @brief Comparison operator * @param that Other date * @return true if this is less than that */ bool operator<(const Date &that) const; /** @brief Comparison operator * @param that Other date * @return true if this is equal to that */ bool operator==(const Date &that) const { return y == that.y && m == that.m && d == that.d; } /** @brief Comparison operator * @param that Other date * @return true if this is greater than that */ bool operator>(const Date &that) const { return that < *this; } /** @brief Comparison operator * @param that Other date * @return true if this is less or equal to that */ bool operator<=(const Date &that) const { return !(*this > that); } /** @brief Comparison operator * @param that Other date * @return true if this is greater than or equal to that */ bool operator>=(const Date &that) const { return !(*this < that); } /** @brief Comparison operator * @param that Other date * @return true if this is not equal to that */ bool operator!=(const Date &that) const { return !(*this == that); } /** @brief Convert to string * @return Date in "YYYY-MM-DD" format */ std::string toString() const; // YYYY-MM-DD /** @brief Convert to day number * @return Day number */ int toNumber() const; /** @brief Convert to a @c time_t * @return @c time_t value of date */ time_t toTime() const; /** @brief Today * @return Today's date * * Overridden by @c RSBACKUP_TODAY. */ static Date today(); /** @brief Now * @return The current time * * Overridden by @c RSBACKUP_TODAY. */ static time_t now(); /** @brief Calculate the length of a month in days * @param y Year * @param m Month (1-12) */ static int monthLength(int y, int m); private: /** @brief Test for a leap year * @return @c true iff @ref y is a leap year */ inline bool isLeapYear() const { return isLeapYear(y); } /** @brief Test for a leap year * @param y Year * @return @c true iff @ref y is a leap year */ static inline bool isLeapYear(int y) { return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); } /** @brief Year * * This is the Gregorian year; unlike the C library it is not offset by * 1900. */ int y; /** @brief Month * * 1 = January. */ int m; /** @brief Day of month * * Starts from 1. */ int d; /** @brief Day number at start of month * * The first of January is day 0. * * The values in this array are index by the month number start from 1, and * are cumulative. So @c mday[1] is 0, @c mday[2] is 31, @c mday[3] is * 31+28, etc. @c mday[0] doesn't mean anything. * * This array doesn't take leap years into account so its callers must * correct for that. */ static const int mday[]; }; /** @brief Write a date string to a stream * @param os Output stream * @param d Date * @return @p os * * Formats @p d as if by @ref Date::toString() and writes it to @p os. */ inline std::ostream &operator<<(std::ostream &os, Date &d) { return os << d.toString(); } #endif /* DATE_H */ rsbackup-3.0/src/Email.h0000664000175000017500000000370212621670752012112 00000000000000//-*-C++-*- // Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. // // 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 . #ifndef EMAIL_H #define EMAIL_H /** @file Email.h * @brief Constructing and sending email */ #include #include /** @brief An email message */ class Email { public: /** @brief Add a recipient * @param address Destination address */ void addTo(const std::string &address) { to.push_back(address); } /** @brief Set sender * @param address Sender address */ void setFrom(const std::string &address) { from = address; } /** @brief Set subject * @param text Subject */ void setSubject(const std::string &text) { subject = text; } /** @brief Set content type * @param type_ Content type * * The default is @c text/plain (with no indication of charset). */ void setType(const std::string &type_) { type = type_; } /** @brief Set content * @param msg Content */ void setContent(const std::string &msg) { content = msg; } /** @brief Send message */ void send() const; private: /** @brief Sender address */ std::string from; /** @brief Subject */ std::string subject; /** @brief Recipients */ std::vector to; /** @brief MIME Content type */ std::string type = "text/plain"; /** @brief Contents of email */ std::string content; }; #endif /* EMAIL_H */ rsbackup-3.0/src/DeviceAccess.h0000664000175000017500000000205012620734222013367 00000000000000//-*-C++-*- // Copyright © 2012 Richard Kettlewell. // // 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 . #ifndef DEVICEACCESS_H #define DEVICEACCESS_H /** @file DeviceAccess.h * @brief %Device access functions */ class IO; /** @brief Run pre-access hook */ void preDeviceAccess(); /** @brief Close a file before running the post-access hook */ void closeOnUnmount(IO *f); /** @brief Run post-access hook */ void postDeviceAccess(); #endif /* DEVICEACCESS_H */ rsbackup-3.0/src/test-confbase.cc0000664000175000017500000000276312621703024013751 00000000000000// Copyright © 2014 Richard Kettlewell. // // 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 . #include #include "Errors.h" #include "Conf.h" #include void test_quote() { assert(ConfBase::quote("") == "\"\""); assert(ConfBase::quote("x") == "x"); assert(ConfBase::quote("#") == "\"#\""); assert(ConfBase::quote(" ") == "\" \""); assert(ConfBase::quote("x y") == "\"x y\""); assert(ConfBase::quote("\\") == "\"\\\\\""); assert(ConfBase::quote("\"") == "\"\\\"\""); } void test_quote_vector() { std::vector vs = { "", "x", "#", " ", "x y", "\\", "\"", }; std::string s = ConfBase::quote(vs); assert(s == "\"\" x \"#\" \" \" \"x y\" \"\\\\\" \"\\\"\""); } void test_indent() { assert(ConfBase::indent(0) == ""); assert(ConfBase::indent(3) == " "); } int main(void) { test_indent(); test_quote(); test_quote_vector(); return 0; } rsbackup-3.0/src/Subprocess.h0000664000175000017500000001766612626574612013234 00000000000000//-*-C++-*- // Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. // // 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 . #ifndef SUBPROCESS_H #define SUBPROCESS_H /** @file Subprocess.h * @brief Subprocess/command execution support */ #include #include #include #include #include "EventLoop.h" #include "Action.h" /** @brief Subprocess execution * * This class supports three modes of operation. * * 1. Standalone synchronous execution. The caller sets up the subprocess and * then invokes @ref Subprocess::runAndWait. An internal @ref EventLoop is * used. In this case it is possible to capture output to strings with @ref * Subprocess::capture but not to manage pipes directly since the caller has no * opportunity to read or write them. Only one subprocess may exist at a time. * * 2. Standalone asynchronous execution. The caller sets up the subprocess and * then invokes @ref Subprocess::run. Later the caller invokes @ref * Subprocess::wait. As above, an internal @ref EventLoop is used. In this * case it is possible to manage pipes directly with @ref * Subprocess::addChildFD. Captures will work with small outputs but since the * event loop only has an opportunity to read or write the capture pipes when * @c wait() is called, they do not work in general. Only one subprocess may * exist at a time. * * 3. Concurrent execution as part of an @ref ActionList. The caller sets up * many subprocesses and adds them to the action list with @ref * ActionList::add, before starting them and waiting for them with @ref * ActionList::go. When the action list is complete, wait statuses may be * retrieved with @ref Subprocess::getStatus. String captures will work and if * the caller registers reactors with the event loop then pipes can also be * managed directly. */ class Subprocess: private Reactor, public Action { public: /** @brief Constructor */ Subprocess() = default; /** @brief Constructor * @param cmd Command that will be executed */ Subprocess(const std::vector &cmd); /** @brief Destructor */ ~Subprocess() override; /** @brief Set the command to execute * @param cmd Command that will be executed */ void setCommand(const std::vector &cmd); /** @brief Add a pipe * @param childFD Child file descriptor to redirect * @param pipeFD Child end of pipe * @param closeFD Parent end of pipe * @param otherChildFD Another child file descriptor to redirect * * In the child dup @p pipeFD onto @p childFD and close @p closeFD. * * @p pipeFD is automatically closed in the parent, but only after all * redirections have taken place, so it may be used more than once. */ void addChildFD(int childFD, int pipeFD, int closeFD = -1, int otherChildFD = -1); /** @brief Null out a file descriptor * @param childFD Child file descriptor * * In the child dup @c /dev/null onto @p childFD. */ void nullChildFD(int childFD); /** @brief Capture output from the child * @param childFD Child file descriptor to capture * @param s Where to put result * @param otherChildFD Another child file descriptor to capture * * The capture is performed in wait(); */ void capture(int childFD, std::string *s, int otherChildFD=-1); /** @brief Set an environment variable in the child * @param name Environment variable name * @param value Environment variable value */ void setenv(const std::string &name, const std::string &value) { env[name] = value; } /** @brief Set the child timeout * @param seconds Number of seconds after which to give up and kill child */ void setTimeout(int seconds) { timeout = seconds; } /** @brief Start subprocess * @return Process ID */ pid_t run(); /** @brief Report what would be run */ void report(); /** @brief Wait for the subprocess. * @param checkStatus Throw on abnormal termination * @return Wait status * * If @p checkStatus is true, throws on any kind of abnormal termination * (which includes nonzero exit() and most signals but not SIGPIPE). Returns * the wait status (if it doesn't throw). */ int wait(bool checkStatus = true); /** @brief Run and then wait * @param checkStatus Throw on abnormal termination * @return Wait status */ int runAndWait(bool checkStatus = true) { run(); return wait(checkStatus); } /** @brief Return the wait status * @return Wait status * * Meaningless until the process has terminated. */ int getStatus() const { return status; } private: /** @brief Process ID of child * Set to -1 before there is a child. */ pid_t pid = -1; /** @brief A rule for file descriptor changes in the child process */ struct ChildFD { /** @brief Child file descriptor to redirect */ int child; /** @brief Child's pipe endpoint, or -1 * * If this is -1 then the child's file descriptor is redirected to @c * /dev/null */ int pipe; /** @brief Child file descriptor to close or -1 * * If this is not -1 then this file descriptor will be closed in the child. * This is used for the parent's pipe endpoints. */ int close; /** @brief Other child file descriptor to redirect or -1 */ int childOther; /** @brief Construct a ChildFD * @param child_ Child file descriptor to redirect * @param pipe_ Child's pipe endpoint, or -1 * @param close_ File descriptor to close in child, or -1 * @param childOther_ Another child file descriptor to redirect, or -1 */ ChildFD(int child_, int pipe_, int close_, int childOther_): child(child_), pipe(pipe_), close(close_), childOther(childOther_) {} }; /** @brief Rules for file descriptor changes in the child process */ std::vector fds; /** @brief Command to execute in the child */ std::vector cmd; /** @brief Environment variables to set in the child */ std::map env; /** @brief Ouptuts to capture from the child * * Keys are file descriptors to read from, values are pointers to the strings * used to accumulate the output. */ std::map captures; /** @brief Launch subprocess * @param e Event loop * @return Process ID */ pid_t launch(EventLoop *e); /** @brief Setup event loop integration * @param e Event loop */ void setup(EventLoop *e); /** @brief Timeout after which child is killed, in seconds * 0 means no timeout: the child may run indefinitely. */ int timeout = 0; /** @brief Get a timestamp for the current time * @param now Where to store timestamp * * If possible the monotonic clock is used. Otherwise the real time clock is * used. */ static void getTimestamp(struct timespec &now); void onReadable(EventLoop *e, int fd, const void *ptr, size_t n) override; void onReadError(EventLoop *e, int fd, int errno_value) override; void onTimeout(EventLoop *e, const struct timespec &now) override; void onWait(EventLoop *e, pid_t pid, int status, const struct rusage &ru) override; void go(EventLoop *e, ActionList *al) override; /** @brief Wait status */ int status = -1; /** @brief Containing action list */ ActionList *actionlist = nullptr; /** @brief Private event loop */ EventLoop *eventloop = nullptr; }; #endif /* SUBPROCESS_H */ rsbackup-3.0/src/Conf.cc0000644000175000017500000007656112626632562012123 00000000000000// Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. // // 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 . #include #include "rsbackup.h" #include "Conf.h" #include "Store.h" #include "Errors.h" #include "IO.h" #include "Command.h" #include "Utils.h" #include "Database.h" #include "Prune.h" #include #include #include #include #include #include #include #include #include /** @brief Context for configuration file parsing */ struct ConfContext { /** @brief Constructor * * @param conf_ Root configuration node */ ConfContext(Conf *conf_): conf(conf_), context(conf_) {} /** @brief Root of configuration */ Conf *conf; /** @brief Current configuration node * * Could be a @ref Conf, @ref Host or @ref Volume. */ ConfBase *context; /** @brief Current host or null */ Host *host = nullptr; /** @brief Current volume or null */ Volume *volume = nullptr; /** @brief Parsed directive */ std::vector bits; /** @brief Containing filename */ std::string path; /** @brief Line number */ int line = -1; }; struct Directive; /** @brief Type of name-to-directive map */ typedef std::map directives_type; /** @brief Map names to directives */ static directives_type *directives; /** @brief Base class for configuration file directives */ struct Directive { /** @brief Constructor * * @param name_ Name of directive * @param min_ Minimum number of arguments * @param max_ Maximum number of arguments * * Directives are automatically registered in this constructor. */ Directive(const char *name_, int min_=0, int max_=INT_MAX): name(name_), min(min_), max(max_) { if(!directives) directives = new directives_type(); assert((*directives).find(name) == (*directives).end()); (*directives)[name] = this; } /** @brief Name of directive */ const std::string name; /** @brief Minimum number of arguments */ int min; /** @brief Maximum number of arguments */ int max; /** @brief Check directive syntax * @param cc Context containing directive * * The base class implementation just checks the minimum and maximum number * of arguments. */ virtual void check(const ConfContext &cc) const { int args = cc.bits.size() - 1; if(args < min) throw SyntaxError("too few arguments to '" + name + "'"); if(args > max) throw SyntaxError("too many arguments to '" + name + "'"); } /** @brief Get a boolean parameter * @param cc Context containing directive * @return @c true or @c false * * Use in Directive::set implementations for boolean-sense directives. */ bool get_boolean(const ConfContext &cc) const { if(cc.bits.size() == 1) { warning("%s:%d: use '%s true' instead of '%s'", cc.path.c_str(), cc.line, name.c_str(), name.c_str()); return true; } else if(cc.bits[1] == "true") return true; else if(cc.bits[1] == "false") return false; else throw SyntaxError("invalid argument to '" + name + "' - only 'true' or 'false' allowed"); } /** @brief Act on a directive * @param cc Context containing directive */ virtual void set(ConfContext &cc) const = 0; }; /** @brief Base class for directives that can only appear in a host context */ struct HostOnlyDirective: public Directive { /** @brief Constructor * * @param name_ Name of directive * @param min_ Minimum number of arguments * @param max_ Maximum number of arguments * @param inheritable_ If @c true, also allowed in volume context */ HostOnlyDirective(const char *name_, int min_=0, int max_=INT_MAX, bool inheritable_ = false): Directive(name_, min_, max_), inheritable(inheritable_) {} void check(const ConfContext &cc) const override { if(cc.host == nullptr) throw SyntaxError("'" + name + "' command without 'host'"); if(cc.volume != nullptr && !inheritable) throw SyntaxError("'" + name + "' inside 'volume'"); Directive::check(cc); } /** @brief If @c true, also allowed in volume context */ bool inheritable; }; /** @brief Base class for directives that can only appear in a volume context */ struct VolumeOnlyDirective: public Directive { /** @brief Constructor * * @param name_ Name of directive * @param min_ Minimum number of arguments * @param max_ Maximum number of arguments */ VolumeOnlyDirective(const char *name_, int min_=0, int max_=INT_MAX): Directive(name_, min_, max_) {} void check(const ConfContext &cc) const override { if(cc.volume == nullptr) throw SyntaxError("'" + name + "' command without 'volume'"); Directive::check(cc); } }; // Global directives ---------------------------------------------------------- /** @brief The @c store directive */ static const struct StoreDirective: public Directive { StoreDirective(): Directive("store", 1, 1) {} void set(ConfContext &cc) const override { cc.conf->stores[cc.bits[1]] = new Store(cc.bits[1]); } } store_directive; /** @brief The @c store-pattern directive */ static const struct StorePatternDirective: public Directive { StorePatternDirective(): Directive("store-pattern", 1, 1) {} void set(ConfContext &cc) const override { std::vector files; globFiles(files, cc.bits[1], GLOB_NOCHECK); for(auto &file: files) cc.conf->stores[file] = new Store(file); } } store_pattern_directive; /** @brief The @c stylesheet directive */ static const struct StyleSheetDirective: public Directive { StyleSheetDirective(): Directive("stylesheet", 1, 1) {} void set(ConfContext &cc) const override { cc.conf->stylesheet = cc.bits[1]; } } stylesheet_directive; /** @brief The @c colors directive */ static const struct ColorsDirective: public Directive { ColorsDirective(): Directive("colors", 2, 2) {} void set(ConfContext &cc) const override { cc.conf->colorGood = parseInteger(cc.bits[1], 0, 0xFFFFFF, 0); cc.conf->colorBad = parseInteger(cc.bits[2], 0, 0xFFFFFF, 0); } } colors_directive; /** @brief The @c device directive */ static const struct DeviceDirective: public Directive { DeviceDirective(): Directive("device", 1, 1) {} void set(ConfContext &cc) const override { cc.conf->devices[cc.bits[1]] = new Device(cc.bits[1]); } } device_directive; /** @brief The @c max-usage directive */ static const struct MaxUsageDirective: public Directive { MaxUsageDirective(): Directive("max-usage", 1, 1) {} void set(ConfContext &cc) const override { cc.conf->maxUsage = parseInteger(cc.bits[1], 0, 100); } } max_usage_directive; /** @brief The @c max-file-usage directive */ static const struct MaxFileUsageDirective: public Directive { MaxFileUsageDirective(): Directive("max-file-usage", 1, 1) {} void set(ConfContext &cc) const override { cc.conf->maxFileUsage = parseInteger(cc.bits[1], 0, 100); } } max_file_usage_directive; /** @brief The @c public directive */ static const struct PublicDirective: public Directive { PublicDirective(): Directive("public", 0, 1) {} void set(ConfContext &cc) const override { cc.conf->publicStores = get_boolean(cc); } } public_directive; /** @brief The @c logs directive */ static const struct LogsDirective: public Directive { LogsDirective(): Directive("logs", 1, 1) {} void set(ConfContext &cc) const override { cc.conf->logs = cc.bits[1]; } } logs_directive; /** @brief The @c lock directive */ static const struct LockDirective: public Directive { LockDirective(): Directive("lock", 1, 1) {} void set(ConfContext &cc) const override { cc.conf->lock = cc.bits[1]; } } lock_directive; /** @brief The @c sendmail directive */ static const struct SendmailDirective: public Directive { SendmailDirective(): Directive("sendmail", 1, 1) {} void set(ConfContext &cc) const override { cc.conf->sendmail = cc.bits[1]; } } sendmail_directive; /** @brief The @c pre-access-hook directive */ static const struct PreAccessHookDirective: public Directive { PreAccessHookDirective(): Directive("pre-access-hook", 1, INT_MAX) {} void set(ConfContext &cc) const override { cc.conf->preAccess.assign(cc.bits.begin() + 1, cc.bits.end()); } } pre_access_hook_directive; /** @brief The @c post-access-hook directive */ static const struct PostAccessHookDirective: public Directive { PostAccessHookDirective(): Directive("post-access-hook", 1, INT_MAX) {} void set(ConfContext &cc) const override { cc.conf->postAccess.assign(cc.bits.begin() + 1, cc.bits.end()); } } post_access_hook_directive; /** @brief The @c keep-prune-logs directive */ static const struct KeepPruneLogsDirective: public Directive { KeepPruneLogsDirective(): Directive("keep-prune-logs", 1, 1) {} void set(ConfContext &cc) const override { cc.conf->keepPruneLogs = parseInteger(cc.bits[1], 1); } } keep_prune_logs_directive; /** @brief The @c report-prune-logs directive */ static const struct ReportPruneLogsDirective: public Directive { ReportPruneLogsDirective(): Directive("report-prune-logs", 1, 1) {} void set(ConfContext &cc) const override { cc.conf->reportPruneLogs = parseInteger(cc.bits[1], 1); } } report_prune_logs_directive; /** @brief The @c include directive */ static const struct IncludeDirective: public Directive { IncludeDirective(): Directive("include", 1, 1) {} void set(ConfContext &cc) const override { cc.conf->includeFile(cc.bits[1]); } } include_directive; // Inheritable directives ----------------------------------------------------- /** @brief The @c max-age directive */ static const struct MaxAgeDirective: public Directive { MaxAgeDirective(): Directive("max-age", 1, 1) {} void set(ConfContext &cc) const override { cc.context->maxAge = parseInteger(cc.bits[1], 1); } } max_age_directive; /** @brief The @c min-backups directive */ static const struct MinBackupsDirective: public Directive { MinBackupsDirective(): Directive("min-backups", 1, 1) {} void set(ConfContext &cc) const override { warning("%s:%d: the 'min-backups' directive is deprecated, use 'prune-parameter min-backups' instead", cc.path.c_str(), cc.line); parseInteger(cc.bits[1], 1); cc.context->pruneParameters["min-backups"] = cc.bits[1]; } } min_backups_directive; /** @brief The @c prune-age directive */ static const struct PruneAgeDirective: public Directive { PruneAgeDirective(): Directive("prune-age", 1, 1) {} void set(ConfContext &cc) const override { warning("%s:%d: the 'prune-age' directive is deprecated, use 'prune-parameter prune-age' instead", cc.path.c_str(), cc.line); parseInteger(cc.bits[1], 1); cc.context->pruneParameters["prune-age"] = cc.bits[1]; } } prune_age_directive; /** @brief The @c prune-policy directive */ static const struct PrunePolicyDirective: public Directive { PrunePolicyDirective(): Directive("prune-policy", 1, 1) {} void set(ConfContext &cc) const override { if(cc.bits[1].size() > 0 && cc.bits[1].at(0) == '/') { cc.context->prunePolicy = "exec"; cc.context->pruneParameters["path"] = cc.bits[1]; } else cc.context->prunePolicy = cc.bits[1]; } } prune_policy_directive; /** @brief The @c prune-parameter directive */ static const struct PruneParameterDirective: public Directive { PruneParameterDirective(): Directive("prune-parameter", 2, 2) {} void check(const ConfContext &cc) const override { Directive::check(cc); const std::string &name = (cc.bits[1] != "--remove" ? cc.bits[1] : cc.bits[2]); if(!valid(name)) throw SyntaxError("invalid prune-parameter name"); } void set(ConfContext &cc) const override { if(cc.bits[1] != "--remove") cc.context->pruneParameters[cc.bits[1]] = cc.bits[2]; else cc.context->pruneParameters.erase(cc.bits[2]); } static bool valid(const std::string &name) { return name.size() > 0 && name.at(0) != '-' && name.find_first_not_of(PRUNE_PARAMETER_VALID) == std::string::npos; } } prune_parameter_directive; /** @brief The @c pre-backup-hook directive */ static const struct PreBackupHookDirective: public Directive { PreBackupHookDirective(): Directive("pre-backup-hook", 1, INT_MAX) {} void set(ConfContext &cc) const override { cc.context->preBackup.assign(cc.bits.begin() + 1, cc.bits.end()); } } pre_backup_hook_directive; /** @brief The @c post-backup-hook directive */ static const struct PostBackupHookDirective: public Directive { PostBackupHookDirective(): Directive("post-backup-hook", 1, INT_MAX) {} void set(ConfContext &cc) const override { cc.context->postBackup.assign(cc.bits.begin() + 1, cc.bits.end()); } } post_backup_hook_directive; /** @brief The @c rsync-timeout directive */ static const struct RsyncTimeoutDirective: public Directive { RsyncTimeoutDirective(): Directive("rsync-timeout", 1, 1) {} void set(ConfContext &cc) const override { cc.context->rsyncTimeout = parseInteger(cc.bits[1], 1); } } rsync_timeout_directive; /** @brief The @c hook-timeout directive */ static const struct HookTimeoutDirective: public Directive { HookTimeoutDirective(): Directive("hook-timeout", 1, 1) {} void set(ConfContext &cc) const override { cc.context->hookTimeout = parseInteger(cc.bits[1], 1); } } hook_timeout_directive; /** @brief The @c ssh-timeout directive */ static const struct SshTimeoutDirective: public Directive { SshTimeoutDirective(): Directive("ssh-timeout", 1, 1) {} void set(ConfContext &cc) const override { cc.context->sshTimeout = parseInteger(cc.bits[1], 1); } } ssh_timeout_directive; // Host directives ------------------------------------------------------------ /** @brief The @c host directive */ static const struct HostDirective: public Directive { HostDirective(): Directive("host", 1, 1) {} void set(ConfContext &cc) const override { if(!Host::valid(cc.bits[1])) throw SyntaxError("invalid host name"); if(contains(cc.conf->hosts, cc.bits[1])) throw SyntaxError("duplicate host"); cc.context = cc.host = new Host(cc.conf, cc.bits[1]); cc.volume = nullptr; cc.host->hostname = cc.bits[1]; } } host_directive; /** @brief The @c hostname directive */ static const struct HostnameDirective: public HostOnlyDirective { HostnameDirective(): HostOnlyDirective("hostname", 1, 1) {} void set(ConfContext &cc) const override { cc.host->hostname = cc.bits[1]; } } hostname_directive; /** @brief The @c always-up directive */ static const struct AlwaysUpDirective: public HostOnlyDirective { AlwaysUpDirective(): HostOnlyDirective("always-up", 0, 1) {} void set(ConfContext &cc) const override { cc.host->alwaysUp = get_boolean(cc); } } always_up_directive; /** @brief The @c priority directive */ static const struct PriorityDirective: public HostOnlyDirective { PriorityDirective(): HostOnlyDirective("priority", 1, 1) {} void set(ConfContext &cc) const override { cc.host->priority = parseInteger(cc.bits[1]); } } priority_directive; /** @brief The @c user directive */ static const struct UserDirective: public HostOnlyDirective { UserDirective(): HostOnlyDirective("user", 1, 1) {} void set(ConfContext &cc) const override { cc.host->user = cc.bits[1]; } } user_directive; /** @brief The @c devices directive */ static const struct DevicesDirective: public HostOnlyDirective { DevicesDirective(): HostOnlyDirective("devices", 1, 1, true) {} void set(ConfContext &cc) const override { cc.context->devicePattern = cc.bits[1]; } } devices_directive; // Volume directives ---------------------------------------------------------- /** @brief The @c volume directive */ static const struct VolumeDirective: public HostOnlyDirective { VolumeDirective(): HostOnlyDirective("volume", 2, 2, true/*hacky*/) {} void set(ConfContext &cc) const override { if(!Volume::valid(cc.bits[1])) throw SyntaxError("invalid volume name"); if(contains(cc.host->volumes, cc.bits[1])) throw SyntaxError("duplicate volume"); cc.context = cc.volume = new Volume(cc.host, cc.bits[1], cc.bits[2]); } } volume_directive; /** @brief The @c exclude directive */ static const struct ExcludeDirective: public VolumeOnlyDirective { ExcludeDirective(): VolumeOnlyDirective("exclude", 1, 1) {} void set(ConfContext &cc) const override { cc.volume->exclude.push_back(cc.bits[1]); } } exclude_directive; /** @brief The @c traverse directive */ static const struct TraverseDirective: public VolumeOnlyDirective { TraverseDirective(): VolumeOnlyDirective("traverse", 0, 1) {} void set(ConfContext &cc) const override { cc.volume->traverse = get_boolean(cc); } } traverse_directive; /** @brief The @c check-file directive */ static const struct CheckFileDirective: public VolumeOnlyDirective { CheckFileDirective(): VolumeOnlyDirective("check-file", 1, 1) {} void set(ConfContext &cc) const override { cc.volume->checkFile = cc.bits[1]; } } check_file_directive; /** @brief The @c check-mounted directive */ static const struct CheckMountedDirective: public VolumeOnlyDirective { CheckMountedDirective(): VolumeOnlyDirective("check-mounted", 0, 1) {} void set(ConfContext &cc) const override { cc.volume->checkMounted = get_boolean(cc); } } check_mounted_directive; void Conf::write(std::ostream &os, int step, bool verbose) const { describe_type *d = verbose ? describe : nodescribe; d(os, "# ---- Inheritable directives ----", step); d(os, "", step); ConfBase::write(os, step, verbose); d(os, "# ---- Non-inheritable directives ----", step); d(os, "", step); d(os, "# Whether stores are public or private (default)", step); d(os, "# public true|false", step); os << indent(step) << "public " << (publicStores ? "true" : "false") << '\n'; d(os, "", step); d(os, "# Path to log directory", step); d(os, "# logs PATH", step); os << indent(step) << "logs " << quote(logs) << '\n'; d(os, "", step); d(os, "# Path to lock file", step); d(os, "# lock PATH", step); if(lock.size()) os << indent(step) << "lock " << quote(lock) << '\n'; d(os, "", step); d(os, "# Path to mail transport agent", step); d(os, "# sendmail PATH", step); os << indent(step) << "sendmail " << quote(sendmail) << '\n'; d(os, "", step); d(os, "# Command to run before accessing backup devices", step); d(os, "# pre-access-hook COMMAND ...", step); if(preAccess.size()) os << indent(step) << "pre-access-hook " << quote(preAccess) << '\n'; d(os, "", step); d(os, "# Command to run after accessing backup devices", step); d(os, "# pre-access-hook COMMAND ...", step); if(postAccess.size()) os << indent(step) << "post-access-hook " << quote(postAccess) << '\n'; d(os, "", step); d(os, "# Stylesheet for HTML report", step); d(os, "# stylesheet PATH", step); if(stylesheet.size()) os << indent(step) << "stylesheet " << quote(stylesheet) << '\n'; d(os, "", step); d(os, "# 'Good' and 'bad' colors for HTML report", step); d(os, "# colors 0xRRGGBB 0xRRGGBB", step); os << indent(step) << "colors " << std::hex << "0x" << std::setw(6) << std::setfill('0') << colorGood << ' ' << "0x" << std::setw(6) << std::setfill('0') << colorBad << '\n' << std::dec; d(os, "", step); d(os, "# Names of backup devices", step); d(os, "# device NAME", step); for(auto &d: devices) os << "device " << quote(d.first) << '\n'; d(os, "", step); d(os, "# ---- Hosts to back up ----", step); for(auto &h: hosts) { os << '\n'; h.second->write(os, step, verbose); } } // Read the master configuration file plus anything it includes. void Conf::read() { readOneFile(command.configPath); } // Read one configuration file. Throws IOError if some file cannot be // read or ConfigError if the contents are bad. void Conf::readOneFile(const std::string &path) { ConfContext cc(this); IO input; D("Conf::readOneFile %s", path.c_str()); input.open(path, "r"); std::string line; int lineno = 0; while(input.readline(line)) { ++lineno; // keep track of where we are cc.path = path; cc.line = lineno; try { split(cc.bits, line); if(!cc.bits.size()) // skip blank lines continue; // Consider all the possible commands auto it = (*directives).find(cc.bits[0]); if(it != (*directives).end()) { const Directive *d = it->second; d->check(cc); d->set(cc); } else { throw SyntaxError("unknown command '" + cc.bits[0] + "'"); } } catch(SyntaxError &e) { // Wrap up in a ConfigError, which carries the path/line information. std::stringstream s; s << path << ":" << lineno << ": " << e.what(); throw ConfigError(s.str()); } } } // Implementation of the 'include' command. If PATH is a directory then // includes all the regular files it contains (excluding dotfiles and backups // but including symbolic links to regular files of any name), otherwise just // tries to read it. void Conf::includeFile(const std::string &path) { D("Conf::includeFile %s", path.c_str()); if(boost::filesystem::is_directory(path)) { std::vector files; Directory::getFiles(path, files); for(auto &name: files) { if(!name.size() || name.at(0) == '.' || name.at(0) == '#' || name.find('~') != std::string::npos) continue; std::string fullname = path + PATH_SEP + name; if(boost::filesystem::is_regular_file(fullname)) readOneFile(fullname); } } else readOneFile(path); } void Conf::validate() const { for(auto &h: hosts) for(auto &v: h.second->volumes) validatePrunePolicy(v.second); } // (De-)select all hosts void Conf::selectAll(bool sense) { for(auto &h: hosts) h.second->select(sense); } // (De-)select one host (or all if hostName="*") void Conf::selectHost(const std::string &hostName, bool sense) { if(hostName == "*") { selectAll(sense); } else { auto hosts_iterator = hosts.find(hostName); if(hosts_iterator == hosts.end()) throw CommandError("no such host as '" + hostName + "'"); hosts_iterator->second->select(sense); } } // (De-)select one volume (or all if volumeName="*") void Conf::selectVolume(const std::string &hostName, const std::string &volumeName, bool sense) { if(volumeName == "*") { selectHost(hostName, sense); } else { auto hosts_iterator = hosts.find(hostName); if(hosts_iterator == hosts.end()) throw CommandError("no such host as '" + hostName + "'"); Host *host = hosts_iterator->second; auto volumes_iterator = host->volumes.find(volumeName); if(volumes_iterator == host->volumes.end()) throw CommandError("no such volume as '" + hostName + ":" + volumeName + "'"); volumes_iterator->second->select(sense); } } void Conf::addHost(Host *h) { hosts[h->name] = h; } // Find a host by name Host *Conf::findHost(const std::string &hostName) const { auto it = hosts.find(hostName); return it != hosts.end() ? it->second : nullptr; } // Find a volume by name Volume *Conf::findVolume(const std::string &hostName, const std::string &volumeName) const { Host *host = findHost(hostName); return host ? host->findVolume(volumeName) : nullptr; } // Find a device by name Device *Conf::findDevice(const std::string &deviceName) const { auto it = devices.find(deviceName); return it != devices.end() ? it->second : nullptr; } // Read in logfiles void Conf::readState() { if(logsRead) return; std::string hostName, volumeName; std::vector files; const bool progress = command.verbose && isatty(2); std::vector upgraded; std::string log; // Read database contents // Better would be to read only the rows required, on demand. { Database::Statement stmt(getdb(), "SELECT host,volume,device,id,time,pruned,rc,status,log" " FROM backup", SQL_END); while(stmt.next()) { Backup backup; hostName = stmt.get_string(0); volumeName = stmt.get_string(1); backup.deviceName = stmt.get_string(2); backup.id = stmt.get_string(3); backup.time = stmt.get_int64(4); backup.date = Date(backup.time); backup.pruned = stmt.get_int64(5); backup.rc = stmt.get_int(6); backup.setStatus(stmt.get_int(7)); backup.contents = stmt.get_blob(8); addBackup(backup, hostName, volumeName); } } // Upgrade old-format logfiles Directory::getFiles(logs, files); std::regex logfileRegexp("^([0-9]+-[0-9]+-[0-9]+)-([^-]+)-([^-]+)-([^-]+)\\.log$"); for(size_t n = 0; n < files.size(); ++n) { if(progress) progressBar(IO::err, "Upgrading old logs", n, files.size()); // Parse the filename std::smatch mr; if(!std::regex_match(files[n], mr, logfileRegexp)) continue; Backup backup; backup.date = Date(mr[1]); backup.id = mr[1]; backup.time = backup.date.toTime(); backup.deviceName = mr[2]; hostName = mr[3]; volumeName = mr[4]; // Read the log IO input; std::vector contents; input.open(logs + "/" + files[n], "r"); input.readlines(contents); // Skip empty files if(contents.size() == 0) { if(progress) progressBar(IO::err, nullptr, 0, 0); warning("empty file: %s", files[n].c_str()); continue; } // Find the status code const std::string &last = contents[contents.size() - 1]; backup.rc = -1; if(last.compare(0, 3, "OK:") == 0) backup.rc = 0; else { std::string::size_type pos = last.rfind("error="); if(pos < std::string::npos) sscanf(last.c_str() + pos + 6, "%i", &backup.rc); } if(last.rfind("pruning") != std::string::npos) backup.setStatus(PRUNING); else if(backup.rc == 0) backup.setStatus(COMPLETE); else backup.setStatus(FAILED); for(std::string &c: contents) { backup.contents += c; backup.contents += "\n"; } addBackup(backup, hostName, volumeName, true); if(command.act) { // addBackup might fail to set volume if(backup.volume != nullptr) { if(upgraded.size() == 0) getdb().begin(); try { backup.insert(getdb()); } catch(DatabaseError &e) { if(e.status != SQLITE_CONSTRAINT) throw; } upgraded.push_back(files[n]); } else { if(progress) progressBar(IO::err, nullptr, 0, 0); warning("cannot upgrade %s", files[n].c_str()); } } } logsRead = true; if(command.act && upgraded.size()) { getdb().commit(); bool upgradeFailure = false; for(std::string &u: upgraded) { const std::string path = logs + "/" + u; if(unlink(path.c_str())) { error("removing %s: %s", path.c_str(), strerror(errno)); upgradeFailure = true; } } if(upgradeFailure) throw SystemError("could not remove old logfiles"); } if(progress) progressBar(IO::err, nullptr, 0, 0); } void Conf::addBackup(Backup &backup, const std::string &hostName, const std::string &volumeName, bool forceWarn) { const bool progress = command.verbose && isatty(2); /* Don't keep pruned backups around */ if(backup.getStatus() == PRUNED) return; if(!contains(devices, backup.deviceName)) { if(!contains(unknownDevices, backup.deviceName)) { if(command.warnUnknown || forceWarn) { if(progress) progressBar(IO::err, nullptr, 0, 0); warning("unknown device %s", backup.deviceName.c_str()); } unknownDevices.insert(backup.deviceName); ++config.unknownObjects; } return; } // Find the volume for this status record. If it cannot be found, we warn // about it once. Host *host = findHost(hostName); if(!host) { if(!contains(unknownHosts, hostName)) { if(command.warnUnknown || forceWarn) { if(progress) progressBar(IO::err, nullptr, 0, 0); warning("unknown host %s", hostName.c_str()); } unknownHosts.insert(hostName); ++config.unknownObjects; } return; } Volume *volume = host->findVolume(volumeName); if(!volume) { if(!contains(host->unknownVolumes, volumeName)) { if(command.warnUnknown || forceWarn) { if(progress) progressBar(IO::err, nullptr, 0, 0); warning("unknown volume %s:%s", hostName.c_str(), volumeName.c_str()); } host->unknownVolumes.insert(volumeName); ++config.unknownObjects; } return; } backup.volume = volume; // Attach the status record to the volume volume->addBackup(new Backup(backup)); } // Create the mapping between stores and devices. void Conf::identifyDevices(int states) { if((devicesIdentified & states) == states) return; int found = 0; std::vector storeExceptions; for(auto &s: stores) { Store *store = s.second; if(!(store->state & states)) continue; try { store->identify(); ++found; } catch(UnavailableStore &unavailableStoreException) { if(command.warnStore) warning("%s", unavailableStoreException.what()); storeExceptions.push_back(unavailableStoreException); } catch(FatalStoreError &fatalStoreException) { if(states == Store::Enabled) throw; else if(command.warnStore) warning("%s", fatalStoreException.what()); } catch(BadStore &badStoreException) { if(states == Store::Enabled) error("%s", badStoreException.what()); } } if(!found && states == Store::Enabled) { error("no backup devices found"); if(!command.warnStore) for(size_t n = 0; n < storeExceptions.size(); ++n) IO::err.writef(" %s\n", storeExceptions[n].what()); } devicesIdentified |= states; } Database &Conf::getdb() { if(!db) { if(command.database.size() == 0) command.database = logs + "/backups.db"; if(command.act) { db = new Database(command.database); if(!db->hasTable("backup")) createTables(); } else { try { db = new Database(command.database, false); } catch(DatabaseError &) { db = new Database(":memory:"); createTables(); } } } return *db; } void Conf::createTables() { db->begin(); db->execute("CREATE TABLE backup (\n" " host TEXT,\n" " volume TEXT,\n" " device TEXT,\n" " id TEXT,\n" " time INTEGER,\n" " pruned INTEGER,\n" " rc INTEGER,\n" " status INTEGER,\n" " log BLOB,\n" " PRIMARY KEY (host,volume,device,id)\n" ")"); db->commit(); } ConfBase *Conf::getParent() const { return nullptr; } std::string Conf::what() const { return "system"; } Conf config; rsbackup-3.0/src/IO.h0000664000175000017500000001413012626633053011365 00000000000000// -*-C++-*- // Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. // // 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 . #ifndef IO_H #define IO_H /** @file IO.h * @brief I/O support */ #include #include #include #include #include #include /** @brief Possible directions of pipe * * Both are given from the parent's point of view. */ enum PipeDirection { /** @brief Parent reads, child writes */ ReadFromPipe, /** @brief Parent writes, child reads */ WriteToPipe, }; class Subprocess; /** @brief RAII-friendly I/O class * * Members will throw IOError if anything goes wrong. */ class IO { public: /** @brief Constructor */ IO() = default; IO(const IO &) = delete; IO &operator=(const IO &) = delete; /** @brief Constructor * @param fp_ Underlying stream * @param path_ Filename for error messages */ IO(FILE *fp_, const std::string &path_): IO(fp_, path_, false) {} /** @brief Destructor * * Closes underlying stream, discarding any errors, if it is still open. */ ~IO(); /** @brief Open a file * @param path File to open * @param mode Open mode as per @c fopen() */ void open(const std::string &path, const std::string &mode); /** @brief Open a pipe to/from a subprocess * @param command Command to execute in subprocess * @param d Pipe direction * @param verbose If true, report command and environment to stderr */ void popen(const std::vector &command, PipeDirection d, bool verbose); /** @brief Close file * @param checkStatus Throw on abnormal subprocess termination * @return Wait status for a subprocess, or 0 * * If the file is a pipe and @p checkStatus is true then an * exception is thrown if the subprocess indicates an error with its wait * status. The wait status is returned. If the file is not a pipe then the * return value is 0. */ int close(bool checkStatus = true); /** @brief Read one line * @param line Where to put line * @return true on success, false at eof * * Strips the newline. */ bool readline(std::string &line); /** @brief Read all lines * @param lines Where to put lines * * Strips the newlines. */ void readlines(std::vector &lines); /** @brief Read whole file * @param file Where to put contents */ void readall(std::string &file); /** @brief Write a string * @param s String to write */ void write(const std::string &s); /** @brief Write a formatted string * @param format Format string as per @c printf() * @param ... Arguments * @return Number of bytes written */ int writef(const char *format, ...); /** @brief Write a formatted string * @param format Format string as per @c printf() * @param ap Arguments * @return Number of bytes written */ int vwritef(const char *format, va_list ap); /** @brief Flush any buffered writes */ void flush(); /** @brief Standard output */ static IO out; /** @brief Standard error * * If writes to this stream fail, the process will be aborted. */ static IO err; private: /** @brief Constructor with special error handling * @param fp_ Underlying stream * @param path_ Filename for error messages * @param abortOnError_ If @c true, write errors will abort process * * This is used for @ref err. */ IO(FILE *fp_, const std::string &path_, bool abortOnError_): fp(fp_), path(path_), abortOnError(abortOnError_) {} /** @brief Underlying stdio stream */ FILE *fp = nullptr; /** @brief Path to open file */ std::string path; /** @brief Subprocess handler or null pointer * * Used by @ref popen(). */ Subprocess *subprocess = nullptr; /** @brief If @c true, close @ref fp in destructor */ bool closeFile = false; /** @brief If @c true, abort on error */ bool abortOnError = false; /** @brief Called when a read error occurs */ void readError(); /** @brief Called when a write error occurs */ void writeError(); }; /** @brief RAII-friendly directory reader * * Members will throw IOError if anything goes wrong. */ class Directory { public: /** @brief Destructor * * Closes the directory if it is open. */ ~Directory(); Directory() = default; Directory(const Directory &) = delete; Directory &operator=(const Directory &) = delete; /** @brief Open a directory * @param path Directory to open * @throws IOError if @p path cannot be opened as a directory * * The directory must not already be open. */ void open(const std::string &path); /** @brief Close a directory * * Does nothing if the directory is not open. */ void close(); /** @brief Get one filename * @param name Where to put filename * @return true if a filename returned, false at end. * * Only the basename is supplied. * * The directory must be open. */ bool get(std::string &name) const; /** @brief Get all filenames * @param files Where to put filenames * * The directory must be open. */ void get(std::vector &files) const; /** @brief Get all filenames from a directory * @param path Directory to read * @param files Where to put filenames */ static void getFiles(const std::string &path, std::vector &files); private: /** @brief Underlying directory handle */ DIR *dp = nullptr; /** @brief Path to directory */ std::string path; }; #endif /* IO_H */ rsbackup-3.0/src/test-database.cc0000664000175000017500000000446212451031033013726 00000000000000// Copyright © 2014 Richard Kettlewell. // // 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 . #include #include "Utils.h" #include "Database.h" #include #include #define DBPATH "test.db" static void test_create() { Database d(DBPATH); assert(!d.hasTable("t")); d.execute("CREATE TABLE t (i INT PRIMARY KEY, s TEXT)"); assert(d.hasTable("t")); } static void test_populate() { Database d(DBPATH); d.begin(); Database::Statement(d, "INSERT INTO t (i, s) VALUES (?, ?)", SQL_INT, 0, SQL_CSTRING, "zero", SQL_END).next(); Database::Statement(d, "INSERT INTO t (i, s) VALUES (?, ?)", SQL_INT64, (sqlite_int64)1, SQL_CSTRING, "one", SQL_END).next(); d.commit(); } static void test_retrieve() { Database d(DBPATH); { Database::Statement s(d); s.prepare("SELECT s FROM t WHERE i = ?", SQL_INT, 0, SQL_END); assert(s.next()); std::string str = s.get_string(0); assert(str == "zero"); assert(!s.next()); } { Database::Statement s(d); s.prepare("SELECT i FROM t WHERE s = ?", SQL_CSTRING, "one", SQL_END); assert(s.next()); int n = s.get_int(0); assert(n == 1); assert(!s.next()); } { Database::Statement s(d); s.prepare("SELECT i FROM t WHERE s = ?", SQL_CSTRING, "zero", SQL_END); assert(s.next()); sqlite_int64 n = s.get_int64(0); assert(n == 0); assert(!s.next()); } } int main() { unlink(DBPATH); test_create(); test_populate(); test_retrieve(); unlink(DBPATH); return 0; } rsbackup-3.0/src/check-source0000775000175000017500000000135412631030155013200 00000000000000#! /bin/sh # # Copyright (C) 2015 Richard Kettlewell # # 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 . # set -e cd ${srcdir} exec perl ../tools/srccheck *.h *.cc rsbackup-3.0/src/Date.cc0000664000175000017500000000757212620463022012074 00000000000000// Copyright © 2011 Richard Kettlewell. // // 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 . #include #include "Date.h" #include "Errors.h" #include #include #include #include // Cumulative day numbers at start of each month // (for a non-leap-year) const int Date::mday[] = { 0, 0, // January 31, 31 + 28, 31 + 28 + 31, 31 + 28 + 31 + 30, 31 + 28 + 31 + 30 + 31, 31 + 28 + 31 + 30 + 31 + 30, 31 + 28 + 31 + 30 + 31 + 30 + 31, 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31, 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30, 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31, 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30, 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31, }; Date::Date(const std::string &dateString) { long bits[3]; const char *s = dateString.c_str(); char *e; for(int n = 0; n < 3; ++n) { if(n) { if(*s != '-') throw InvalidDate("invalid date string '" + dateString + "'"); ++s; } if(!isdigit(*s)) throw InvalidDate("invalid date string '" + dateString + "'"); errno = 0; bits[n] = strtol(s, &e, 10); if(errno) throw InvalidDate("invalid date string '" + dateString + "' - " + strerror(errno)); s = e; } if(*s) throw InvalidDate("invalid date string '" + dateString + "'"); if(bits[0] < 1 || bits[0] > INT_MAX) throw InvalidDate("invalid date string '" + dateString + "' - year too small"); y = bits[0]; if(bits[1] < 1 || bits[1] > 12) throw InvalidDate("invalid date string '" + dateString + "' - month out of range"); m = bits[1]; if(bits[2] < 1 || bits[2] > monthLength(y, m)) throw InvalidDate("invalid date string '" + dateString + "' - day out of range"); d = bits[2]; } Date::Date(time_t when) { struct tm result; localtime_r(&when, &result); y = result.tm_year + 1900; m = result.tm_mon + 1; d = result.tm_mday; } std::string Date::toString() const { char buffer[64]; snprintf(buffer, sizeof buffer, "%04d-%02d-%02d", y, m, d); return buffer; } int Date::toNumber() const { int dayno = 365 * y + y / 4 - y / 100 + y / 400; dayno += mday[m] + (m > 2 && isLeapYear() ? 1 : 0); dayno += d - 1; return dayno; } time_t Date::toTime() const { struct tm t; memset(&t, 0, sizeof t); t.tm_year = y - 1900; t.tm_mon = m - 1; t.tm_mday = d; t.tm_isdst = -1; time_t r = mktime(&t); if(r == -1) throw SystemError("mktime failed"); // not documented as setting errno return r; } bool Date::operator<(const Date &that) const { int delta; if((delta = y - that.y)) return delta < 0; if((delta = m - that.m)) return delta < 0; if((delta = d - that.d)) return delta < 0; return false; } int Date::operator-(const Date &that) const { return toNumber() - that.toNumber(); } Date Date::today() { // Allow overriding of 'today' form environment for testing const char *override = getenv("RSBACKUP_TODAY"); if(override) return Date(override); time_t now; time(&now); return Date(now); } time_t Date::now() { const char *override = getenv("RSBACKUP_TODAY"); if(override) return Date(override).toTime(); return time(nullptr); } int Date::monthLength(int y, int m) { int len = mday[m + 1] - mday[m]; if(m == 2 && isLeapYear(y)) ++len; return len; } rsbackup-3.0/src/test-check.cc0000664000175000017500000000750312620463022013243 00000000000000// Copyright © 2014 Richard Kettlewell. // // 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 . #include #include "Utils.h" #include "Errors.h" #include "Command.h" #include #include #include #include static FILE *input; static int output; static bool result; static void *background(void *) { result = check("%s", "spong"); return nullptr; } /* We can't use stdio here because reading from an unbuffered file causes a * flush of other files, which (at least in Glibc) implies taking a lock on * other files. Since the background thread is blocked in a read, holding a * lock while it does so, a deadlock results. * * References: * - C99 7.19.3#3 * - http://austingroupbugs.net/view.php?id=689 * - _IO_flush_all_linebuffered in Glibc */ static int fd_getc(int fd) { unsigned char buffer[1]; if(read(fd, buffer, 1) < 0) return EOF; else return buffer[0]; } static char *fd_fgets(char buffer[], size_t bufsize, int fd) { size_t index = 0; int ch; assert(bufsize > 0); while(index + 1 < bufsize && (ch = fd_getc(fd)) >= 0) { buffer[index++] = ch; if(ch == '\n') break; } buffer[index] = 0; return ch < 0 ? nullptr : buffer; } static void test(const char *typed, const char *typed2, bool expect) { pthread_t tid; char buffer[1024]; assert(pthread_create(&tid, nullptr, background, nullptr) == 0); assert(fd_fgets(buffer, sizeof buffer, output)); assert(std::string(buffer) == "spong\n"); assert(fd_getc(output) == 'y'); assert(fd_getc(output) == 'e'); assert(fd_getc(output) == 's'); assert(fd_getc(output) == '/'); assert(fd_getc(output) == 'n'); assert(fd_getc(output) == 'o'); assert(fd_getc(output) == '>'); assert(fd_getc(output) == ' '); assert(fprintf(input, "%s\n", typed) >= 0); assert(fflush(input) >= 0); if(typed2) { assert(fd_fgets(buffer, sizeof buffer, output)); assert(std::string(buffer) == "Please answer 'yes' or 'no'.\n"); assert(fd_fgets(buffer, sizeof buffer, output)); assert(std::string(buffer) == "spong\n"); assert(fd_getc(output) == 'y'); assert(fd_getc(output) == 'e'); assert(fd_getc(output) == 's'); assert(fd_getc(output) == '/'); assert(fd_getc(output) == 'n'); assert(fd_getc(output) == 'o'); assert(fd_getc(output) == '>'); assert(fd_getc(output) == ' '); assert(fprintf(input, "%s\n", typed2) >= 0); assert(fflush(input) >= 0); } assert(pthread_join(tid, nullptr) == 0); assert(result == expect); } static void test_force(void) { pthread_t tid; command.force = true; assert(pthread_create(&tid, nullptr, background, nullptr) == 0); assert(pthread_join(tid, nullptr) == 0); assert(result == true); command.force = false; } int main() { int i[2], o[2]; assert(pipe(i) >= 0); assert(pipe(o) >= 0); assert(dup2(i[0], 0) >= 0); assert(close(i[0]) >= 0); assert(dup2(o[1], 1) >= 0); assert(close(o[1]) >= 0); assert((input = fdopen(i[1], "w"))); output = o[0]; test("yes", nullptr, true); test("no", nullptr, false); test("", "yes", true); test("whatever", "yes", true); test_force(); assert(fclose(input) >= 0); try { check("%s", "spong"); assert(!"unexpectedly succeeded"); } catch(IOError &e) { } return 0; } rsbackup-3.0/src/test-progress.cc0000664000175000017500000000360412356276723014050 00000000000000// Copyright © 2014 Richard Kettlewell. // // 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 . #include #include "Utils.h" #include "IO.h" #include #include #include #include #include #define WIDTH 79 static std::string getBytes(int fd) { std::string s; char buffer[128]; int n; while((n = read(fd, buffer, sizeof buffer)) > 0) s.append(buffer, static_cast(n)); if(n < 0) assert(errno == EAGAIN); return s; } int main() { FILE *ofp; int p[2], r; assert(pipe(p) >= 0); assert((ofp = fdopen(p[1], "w"))); assert((r = fcntl(p[0], F_GETFL)) >= 0); assert(fcntl(p[0], F_SETFL, r | O_NONBLOCK) >= 0); IO o(ofp, "output"); progressBar(o, "spong", 0, 0); std::string s = getBytes(p[0]); assert(s == "\r" + std::string(WIDTH, ' ') + "\r"); progressBar(o, "spong", 0, 10); s = getBytes(p[0]); assert(s == "\rspong [" + std::string(WIDTH - 8, ' ') + "]\r"); progressBar(o, "spong", 1, 10); s = getBytes(p[0]); assert(s == "\rspong [" + std::string((WIDTH - 8) / 10, '=') + std::string((WIDTH - 8) - (WIDTH - 8) / 10, ' ') + "]\r"); progressBar(o, "spong", 10, 10); s = getBytes(p[0]); assert(s == "\rspong [" + std::string(WIDTH - 8, '=') + "]\r"); return 0; } rsbackup-3.0/src/Unicode.cc0000664000175000017500000000332112621742165012602 00000000000000// Copyright © 2011, 2012 Richard Kettlewell. // // 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 . #include #include "Utils.h" #include "Errors.h" #include #include #include #include // We need to specify the endianness explicitly or iconv() assumes we want a // BOM. #ifdef WORDS_BIGENDIAN # define ENCODING "UTF-32BE" #else # define ENCODING "UTF-32LE" #endif void toUnicode(std::u32string &u, const std::string &mbs) { static iconv_t cd; if(cd == nullptr) { char *mbsEncoding = nl_langinfo(CODESET); cd = iconv_open(ENCODING, mbsEncoding); if(!cd) throw std::runtime_error(std::string("iconv_open: ") + strerror(errno)); } u.clear(); char32_t buffer[1024]; char *inptr = (char *)mbs.data(); size_t inleft = mbs.size(); while(inleft > 0) { char *outptr = (char *)buffer; size_t outleft = sizeof buffer; size_t n = iconv(cd, ICONV_FIXUP &inptr, &inleft, &outptr, &outleft); if(n == (size_t)-1 && n != E2BIG) throw std::runtime_error(std::string("iconv: ") + strerror(errno)); u.append(buffer, (char32_t *)outptr - buffer); } } rsbackup-3.0/src/test-subprocess.cc0000664000175000017500000000615212621703127014361 00000000000000// Copyright © 2012-14 Richard Kettlewell. // // 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 . #include #include "Subprocess.h" #include "Errors.h" #include #include #include #include #include #include static const char *warnings[64]; static size_t nwarnings; void warning(const char *fmt, ...) { char *w; va_list ap; assert(nwarnings < sizeof warnings / sizeof *warnings); va_start(ap, fmt); assert(vasprintf(&w, fmt, ap) >= 0); va_end(ap); warnings[nwarnings++] = w; } int main() { // Separate capture of stdout and stderr std::vector command = { "sh", "-c", "echo stdout; sleep 1; echo >&2 stderr; sleep 2; echo skipped" }; Subprocess sp(command); std::string stdoutCapture, stderrCapture; sp.capture(1, &stdoutCapture); sp.capture(2, &stderrCapture); sp.setTimeout(2); int rc = sp.runAndWait(false); assert(stdoutCapture == "stdout\n"); assert(stderrCapture == "stderr\n"); assert(WIFSIGNALED(rc)); assert(WTERMSIG(rc) == SIGKILL); assert(nwarnings == 1); assert(!strcmp(warnings[0], "sh exceeded timeout of 2 seconds")); // Capture of both stdout and stderr command = { "sh", "-c", "echo stdout; echo >&2 stderr" }; Subprocess sp2(command); std::string bothCapture; sp2.capture(1, &bothCapture, 2); rc = sp2.runAndWait(false); assert(bothCapture == "stdout\nstderr\n"); assert(WIFEXITED(rc)); assert(WEXITSTATUS(rc) == 0); assert(nwarnings == 1); // NB assumes the 'usual' encoding of exit status, will need to do something // more sophisticated if some useful platform doesn't play along. // // For reference the 'usual' encoding is: // bits 0-6: // The termination/stop signal // 0 = exited // 1-126 = terminated with this signal // 127 = stopped // bits 7 // Set if core dumped // bits 8-15 // If exited: the exit status // If stopped: the stop signal std::string d; d = SubprocessFailed::format("progname", SIGKILL); assert(d == std::string("progname: ") + strsignal(SIGKILL)); d = SubprocessFailed::format("progname", SIGKILL|0x80); assert(d == std::string("progname: ") + strsignal(SIGKILL) + " (core dumped)"); d = SubprocessFailed::format("progname", 37 << 8); assert(d.find("progname") != std::string::npos); assert(d == "progname: exited with status 37"); d = SubprocessFailed::format("progname", (SIGSTOP << 8) + 0x7F); assert(d == std::string("progname: ") + strsignal(SIGSTOP)); return 0; } rsbackup-3.0/src/Store.cc0000644000175000017500000000554712626635545012332 00000000000000// Copyright © 2011, 2012 Richard Kettlewell. // // 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 . #include #include "Conf.h" #include "Store.h" #include "Errors.h" #include "IO.h" #include "Utils.h" #include "DeviceAccess.h" #include #include #include // Identify the device on this store, if any void Store::identify() { IO *f = nullptr; try { struct stat sb; if(device) return; // already identified if(stat(path.c_str(), &sb) < 0) throw BadStore("store '" + path + "' does not exist"); // Make sure backup devices are mounted preDeviceAccess(); // Read the device name f = new IO(); f->open(path + PATH_SEP + "device-id", "r"); std::string deviceName; if(!f->readline(deviceName)) throw BadStore("store '" + path + "' has a malformed device-id"); // See if it exists auto devices_iterator = config.devices.find(deviceName); if(devices_iterator == config.devices.end()) throw BadStore("store '" + path + "' has unknown device-id '" + deviceName + "'"); Device *foundDevice = devices_iterator->second; // Duplicates are bad, sufficiently so that we don't treat it as // just an unsuitable store; something is seriously wrong and it // needs immediate attention. if(foundDevice->store) throw FatalStoreError("store '" + path + "' has duplicate device-id '" + deviceName + "', also found on store '" + foundDevice->store->path + "'"); if(!config.publicStores) { // Verify permissions if(sb.st_uid) throw BadStore("store '" + path + "' not owned by root"); if(sb.st_mode & 077) throw BadStore("store '" + path + "' is not private"); } device = foundDevice; device->store = this; // On success, leave a file open on the store to stop it being unmounted // while we it's a potential destination for backups; but close it before // unmounting. closeOnUnmount(f); } catch(IOError &e) { if(f) delete f; // Re-throw with the appropriate error type if(e.errno_value == ENOENT) throw UnavailableStore(e.what()); else throw BadStore(e.what()); } } rsbackup-3.0/src/test-io.cc0000664000175000017500000000341712621703101012571 00000000000000// Copyright © 2014 Richard Kettlewell. // // 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 . #include #include "IO.h" #include #include static void test_io_write(void) { IO f; f.open("test-io-tmp", "w"); f.write("line 1\n"); f.writef("line %d\n", 2); f.close(); } static void test_io_readline(void) { IO f; f.open("test-io-tmp", "r"); std::string l; bool rc; rc = f.readline(l); assert(rc); assert(l == "line 1"); rc = f.readline(l); assert(rc); assert(l == "line 2"); rc = f.readline(l); assert(!rc); f.close(); } static void test_io_readlines(void) { IO f; f.open("test-io-tmp", "r"); std::vector ls; f.readlines(ls); assert(ls.size() == 2); assert(ls[0] == "line 1"); assert(ls[1] == "line 2"); f.close(); } static void test_io_capture(void) { IO f; std::vector command = { "echo", "spong" }; std::vector ls; f.popen(command, ReadFromPipe, false); f.readlines(ls); f.close(); assert(ls.size() == 1); assert(ls[0] == "spong"); } int main() { test_io_write(); test_io_readline(); test_io_readlines(); test_io_capture(); remove("test-io-tmp"); return 0; } rsbackup-3.0/src/test-date.cc0000664000175000017500000000610412450336324013104 00000000000000// Copyright © 2012 Richard Kettlewell. // // 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 . #include #include "Date.h" #include "Errors.h" #include #include #include #define assert_throws(expr, except) do { \ try { \ (expr); \ assert(!"unexpected succeeded"); \ } catch(except &e) { \ } \ } while(0) int main() { Date d("1997-03-02"); assert(d.toString() == "1997-03-02"); assert(d.toNumber() == (1997*365+(1997/4)-(1997/100)+(1997/400) +31+28 +2-1)); Date dd(d.toTime()); assert(d.toString() == dd.toString()); std::stringstream s; s << d; assert(s.str() == "1997-03-02"); Date e("1998-03-02"); assert(e.toString() == "1998-03-02"); assert(e.toNumber() == (1998*365+(1997/4)-(1997/100)+(1997/400) +31+28 +2-1)); assert(e - d == 365); Date ee(e.toTime()); assert(e.toString() == ee.toString()); Date f; assert(f.toString() == "0000-01-01"); Date t = Date::today(); printf("today = %s = %d\n", t.toString().c_str(), t.toNumber()); Date tt(t.toTime()); assert(t.toString() == tt.toString()); assert(Date("1997-03-01") < Date("1997-03-02")); assert(Date("1997-03-02") < Date("1997-04-01")); assert(Date("1997-03-02") < Date("1998-01-01")); assert(Date::monthLength(1999, 1) == 31); assert(Date::monthLength(1999, 2) == 28); assert(Date::monthLength(2000, 2) == 29); assert(Date::monthLength(2004, 2) == 29); assert(Date::monthLength(2100, 2) == 28); assert_throws(Date(""), InvalidDate); assert_throws(Date("whatever"), InvalidDate); assert_throws(Date("2012"), InvalidDate); assert_throws(Date("2012-03"), InvalidDate); assert_throws(Date("2012--03-01"), InvalidDate); assert_throws(Date("2012-03-04-05"), InvalidDate); assert_throws(Date("2012/03/04"), InvalidDate); assert_throws(Date("0-01-01"), InvalidDate); assert_throws(Date("2012-00-01"), InvalidDate); assert_throws(Date("2012-13-01"), InvalidDate); assert_throws(Date("2012-01-00"), InvalidDate); assert_throws(Date("2012-01-32"), InvalidDate); assert_throws(Date("2011-02-29"), InvalidDate); assert_throws(Date("0x100-02-29"), InvalidDate); assert_throws(Date("2147483648-02-01"), InvalidDate); assert_throws(Date("9223372036854775808-02-21"), InvalidDate); return 0; } rsbackup-3.0/src/Makefile.am0000644000175000017500000001011012626634241012731 00000000000000# Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. # # 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 . noinst_LIBRARIES=librsbackup.a bin_PROGRAMS=rsbackup noinst_PROGRAMS=test-date test-io test-directory test-subprocess \ test-unicode test-timespec test-command test-select \ test-confbase test-check test-device test-host test-volume \ test-progress test-database test-tolines test-globfiles \ test-lock test-split test-parseinteger test-prunedecay \ test-eventloop dist_noinst_SCRIPTS=check-source AM_CFLAGS=$(SQLITE3_CFLAGS) librsbackup_a_SOURCES=Backup.cc BulkRemove.cc Check.cc Command.cc \ Conf.cc \ Date.cc DeviceAccess.cc Device.cc Directory.cc Document.cc Email.cc \ error.cc Errors.cc FileLock.cc Host.cc HTML.cc IO.cc MakeBackup.cc \ Progress.cc Prune.h Prune.cc Report.cc \ RetireDevices.cc RetireVolumes.cc Store.cc stylesheet.cc \ Subprocess.cc Text.cc Unicode.cc Volume.cc Command.h Conf.h Date.h \ Defaults.h DeviceAccess.h Document.h Email.h Errors.h FileLock.h IO.h \ rsbackup.h Store.h Subprocess.h Utils.h ConfBase.cc \ toLines.cc globFiles.cc Database.h Database.cc Report.h \ parseInteger.cc split.cc EventLoop.cc EventLoop.h nonblock.cc \ Action.cc Action.h BulkRemove.h rsbackup_SOURCES=rsbackup.cc PruneAge.cc PruneNever.cc PruneExec.cc \ PruneDecay.cc rsbackup_LDADD=librsbackup.a $(SQLITE3_LIBS) $(BOOST_LIBS) test_date_SOURCES=test-date.cc test_date_LDADD=librsbackup.a test_subprocess_SOURCES=test-subprocess.cc Subprocess.cc Errors.cc IO.cc \ EventLoop.cc nonblock.cc Action.cc test_unicode_SOURCES=test-unicode.cc test_unicode_LDADD=librsbackup.a test_io_SOURCES=test-io.cc test_io_LDADD=librsbackup.a test_directory_SOURCES=test-directory.cc test_directory_LDADD=librsbackup.a test_timespec_SOURCES=test-timespec.cc test_command_SOURCES=test-command.cc test_command_LDADD=librsbackup.a $(SQLITE3_LIBS) $(BOOST_LIBS) test_select_SOURCES=test-select.cc test_select_LDADD=librsbackup.a $(SQLITE3_LIBS) $(BOOST_LIBS) test_confbase_SOURCES=test-confbase.cc test_confbase_LDADD=librsbackup.a test_check_SOURCES=test-check.cc test_check_LDADD=librsbackup.a $(LIBPTHREAD) $(SQLITE3_LIBS) $(BOOST_LIBS) test_device_SOURCES=test-device.cc test_device_LDADD=librsbackup.a test_host_SOURCES=test-host.cc test_host_LDADD=librsbackup.a $(SQLITE3_LIBS) $(BOOST_LIBS) test_volume_SOURCES=test-volume.cc test_volume_LDADD=librsbackup.a $(SQLITE3_LIBS) $(BOOST_LIBS) test_progress_SOURCES=test-progress.cc test_progress_LDADD=librsbackup.a test_database_SOURCES=test-database.cc test_database_LDADD=librsbackup.a $(SQLITE3_LIBS) $(BOOST_LIBS) test_tolines_SOURCES=test-tolines.cc test_tolines_LDADD=librsbackup.a test_globfiles_SOURCES=test-globfiles.cc test_globfiles_LDADD=librsbackup.a test_lock_SOURCES=test-lock.cc test_lock_LDADD=librsbackup.a test_split_SOURCES=test-split.cc test_split_LDADD=librsbackup.a test_parseinteger_SOURCES=test-parseinteger.cc test_parseinteger_LDADD=librsbackup.a test_prunedecay_SOURCES=test-prunedecay.cc PruneDecay.cc test_prunedecay_LDADD=librsbackup.a $(SQLITE3_LIBS) $(BOOST_LIBS) test_eventloop_SOURCES=test-eventloop.cc EventLoop.cc test_eventloop_LDADD=librsbackup.a TESTS=test-date test-io test-directory test-subprocess test-unicode \ test-timespec test-command test-select test-confbase \ test-check test-device test-host test-volume test-progress test-database \ test-tolines test-globfiles test-lock test-split test-parseinteger \ test-prunedecay test-eventloop check-source stylesheet.cc: ${top_srcdir}/doc/rsbackup.css ${top_srcdir}/scripts/txt2src stylesheet < $^ > $@ rsbackup-3.0/src/Command.cc0000664000175000017500000002310112621666133012570 00000000000000// Copyright © 2011-15 Richard Kettlewell. // // 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 . #include #include "Command.h" #include "Defaults.h" #include "Errors.h" #include "Conf.h" #include "IO.h" #include #include // Long-only options enum { RETIRE_DEVICE = 256, RETIRE = 257, WARN_UNKNOWN = 258, WARN_STORE = 259, WARN_UNREACHABLE = 261, WARN_PARTIAL = 262, REPEAT_ERRORS = 263, NO_REPEAT_ERRORS = 264, NO_WARN_PARTIAL = 265, LOG_VERBOSITY = 266, DUMP_CONFIG = 267, }; const struct option Command::options[] = { { "help", no_argument, nullptr, 'h' }, { "version", no_argument, nullptr, 'V' }, { "backup", no_argument, nullptr, 'b' }, { "html", required_argument, nullptr, 'H' }, { "text", required_argument, nullptr, 'T' }, { "email", required_argument, nullptr, 'e' }, { "prune", no_argument, nullptr, 'p' }, { "prune-incomplete", no_argument, nullptr, 'P' }, { "store", required_argument, nullptr, 's' }, { "retire-device", no_argument, nullptr, RETIRE_DEVICE }, { "retire", no_argument, nullptr, RETIRE }, { "config", required_argument, nullptr, 'c' }, { "wait", no_argument, nullptr, 'w' }, { "force", no_argument, nullptr, 'f' }, { "dry-run", no_argument, nullptr, 'n' }, { "verbose", no_argument, nullptr, 'v' }, { "warn-unknown", no_argument, nullptr, WARN_UNKNOWN }, { "warn-store", no_argument, nullptr, WARN_STORE }, { "warn-unreachable", no_argument, nullptr, WARN_UNREACHABLE }, { "warn-partial", no_argument, nullptr, WARN_PARTIAL }, { "no-warn-partial", no_argument, nullptr, NO_WARN_PARTIAL }, { "errors", no_argument, nullptr, REPEAT_ERRORS }, { "no-errors", no_argument, nullptr, NO_REPEAT_ERRORS }, { "warn-all", no_argument, nullptr, 'W' }, { "debug", no_argument, nullptr, 'd' }, { "logs", required_argument, nullptr, LOG_VERBOSITY }, { "dump-config", no_argument, nullptr, DUMP_CONFIG }, { "database", required_argument, nullptr, 'D' }, { nullptr, 0, nullptr, 0 } }; void Command::help() { IO::out.writef(helpString()); IO::out.close(); exit(0); } const char *Command::helpString() { return "Usage:\n" " rsbackup [OPTIONS] [--] [[-]HOST...] [[-]HOST:VOLUME...]\n" " rsbackup --retire [OPTIONS] [--] [HOST...] [HOST:VOLUME...]\n" " rsbackup --retire-device [OPTIONS] [--] DEVICES...\n" "\n" "At least one action option is required:\n" " --backup, -b Back up selected volumes (default: all)\n" " --html, -H PATH Write an HTML report to PATH\n" " --text, -T PATH Write a text report to PATH\n" " --email, -e ADDRESS Mail HTML report to ADDRESS\n" " --prune, -p Prune old backups of selected volumes (default: all)\n" " --prune-incomplete, -P Prune incomplete backups\n" " --retire Retire volumes (must specify at least one)\n" " --retire-device Retire devices (must specify at least one)\n" " --dump-config Dump parsed configuration\n" "\n" "Additional options:\n" " --logs all|errors|recent|latest|failed Log verbosity in report\n" " --store, -s DIR Override directory(s) to store backups in\n" " --config, -c PATH Set config file (default: /etc/rsbackup/config)\n" " --wait, -w Wait until running rsbackup finishes\n" " --force, -f Don't prompt when retiring\n" " --dry-run, -n Dry run only\n" " --verbose, -v Verbose output\n" " --debug, -d Debug output\n" " --database, -D PATH Override database path\n" " --help, -h Display usage message\n" " --version, -V Display version number\n" "\n" "Warning options:\n" " --warn-unknown Warn about unknown devices/volumes\n" " --warn-store Warn about bad stores/unavailable devices\n" " --warn-unreachable Warn about unreachable hosts\n" " --warn-partial Warn about partial transfers (default)\n" " --no-warn-partial Suppress warnings about partial transfers\n" " --warn-all, -W Enable all warnings\n" " --errors Display rsync errors (default)\n" " --no-errors Don't display rsync errors\n" ; } void Command::version() { IO::out.writef("%s\n", VERSION); IO::out.close(); exit(0); } void Command::parse(int argc, const char *const *argv) { int n; // Override debug if(getenv("RSBACKUP_DEBUG")) debug = true; // Parse options optind = 1; while((n = getopt_long(argc, (char *const *)argv, "+hVbH:T:e:pPs:c:wnfvdWD:", options, nullptr)) >= 0) { switch(n) { case 'h': help(); case 'V': version(); case 'b': backup = true; break; case 'H': html = new std::string(optarg); break; case 'T': text = new std::string(optarg); break; case 'e': email = new std::string(optarg); break; case 'p': prune = true; break; case 'P': pruneIncomplete = true; break; case 's': stores.push_back(optarg); warnStore = true; break; case 'c': configPath = optarg; break; case 'w': wait = true; break; case 'n': act = false; verbose = true; break; case 'f': force = true; break; case 'v': verbose = true; break; case 'd': debug = true; break; case 'D': database = optarg; break; case RETIRE_DEVICE: retireDevice = true; break; case RETIRE: retire = true; break; case WARN_UNKNOWN: warnUnknown = true; break; case WARN_STORE: warnStore = true; break; case WARN_UNREACHABLE: warnUnreachable = true; break; case WARN_PARTIAL: warnPartial = true; break; case NO_WARN_PARTIAL: warnPartial = false; break; case REPEAT_ERRORS: repeatErrorLogs = true; break; case NO_REPEAT_ERRORS: repeatErrorLogs = false; break; case LOG_VERBOSITY: logVerbosity = getVerbosity(optarg); break; case 'W': warnUnknown = warnStore = warnUnreachable = warnPartial = true; break; case DUMP_CONFIG: dumpConfig = true; break; default: exit(1); } } // Various options are incompatible with one another if(retire && retireDevice) throw CommandError("--retire and --retire-device cannot be used together"); if(backup && retire) throw CommandError("--retire and --backup cannot be used together"); if(backup && retireDevice) throw CommandError("--retire-device and --backup cannot be used together"); if(dumpConfig && (backup || html || text || email || prune || pruneIncomplete || retireDevice || retire)) throw CommandError("--dump-config cannot be used with any other action"); // We have to do *something* if(!backup && !html && !text && !email && !prune && !pruneIncomplete && !retireDevice && !retire && !dumpConfig) throw CommandError("no action specified"); if(backup || prune || pruneIncomplete || retire) { // Volumes to back up, prune or retire if(optind < argc) { for(n = optind; n < argc; ++n) { // Establish the sense of this entry bool sense; const char *s = argv[n], *t; if(*s == '-' || *s == '!') { sense = false; ++s; } else sense = true; if((t = strchr(s, ':'))) { // A host:volume pair selections.push_back(Selection(std::string(s, t - s), t + 1, sense)); } else { // Just a host selections.push_back(Selection(s, "*", sense)); } } } else { if(retire) throw CommandError("no volumes specified to retire"); // No volumes requested = back up/prune everything selections.push_back(Selection("*", "*", true)); } } if(retireDevice) { if(optind >= argc) throw CommandError("no devices specified to retire"); for(n = optind; n < argc; ++n) devices.push_back(argv[n]); } if(dumpConfig) { if(optind < argc) throw CommandError("no arguments allowed to --dump-config"); } } void Command::selectVolumes() { // This is a separate method because it has to be called after the config // file is read. for(auto &selection: selections) config.selectVolume(selection.host, selection.volume, selection.sense); } Command::LogVerbosity Command::getVerbosity(const std::string &v) { if(v == "all") return All; if(v == "errors") return Errors; if(v == "recent") return Recent; if(v == "latest") return Latest; if(v == "failed") return Failed; throw CommandError("invalid argument to --logs: " + v); } Command::Selection::Selection(const std::string &host_, const std::string &volume_, bool sense_): sense(sense_), host(host_), volume(volume_) { if(!Host::valid(host) && host != "*") throw CommandError("invalid host: " + host); if(!Volume::valid(volume) && volume != "*") throw CommandError("invalid volume: " + volume); if(host == "*" && volume != "*") throw CommandError("invalid host: " + host); } Command command; rsbackup-3.0/src/Volume.cc0000664000175000017500000001404212621636127012465 00000000000000// Copyright © 2011-2015 Richard Kettlewell. // // 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 . #include #include "Conf.h" #include "Subprocess.h" #include "Utils.h" #include #include void Volume::select(bool sense) { isSelected = sense; } bool Volume::valid(const std::string &name) { return name.size() > 0 && name.at(0) != '-' && name.find_first_not_of(VOLUME_VALID) == std::string::npos; } void Volume::calculate() { completed = 0; for(auto &pd: perDevice) pd.second.count = 0; for(const Backup *backup: backups) { // Only count complete backups which aren't going to be pruned if(backup->getStatus() == COMPLETE) { // Global figures ++completed; if(completed == 1 || backup->date < oldest) oldest = backup->date; if(completed == 1 || backup->date > newest) newest = backup->date; // Per-device figures Volume::PerDevice &pd = perDevice[backup->deviceName]; ++pd.count; if(pd.count == 1 || backup->date < pd.oldest) pd.oldest = backup->date; if(pd.count == 1 || backup->date > pd.newest) pd.newest = backup->date; } } for(auto it = perDevice.begin(); it != perDevice.end();) { auto jt = it; ++it; Volume::PerDevice &pd = jt->second; if(!pd.count) perDevice.erase(jt); } } void Volume::addBackup(Backup *backup) { backups.insert(backup); calculate(); } bool Volume::removeBackup(const Backup *backup) { for(auto it = backups.begin(); it != backups.end(); ++it) { const Backup *s = *it; if(s == backup) { backups.erase(it); // Recalculate totals calculate(); return true; } } return false; } const Backup *Volume::mostRecentBackup(const Device *device) const { const Backup *result = nullptr; for(const Backup *backup: backups) { if(!device || backup->getDevice() == device) { if(!result || *result < *backup) result = backup; } } return result; } const Backup *Volume::mostRecentFailedBackup(const Device *device) const { const Backup *result = nullptr; for(const Backup *backup: backups) { if(!device || backup->getDevice() == device) { if(backup->rc) if(!result || *result < *backup) result = backup; } } return result; } bool Volume::available() const { if(checkMounted) { std::string os, stats; std::string parent_directory = path + "/.."; const char *option; // Guess which version of stat to use based on uname. if(parent->invoke(&os, "uname", "-s", (const char *)nullptr) != 0) return false; if(os == "Darwin" || (os.size() >= 3 && os.compare(os.size() - 3, 3, "BSD") == 0)) { option = "-f"; } else { // For everything else assume coreutils stat(1) option = "-c"; } // Get the device numbers for path and its parent if(parent->invoke(&stats, "stat", option, "%d", path.c_str(), parent_directory.c_str(), (const char *)nullptr)) return false; // Split output into lines std::vector lines; toLines(lines, stats); // If stats is malformed, or if device numbers match (implying path is not // a mount point), volume is not available. if(lines.size() != 2 || lines[0].size() == 0 || lines[1].size() == 0 || lines[0] == lines[1]) return false; } if(checkFile.size()) { std::string file = (checkFile[0] == '/' ? checkFile : path + "/" + checkFile); if(parent->invoke(nullptr, "test", "-e", file.c_str(), (const char *)nullptr) != 0) return false; } return true; } void Volume::write(std::ostream &os, int step, bool verbose) const { describe_type *d = verbose ? describe : nodescribe; os << indent(step) << "volume " << quote(name) << ' ' << quote(path) << '\n'; step += 4; ConfBase::write(os, step, verbose); d(os, "", step); d(os, "# Glob pattern for devices this host will be backed up to", step); d(os, "# devices PATTERN", step); if(devicePattern.size()) os << indent(step) << "devices " << quote(devicePattern) << '\n'; d(os, "", step); d(os, "# Paths to exclude from backup", step); d(os, "# Patterns are glob patterns, starting at the root of the volume as '/'.", step); d(os, "# '*' matches multiple characters but not '/'", step); d(os, "# '**' matches multiple characters including '/'", step); d(os, "# Consult rsync manual for full pattern syntax", step); d(os, "# exclude PATTERN", step); for(const std::string &exclusion: exclude) os << indent(step) << "exclude " << quote(exclusion) << '\n'; d(os, "", step); d(os, "# Back up across mount points", step); d(os, "# traverse true|false", step); os << indent(step) << "traverse " << (traverse ? "true" : "false") << '\n'; d(os, "", step); d(os, "# Check that a named file exists before performing backup", step); d(os, "# check-file PATH", step); if(checkFile.size()) os << indent(step) << "check-file " << quote(checkFile) << '\n'; d(os, "", step); d(os, "# Check that volume is a mount point before performing backup", step); d(os, "# check-mounted true|false", step); os << indent(step) << "check-mounted " << (checkMounted ? "true" : "false") << '\n'; } ConfBase *Volume::getParent() const { return parent; } std::string Volume::what() const { return "volume"; } rsbackup-3.0/src/PruneDecay.cc0000664000175000017500000000756512620463022013260 00000000000000// Copyright © 2015 Richard Kettlewell. // // 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 . #include #include "rsbackup.h" #include "Conf.h" #include "Prune.h" #include "Utils.h" #include // See also ../doc/decay.lyx (and .pdf) int prune_decay_bucket(double w, double s, int a) { return ceil(logbase((s - 1) * a / w + 1, s)) - 1; } /** @brief The @c decay pruning policy */ class PruneDecay: public PrunePolicy { public: PruneDecay(): PrunePolicy("decay") {} void validate(const Volume *volume) const override { parseInteger(get(volume, "decay-start", DEFAULT_DECAY_START), 1); parseInteger(get(volume, "decay-window", DEFAULT_DECAY_WINDOW), 1); parseInteger(get(volume, "decay-scale", DEFAULT_DECAY_SCALE), 2); parseInteger(get(volume, "decay-limit", DEFAULT_PRUNE_AGE), 1); } void prunable(std::vector &onDevice, std::map &prune, int) const override { const Volume *volume = onDevice.at(0)->volume; int decayStart = parseInteger(get(volume, "decay-start", DEFAULT_DECAY_START), 1); int decayWindow = parseInteger(get(volume, "decay-window", DEFAULT_DECAY_WINDOW), 1); int decayScale = parseInteger(get(volume, "decay-scale", DEFAULT_DECAY_SCALE), 2); int decayLimit = parseInteger(get(volume, "decay-limit", DEFAULT_PRUNE_AGE), 1); if(onDevice.size() == 1) return; // Map of bucket numbers to oldest backup in the bucket. These will be // presderved. std::map oldest; for(Backup *backup: onDevice) { int age = Date::today() - backup->date; // Keep backups that are young enough int a = age - decayStart; if(a <= 0) continue; // Prune backups that are much too old if(age > decayLimit) { std::ostringstream ss; ss << "age " << age << " > " << decayLimit << " and other backups exist"; prune[backup] = ss.str(); continue; } // Assign backups to buckets int bucket = prune_decay_bucket(decayWindow, decayScale, a); // Track the oldest backup in this bucket auto bucket_iterator = oldest.find(bucket); if(bucket_iterator == oldest.end()) oldest[bucket] = age; else { int &oldest_in_this_bucket = bucket_iterator->second; if(age > oldest_in_this_bucket) oldest_in_this_bucket = age; } } // Now that we know what the oldest backup in each bucket is, we can prune // the rest. for(Backup *backup: onDevice) { int age = Date::today() - backup->date; // Keep backups that are young enough int a = age - decayStart; if(a <= 0 || age > decayLimit) continue; int bucket = prune_decay_bucket(decayWindow, decayScale, a); auto bucket_iterator = oldest.find(bucket); assert(bucket_iterator != oldest.end()); int oldest_in_this_bucket = bucket_iterator->second; if(age != oldest_in_this_bucket) { std::ostringstream ss; ss << "age " << age << " > " << decayStart << " and oldest in bucket " << bucket; prune[backup] = ss.str(); } } } } prune_decay; rsbackup-3.0/src/Prune.cc0000664000175000017500000002653212626652660012323 00000000000000// Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. // // 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 . #include #include "rsbackup.h" #include "Conf.h" #include "Command.h" #include "Errors.h" #include "IO.h" #include "Utils.h" #include "Store.h" #include "Database.h" #include "Prune.h" #include "BulkRemove.h" #include #include #include #include #include #include /** @brief A removable backup */ class RemovableBackup { public: /** @brief Constructor * @param b Backup to remove */ RemovableBackup(Backup *b): backup(b) {} /** @brief Initialize the @ref BulkRemove instance */ void initialize() { bulkRemover.initialize(backup->backupPath()); bulkRemover.uses(backup->deviceName); } /** @brief The backup to remove */ Backup *backup; /** @brief The bulk remove instance for this backup */ BulkRemove bulkRemover; }; static void findObsoleteBackups(std::vector &obsoleteBackups); static void markObsoleteBackups(std::vector obsoleteBackups); static void findRemovableBackups(std::vector obsoleteBackups, std::vector &removableBackups); static void checkRemovalErrors(std::vector &removableBackups); static void commitRemovals(std::vector &removableBackups); PrunePolicy::PrunePolicy(const std::string &name) { if(!policies) policies = new policies_type(); (*policies)[name] = this; } const std::string &PrunePolicy::get(const Volume *volume, const std::string &name) const { auto it = volume->pruneParameters.find(name); if(it != volume->pruneParameters.end()) return it->second; else throw ConfigError("missing pruning parameter '" + name + "'"); } const std::string &PrunePolicy::get(const Volume *volume, const std::string &name, const std::string &def) const { auto it = volume->pruneParameters.find(name); if(it != volume->pruneParameters.end()) return it->second; else return def; } const PrunePolicy *PrunePolicy::find(const std::string &name) { auto it = policies->find(name); if(it == policies->end()) throw ConfigError("unrecognized pruning policy '" + name + "'"); return it->second; } void validatePrunePolicy(const Volume *volume) { const PrunePolicy *policy = PrunePolicy::find(volume->prunePolicy); policy->validate(volume); } void backupPrunable(std::vector &onDevice, std::map &prune, int total) { if(onDevice.size() == 0) return; const Volume *volume = onDevice.at(0)->volume; const PrunePolicy *policy = PrunePolicy::find(volume->prunePolicy); policy->prunable(onDevice, prune, total); } PrunePolicy::policies_type *PrunePolicy::policies; // Remove old and incomplete backups void pruneBackups() { // Make sure all state is available config.readState(); // An _obsolete_ backup is a backup which exists on any device which is now // due for removal. This includes devices which aren't currently available. std::vector obsoleteBackups; findObsoleteBackups(obsoleteBackups); // Return straight away if there's nothing to do if(obsoleteBackups.size() == 0) return; // We set all obsolete backups to PRUNING state even if they're on currently // unavailable devices. Note that this means that pruning policies are // implemented even for these devices. if(command.act) markObsoleteBackups(obsoleteBackups); // Identify devices config.identifyDevices(Store::Enabled); // A _removable_ backup is an obsolete backup which is on an available device // and can therefore actually be removed. std::vector removableBackups; findRemovableBackups(obsoleteBackups, removableBackups); if(!command.act) assert(removableBackups.size() == 0); EventLoop e; ActionList al(&e); // Initialize the bulk remove operations for(auto &removable: removableBackups) { removable.initialize(); al.add(&removable.bulkRemover); } // Perform the deletions al.go(); if(command.act) { // Complain about failed prunes checkRemovalErrors(removableBackups); // Update persistent state commitRemovals(removableBackups); // Update internal state for(auto &removable: removableBackups) { if(removable.bulkRemover.getStatus() == 0) removable.backup->volume->removeBackup(removable.backup); } } } static void findObsoleteBackups(std::vector &obsoleteBackups) { for(auto &h: config.hosts) { const Host *host = h.second; if(!host->selected()) continue; for(auto &v: host->volumes) { Volume *volume = v.second; if(!volume->selected()) continue; // For each device, the complete backups on that device std::map> onDevices; // Total backups of this volume int total = 0; for(Backup *backup: volume->backups) { switch(backup->getStatus()) { case UNKNOWN: case UNDERWAY: case FAILED: if(command.pruneIncomplete) { // Prune incomplete backups. Anything that failed is counted as // incomplete (a succesful retry will overwrite the log entry). backup->contents = std::string("status=") + backup_status_names[backup->getStatus()]; obsoleteBackups.push_back(backup); } break; case PRUNING: // Both commands continue pruning anything that has started being // pruned. log should already be set. obsoleteBackups.push_back(backup); break; case PRUNED: break; case COMPLETE: if(command.prune) { onDevices[backup->deviceName].push_back(backup); ++total; } break; } } for(auto &od: onDevices) { std::vector &onDevice = od.second; std::map prune; backupPrunable(onDevice, prune, total); for(auto &p: prune) { Backup *backup = p.first; backup->contents = p.second; obsoleteBackups.push_back(backup); --total; } } } } } static void markObsoleteBackups(std::vector obsoleteBackups) { config.getdb().begin(); for(Backup *b: obsoleteBackups) { if(b->getStatus() != PRUNING) { b->setStatus(PRUNING); b->pruned = Date::now(); b->update(config.getdb()); } } config.getdb().commit(); // We don't catch DatabaseBusy here; the prune just fails. } static void findRemovableBackups(std::vector obsoleteBackups, std::vector &removableBackups) { for(auto backup: obsoleteBackups) { Device *device = config.findDevice(backup->deviceName); Store *store = device->store; // Can't delete backups from unavailable stores if(!store || store->state != Store::Enabled) continue; std::string backupPath = backup->backupPath(); std::string incompletePath = backupPath + ".incomplete"; try { // Schedule removal of the backup if(command.verbose) IO::out.writef("INFO: pruning %s because: %s\n", backupPath.c_str(), backup->contents.c_str()); if(command.act) { // Create the .incomplete flag file so that the operator knows this // backup is now partial IO ifile; ifile.open(incompletePath, "w"); ifile.close(); // Queue up a bulk remove operation removableBackups.push_back(RemovableBackup(backup)); } } catch(std::runtime_error &exception) { // Log anything that goes wrong error("failed to remove %s: %s\n", backupPath.c_str(), exception.what()); ++errors; } } } static void checkRemovalErrors(std::vector &removableBackups) { for(auto &removable: removableBackups) { const std::string backupPath = removable.backup->backupPath(); if(removable.bulkRemover.getStatus() != 0) { // Log failed prunes error("failed to remove %s: %s\n", backupPath.c_str(), SubprocessFailed::format("rm", removable.bulkRemover.getStatus()).c_str()); } else { const std::string incompletePath = backupPath + ".incomplete"; // Remove the 'incomplete' marker. if(command.verbose) IO::out.writef("INFO: removing %s\n", incompletePath.c_str()); if(unlink(incompletePath.c_str()) < 0 && errno != ENOENT) { error("removing %s: %s", incompletePath.c_str(), strerror(errno)); ++errors; } } } } static void commitRemovals(std::vector &removableBackups) { for(;;) { int retries = 0; try { config.getdb().begin(); for(auto &removable: removableBackups) { if(removable.bulkRemover.getStatus() == 0) { removable.backup->setStatus(PRUNED); // TODO actually this value for pruned is a bit late. removable.backup->pruned = Date::now(); removable.backup->update(config.getdb()); } } config.getdb().commit(); } catch(DatabaseBusy &) { // Keep trying, database should be in sync with reality // Log a message every second or so if(!(retries++ & 1023)) warning("pruning: retrying database update"); // Wait a millisecond and try again usleep(1000); continue; } break; // success } } // Remove old prune logfiles void prunePruneLogs() { // Delete status=PRUNED records that are too old Database::Statement(config.getdb(), "DELETE FROM backup" " WHERE status=?" " AND pruned < ?", SQL_INT, PRUNED, SQL_INT64, (int64_t)(Date::now() - config.keepPruneLogs * 86400), SQL_END); // Delete pre-sqlitification pruning logs // TODO: one day this code can be removed. Date today = Date::today(); // Regexp for parsing the filename // Format is prune-YYYY-MM-DD.log std::regex r("^prune-([0-9]+-[0-9]+-[0-9]+)\\.log$"); Directory d; d.open(config.logs); std::string f; while(d.get(f)) { std::smatch mr; if(!std::regex_match(f, mr, r)) continue; Date d = Date(mr[1]); int age = today - d; if(age <= config.keepPruneLogs) continue; std::string path = config.logs + PATH_SEP + f; if(command.verbose) IO::out.writef("INFO: removing %s\n", path.c_str()); if(command.act) if(unlink(path.c_str()) < 0) throw IOError("removing " + path, errno); } } rsbackup-3.0/src/test-tolines.cc0000664000175000017500000000227112452265667013662 00000000000000// Copyright © 2015 Richard Kettlewell. // // 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 . #include #include "Utils.h" #include int main() { std::vector lines; toLines(lines, ""); assert(lines.size() == 0); lines.push_back(""); toLines(lines, ""); assert(lines.size() == 0); toLines(lines, "1"); assert(lines.size() == 1); assert(lines[0] == "1"); toLines(lines, "1\n"); assert(lines.size() == 1); assert(lines[0] == "1"); toLines(lines, "1\n2"); assert(lines.size() == 2); assert(lines[0] == "1"); assert(lines[1] == "2"); return 0; } rsbackup-3.0/src/test-select.cc0000664000175000017500000000536112601750105013445 00000000000000// Copyright © 2014 Richard Kettlewell. // // 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 . #include #include "Conf.h" #include #define SETUP() \ Conf c; \ Host h1(&c, "h1"); \ Host h2(&c, "h2"); \ Volume h1v1(&h1, "v1", "/v1"); \ Volume h1v2(&h1, "v2", "/v2"); \ Volume h2v1(&h2, "v1", "/v1"); \ Volume h2v2(&h2, "v2", "/v2") static void test_initial_state() { SETUP(); assert(!h1.selected()); assert(!h1v1.selected()); assert(!h1v2.selected()); assert(!h2.selected()); assert(!h2v1.selected()); assert(!h2v2.selected()); } static void test_select_all() { SETUP(); c.selectVolume("*", "*", true); assert(h1.selected()); assert(h1v1.selected()); assert(h1v2.selected()); assert(h2.selected()); assert(h2v1.selected()); assert(h2v2.selected()); } static void test_select_host() { SETUP(); c.selectVolume("h1", "*", true); assert(h1.selected()); assert(h1v1.selected()); assert(h1v2.selected()); assert(!h2.selected()); assert(!h2v1.selected()); assert(!h2v2.selected()); } static void test_deselect_host() { SETUP(); c.selectVolume("*", "*", true); c.selectVolume("h2", "*", false); assert(h1.selected()); assert(h1v1.selected()); assert(h1v2.selected()); assert(!h2.selected()); assert(!h2v1.selected()); assert(!h2v2.selected()); } static void test_select_volume() { SETUP(); c.selectVolume("h1", "v1", true); assert(h1.selected()); assert(h1v1.selected()); assert(!h1v2.selected()); assert(!h2.selected()); assert(!h2v1.selected()); assert(!h2v2.selected()); } static void test_deselect_volume() { SETUP(); c.selectVolume("*", "*", true); c.selectVolume("h2", "v1", false); assert(h1.selected()); assert(h1v1.selected()); assert(h1v2.selected()); assert(h2.selected()); assert(!h2v1.selected()); assert(h2v2.selected()); } int main() { test_initial_state(); test_select_all(); test_select_host(); test_deselect_host(); test_select_volume(); test_deselect_volume(); return 0; } rsbackup-3.0/src/Defaults.h0000664000175000017500000000612312620463022012617 00000000000000// -*-C++-*- // Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. // // 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 . #ifndef DEFAULTS_H #define DEFAULTS_H /** @file Defaults.h * @brief Default values, etc */ #if HAVE_PATHS_H # include #endif /** @cond fixup */ #ifndef _PATH_DEVNULL # define _PATH_DEVNULL "/dev/null" #endif #ifndef _PATH_SENDMAIL # define _PATH_SENDMAIL "/usr/sbin/sendmail" #endif /** @endcond */ /* Default values for various things */ /** @brief Path to configuration file */ #define DEFAULT_CONFIG "/etc/rsbackup/config" /** @brief Default maximum age */ #define DEFAULT_MAX_AGE 3 /** @brief Default minimum backups */ #define DEFAULT_MIN_BACKUPS "1" /** @brief Default pruning age */ #define DEFAULT_PRUNE_AGE "366" /** @brief Default pruning age */ #define DEFAULT_DECAY_START "1" /** @brief Default decay window size */ #define DEFAULT_DECAY_WINDOW "1" /** @brief Default decay scale */ #define DEFAULT_DECAY_SCALE "2" /** @brief Default pruning policy */ #define DEFAULT_PRUNE_POLICY "age" /** @brief Default age for pruning logs in report */ #define DEFAULT_PRUNE_REPORT_AGE 3 /** @brief Default maximum disk usage */ #define DEFAULT_MAX_USAGE 80 /** @brief Default maximum inode usage */ #define DEFAULT_MAX_FILE_USAGE 80 /** @brief Default log directory */ #define DEFAULT_LOGS "/var/log/backup" /** @brief Default SSH timeout */ #define DEFAULT_SSH_TIMEOUT 60 /** @brief Default days to keep pruning logs */ #define DEFAULT_KEEP_PRUNE_LOGS 31 /** @brief Default path to email injector */ #define DEFAULT_SENDMAIL _PATH_SENDMAIL /* Colors */ /** @brief "Good" color in HTML report */ #define COLOR_GOOD 0xE0FFE0 /** @brief "Bad" color in HTML report */ #define COLOR_BAD 0xFF4040 /* Valid names */ /** @brief Lower case letters */ #define LOWER "abcdefghijklmnopqrstuvwxyz" /** @brief Upper case letters */ #define UPPER "ABCDEFGHIJKLMNOPQRSTUVWXYZ" /** @brief Letters */ #define ALPHA LOWER UPPER /** @brief Digits */ #define DIGIT "0123456789" /** @brief Valid characters in a device name */ #define DEVICE_VALID ALPHA DIGIT "_." /** @brief Valid characters in a host name */ #define HOST_VALID ALPHA DIGIT ".-" /** @brief Valid characters in a volume name */ #define VOLUME_VALID ALPHA DIGIT "_." /** @brief Valid characters in a prune-parameter name */ #define PRUNE_PARAMETER_VALID ALPHA DIGIT "-" /** @brief Path separator */ #define PATH_SEP "/" /** @brief MIME boundary string */ #define MIME_BOUNDARY "a911ebf382e50dffdf966c4acf269d36e48824bb" #endif /* DEFAULTS_H */ rsbackup-3.0/src/MakeBackup.cc0000644000175000017500000003617412626633142013230 00000000000000// Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. // // 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 . #include #include "rsbackup.h" #include "Conf.h" #include "Store.h" #include "Command.h" #include "IO.h" #include "Subprocess.h" #include "Errors.h" #include "Utils.h" #include "Database.h" #include #include #include #include #include #include #include #include /** @brief State for a single backup attempt */ class MakeBackup { public: /** @brief Volume to back up */ Volume *volume; /** @brief Target device */ Device *device; /** @brief Host containing @ref volume */ Host *host; /** @brief Start time of backup */ time_t startTime; /** @brief Today's date */ Date today; /** @brief ID of new backup */ std::string id; /** @brief Volume path on device */ const std::string volumePath; /** @brief Backup path on device */ const std::string backupPath; /** @brief .incomplete file on device */ const std::string incompletePath; /** @brief Path to volume to back up * * May be modified by the pre-backup hook. */ std::string sourcePath; /** @brief Current work */ const char *what = "pending"; /** @brief Log output */ std::string log; /** @brief The outcome of the backup */ Backup *outcome = nullptr; /** @brief Constructor */ MakeBackup(Volume *volume_, Device *device_); /** @brief Find the most recent matching backup * * Prefers complete backups if available. */ const Backup *getLastBackup(); /** @brief Set up the common hook environment for a subprocess * @param sp Subprocess */ void hookEnvironment(Subprocess &sp); /** @brief Set up logfile IO for a subprocess * @param sp Subprocess * @param outputToo Log stdout as well as just stderr */ void subprocessIO(Subprocess &sp, bool outputToo = true); /** @brief Run the pre-backup hook if there is one * @return Wait status */ int preBackup(); /** @brief Run rsync to make the backup * @return Wait status */ int rsyncBackup(); /** @brief Run the post-backup hook if there is one */ void postBackup(); /** @brief Perform a backup */ void performBackup(); }; MakeBackup::MakeBackup(Volume *volume_, Device *device_): volume(volume_), device(device_), host(volume->parent), startTime(Date::now()), today(Date::today()), id(today.toString()), volumePath(device->store->path + PATH_SEP + host->name + PATH_SEP + volume->name), backupPath(volumePath + PATH_SEP + id), incompletePath(backupPath + ".incomplete"), sourcePath(volume->path) { } // Find a backup to link to. const Backup *MakeBackup::getLastBackup() { // Link against the most recent complete backup if possible. for(const Backup *backup: boost::adaptors::reverse(volume->backups)) { if(backup->rc == 0 && device->name == backup->deviceName) return backup; } // If there are no complete backups link against the most recent incomplete // one. for(const Backup *backup: boost::adaptors::reverse(volume->backups)) { if(device->name == backup->deviceName) return backup; } // Otherwise there is nothing to link to. return nullptr; } void MakeBackup::hookEnvironment(Subprocess &sp) { sp.setenv("RSBACKUP_DEVICE", device->name); sp.setenv("RSBACKUP_HOST", host->name); sp.setenv("RSBACKUP_SSH_HOSTNAME", host->hostname); sp.setenv("RSBACKUP_SSH_USERNAME", host->user); sp.setenv("RSBACKUP_SSH_TARGET", host->userAndHost()); sp.setenv("RSBACKUP_STORE", device->store->path); sp.setenv("RSBACKUP_VOLUME", volume->name); sp.setenv("RSBACKUP_VOLUME_PATH", volume->path); sp.setenv("RSBACKUP_ACT", command.act ? "true" : "false"); sp.setTimeout(volume->hookTimeout); } void MakeBackup::subprocessIO(Subprocess &sp, bool outputToo) { sp.capture(2, &log, outputToo ? 1 : -1); } int MakeBackup::preBackup() { if(volume->preBackup.size()) { std::string output; Subprocess sp(volume->preBackup); sp.capture(1, &output); sp.setenv("RSBACKUP_HOOK", "pre-backup-hook"); hookEnvironment(sp); if(command.verbose) sp.report(); subprocessIO(sp, false); int rc = sp.runAndWait(false); if(output.size()) { if(output[output.size() - 1] == '\n') output.erase(output.size() - 1); sourcePath = output; } return rc; } return 0; } int MakeBackup::rsyncBackup() { int rc; try { // Create volume directory if(command.act) { what = "creating volume directory"; boost::filesystem::create_directories(volumePath); // Create the .incomplete flag file what = "creating .incomplete file"; IO ifile; ifile.open(incompletePath, "w"); ifile.close(); // Create backup directory what = "creating backup directory"; boost::filesystem::create_directories(backupPath); what = "constructing command"; } // Synthesize command std::vector cmd = { "rsync", "--archive", // == -rlptgoD // --recursive recurse into directories // --links preserve symlinks // --perms preserve permissions // --times preserve modification times // --group preserve group IDs // --owner preserve user IDs // --devices preserve device files // --specials preserve special files "--sparse", // handle spare files efficiently "--numeric-ids", // don't remap UID/GID by name "--compress", // compress during file transfer "--fuzzy", // look for similar files "--hard-links", // preserve hard links "--delete", // delete extra files in destination }; if(!command.verbose) cmd.push_back("--quiet"); // suppress non-errors if(!volume->traverse) cmd.push_back("--one-file-system"); // don't cross mount points // Exclusions for(auto &exclusion: volume->exclude) cmd.push_back("--exclude=" + exclusion); const Backup *lastBackup = getLastBackup(); if(lastBackup != nullptr) cmd.push_back("--link-dest=" + lastBackup->backupPath()); // Source cmd.push_back(host->sshPrefix() + sourcePath + "/."); // Destination cmd.push_back(backupPath + "/."); // Set up subprocess Subprocess sp(cmd); if(command.verbose) sp.report(); if(!command.act) return 0; subprocessIO(sp, true); sp.setTimeout(volume->rsyncTimeout); // Make the backup rc = sp.runAndWait(false); what = "rsync"; // Suppress exit status 24 "Partial transfer due to vanished source files" if(WIFEXITED(rc) && WEXITSTATUS(rc) == 24) { if(command.warnPartial) warning("partial transfer backing up %s:%s to %s", host->name.c_str(), volume->name.c_str(), device->name.c_str()); rc = 0; } } catch(std::runtime_error &e) { // Try to handle any other errors the same way as rsync failures. If we // can't even write to the logfile we error out. log += "ERROR: "; log += e.what(); log += "\n"; // This is a bit misleading (it's not really a wait status) but it will // do for now. rc = 255; } // If the backup completed, remove the 'incomplete' flag file if(!rc) { if(unlink(incompletePath.c_str()) < 0) throw IOError("removing " + incompletePath, errno); } return rc; } void MakeBackup::postBackup() { if(volume->postBackup.size()) { Subprocess sp(volume->postBackup); sp.setenv("RSBACKUP_STATUS", outcome && outcome->rc == 0 ? "ok" : "failed"); sp.setenv("RSBACKUP_HOOK", "post-backup-hook"); hookEnvironment(sp); if(command.verbose) sp.report(); subprocessIO(sp, true); sp.runAndWait(false); } } void MakeBackup::performBackup() { // Run the pre-backup hook what = "preBackup"; int rc = preBackup(); if(!rc) rc = rsyncBackup(); // Put together the outcome outcome = new Backup(); outcome->rc = rc; outcome->time = startTime; outcome->date = today; outcome->id = id; outcome->deviceName = device->name; outcome->volume = volume; outcome->setStatus(UNDERWAY); if(command.act) { // Record in the database that the backup is underway // If this fails then the backup just fails. config.getdb().begin(); outcome->insert(config.getdb(), true/*replace*/); config.getdb().commit(); } // Run the post-backup hook postBackup(); if(!command.act) return; // Get the logfile // TODO we could perhaps share with Conf::readState() here outcome->contents = log; if(outcome->contents.size() && outcome->contents[outcome->contents.size() - 1] != '\n') outcome->contents += '\n'; volume->addBackup(outcome); if(rc) { // Count up errors ++errors; if(command.verbose || command.repeatErrorLogs) { warning("backup of %s:%s to %s: %s", host->name.c_str(), volume->name.c_str(), device->name.c_str(), SubprocessFailed::format(what, rc).c_str()); IO::err.write(outcome->contents); IO::err.writef("\n"); } /*if(WIFEXITED(rc) && WEXITSTATUS(rc) == 24) outcome->status = COMPLETE;*/ outcome->setStatus(FAILED); } else outcome->setStatus(COMPLETE); // Store the result in the database // We really care about 'busy' errors - the backup has been made, we must // record this fact. for(;;) { int retries = 0; try { config.getdb().begin(); outcome->update(config.getdb()); config.getdb().commit(); break; } catch(DatabaseBusy &) { // Log a message every second or so if(!(retries++ & 1023)) warning("backup of %s:%s to %s: retrying database update", host->name.c_str(), volume->name.c_str(), device->name.c_str()); // Wait a millisecond and try again usleep(1000); continue; } } } // Backup VOLUME onto DEVICE. // // device->store is assumed to be set. static void backupVolume(Volume *volume, Device *device) { Host *host = volume->parent; if(command.verbose) IO::out.writef("INFO: backup %s:%s to %s\n", host->name.c_str(), volume->name.c_str(), device->name.c_str()); MakeBackup mb(volume, device); mb.performBackup(); } enum BackupRequirement { AlreadyBackedUp, NotThisDevice, NotAvailable, BackupRequired }; // See whether VOLUME needs a backup on DEVICE static BackupRequirement needsBackup(Volume *volume, Device *device) { switch(fnmatch(volume->devicePattern.c_str(), device->name.c_str(), FNM_NOESCAPE)) { case 0: break; case FNM_NOMATCH: return NotThisDevice; default: warning("invalid device pattern '%s'", volume->devicePattern.c_str()); /* fail safe - make the backup */ break; } Date today = Date::today(); for(const Backup *backup: volume->backups) if(backup->rc == 0 && backup->date == today && backup->deviceName == device->name) return AlreadyBackedUp; // Already backed up if(!volume->available()) return NotAvailable; return BackupRequired; } // Backup VOLUME static void backupVolume(Volume *volume) { Host *host = volume->parent; char buffer[1024]; for(auto &d: config.devices) { Device *device = d.second; switch(needsBackup(volume, device)) { case BackupRequired: config.identifyDevices(Store::Enabled); if(device->store && device->store->state == Store::Enabled) backupVolume(volume, device); else if(command.warnStore) { config.identifyDevices(Store::Disabled); if(device->store) switch(device->store->state) { case Store::Disabled: warning("cannot backup %s:%s to %s - device suppressed due to --store", host->name.c_str(), volume->name.c_str(), device->name.c_str()); break; default: snprintf(buffer, sizeof buffer, "device %s store %s unexpected state %d", device->name.c_str(), device->store->path.c_str(), device->store->state); throw FatalStoreError(buffer); } else warning("cannot backup %s:%s to %s - device not available", host->name.c_str(), volume->name.c_str(), device->name.c_str()); } break; case AlreadyBackedUp: if(command.verbose) IO::out.writef("INFO: %s:%s is already backed up on %s\n", host->name.c_str(), volume->name.c_str(), device->name.c_str()); break; case NotAvailable: if(command.verbose) IO::out.writef("INFO: %s:%s is not available\n", host->name.c_str(), volume->name.c_str()); break; case NotThisDevice: if(command.verbose) IO::out.writef("INFO: %s:%s excluded from %s by device pattern\n", host->name.c_str(), volume->name.c_str(), device->name.c_str()); break; } } } // Backup HOST static void backupHost(Host *host) { // Do a quick check for unavailable hosts if(!host->available()) { if(host->alwaysUp) { warning("cannot backup always-up host %s - not reachable", host->name.c_str()); ++errors; // Try anyway, so that the failures are recorded. } else { if(command.warnUnreachable) warning("cannot backup %s - not reachable", host->name.c_str()); return; } } for(auto &v: host->volumes) { Volume *volume = v.second; if(volume->selected()) backupVolume(volume); } } static bool order_host(const Host *a, const Host *b) { if(a->priority > b->priority) return true; if(a->priority < b->priority) return false; return a->name < b->name; } // Backup everything void makeBackups() { // Load up log files config.readState(); std::vector hosts; for(auto &h: config.hosts) { Host *host = h.second; if(host->selected()) hosts.push_back(host); } std::sort(hosts.begin(), hosts.end(), order_host); for(Host *h: hosts) backupHost(h); } rsbackup-3.0/src/rsbackup.cc0000664000175000017500000001404012621427341013022 00000000000000// Copyright © 2011-15 Richard Kettlewell. // // 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 . #include #include "rsbackup.h" #include "Command.h" #include "Conf.h" #include "Store.h" #include "Errors.h" #include "Document.h" #include "Email.h" #include "IO.h" #include "FileLock.h" #include "Subprocess.h" #include "DeviceAccess.h" #include "Utils.h" #include "Report.h" #include #include #include #include #include #include int main(int argc, char **argv) { try { if(setlocale(LC_CTYPE, "") == nullptr) throw std::runtime_error(std::string("setlocale: ") + strerror(errno)); // Parse command line command.parse(argc, argv); // Read configuration config.read(); // Validate configuration config.validate(); // Dump configuration if(command.dumpConfig) { config.write(std::cout, 0, command.verbose); exit(0); } // Override stores if(command.stores.size() != 0) { for(auto &s: config.stores) s.second->state = Store::Disabled; for(auto &s: command.stores) { auto it = config.stores.find(s); if(it == config.stores.end()) config.stores[s] = new Store(s); else it->second->state = Store::Enabled; } } // Take the lock, if one is defined. FileLock lockFile(config.lock); if((command.backup || command.prune || command.pruneIncomplete || command.retireDevice || command.retire) && config.lock.size()) { D("attempting to acquire lockfile %s", config.lock.c_str()); if(!lockFile.acquire(command.wait)) { // Failing to acquire the lock is not really an error if --wait was not // requested. if(command.verbose) warning("cannot acquire lockfile %s", config.lock.c_str()); exit(0); } } // Select volumes if(command.backup || command.prune || command.pruneIncomplete) command.selectVolumes(); // Execute commands if(command.backup) makeBackups(); if(command.retire) retireVolumes(); if(command.retireDevice) retireDevices(); if(command.prune || command.pruneIncomplete) pruneBackups(); if(command.prune) prunePruneLogs(); // Run post-access hook postDeviceAccess(); // Generate report if(command.html || command.text || command.email) { config.readState(); Document d; if(config.stylesheet.size()) { IO ssf; ssf.open(config.stylesheet, "r"); ssf.readall(d.htmlStyleSheet); } else d.htmlStyleSheet = stylesheet; // Include user colors in the stylesheet std::stringstream ss; ss << std::hex; ss << "td.bad { background-color: #" << std::setw(6) << std::setfill('0') << config.colorBad << " }\n"; ss << "td.good { background-color: #" << std::setw(6) << std::setfill('0') << config.colorGood << " }\n"; ss << "span.bad { color: #" << std::setw(6) << std::setfill('0') << config.colorBad << " }\n"; d.htmlStyleSheet += ss.str(); Report report(d); report.generate(); std::stringstream htmlStream, textStream; if(command.html || command.email) d.renderHtml(htmlStream); if(command.text || command.email) d.renderText(textStream); if(command.html) { if(*command.html == "-") { IO::out.write(htmlStream.str()); } else { IO f; f.open(*command.html, "w"); f.write(htmlStream.str()); f.close(); } } if(command.text) { if(*command.text == "-") { IO::out.write(textStream.str()); } else { IO f; f.open(*command.text, "w"); f.write(textStream.str()); f.close(); } } if(command.email) { Email e; e.addTo(*command.email); std::stringstream subject; subject << d.title; if(report.backups_missing) subject << " missing:" << report.backups_missing; if(report.backups_partial) subject << " partial:" << report.backups_partial; if(report.backups_out_of_date) subject << " stale:" << report.backups_out_of_date; if(report.backups_failed) subject << " failed:" << report.backups_failed; if(report.devices_unknown || report.hosts_unknown || report.volumes_unknown) subject << " unknown:" << (report.devices_unknown + report.hosts_unknown + report.volumes_unknown); e.setSubject(subject.str()); e.setType("multipart/alternative; boundary=" MIME_BOUNDARY); std::stringstream body; body << "--" MIME_BOUNDARY "\n"; body << "Content-Type: text/plain\n"; body << "\n"; body << textStream.str(); body << "\n"; body << "--" MIME_BOUNDARY "\n"; body << "Content-Type: text/html\n"; body << "\n"; body << htmlStream.str(); body << "\n"; body << "--" MIME_BOUNDARY "--\n"; e.setContent(body.str()); e.send(); } } if(errors && command.verbose) warning("%d errors detected", errors); IO::out.close(); } catch(Error &e) { error("%s", e.what()); if(command.debug) e.trace(stderr); } catch(std::runtime_error &e) { error("%s", e.what()); } exit(!!errors); } rsbackup-3.0/src/test-parseinteger.cc0000664000175000017500000000444712620463022014662 00000000000000// Copyright © 2015 Richard Kettlewell. // // 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 . #include #include "Errors.h" #include "Utils.h" int main(void) { assert(parseInteger("0", 0, 0, 0) == 0); assert(parseInteger("0", 0, 0, 8) == 0); assert(parseInteger("0", 0, 0, 10) == 0); assert(parseInteger("0", 0, 0, 16) == 0); assert(parseInteger("100", 0, INT_MAX, 0) == 100); assert(parseInteger("100", 0, INT_MAX, 8) == 64); assert(parseInteger("0100", 0, INT_MAX, 0) == 64); assert(parseInteger("100", 0, INT_MAX, 10) == 100); assert(parseInteger("100", 0, INT_MAX, 16) == 256); assert(parseInteger("0x100", 0, INT_MAX, 0) == 256); assert(parseInteger("-100", INT_MIN, INT_MAX, 0) == -100); assert(parseInteger("-100", INT_MIN, INT_MAX, 8) == -64); assert(parseInteger("-0100", INT_MIN, INT_MAX, 0) == -64); assert(parseInteger("-100", INT_MIN, INT_MAX, 10) == -100); assert(parseInteger("-100", INT_MIN, INT_MAX, 16) == -256); assert(parseInteger("-0x100", INT_MIN, INT_MAX, 0) == -256); try { parseInteger("10", 0, 9, 0); assert(0); } catch(SyntaxError &) { } try { parseInteger("-10", 0, 9, 0); assert(0); } catch(SyntaxError &) { } try { parseInteger("0x10", 0, 1000, 10); assert(0); } catch(SyntaxError &) { } try { parseInteger("junk", 0, 1000, 0); assert(0); } catch(SyntaxError &) { } try { parseInteger("100 ", 0, 1000, 0); assert(0); } catch(SyntaxError &) { } #if 0 // TODO maybe this should be rejected try { parseInteger(" 100", 0, 1000, 0); assert(0); } catch(SyntaxError &) { } #endif try { parseInteger("2.2", 0, 1000, 0); assert(0); } catch(SyntaxError &) { } return 0; } rsbackup-3.0/src/Store.h0000664000175000017500000000323512621700272012147 00000000000000// -*-C++-*- // Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. // // 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 . #ifndef STORE_H #define STORE_H /** @file Store.h * @brief Store (mount point) support */ #include class Device; /** @brief Represents a store * * A store is a path at which a backup device may be mounted. */ class Store { public: /** @brief Constructor * @param path_ Location of store */ Store(const std::string &path_): path(path_) {} /** @brief Possible states */ enum State { /** @brief A disabled store */ Disabled = 1, /** @brief An enabled store */ Enabled = 2, }; /** @param Location of store */ std::string path; /** @param Device mounted at this store * * Set to null pointer before checking, or if no device is mounted here */ Device *device = nullptr; /** @brief State of this store */ State state = Enabled; /** @brief Identify the device mounted here * @throw BadStore * @throw FatalStoreError * @throw UnavailableStore */ void identify(); }; #endif /* STORE_H */ rsbackup-3.0/src/test-host.cc0000664000175000017500000000225712620463022013144 00000000000000// Copyright © 2014-15 Richard Kettlewell. // // 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 . #include #include "Conf.h" #include #include int main() { assert(!Host::valid("")); assert(Host::valid( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.")); assert(!Host::valid("_")); assert(!Host::valid("/")); assert(!Host::valid("~")); assert(!Host::valid("\x80")); assert(!Host::valid(" ")); assert(!Host::valid("\x1F")); assert(!Host::valid("-whatever")); assert(Host::valid("what-are-the-civilian-applications")); return 0; } rsbackup-3.0/src/test-unicode.cc0000664000175000017500000000337712621742261013627 00000000000000// Copyright © 2012, 2014 Richard Kettlewell. // // 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 . #include #include "Utils.h" #include #include #include static const unsigned char narrow[] = { 0xf0, 0x90, 0x8c, 0xb2, 0xf0, 0x90, 0x8c, 0xbf, 0xf0, 0x90, 0x8d, 0x84, 0xf0, 0x90, 0x8c, 0xb0, 0xf0, 0x90, 0x8c, 0xbd, 0xf0, 0x90, 0x8d, 0x83, 0x20, 0xf0, 0x90, 0x8c, 0xbf, 0xf0, 0x90, 0x8d, 0x83, 0x20, 0xf0, 0x90, 0x8d, 0x84, 0xf0, 0x90, 0x8d, 0x82, 0xf0, 0x90, 0x8c, 0xb9, 0xf0, 0x90, 0x8c, 0xbe, 0xf0, 0x90, 0x8c, 0xbf, 0xf0, 0x90, 0x8d, 0x83, 0 }; static const char32_t wide[] = { 0x10332, 0x1033f, 0x10344, 0x10330, 0x1033d, 0x10343, 0x20, 0x1033f, 0x10343, 0x20, 0x10344, 0x10342, 0x10339, 0x1033e, 0x1033f, 0x10343, 0 }; int main() { std::u32string w; if(!setlocale(LC_CTYPE, "C.UTF-8") && !setlocale(LC_CTYPE, "en_US.UTF-8") && !setlocale(LC_CTYPE, "en_GB.UTF-8")) { fprintf(stderr, "ERROR: cannot find a UTF-8 locale to test in\n"); return 77; } toUnicode(w, "just ascii"); assert(w == U"just ascii"); toUnicode(w, reinterpret_cast(narrow)); assert(w == wide); return 0; } rsbackup-3.0/src/test-directory.cc0000664000175000017500000000316112356017171014174 00000000000000// Copyright © 2014 Richard Kettlewell. // // 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 . #include #include "IO.h" #include "Errors.h" #include #include int main() { { Directory d; std::vector files; d.open("."); d.get(files); for(size_t n = 0; n + 1 < files.size(); ++n) assert(files[n] < files[n + 1]); d.close(); } { std::vector files; Directory::getFiles(".", files); for(size_t n = 0; n + 1 < files.size(); ++n) assert(files[n] < files[n + 1]); } { Directory d; std::vector files; d.open("."); std::string name; while(d.get(name)) files.push_back(name); } try { Directory d; d.open("/dev/null"); assert(!"unexpectedly succeeded"); } catch(IOError &e) { assert(e.errno_value == ENOTDIR); } try { Directory d; d.open("does not exist"); assert(!"unexpectedly succeeded"); } catch(IOError &e) { assert(e.errno_value == ENOENT); } return 0; } rsbackup-3.0/src/Check.cc0000664000175000017500000000303012103242262012212 00000000000000// Copyright © 2011, 2012 Richard Kettlewell. // // 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 . #include #include "Command.h" #include "Errors.h" #include "Utils.h" #include "IO.h" #include #include #include bool check(const char *format, ...) { // --force overrides if(command.force) return true; char buffer[64]; for(;;) { // Display the prompt va_list ap; va_start(ap, format); IO::out.vwritef(format, ap); va_end(ap); IO::out.writef("\nyes/no> "); IO::out.flush(); // Get a yes/no answer if(!fgets(buffer, sizeof buffer, stdin)) { if(feof(stdin)) throw IOError("unexpected EOF reading stdin"); if(ferror(stdin)) throw IOError("reading stdin", errno); } std::string result = buffer; if(result == "yes\n") return true; if(result == "no\n") return false; IO::out.writef("Please answer 'yes' or 'no'.\n"); } } rsbackup-3.0/src/Utils.h0000664000175000017500000001372312631030155012153 00000000000000//-*-C++-*- // Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. // // 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 . #ifndef UTILS_H #define UTILS_H /** @file Utils.h * @brief Miscellaneous utilities */ #include #include #include #include #include #include class IO; // forward declaration /** @brief Display a prompt and retrieve a yes/no reply * @param format Format string as per @c printf() * @param ... Arguments * @return True if the user said yes * * Overridden by @c --force, which means "always yes". */ bool check(const char *format, ...); /** @brief Convert to Unicode * @param u Where to put Unicode string * @param mbs Multibyte string */ void toUnicode(std::u32string &u, const std::string &mbs); /** @brief Display a progress bar * @param stream Output stream * @param prompt Prompt string * @param done Work done * @param total Total work * * If @p total is 0 then the progress bar is erased. */ void progressBar(IO &stream, const char *prompt, size_t done, size_t total); /** @brief Break up a string into lines * @param lines Where to put lines * @param s Input string * @return Number of lines * * Lines are terminated by @c \\n. The members of @p lines do not include the * newline. */ size_t toLines(std::vector &lines, const std::string &s); /** @brief Expand a filename glob pattern * @param files List of filenames * @param pattern Pattern * @param flags Flags as per glob(3) */ void globFiles(std::vector &files, const std::string &pattern, int flags); /** @brief Parse an integer * @param s Representation of integer * @param min Minimum acceptable value * @param max Maximum acceptable value * @param radix Base, or 0 to follow C conventions * @return Integer value * @throws SyntaxError if the @p s doesn't represent an integer * @throws SyntaxError if the integer value is out of range */ int parseInteger(const std::string &s, int min = INT_MIN, int max = INT_MAX, int radix = 0); /** @brief Split and parse a list represented as a string * @param bits Destination for components of the string * @param line String to parse * @throws SyntaxError if @p line is malformed. * * Each component can be quoted or unquoted. * * Unquoted components are delimited by whitespace and cannot contain double * quotes or backslashes. * * Quoted components are delimited by double quotes. Within the quotes * backslash can be used to escape the next character. * * The hash character can appear inside quotes or noninitially in an unquoted * component, but otherwise introduces a comment which extends to the end of * @p line. */ void split(std::vector &bits, const std::string &line); /** @brief Display an error message * @param fmt Format string, as printf() * @param ... Arguments to format string * * Writes an error message to standard error. * * Increments @ref errors. */ void error(const char *fmt, ...); /** @brief Display a warning message * @param fmt Format string, as printf() * @param ... Arguments to format string * * Writes an warning message to standard error. */ void warning(const char *fmt, ...); /** @brief Compare timespec values */ inline int compare_timespec(const struct timespec &a, const struct timespec &b) { if(a.tv_sec < b.tv_sec) return -1; if(a.tv_sec > b.tv_sec) return 1; if(a.tv_nsec < b.tv_nsec) return -1; if(a.tv_nsec > b.tv_nsec) return 1; return 0; } /** @brief Compare timespec values */ inline bool operator>=(const struct timespec &a, const struct timespec &b) { return compare_timespec(a, b) >= 0; } /** @brief Compare timespec values */ inline bool operator==(const struct timespec &a, const struct timespec &b) { return compare_timespec(a, b) == 0; } /** @brief Compare timespec values */ inline bool operator<(const struct timespec &a, const struct timespec &b) { return compare_timespec(a, b) < 0; } /** @brief Subtract timespec values */ inline struct timespec operator-(const struct timespec &a, const struct timespec &b) { struct timespec r; r.tv_sec = a.tv_sec - b.tv_sec; r.tv_nsec = a.tv_nsec - b.tv_nsec; if(r.tv_nsec < 0) { r.tv_nsec += 1000000000; r.tv_sec -= 1; } return r; } /** @brief Log to arbitrary base * @param x Argument to logarithm * @param b Base for logarithm * @return \f$log_b(x)\f$ */ inline double logbase(double x, double b) { /* Why log2 instead of log? Because FreeBSD's log() implementation is * inaccurate. */ return log2(x) / log2(b); } /** @brief Make a file descriptor nonblocking * @param fd File descriptor */ void nonblock(int fd); /** @brief Delete all the children of a container * @param container Container * * Uses @c delete to destroy all the elements of @p container, and then empties * it. */ template void deleteAll(C &container) { for(auto element: container) delete element; container.clear(); } /** @brief Test whether a container contains a particular element * @param container container to search * @param element element to test for * @return @c true if @p element can be found in @p container */ template bool contains(const C &container, const E &element) { return container.find(element) != container.end(); } #endif /* UTILS_H */ rsbackup-3.0/src/Directory.cc0000664000175000017500000000365012620463022013154 00000000000000// Copyright © 2011, 2013 Richard Kettlewell. // // 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 . #include #include "IO.h" #include "Errors.h" #include #include Directory::~Directory() { if(dp) closedir(dp); } void Directory::open(const std::string &path_) { if(dp) throw std::logic_error("Directory::open on open directory"); if(!(dp = opendir(path_.c_str()))) throw IOError("opening " + path_, errno); path = path_; } void Directory::close() { if(!dp) throw std::logic_error("Directory::close on closed directory"); closedir(dp); dp = nullptr; path.clear(); } bool Directory::get(std::string &name) const { if(!dp) throw std::logic_error("Directory::get on closed directory"); errno = 0; struct dirent *de = readdir(dp); if(de) { name = de->d_name; return true; } else { if(errno) throw IOError("reading " + path, errno); return false; } } void Directory::get(std::vector &files) const { std::string f; files.clear(); while(get(f)) files.push_back(f); // Sort files by name so that warnings come out in a predictable order. std::sort(files.begin(), files.end()); } void Directory::getFiles(const std::string &path, std::vector &files) { Directory d; d.open(path); d.get(files); } rsbackup-3.0/src/Progress.cc0000664000175000017500000000227512601750104013015 00000000000000// Copyright © 2011 Richard Kettlewell. // // 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 . #include #include "IO.h" #include void progressBar(IO &stream, const char *prompt, size_t done, size_t total) { const int width = 79; if(total == 0) { stream.writef("\r%*s\r", width, " "); } else { std::string s; int bar = width - (3 + strlen(prompt)); s.append("\r"); s.append(prompt); s.append(" ["); s.append(done * bar / total, '='); s.append(bar - (done * bar / total), ' '); s.append("]\r"); stream.writef("%s", s.c_str()); } stream.flush(); } rsbackup-3.0/src/Report.h0000664000175000017500000000531412621700160012322 00000000000000// -*-C++-*- // Copyright © 2015 Richard Kettlewell. // // 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 . #ifndef REPORT_H #define REPORT_H /** @file Report.h * @brief Report generation */ #include "Document.h" class Volume; class Backup; /** @brief Generator for current state */ class Report { /** @brief Destination for report */ Document &d; public: /** @brief Constructor * @param d_ Destination for report */ Report(Document &d_): d(d_) {} /** @brief Generate the report and set counters */ void generate(); /** @brief Number of volumes with no backups at all */ int backups_missing = 0; /** @brief Number of volumes missing a backup on at least one device */ int backups_partial = 0; /** @brief Number of volumes with no backup within max-age */ int backups_out_of_date = 0; /** @brief Number of volume/device pairs where most recent backup failed */ int backups_failed = 0; /** @brief Number of unknown devices */ int devices_unknown = 0; /** @brief Number of unknown hosts */ int hosts_unknown = 0; /** @brief Number of unknown volumes */ int volumes_unknown = 0; private: /** @brief Split up a color into RGB components */ static void unpackColor(unsigned color, int rgb[3]); /** @brief Pack a color from RGB components */ static unsigned packColor(const int rgb[3]); /** @brief Pick a color as a (clamped) linear combination of two endpoints */ static unsigned pickColor(unsigned zero, unsigned one, double param); /** @brief Generate the list of warnings * * The counters must have been set. */ void reportWarnings(); /** @brief Generate the summary table and set counters */ Document::Table *reportSummary(); /** @brief Return @c true if this is a suitable log for the report */ bool suitableLog(const Volume *volume, const Backup *backup); /** @brief Generate the report of backup logs for a volume */ void reportLogs(const Volume *volume); /** @brief Generate the report of backup logs for everything */ void reportLogs(); /** @brief Generate the report of pruning logfiles */ Document::Node *reportPruneLogs(); }; #endif /* REPORT_H */ rsbackup-3.0/src/RetireDevices.cc0000644000175000017500000000310712626341243013746 00000000000000// Copyright © 2011, 2014, 2015 Richard Kettlewell. // // 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 . #include #include "rsbackup.h" #include "Conf.h" #include "Command.h" #include "Utils.h" #include "IO.h" #include "Database.h" #include #include static void retireDevice(const std::string &deviceName) { // If the device is still configured, check whether it should really be // retired Device *device = config.findDevice(deviceName); if(device) { if(!check("Really retire device '%s'?", deviceName.c_str())) return; } // Remove all the log records for this device. if(command.act) { config.getdb().begin(); Database::Statement(config.getdb(), "DELETE FROM backup" " WHERE device=?", SQL_STRING, &deviceName, SQL_END).next(); config.getdb().commit(); } } void retireDevices() { for(std::string &d: command.devices) retireDevice(d); } rsbackup-3.0/src/test-split.cc0000664000175000017500000000524412601750105013321 00000000000000// Copyright © 2015 Richard Kettlewell. // // 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 . #include #include "Errors.h" #include "Utils.h" int main(void) { std::vector bits; bits.push_back("spong"); split(bits, ""); assert(bits.size() == 0); bits.push_back("spong"); split(bits, " "); assert(bits.size() == 0); bits.push_back("spong"); split(bits, "# junk"); assert(bits.size() == 0); bits.push_back("spong"); split(bits, "word"); assert(bits.size() == 1); assert(bits[0] == "word"); bits.push_back("spong"); split(bits, " word "); assert(bits.size() == 1); assert(bits[0] == "word"); bits.push_back("spong"); split(bits, "\tword\r"); assert(bits.size() == 1); assert(bits[0] == "word"); bits.push_back("spong"); split(bits, "word second"); assert(bits.size() == 2); assert(bits[0] == "word"); assert(bits[1] == "second"); bits.push_back("spong"); split(bits, "word second # junk"); assert(bits.size() == 2); assert(bits[0] == "word"); assert(bits[1] == "second"); bits.push_back("spong"); split(bits, "\"quoted\""); assert(bits.size() == 1); assert(bits[0] == "quoted"); bits.push_back("spong"); split(bits, "\"quoted\""); assert(bits.size() == 1); assert(bits[0] == "quoted"); bits.push_back("spong"); split(bits, "\"with spaces\""); assert(bits.size() == 1); assert(bits[0] == "with spaces"); bits.push_back("spong"); split(bits, "\"\\\\\""); assert(bits.size() == 1); assert(bits[0] == "\\"); bits.push_back("spong"); split(bits, "\"\\\"\""); assert(bits.size() == 1); assert(bits[0] == "\""); bits.push_back("spong"); split(bits, "\"\\xxx\""); assert(bits.size() == 1); assert(bits[0] == "xxx"); try { split(bits, "\"unterminated"); assert(0); } catch(SyntaxError &) { } try { split(bits, "\"unterminated\\"); assert(0); } catch(SyntaxError &) { } try { split(bits, "\"unterminated\\\""); assert(0); } catch(SyntaxError &) { } try { split(bits, "\\"); assert(0); } catch(SyntaxError &) { } return 0; } rsbackup-3.0/src/Command.h0000664000175000017500000001361012626573770012447 00000000000000// -*-C++-*- // Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. // // 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 . #ifndef COMMANDLINE_H #define COMMANDLINE_H /** @file Command.h * @brief Command-line parsing */ #include #include #include #include "Defaults.h" struct option; /** @brief Represents the parsed command line */ class Command { public: Command() = default; Command(const Command &) = delete; Command &operator=(const Command &) = delete; /** @brief Represents a selection * * A selection is a volume or collection of volumes and a positive or * negative sense (represented by @c true and @c false respectively). The * list of selections in @ref Command::selections determines which volumes an * operation applies to. */ struct Selection { /** @brief Construct a selection * @param host_ Host or "*" for all hosts * @param volume_ Volume or "*" for all hosts * @param sense_ @c true for "+ and @c false for "-" * * A @p host_ of "*" but a @p volume_ not equal to "*" does not make sense * and will fail in @ref Conf::selectVolume. */ Selection(const std::string &host_, const std::string &volume_, bool sense_ = true); /** @brief Sense of selection * * @c true for "+" and @c false for "-" */ bool sense; /** @brief Host name or "*" * * "*" means all hosts. */ std::string host; /** @brief Volume name or "*" * * "*" means all volumes. */ std::string volume; }; /** @brief Verbosity of log summary in report */ enum LogVerbosity { All, Errors, Recent, Latest, Failed, }; /** @brief Parse command line arguments */ void parse(int argc, const char *const *argv); /** @brief Select volumes * * Invokes Conf::selectVolumes() as required. */ void selectVolumes(); /** @brief @c --backup action * * The default is @c false. */ bool backup = false; /** @brief @c --prune action * * The default is @c false. */ bool prune = false; /** @brief @c --prune-incomplete action * * The default is @c false. */ bool pruneIncomplete = false; /** @brief @c --retire action * * The default is @c false. */ bool retire = false; /** @brief @c --retire-device action * * The default is @c false. */ bool retireDevice = false; /** @brief @c --dump-config action * * The default is @c false. */ bool dumpConfig = false; /** @brief Output file for HTML report or null pointer */ std::string *html = nullptr; /** @brief Output file for text report or null pointer */ std::string *text = nullptr; /** @brief Address for email report or null pointer */ std::string *email = nullptr; /** @brief Explicitly specified stores */ std::vector stores; /** @brief Path to config file * * This defaults to @ref DEFAULT_CONFIG. */ std::string configPath = DEFAULT_CONFIG; /** @brief Wait if lock cannot be held * * The default is @c false. */ bool wait = false; /** @brief Actually do something * * i.e. opposite of @c --no-act * * The default is @c true. */ bool act = true; /** @brief Force retirement * * The default is @c false. */ bool force = false; /** @brief Verbose operation * * The default is @c false. */ bool verbose = false; /** @brief Warn for unknown objects * * The default is @c false. */ bool warnUnknown = false; /** @brief Warn for unsuitable stores * * The default is @c false. */ bool warnStore = false; /** @brief Warn for unreachable hosts * * The default is @c false. */ bool warnUnreachable = false; /** @brief Warn about @c rsync partial transfer warnings * * The default is @c true. */ bool warnPartial = true; /** @brief Repeat @c rsync errors * * The default is @c true. */ bool repeatErrorLogs = true; /** @brief Log summary verbosity */ LogVerbosity logVerbosity = Failed; /** @brief Issue debug output * * Affects the @ref D macro. * * The default is @c false. */ bool debug = false; /** @brief Devices selected for retirement */ std::vector devices; /** @brief Selections */ std::vector selections; /** @brief Database path */ std::string database; /** @brief Convert verbosity from string * @param v Verbosity string from command line * @return Enumeration value */ static LogVerbosity getVerbosity(const std::string &v); /** @brief Return the help string */ static const char *helpString(); /** @brief Option table * Used by getopt_long(3). */ static const struct option options[]; private: /** @brief Display help message and terminate */ void help(); /** @brief Display version string and terminate */ void version(); }; /** @brief Program command line */ extern Command command; /** @brief Write a debug message to standard error * * The arguments are the same as @c printf(). A newline is added to the output * (so debug messages should not end with a newline). * * Only displays the a message if @ref Command::debug is set (in @ref * command). */ #define D(...) (void)(command.debug && fprintf(stderr, __VA_ARGS__) >= 0 && fputc('\n', stderr)) #endif /* COMMANDLINE_H */ rsbackup-3.0/src/test-eventloop.cc0000664000175000017500000000404712621671112014203 00000000000000// Copyright © 2015 Richard Kettlewell. // // 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 . #include #include "Utils.h" #include "EventLoop.h" #include "Errors.h" #include #include #include class TestReactor: public Reactor { public: void onReadable(EventLoop *e, int fd, const void *, size_t) override { assert(close(fd) == 0); e->cancelRead(fd); ++read_calls; } void onWritable(EventLoop *e, int fd) override { if(wrote_bytes < writeme.size()) { size_t remain = writeme.size() - wrote_bytes; ssize_t n = ::write(fd, &writeme[wrote_bytes], remain); assert(n >= 0); assert(static_cast(n) <= remain); wrote_bytes += n; } else { assert(close(fd) == 0); e->cancelWrite(fd); } } int read_calls = 0; std::string writeme; size_t wrote_bytes = 0; }; static void test_read_closed() { int p[2]; assert(pipe(p) == 0); assert(close(p[1]) == 0); EventLoop e; TestReactor tr; e.whenReadable(p[0], &tr); e.wait(); assert(tr.read_calls == 1); } static void test_write() { int p[2]; assert(pipe(p) == 0); EventLoop e; TestReactor tr; tr.writeme = "test data"; e.whenWritable(p[1], &tr); e.wait(); char buffer[4096]; ssize_t n = ::read(p[0], buffer, sizeof buffer); assert(static_cast(n) == tr.writeme.size()); assert(std::string(buffer, n) == tr.writeme); } int main() { test_read_closed(); test_write(); return 0; } rsbackup-3.0/src/Subprocess.cc0000644000175000017500000001473512621667350013357 00000000000000// Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. // // 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 . #include #include "Subprocess.h" #include "Errors.h" #include "Command.h" #include "Defaults.h" #include "IO.h" #include "Utils.h" #include #include #include #include #include #include #include #include #include Subprocess::Subprocess(const std::vector &cmd_): cmd(cmd_) { } Subprocess::~Subprocess() { if(pid >= 0) { kill(pid, SIGKILL); try { if(eventloop) wait(false); } catch(...) { } } delete eventloop; } void Subprocess::setCommand(const std::vector &cmd_) { cmd = cmd_; } void Subprocess::addChildFD(int childFD, int pipeFD, int closeFD, int otherChildFD) { fds.push_back(ChildFD(childFD, pipeFD, closeFD, otherChildFD)); } void Subprocess::nullChildFD(int childFD) { fds.push_back(ChildFD(childFD, -1, -1, -1)); } void Subprocess::capture(int childFD, std::string *s, int otherChildFD) { int p[2]; if(pipe(p) < 0) throw IOError("creating pipe", errno); addChildFD(childFD, p[1], p[0], otherChildFD); captures[p[0]] = s; } pid_t Subprocess::run() { assert(!eventloop); eventloop = new EventLoop(); return launch(eventloop); } pid_t Subprocess::launch(EventLoop *e) { assert(e); // EventLoop must already exist if(pid >= 0) throw std::logic_error("Subprocess::run but already running"); // Convert the command std::vector args; for(auto &arg: cmd) args.push_back(arg.c_str()); args.push_back(nullptr); // Start the subprocess switch(pid = fork()) { case -1: throw SystemError("creating subprocess for " + cmd[0], errno); case 0: { int nullfd = -1; // Dup file descriptors into place for(size_t n = 0; n < fds.size(); ++n) { const ChildFD &cfd = fds[n]; if(cfd.pipe >= 0) { if(dup2(cfd.pipe, cfd.child) < 0) { perror("dup2"); _exit(-1); } } else { if(nullfd < 0 && (nullfd = open(_PATH_DEVNULL, O_RDWR)) < 0) { perror("/dev/null"); _exit(-1); } if(dup2(nullfd, cfd.child) < 0) { perror("dup2"); _exit(-1); } } if(cfd.childOther >= 0 && dup2(cfd.child, cfd.childOther) < 0) { perror("dup2"); _exit(-1); } } // Close leftovers for(size_t n = 0; n < fds.size(); ++n) { const ChildFD &cfd = fds[n]; if(cfd.pipe >= 0) { if(close(cfd.pipe) < 0) { perror("close"); _exit(-1); } for(size_t m = n + 1; m < fds.size(); ++m) if(fds[m].pipe == cfd.pipe) fds[m].pipe = -1; } if(cfd.close >= 0) if(close(cfd.close) < 0) { perror("close"); _exit(-1); } } if(nullfd >= 0 && close(nullfd) < 0) { perror("close"); _exit(-1); } for(auto &e: env) { const std::string &name = e.first, &value = e.second; if(::setenv(name.c_str(), value.c_str(), 1/*overwrite*/)) { perror("setenv"); _exit(-1); } } // Execute the command execvp(args[0], (char **)&args[0]); perror(args[0]); _exit(-1); } } // Close file descriptors used by the child for(size_t n = 0; n < fds.size(); ++n) { const ChildFD &cfd = fds[n]; if(cfd.pipe >= 0) { if(close(cfd.pipe) < 0) throw IOError("closing FD for " + cmd[0], errno); for(size_t m = n + 1; m < fds.size(); ++m) if(fds[m].pipe == cfd.pipe) fds[m].pipe = -1; } } return pid; } void Subprocess::onReadable(EventLoop *e, int fd, const void *ptr, size_t n) { if(n) captures[fd]->append((char *)ptr, n); else e->cancelRead(fd); } void Subprocess::onReadError(EventLoop *, int, int errno_value) { throw IOError("reading pipe", errno_value); } void Subprocess::onTimeout(EventLoop *, const struct timespec &) { warning("%s exceeded timeout of %d seconds", cmd[0].c_str(), timeout); kill(pid, SIGKILL); } void Subprocess::onWait(EventLoop *, pid_t, int status, const struct rusage &) { this->status = status; if(actionlist) actionlist->completed(this); } void Subprocess::setup(EventLoop *e) { if(pid < 0) throw std::logic_error("Subprocess::setup but not running"); for(auto &c: captures) e->whenReadable(c.first, static_cast(this)); if(timeout > 0) { struct timespec timeLimit; getTimestamp(timeLimit); if(timeLimit.tv_sec <= std::numeric_limits::max() - timeout) timeLimit.tv_sec += timeout; else timeLimit.tv_sec = std::numeric_limits::max(); e->whenTimeout(timeLimit, this); } e->whenWaited(pid, this); } int Subprocess::wait(bool checkStatus) { assert(eventloop); setup(eventloop); eventloop->wait(); delete eventloop; eventloop = nullptr; pid = -1; if(checkStatus && status) { if(WIFSIGNALED(status) && WTERMSIG(status) == SIGPIPE) ; else throw SubprocessFailed(cmd[0], status); } return status; } void Subprocess::go(EventLoop *e, ActionList *al) { actionlist = al; launch(e); setup(e); } void Subprocess::report() { if(env.size()) { IO::out.writef("> # environment for next command\n"); for(auto &e: env) IO::out.writef("> %s=%s\n", e.first.c_str(), e.second.c_str()); } std::string command; for(size_t i = 0; i < cmd.size(); ++i) { if(i) command += ' '; command += cmd[i]; } IO::out.writef("> %s\n", command.c_str()); } void Subprocess::getTimestamp(struct timespec &now) { #ifdef CLOCK_MONOTONIC if(clock_gettime(CLOCK_MONOTONIC, &now) < 0) throw IOError("clock_gettime", errno); #else struct timeval tv; if(gettimeofday(&tv, nullptr) < 0) throw IOError("gettimeofday", errno); now.tv_sec = tv.tv_sec; now.tv_nsec = tv.tv_sec * 1000; #endif } rsbackup-3.0/src/FileLock.cc0000664000175000017500000000340112621670751012704 00000000000000// Copyright © 2011, 2012, 2015 Richard Kettlewell. // // 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 . #include #include "FileLock.h" #include "Errors.h" #include #include #include FileLock::FileLock(const std::string &path_): path(path_) { } FileLock::~FileLock() { if(fd >= 0) close(fd); } void FileLock::ensureOpen() { if(fd >= 0) return; if((fd = open(path.c_str(), O_WRONLY|O_CREAT, 0666)) < 0) throw IOError("opening " + path, errno); int flags; if((flags = fcntl(fd, F_GETFL)) < 0) throw IOError("fcntl F_GETFL " + path, errno); if(fcntl(fd, F_SETFL, flags | FD_CLOEXEC) < 0) throw IOError("fcntl F_SETFL " + path, errno); } bool FileLock::acquire(bool wait) { ensureOpen(); if(held) return true; if(flock(fd, wait ? LOCK_EX : LOCK_EX|LOCK_NB) < 0) { if(errno == EWOULDBLOCK && !wait) return false; throw IOError("acquiring lock on " + path, errno); } held = true; return true; } void FileLock::release() { if(!held) throw std::logic_error("release without acquire"); if(flock(fd, LOCK_UN) < 0) throw IOError("releasing lock on " + path, errno); held = false; } rsbackup-3.0/src/Prune.h0000664000175000017500000000653312620463022012146 00000000000000// -*-C++-*- // Copyright © 2015 Richard Kettlewell. // // 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 . #ifndef PRUNE_H #define PRUNE_H /** @file Prune.h * @brief Definitions used by the pruning logic */ #include #include #include class Backup; class Volume; /** @brief Base class for pruning policies */ class PrunePolicy { public: /** @brief Constructor * * Policies are automatically registered upon construction. */ PrunePolicy(const std::string &name); /** @brief Validate a pruning policy * @param volume Volume to validate */ virtual void validate(const Volume *volume) const = 0; /** @brief Get a parameter value * @param volume Volume to validate * @param name Name of parameter */ const std::string &get(const Volume *volume, const std::string &name) const; /** @brief Get a parameter value * @param volume Volume to validate * @param name Name of parameter * @param def Default value */ const std::string &get(const Volume *volume, const std::string &name, const std::string &def) const; /** @brief Identify prunable backups * @param onDevice Surviving backups of same volume on same device * @param total Number of backups anywhere * @param prune Map of backups to prune to reason strings * * @p total does not include backups on other devices that have "only just" * been selected for pruning. */ virtual void prunable(std::vector &onDevice, std::map &prune, int total) const = 0; /** @brief Find a prune policy by name * @param name Name of policy * @return Prune policy */ static const PrunePolicy *find(const std::string &name); private: /** @brief Type for @ref policies */ typedef std::map policies_type; /** @brief Map of policy names to implementations */ static policies_type *policies; }; /** @brief Validate a pruning policy * @param volume Volume to validate */ void validatePrunePolicy(const Volume *volume); /** @brief Identify prunable backups * @param onDevice Number of backups of same volume on same device * @param prune Map of backups to prune to reason strings * @param total Number of backups anywhere */ void backupPrunable(std::vector &onDevice, std::map &prune, int total); /** @brief Identify the bucket for a backup * @param w Decay window * @param s Decay scale * @param a Age of backup * @return Bucket number from 0 * * See decay.pdf for more information. */ int prune_decay_bucket(double w, double s, int a); #endif /* PRUNE_H */ rsbackup-3.0/src/Database.h0000644000175000017500000001536412626574071012576 00000000000000//-*-C++-*- // Copyright © 2014, 2015 Richard Kettlewell. // // 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 . #ifndef DATABASE_H #define DATABASE_H #include #include /** @file Database.h * @brief %Database support */ /** @brief End of binding information */ #define SQL_END 0 /** @brief Bind an @c int */ #define SQL_INT 1 /** @brief Bind an @c int64_t */ #define SQL_INT64 2 /** @brief Bind a @c const @c std::string @c * as text */ #define SQL_STRING 3 /** @brief Bind a @c const @c std::string @c * as a blob */ #define SQL_BLOB 4 /** @brief Bind a @c const @c char @c * as text */ #define SQL_CSTRING 5 /** @brief A database handle */ class Database { public: /** @brief A SQL statement */ class Statement { public: /** @brief Create a statement * @param d Database * @throw DatabaseError if an error occurs */ inline Statement(Database &d): db(d.db) {} /** @brief Create a statement, prepare it with a command and bind data it * @param d Database * @param cmd Command * @param ... Binding information * @throw DatabaseError if an error occurs * * Binding information is a series of type values followed by parameter * values and terminated by @ref SQL_END. The type values are: * * - @ref SQL_INT, followed by an @c int parameter value. * - @ref SQL_INT64, followed by an @c int64_t parameter value. * - @ref SQL_STRING, followed by a @c const @c std::string @c * parameter value. * - @ref SQL_CSTRING, followed by a @c const @c char @c * parameter value. */ Statement(Database &d, const char *cmd, ...); Statement(const Statement &) = delete; Statement &operator=(const Statement &) = delete; /** @brief Prepare a statement with a command and bind data to it * @param cmd Command * @param ... Binding information * @throw DatabaseError if an error occurs * * Binding information is a series of type values followed by parameter * values and terminated by @ref SQL_END. The type values are: * * - @ref SQL_INT, followed by an @c int parameter value. * - @ref SQL_INT64, followed by an @c int64_t parameter value. * - @ref SQL_STRING, followed by a @c const @c std::string @c * parameter value. * - @ref SQL_CSTRING, followed by a @c const @c char @c * parameter value. */ void prepare(const char *cmd, ...); /** @brief Fetch the next row * @return @c true if a row is available, otherwise @c false * @throw DatabaseError if an error occurs * @throw DatabaseBusy if the database is busy */ bool next(); /** @brief Get an @c int value * @param col Column number from 0 * @return Integer value */ int get_int(int col); /** @brief Get an @c int64 value * @param col Column number from 0 * @return Integer value */ sqlite_int64 get_int64(int col); /** @brief Get a @c std::string value as text * @param col Column number from 0 * @return String value */ std::string get_string(int col); /** @brief Get a @c std::string value as a blob * @param col Column number from 0 * @return String value */ std::string get_blob(int col); /** @brief Destroy a statement */ ~Statement(); private: /** @brief Prepare and bind a statment * @param cmd Command * @param ap Binding information * @throw DatabaseError if an error occurs */ void vprepare(const char *cmd, va_list ap); /** @brief Bind to a statement * @param ap Binding information * @throw DatabaseError if an error occurs * * Depends on @ref param being initialized so only callable from or after * @ref vprepare and its callers. */ void vbind(va_list ap); /** @brief Raise an error * @param description Context for error * @param rc Error code * @throw DatabaseError * @throw DatabaseBusy */ inline void error [[noreturn]] (const std::string &description, int rc) { Database::error(db, description, rc); } /** @brief Underlying statement handle */ sqlite3_stmt *stmt = nullptr; /** @brief Underlying database handle */ sqlite3 *db = nullptr; /** @brief Next parameter index * Only meaningful after @ref vprepare (and its callers) */ int param = 0; }; /** @brief Create a database object * @param path Path to database * @param rw Read-write mode * @throw DatabaseError if an error occurs * * In read-write mode, the database is created if it does not exist. */ Database(const std::string &path, bool rw=true); Database(const Database &) = delete; Database &operator=(const Database &) = delete; /** @brief Test whether a table exists * @param name Table name * @return @c true if table exists, @c false otherwise * @throw DatabaseError if an error occurs * @throw DatabaseBusy if the database is busy */ bool hasTable(const std::string &name); /** @brief Execute a simple command * @param cmd Command to execute */ void execute(const char *cmd); /** @brief Begin a transaction */ void begin(); /** @brief Commit a transaction */ void commit(); /** @brief Abandon a transaction */ void rollback(); /** @brief Destructor */ ~Database(); private: /** @brief Underlying database handle */ sqlite3 *db; /** @brief Raise an error * @param description Context for error * @param rc Error code * @throw DatabaseError * @throw DatabaseBusy */ inline void error [[noreturn]] (const std::string &description, int rc) { error(db, description, rc); } /** @brief Raise an error * @param db Database handle * @param description Context for error * @param rc Error code * @throw DatabaseError * @throw DatabaseBusy * * Throws a @ref DatabaseError, unless @p rc is @c SQLITE_BUSY, in which case * @ref DatabaseBusy is thrown instead. */ static void error [[noreturn]] (sqlite3 *db, const std::string &description, int rc); friend class Database::Statement; }; #endif /* DATABASE_H */ rsbackup-3.0/src/BulkRemove.h0000664000175000017500000000304212626575050013133 00000000000000//-*-C++-*- // Copyright © 2015 Richard Kettlewell. // // 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 . #ifndef BULKREMOVE_H #define BULKREMOVE_H /** @file BulkRemove.h * @brief Bulk remove operations */ #include "Subprocess.h" /** @brief Bulk remove files and directories, as if by @c rm @c -rf. * * A @ref BulkRemove is a @ref Subprocess and therefore an @ref Action; it can * be invoked either with BulkRemove::runAndWait or as part of an @ref * ActionList. */ class BulkRemove: public Subprocess { public: /** @brief Constructor * @param path Base path to remove * * The effect is equivalent to @c rm @c -rf. */ BulkRemove(const std::string &path) { initialize(path); } /** @brief Constructor */ BulkRemove() = default; /** @brief Initialize the bulk remover * @param path Base path to remove * * The effect is equivalent to @c rm @c -rf. */ void initialize(const std::string &path); }; #endif /* BULKREMOVE_H */ rsbackup-3.0/src/rsbackup.h0000664000175000017500000000234112452266007012667 00000000000000//-*-C++-*- // Copyright © 2011, 2012, 2015 Richard Kettlewell. // // 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 . #ifndef RSBACKUP_H #define RSBACKUP_H /** @file rsbackup.h * @brief Common definitions */ #include #include class Document; /** @brief Make backups */ void makeBackups(); /** @brief Retire volumes */ void retireVolumes(); /** @brief Retire devices */ void retireDevices(); /** @brief Prune backups */ void pruneBackups(); /** @brief Prune redundant logs */ void prunePruneLogs(); /** @brief HTML stylesheet */ extern char stylesheet[]; /** @brief Error count */ extern int errors; #endif /* RSBACKUP_H */ rsbackup-3.0/src/stylesheet.cc0000664000175000017500000000376612327515361013421 00000000000000char stylesheet[] = "/* Copyright © 2011 Richard Kettlewell.\n" " *\n" " * This program is free software: you can redistribute it and/or modify\n" " * it under the terms of the GNU General Public License as published by\n" " * the Free Software Foundation, either version 3 of the License, or\n" " * (at your option) any later version.\n" " *\n" " * This program is distributed in the hope that it will be useful,\n" " * but WITHOUT ANY WARRANTY; without even the implied warranty of\n" " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" " * GNU General Public License for more details.\n" " *\n" " * You should have received a copy of the GNU General Public License\n" " * along with this program. If not, see .\n" " */\n" "body {\n" " color: black;\n" " background-color: white\n" "}\n" "\n" "a:link, a:visited, a:active {\n" " color: blue;\n" " text-decoration: underline\n" "}\n" "\n" "h1 {\n" " background-color: #e0ffe0;\n" " padding: 0.2em\n" "}\n" "\n" "h2 {\n" " background-color: #e0e0e0;\n" " padding: 0.2em\n" "}\n" "\n" "h3 {\n" " text-decoration: underline\n" "}\n" "\n" "a.h3 {\n" " margin-left: 1em\n" "}\n" "\n" "h1,h2,h3,h4 {\n" " font-family: sans-serif\n" "}\n" "\n" "table {\n" " border-collapse: collapse\n" "}\n" "\n" "th {\n" " background-color: #e0e0e0;\n" " border-left: 1px solid #e0e0e0;\n" " border-top: 1px solid #e0e0e0;\n" " border-right: 1px solid #e0e0e0\n" "}\n" "\n" "td {\n" " border: 1px solid black;\n" " vertical-align: top;\n" " padding-left: 4px;\n" " padding-right: 4px\n" "}\n" "\n" "td.bad {\n" " background-color: #ff4040;\n" " color: #ffffff\n" "}\n" "\n" "td.good {\n" " background-color: #e0ffe0;\n" " color: #000000\n" "}\n" "\n" "span.bad {\n" " color: #ff4040\n" "}\n" "\n" "pre.log {\n" " background-color: #f0f0f0\n" "}\n" "\n" ".example {\n" " border-left: 2px solid black;\n" " padding-left: 2px\n" "}\n" "\n" "div.volume {\n" " margin-left: 1em\n" "}\n" "\n" ".recent {\n" " color: #ff4040\n" "}\n" ; rsbackup-3.0/src/BulkRemove.cc0000664000175000017500000000204112626566243013273 00000000000000// Copyright © 2011, 2012, 2015 Richard Kettlewell. // // 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 . #include #include "Subprocess.h" #include "Utils.h" #include "Command.h" #include #include "BulkRemove.h" void BulkRemove::initialize(const std::string &path) { // Invoking rm makes more sense than re-implementing it. std::vector cmd = { "rm", "-rf", path }; setCommand(cmd); if(command.verbose) report(); } rsbackup-3.0/src/parseInteger.cc0000664000175000017500000000255212571037171013647 00000000000000// Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. // // 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 . #include #include "rsbackup.h" #include "Errors.h" #include "Utils.h" #include #include // Convert a string into an integer, throwing a SyntaxError if it is malformed // or outside [min,max]. int parseInteger(const std::string &s, int min, int max, int radix) { errno = 0; const char *sc = s.c_str(); char *e; long n = strtol(sc, &e, radix); if(errno) throw SyntaxError("invalid integer '" + s + "': " + strerror(errno)); if(*e || e == sc) throw SyntaxError("invalid integer '" + s + "'"); if(n > max || n < min) throw SyntaxError("integer '" + s + "' out of range"); return (int)n; } rsbackup-3.0/src/Database.cc0000644000175000017500000001377412626341243012730 00000000000000// Copyright © 2014, 2015 Richard Kettlewell. // // 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 . #include #include "Database.h" #include "Errors.h" #include "Command.h" #include Database::Database(const std::string &path, bool rw) { int rc = sqlite3_open_v2(path.c_str(), &db, rw ? SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE : SQLITE_OPEN_READONLY, nullptr); if(rc != SQLITE_OK) error("sqlite3_open_v2 " + path, rc); } void Database::error(sqlite3 *db, const std::string &description, int rc) { if(db) if(rc == SQLITE_BUSY) throw DatabaseBusy(rc, description + ": " + sqlite3_errmsg(db)); else throw DatabaseError(rc, description + ": " + sqlite3_errmsg(db)); else throw DatabaseError(rc, description + ": error " + sqlite3_errstr(rc)); } bool Database::hasTable(const std::string &name) { return Statement(*this, "SELECT name FROM sqlite_master" " WHERE type = 'table' AND name = ?", SQL_STRING, &name, SQL_END).next(); } void Database::execute(const char *cmd) { Statement(*this, cmd, SQL_END).next(); } void Database::begin() { execute("BEGIN"); } void Database::commit() { execute("COMMIT"); } void Database::rollback() { execute("ROLLBACK"); } Database::~Database() { int rc = sqlite3_close_v2(db); db = nullptr; if(rc != SQLITE_OK) error("sqlite3_close", rc); } // Database::Statement -------------------------------------------------------- Database::Statement::Statement(Database &d, const char *cmd, ...): Statement(d) { va_list ap; va_start(ap, cmd); try { vprepare(cmd, ap); } catch(std::runtime_error &e) { va_end(ap); throw; } va_end(ap); } void Database::Statement::prepare(const char *cmd, ...) { va_list ap; va_start(ap, cmd); try { vprepare(cmd, ap); } catch(std::runtime_error &e) { va_end(ap); throw; } va_end(ap); } void Database::Statement::vprepare(const char *cmd, va_list ap) { if(stmt) throw std::logic_error("Database::Statement::vprepare: already prepared"); const char *tail; D("vprepare: %s", cmd); int rc = sqlite3_prepare_v2(db, cmd, -1, &stmt, &tail); if(rc != SQLITE_OK) error(std::string("sqlite3_prepare_v2: ") + cmd, rc); if(tail && *tail) throw std::logic_error(std::string("Database::Statement::vprepare: trailing junk: \"") + tail + "\""); try { param = 1; vbind(ap); } catch(std::runtime_error &e) { sqlite3_finalize(stmt); stmt = nullptr; throw; } } void Database::Statement::vbind(va_list ap) { int t, i, rc; sqlite3_int64 i64; const char *cs; const std::string *s; if(param <= 0) throw std::logic_error("Database::Statement::vbind: invalid 'param' value"); while((t = va_arg(ap, int)) != SQL_END) { switch(t) { case SQL_INT: i = va_arg(ap, int); D("vbind %d: %d", param, i); rc = sqlite3_bind_int(stmt, param, i); if(rc != SQLITE_OK) error("sqlite3_bind_int", rc); break; case SQL_INT64: i64 = va_arg(ap, sqlite3_int64); D("vbind %d: %lld", param, (long long)i64); rc = sqlite3_bind_int64(stmt, param, i64); if(rc != SQLITE_OK) error("sqlite3_bind_int64", rc); break; case SQL_STRING: s = va_arg(ap, const std::string *); D("vbind %d: %.*s", param, (int)s->size(), s->data()); rc = sqlite3_bind_text(stmt, param, s->data(), s->size(), SQLITE_TRANSIENT); if(rc != SQLITE_OK) error("sqlite3_bind_text", rc); break; case SQL_CSTRING: cs = va_arg(ap, const char *); D("vbind %d: %s", param, cs); rc = sqlite3_bind_text(stmt, param, cs, -1, SQLITE_TRANSIENT); if(rc != SQLITE_OK) error("sqlite3_bind_text", rc); break; case SQL_BLOB: s = va_arg(ap, const std::string *); D("vbind %d: <%zu bytes>", param, s->size()); rc = sqlite3_bind_blob(stmt, param, s->data(), s->size(), SQLITE_TRANSIENT); if(rc != SQLITE_OK) error("sqlite3_bind_text", rc); break; default: throw std::logic_error("Database::Statement::vbind: unknown parameter type"); } ++param; } } bool Database::Statement::next() { D("next"); switch(int rc = sqlite3_step(stmt)) { case SQLITE_ROW: return true; case SQLITE_DONE: return false; case SQLITE_OK: throw std::logic_error("Database::Statement::next: sqlite3_step returned SQLITE_OK"); default: error("sqlite3_step", rc); } } int Database::Statement::get_int(int col) { int n = sqlite3_column_int(stmt, col); D("get_int %5d: %d", col, n); return n; } sqlite_int64 Database::Statement::get_int64(int col) { sqlite_int64 n = sqlite3_column_int64(stmt, col); D("get_int64 %3d: %lld", col, (long long)n); return n; } std::string Database::Statement::get_string(int col) { const unsigned char *t = sqlite3_column_text(stmt, col); int nt = sqlite3_column_bytes(stmt, col); D("get_string %2d: %.*s", col, nt, t); return std::string((const char *)t, nt); } std::string Database::Statement::get_blob(int col) { const void *t = sqlite3_column_blob(stmt, col); int nt = sqlite3_column_bytes(stmt, col); D("get_blob %4d: <%d bytes>", col, nt); return std::string((const char *)t, nt); } Database::Statement::~Statement() { sqlite3_finalize(stmt); } rsbackup-3.0/src/DeviceAccess.cc0000664000175000017500000000353012620463022013526 00000000000000// Copyright © 2012, 2015 Richard Kettlewell. // // 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 . #include #include "DeviceAccess.h" #include "Conf.h" #include "Subprocess.h" #include "Errors.h" #include "Command.h" #include "IO.h" #include "Utils.h" static bool devicesReady; static std::vector filesToClose; static void runDeviceAccessHook(const std::vector &cmd, const std::string &name) { if(cmd.size() == 0) return; Subprocess sp(cmd); sp.setenv("RSBACKUP_HOOK", name); sp.setenv("RSBACKUP_ACT", command.act ? "true" : "false"); std::string devices; for(auto &d: config.devices) { if(devices.size() != 0) devices += " "; devices += d.first; } sp.setenv("RSBACKUP_DEVICES", devices); if(command.verbose) sp.report(); int rc = sp.runAndWait(false); if(rc) throw SubprocessFailed(name, rc); } void preDeviceAccess() { if(!devicesReady) { runDeviceAccessHook(config.preAccess, "pre-access-hook"); devicesReady = true; } } void closeOnUnmount(IO *f) { filesToClose.push_back(f); } void postDeviceAccess() { if(devicesReady) { deleteAll(filesToClose); runDeviceAccessHook(config.postAccess, "post-access-hook"); devicesReady = false; } } rsbackup-3.0/src/Action.cc0000644000175000017500000000362512626367222012440 00000000000000// Copyright © 2015 Richard Kettlewell. // // 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 . #include #include "Utils.h" #include "EventLoop.h" #include "Action.h" #include #include #include #include void Action::done(EventLoop *, ActionList *) { } void ActionList::add(Action *a) { actions.push_back(a); } void ActionList::go() { while(actions.size() > 0) { trigger(); eventloop->wait(); } } void ActionList::trigger() { bool changed; do { changed = false; for(Action *a: actions) { if(a->running) continue; bool blocked = false; for(auto &r: a->resources) if(contains(resources, r)) { blocked = true; break; } if(blocked) continue; a->running = true; for(std::string &r: a->resources) resources.insert(r); a->go(eventloop, this); changed = true; } } while(changed); } void ActionList::completed(Action *a) { auto it = std::find(actions.begin(), actions.end(), a); if(it != actions.end()) { assert(a->running); for(std::string &r: a->resources) resources.erase(r); a->running = false; actions.erase(it); a->done(eventloop, this); trigger(); return; } throw std::logic_error("ActionList::completed"); } rsbackup-3.0/src/test-command.cc0000664000175000017500000001602112620463022013577 00000000000000// Copyright © 2014 Richard Kettlewell. // // 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 . #include #include "Command.h" #include "Errors.h" #include "Conf.h" #include #include static void test_action_backup(void) { static const char *argv[] = { "rsbackup", "--backup", nullptr }; Command c; assert(c.backup == false); c.parse(2, argv); assert(c.backup == true); } static void test_action_html(void) { static const char *argv[] = { "rsbackup", "--html", "PATH", nullptr }; Command c; assert(c.html == nullptr); c.parse(3, argv); assert(c.html != nullptr); assert(*c.html == "PATH"); } static void test_action_text(void) { static const char *argv[] = { "rsbackup", "--text", "PATH", nullptr }; Command c; assert(c.text == nullptr); c.parse(3, argv); assert(c.text != nullptr); assert(*c.text == "PATH"); } static void test_action_email(void) { static const char *argv[] = { "rsbackup", "--email", "user@domain", nullptr }; Command c; assert(c.email == nullptr); c.parse(3, argv); assert(c.email != nullptr); assert(*c.email == "user@domain"); } static void test_action_prune(void) { static const char *argv[] = { "rsbackup", "--prune", nullptr }; Command c; assert(c.prune == false); c.parse(2, argv); assert(c.prune == true); } static void test_action_prune_incomplete(void) { static const char *argv[] = { "rsbackup", "--prune-incomplete", nullptr }; Command c; assert(c.pruneIncomplete == false); c.parse(2, argv); assert(c.pruneIncomplete == true); } static void test_action_retire(void) { static const char *argv[] = { "rsbackup", "--retire", "VOLUME", nullptr }; Command c; assert(c.retire == false); c.parse(3, argv); assert(c.retire == true); assert(c.selections.size() == 1); Command d; assert(d.retire == false); try { d.parse(2, argv); assert(!"unexpectedly succeeded"); } catch(CommandError &e) { } } static void test_action_retire_device(void) { static const char *argv[] = { "rsbackup", "--retire-device", "DEVICE", nullptr }; Command c; assert(c.retireDevice == false); c.parse(3, argv); assert(c.retireDevice == true); assert(c.devices.size() == 1); assert(c.devices.at(0) == "DEVICE"); Command d; assert(d.retireDevice == false); try { d.parse(2, argv); assert(!"unexpectedly succeeded"); } catch(CommandError &e) { } } static void test_action_dump_config(void) { static const char *argv[] = { "rsbackup", "--dump-config", "JUNK", nullptr }; Command c; assert(c.dumpConfig == false); c.parse(2, argv); assert(c.dumpConfig == true); Command d; assert(d.dumpConfig == false); try { d.parse(3, argv); assert(!"unexpectedly succeeded"); } catch(CommandError &e) { } } static void test_action_none(void) { static const char *argv[] = { "rsbackup", nullptr }; Command c; try { c.parse(1, argv); assert(!"unexpectedly succeeded"); } catch(CommandError &e) { } } static void test_action_incompatible(void) { try { static const char *argv[] = { "rsbackup", "--retire", "--retire-device", "XYZ", nullptr }; Command c; c.parse(4, argv); assert(!"unexpectedly succeeded"); } catch(CommandError &e) { assert(std::string(e.what()).find("cannot be used together") != std::string::npos); } try { static const char *argv[] = { "rsbackup", "--retire", "--backup", "XYZ", nullptr }; Command c; c.parse(4, argv); assert(!"unexpectedly succeeded"); } catch(CommandError &e) { assert(std::string(e.what()).find("cannot be used together") != std::string::npos); } try { static const char *argv[] = { "rsbackup", "--retire-device", "--backup", "XYZ", nullptr }; Command c; c.parse(4, argv); assert(!"unexpectedly succeeded"); } catch(CommandError &e) { assert(std::string(e.what()).find("cannot be used together") != std::string::npos); } try { static const char *argv[] = { "rsbackup", "--dump-config", "--backup", "XYZ", nullptr }; Command c; c.parse(4, argv); assert(!"unexpectedly succeeded"); } catch(CommandError &e) { assert(std::string(e.what()).find("cannot be used with any other action") != std::string::npos); } } static void test_selection(void) { { static const char *argv[] = { "rsbackup", "--backup", "A", "-A:B", "!C", nullptr }; Command c; c.parse(5, argv); assert(c.backup == true); assert(c.selections.size() == 3); assert(c.selections[0].sense == true); assert(c.selections[0].host == "A"); assert(c.selections[0].volume == "*"); assert(c.selections[1].sense == false); assert(c.selections[1].host == "A"); assert(c.selections[1].volume == "B"); assert(c.selections[2].sense == false); assert(c.selections[2].host == "C"); assert(c.selections[2].volume == "*"); } try { static const char *argv[] = { "rsbackup", "--backup", "~A", nullptr }; Command c; c.parse(3, argv); assert(!"unexpectedly succeeded"); } catch(CommandError &e) { } try { static const char *argv[] = { "rsbackup", "--backup", "A:~", nullptr }; Command c; c.parse(3, argv); assert(!"unexpectedly succeeded"); } catch(CommandError &e) { } try { static const char *argv[] = { "rsbackup", "--backup", "A:B:C", nullptr }; Command c; c.parse(3, argv); assert(!"unexpectedly succeeded"); } catch(CommandError &e) { } try { static const char *argv[] = { "rsbackup", "--backup", "*:C", nullptr }; Command c; c.parse(3, argv); assert(!"unexpectedly succeeded"); } catch(CommandError &e) { } } int main() { int errors = 0; const std::string h = Command::helpString(); for(size_t n = 0; Command::options[n].name; ++n) { std::string full = "--" + std::string(Command::options[n].name); if(h.find(full + ",") == std::string::npos && h.find(full + " ") == std::string::npos) { fprintf(stderr, "ERROR: help for option %s not found\n", full.c_str()); ++errors; } } test_action_backup(); test_action_html(); test_action_text(); test_action_email(); test_action_prune(); test_action_prune_incomplete(); test_action_retire(); test_action_retire_device(); test_action_dump_config(); test_action_none(); test_action_incompatible(); test_selection(); return !!errors; } rsbackup-3.0/src/IO.cc0000664000175000017500000000652012620463022011516 00000000000000// Copyright © 2011, 2012, 2014 Richard Kettlewell. // // 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 . #include #include "IO.h" #include "Errors.h" #include "Subprocess.h" #include #include #include #include #include IO::~IO() { if(closeFile && fp) fclose(fp); if(subprocess) delete subprocess; } void IO::open(const std::string &path_, const std::string &mode) { if(!(fp = fopen(path_.c_str(), mode.c_str()))) throw IOError("opening " + path_, errno); path = path_; closeFile = true; } void IO::popen(const std::vector &command, PipeDirection d, bool verbose) { subprocess = new Subprocess(command); int p[2]; if(pipe(p) < 0) throw IOError("creating pipe for " + command[0], errno); switch(d) { case ReadFromPipe: subprocess->addChildFD(1, p[1], p[0]); break; case WriteToPipe: subprocess->addChildFD(0, p[0], p[1]); break; } if(verbose) subprocess->report(); subprocess->run(); switch(d) { case ReadFromPipe: path = "pipe from " + command[0]; fp = fdopen(p[0], "r"); break; case WriteToPipe: path = "pipe to " + command[0]; fp = fdopen(p[1], "w"); break; } if(!fp) throw IOError("fdopen", errno); closeFile = true; } int IO::close(bool checkStatus) { FILE *fpSave = fp; fp = nullptr; if(fclose(fpSave) < 0) { if(abortOnError) abort(); throw IOError("closing " + path); } return subprocess ? subprocess->wait(checkStatus) : 0; } bool IO::readline(std::string &line) { int c; line.clear(); while((c = getc(fp)) != EOF && c != '\n') line += c; if(ferror(fp)) readError(); return line.size() || !feof(fp); } void IO::readlines(std::vector &lines) { std::string line; lines.clear(); while(readline(line)) lines.push_back(line); } void IO::readall(std::string &file) { int c; file.clear(); while((c = getc(fp)) != EOF) file += c; if(ferror(fp)) readError(); } void IO::write(const std::string &s) { fwrite(s.data(), 1, s.size(), fp); if(ferror(fp)) writeError(); } int IO::writef(const char *format, ...) { va_list ap; int rc; va_start(ap, format); rc = vfprintf(fp, format, ap); va_end(ap); if(rc < 0) writeError(); return rc; } int IO::vwritef(const char *format, va_list ap) { int rc = vfprintf(fp, format, ap); if(rc < 0) writeError(); return rc; } void IO::flush() { if(fflush(fp) < 0) writeError(); } void IO::readError() { if(abortOnError) abort(); throw IOError("reading " + path, errno); } void IO::writeError() { if(abortOnError) abort(); throw IOError("writing " + path, errno); } IO IO::out(stdout, "stdout"); IO IO::err(stderr, "stderr", true); rsbackup-3.0/src/Errors.h0000664000175000017500000001305612601750104012326 00000000000000// -*-C++-*- // Copyright © 2011, 2012, 2014 Richard Kettlewell. // // 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 . #ifndef ERRORS_H #define ERRORS_H /** @file Errors.h * @brief Exceptions */ #include #include #include #ifndef STACK_MAX /** @brief Maximum backtrace size */ # define STACK_MAX 128 #endif /** @brief Base class for all errors */ class Error: public std::runtime_error { public: /** @brief Constructor * @param msg Error message */ Error(const std::string &msg); /** @brief Display stack trace * @param fp Destination for stack trace */ void trace(FILE *fp); private: #if HAVE_EXECINFO_H void *stack[STACK_MAX]; int stacksize; #endif }; /** @brief System-level error */ class SystemError: public Error { public: /** @brief Constructor * @param msg Error message */ SystemError(const std::string &msg): Error(msg), errno_value(0) {} /** @brief Constructor * @param msg Error message * @param error @c errno value */ SystemError(const std::string &msg, int error): Error(msg + ": " + strerror(error)), errno_value(error) {} /** @brief @c errno value */ int errno_value; }; /** @brief An I/O error */ class IOError: public SystemError { public: /** @brief Constructor * @param msg Error message */ IOError(const std::string &msg): SystemError(msg) {} /** @brief Constructor * @param msg Error message * @param error @c errno value */ IOError(const std::string &msg, int error): SystemError(msg, error) {} }; /** @brief A syntax error * * Does not include path/line information. */ class SyntaxError: public Error { public: /** @brief Constructor * @param msg Error message */ SyntaxError(const std::string &msg): Error(msg) {} }; /** @brief Represents some problem with a config file * * Usually equivalent to a SyntaxError but with path/line information included * in the message. */ class ConfigError: public Error { public: /** @brief Constructor * @param msg Error message */ ConfigError(const std::string &msg): Error(msg) {} }; /** @brief Represents some problem with a store * * BadStore errors are reported but are not fatal. */ class BadStore: public Error { public: /** @brief Constructor * @param msg Error message */ BadStore(const std::string &msg): Error(msg) {} }; /** @brief Represents the problem that a store is not mounted * * UnavailableStore errors are 'normal' and are only displayed if * --warn-store is enabled. */ class UnavailableStore: public Error { public: /** @brief Constructor * @param msg Error message */ UnavailableStore(const std::string &msg): Error(msg) {} }; /** @brief Represents some problem with a store * * FatalStoreErrors abort the whole process. */ class FatalStoreError: public Error { public: /** @brief Constructor * @param msg Error message */ FatalStoreError(const std::string &msg): Error(msg) {} }; /** @brief Represents a problem with the command line */ class CommandError: public Error { public: /** @brief Constructor * @param msg Error message */ CommandError(const std::string &msg): Error(msg) {} }; /** @brief Represents some problem with a date string */ class InvalidDate: public Error { public: /** @brief Constructor * @param msg Error message */ InvalidDate(const std::string &msg): Error(msg) {} }; /** @brief Represents some problem with a regexp */ class InvalidRegexp: public SystemError { public: /** @brief Constructor * @param msg Error message */ InvalidRegexp(const std::string &msg): SystemError(msg) {} }; /** @brief Represents some problem with @ref PruneExec output */ class InvalidPruneList: public SystemError { public: /** @brief Constructor * @param msg Error message */ InvalidPruneList(const std::string &msg): SystemError(msg) {} }; /** @brief Represents failure of a subprocess */ class SubprocessFailed: public Error { public: /** @brief Constructor * @param name Subprocess name * @param wstat Wait status */ SubprocessFailed(const std::string &name, int wstat): Error(format(name, wstat)) {} /** @brief Format the error message * @param name Subprocess name * @param wstat Wait status * @return Error string */ static std::string format(const std::string &name, int wstat); }; /** @brief Represents an error from the database subsystem */ class DatabaseError: public Error { public: /** @brief @c SQLITE_... error code */ int status; /** @brief Constructor * @param rc @c SQLITE_... error code * @param msg Error message */ DatabaseError(int rc, const std::string &msg): Error(msg), status(rc) {} }; /** @brief Represents a 'busy' error from the database subsystem */ class DatabaseBusy: public DatabaseError { public: /** @brief Constructor * @param rc @c SQLITE_... error code * @param msg Error message */ DatabaseBusy(int rc, const std::string &msg): DatabaseError(rc, msg) {} }; #endif /* ERRORS_H */ rsbackup-3.0/src/PruneExec.cc0000664000175000017500000000643512621702746013124 00000000000000// Copyright © 2015 Richard Kettlewell. // // 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 . #include #include "rsbackup.h" #include "Conf.h" #include "Prune.h" #include "Subprocess.h" #include "Utils.h" #include "Errors.h" #include #include #include /** @brief Pruning policy that executes a program */ class PruneExec: public PrunePolicy { public: PruneExec(): PrunePolicy("exec") {} void validate(const Volume *volume) const override { const std::string &path = get(volume, "path"); if(access(path.c_str(), X_OK) < 0) throw ConfigError("cannot execute pruning policy " + volume->prunePolicy); for(auto &p: volume->pruneParameters) for(auto ch: p.first) if(ch != '_' && !isalnum(ch)) throw ConfigError("invalid pruning parameter '" + p.first + "' for executable policies"); } void prunable(std::vector &onDevice, std::map &prune, int total) const override { char buffer[64]; const Volume *volume = onDevice.at(0)->volume; std::vector command = { get(volume, "path") }; Subprocess sp(command); for(auto &p: volume->pruneParameters) sp.setenv("PRUNE_" + p.first, p.second); std::stringstream ss; for(size_t i = 0; i < onDevice.size(); ++i) { if(i) ss << ' '; ss << Date::today() - onDevice[i]->date; } sp.setenv("PRUNE_ONDEVICE", ss.str()); snprintf(buffer, sizeof buffer, "%d", total); sp.setenv("PRUNE_TOTAL", buffer); sp.setenv("PRUNE_HOST", volume->parent->name); sp.setenv("PRUNE_VOLUME", volume->name); sp.setenv("PRUNE_DEVICE", onDevice.at(0)->deviceName); std::string reasons; sp.capture(1, &reasons); sp.runAndWait(); size_t pos = 0; while(pos < reasons.size()) { size_t newline = reasons.find('\n', pos); if(newline == std::string::npos) throw InvalidPruneList("missing newline"); size_t colon = reasons.find(':', pos); if(colon > newline) throw InvalidPruneList("no colon found"); std::string agestr(reasons, pos, colon - pos); std::string reason(reasons, colon + 1, newline - (colon + 1)); int age = parseInteger(agestr, 0, INT_MAX); bool found = false; for(Backup *backup: onDevice) { if(Date::today() - backup->date == age) { if(contains(prune, backup)) throw InvalidPruneList("duplicate entry in prune list"); prune[backup] = reason; found = true; } } if(!found) throw InvalidPruneList("nonexistent entry in prune list"); pos = newline + 1; } } } prune_exec; rsbackup-3.0/src/Document.h0000664000175000017500000003032012626574404012637 00000000000000//-*-C++-*- // Copyright © 2011, 2012, 2015 Richard Kettlewell. // // 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 . #ifndef DOCUMENT_H #define DOCUMENT_H /** @file Document.h * @brief %Document construction and rendering */ #include #include #include "Defaults.h" /** @brief Structured document class * * Can be rendered to text or HTML. */ class Document { public: /** @brief Base class for document node types */ struct Node { /** @brief Destructor */ virtual ~Node() = default; Node() = default; Node(const Node &) = delete; Node &operator=(const Node &) = delete; /** @brief Style name */ std::string style; /** @brief Foreground color or -1 */ int fgcolor = -1; /** @brief Background color or -1 */ int bgcolor = -1; /** @brief Render as HTML * @param os Output */ virtual void renderHtml(std::ostream &os) const = 0; /** @brief Render as text * @param os Output */ virtual void renderText(std::ostream &os) const = 0; /** @brief Render an open tag * @param os Output * @param name Element name * @param ... Attribute name/value pairs * * Attribute names and values are const char * and are terminated by a null * pointer of the same type. */ void renderHtmlOpenTag(std::ostream &os, const char *name, ...) const; /** @brief Render a close tag * @param os Output * @param name Element name * @param newline Add a trailing newline */ void renderHtmlCloseTag(std::ostream &os, const char *name, bool newline = true) const; }; /** @brief Intermediate base for leaf node types */ struct Leaf: public Node { }; /** @brief An unadorned string */ struct String: public Leaf { /** @brief Text of string */ std::string text; /** @brief Constructor */ String() = default; /** @brief Constructor * @param s Initial text */ String(const std::string &s): text(s) {} /** @brief Constructor * @param n Integer to convert to string */ String(int n); /** @brief Render as HTML * @param os Output */ void renderHtml(std::ostream &os) const override; /** @brief Render as text * @param os Output */ void renderText(std::ostream &os) const override; }; /** @brief Base class for ordered containers */ struct LinearContainer: public Node { /** @brief Destructor */ ~LinearContainer() override; /** @brief List of nodes in container */ std::vector nodes; /** @brief Append a node * @param node Note to append * @return @p node */ Node *append(Node *node) { nodes.push_back(node); return node; } /** @brief Append a string node * @param text Text for new string node * @return New string node */ String *append(const std::string &text) { String *s = new String(text); nodes.push_back(s); return s; } /** @brief Append a list of string nodes * @param text Strings to append * @param insertNewlines If true append @c \\n to each */ void append(const std::vector &text, bool insertNewlines = true) { for(size_t n = 0; n < text.size(); ++n) { append(text[n]); if(insertNewlines) append("\n"); } } /** @brief Render as HTML * @param os Output */ void renderHtmlContents(std::ostream &os) const; /** @brief Render as text * @param os Output */ void renderTextContents(std::ostream &os) const; /** @brief Render as HTML * @param os Output */ void renderHtml(std::ostream &os) const override; /** @brief Render as text * @param os Output */ void renderText(std::ostream &os) const override; }; /** @brief A paragraph */ struct Paragraph: public LinearContainer { /** @brief Constructor */ Paragraph() = default; /** @brief Constructor * @param node Initial node */ Paragraph(Node *node) { append(node); } /** @brief Constructor * @param s Initial text */ Paragraph(const std::string &s) { append(s); } /** @brief Render as HTML * @param os Output */ void renderHtml(std::ostream &os) const override; /** @brief Render as text * @param os Output */ void renderText(std::ostream &os) const override; }; /** @brief A verbatim section */ struct Verbatim: public LinearContainer { /** @brief Constructor */ Verbatim() = default; /** @brief Render as HTML * @param os Output */ void renderHtml(std::ostream &os) const override; /** @brief Render as text * @param os Output */ void renderText(std::ostream &os) const override; }; /** @brief Possible types of list */ enum ListType { UnorderedList, OrderedList }; /** @brief A list */ struct List: public LinearContainer { /** @brief Constructor * @param type_ List type */ List(ListType type_ = UnorderedList): type(type_) {} /** @brief Constructor * @param s Text for initial list entry */ Node *entry(const std::string &s) { return append(new ListEntry(s)); } /** @brief Render as HTML * @param os Output */ void renderHtml(std::ostream &os) const override; /** @brief Render as text * @param os Output */ void renderText(std::ostream &os) const override; /** @brief List type */ ListType type; }; /** @brief One element in a list */ struct ListEntry: public LinearContainer { /** @brief Constructor * @param node Initial node */ ListEntry(Node *node) { append(node); } /** @brief Constructor * @param s Initial text */ ListEntry(const std::string &s) { append(s); } /** @brief Render as HTML * @param os Output */ void renderHtml(std::ostream &os) const override; /** @brief Render as text * @param os Output */ void renderText(std::ostream &os) const override; }; /** @brief A heading * * Level 1 is the highest-level (biggest) heading, level 6 the lowest * (smallest). Don't use levels outside this range. */ struct Heading: public LinearContainer { /** @brief Level of heading, 1-6 */ int level; /** @brief Constructor * @param level_ Level of heading */ Heading(int level_ = 1): level(level_) {} /** @brief Constructor * @param node Initial node * @param level_ Level of heading */ Heading(Node *node, int level_ = 1): Heading(level_) { append(node); } /** @brief Constructor * @param text Initial text * @param level_ Level of heading */ Heading(const std::string &text, int level_ = 1): Heading(level_) { append(text); } /** @brief Render as HTML * @param os Output */ void renderHtml(std::ostream &os) const override; /** @brief Render as text * @param os Output */ void renderText(std::ostream &os) const override; }; /** @brief A cell in a table. * * The origin (x=y=0) is at the top left. Don't add overlapping cells to a * single table. */ struct Cell: public LinearContainer { /** @brief Constructor * @param w_ Cell width * @param h_ Cell height */ Cell(int w_ = 1, int h_ = 1): heading(false), w(w_), h(h_) {} /** @brief Constructor * @param s Initial contents * @param w_ Cell width * @param h_ Cell height */ Cell(const std::string &s, int w_ = 1, int h_ = 1): Cell(w_, h_) { append(new String(s)); } /** @brief Constructor * @param n Initial contents * @param w_ Cell width * @param h_ Cell height */ Cell(Node *n, int w_ = 1, int h_ = 1): Cell(w_, h_) { append(n); } /** @brief True if this is a table heading */ bool heading; /** @brief X position in table */ int x = 0; /** @brief Y position in table */ int y = 0; /** @brief Width in columns */ int w; /** @brief Height in rows */ int h; /** @brief Render as HTML * @param os Output */ void renderHtml(std::ostream &os) const override; /** @brief Render as text * @param os Output */ void renderText(std::ostream &os) const override; }; /** @brief A table. * * The origin (x=y=0) is at the top left. Don't add overlapping cells to a * single table. */ struct Table: public Node { /** @brief Destructor */ ~Table() override; // TODO we do a lot of O(n^2) passes over this; can we do better? /** @brief List of cells */ std::vector cells; /** @brief Width of table (columns) */ int width() const; /** @brief Height of table (rows) */ int height() const; /** @brief Add a cell at the cursor * @param cell Cell to add * @return @p cell */ Cell *addCell(Cell *cell); /** @brief Add a heading cell at the cursor * @param cell Cell to add * @return @p cell */ Cell *addHeadingCell(Cell *cell) { cell->heading = true; return addCell(cell); } /** @brief Start a new row */ void newRow(); /** @brief Add a cell at a particular position * @param cell Cell to add * @param x X position * @param y Y position * @return @p cell */ Cell *addCell(Cell *cell, int x, int y); /** @brief Find the cell at a position * @param x X position * @param y Y position * @return @p cell or null pointer */ Cell *occupied(int x, int y) const; /** @brief Render as HTML * @param os Output */ void renderHtml(std::ostream &os) const override; /** @brief Render as text * @param os Output */ void renderText(std::ostream &os) const override; /** @brief Cursor X position */ int x = 0; /** @brief Cursor Y position */ int y = 0; }; /** @brief The root container for the document */ struct RootContainer: public LinearContainer { /** @brief Render as HTML * @param os Output */ void renderHtml(std::ostream &os) const override; /** @brief Render as text * @param os Output */ void renderText(std::ostream &os) const override; }; /** @brief The content of the document */ RootContainer content; /** @brief The title of the document */ std::string title; /** @brief The stylesheet, for HTML output */ std::string htmlStyleSheet; /** @brief Append something to the document */ Node *append(Node *node) { return content.append(node); } /** @brief Append a heading */ Heading *heading(const std::string &text, int level = 1) { Heading *h = new Heading(new String(text), level); content.append(h); return h; } /** @brief Append a paragraph */ Paragraph *para(const std::string &text) { Paragraph *p = new Paragraph(new String(text)); content.append(p); return p; } /** @brief Append a verbatim section */ Verbatim *verbatim() { Verbatim *v = new Verbatim(); content.append(v); return v; } /** @brief Render the document as HTML * @param os Output */ void renderHtml(std::ostream &os) const; /** @brief Render the document as text * @param os Output */ void renderText(std::ostream &os) const; /** @brief HTML quoting */ static void quoteHtml(std::ostream &os, const std::string &s); /** @brief Word-wrap text */ static void wordWrapText(std::ostream &os, const std::string &s, size_t width, size_t indent = 0, bool indentFirst = true); }; #endif /* DOCUMENT_H */ rsbackup-3.0/src/Action.h0000644000175000017500000001063312626652313012275 00000000000000//-*-C++-*- // Copyright © 2015 Richard Kettlewell. // // 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 . #ifndef ACTION_H #define ACTION_H /** @file Action.h * @brief Sequencing of concurrent operations * * An @ref Action performs some task, while holding some collection of * resources. The task is executed within the context of an @ref EventLoop and * is initiated by @ref Action::go. Resources are registered using @ref * Action::uses. * * An @ref ActionList is an ordered container of @ref Action objects. Actions * are executed concurrently, with the restriction that no two actions can hold * the same resource concurrently. */ #include #include #include #include class ActionList; class EventLoop; /** @brief One action that may be initiated concurrently * * An @ref Action performs some task, while holding some collection of * resources. The task is executed within the context of an @ref EventLoop and * is initiated by @ref Action::go; it should call ActionList::completed when * it is finished. Resources are registered using @ref Action::uses. * Actions must be added to an @ref ActionList to be executed. */ class Action { public: /** @brief Destructor */ virtual ~Action() = default; /** @brief Specify a resource that this action uses * @param r Resource name */ void uses(const std::string &r) { resources.push_back(r); } /** @brief Start the action * @param e Event loop * @param al Execution context * * Actions should not (normally) block but instead execute asynchronously * using event loop @p e. * * When it is complete it must call @ref ActionList::completed. */ virtual void go(EventLoop *e, ActionList *al) = 0; /** @brief Called when the action is complete * @param e Event loop * @param al Execution context * * The default implementation does nothing. */ virtual void done(EventLoop *e, ActionList *al); private: friend class ActionList; /** @brief Resources required by this action */ std::vector resources; /** @brief Current state */ bool running = false; }; /** @brief A collection of actions that are executed concurrently * * @ref Action "Actions" are executed concurrently, with the restriction that no two actions * can hold the same resource concurrently. * * When a new action is to be executed, the first action that has not been * started and does not contradict the restrictions above, is chosen for * execution. Actions are executed via Action::go; they should call * @ref ActionList::completed when they are finished. */ class ActionList { public: /** @brief Constructor * @param e Event loop */ ActionList(EventLoop *e): eventloop(e) { } /** @brief Add an action * @param a Action * * Adds an action to the end of the list. @p a must remain valid at least * until it has been completed, i.e. until @ref Action::done is called. */ void add(Action *a); /** @brief Initiate actions * * Returns when all actions are complete. * * This method repeatedly calls @ref EventLoop::wait, so if there are any * @ref Reactor objects attached to the event loop that do not belong to some * action, unexpected delays may result. */ void go(); /** @brief Called when an action is complete * * It is the responsibility of @ref Action subclasses to call this method. * Normally it should not leave any @ref Reactor objects attached to the @ref * EventLoop when it does so (see the caveat at @ref Action::go). */ void completed(Action *a); private: /** @brief Event loop */ EventLoop *eventloop; /** @brief List of remaining actions */ std::list actions; /** @brief Start any new actions if possible */ void trigger(); /** @brief In-use resources */ std::set resources; }; #endif /* ACTION_H */ rsbackup-3.0/src/RetireVolumes.cc0000664000175000017500000001601412621676402014024 00000000000000// Copyright © 2011, 2013, 2014, 2015 Richard Kettlewell. // // 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 . #include #include "rsbackup.h" #include "Conf.h" #include "Store.h" #include "Command.h" #include "Utils.h" #include "Errors.h" #include "IO.h" #include "Database.h" #include "BulkRemove.h" #include static void removeDirectory(const std::string &path) { if(command.verbose) IO::out.writef("INFO: removing %s\n", path.c_str()); if(command.act && rmdir(path.c_str()) < 0 && errno != ENOENT) { error("removing %s: %s", path.c_str(), strerror(errno)); } } /** @brief One retirable backup */ struct Retirable { /** @brief Host name */ std::string hostName; /** @brief Volume name */ std::string volumeName; /** @brief Pointer to containing device */ Device *device; /** @brief Backup ID */ std::string id; /** @brief Bulk removal */ BulkRemove *b = nullptr; /** @brief Constructor * @param h Host name * @param v Volume name * @param d Pointer to containing device * @param i Backup ID */ inline Retirable(const std::string &h, const std::string &v, Device *d, std::string i): hostName(h), volumeName(v), device(d), id(i) { } /** @brief Destructor */ ~Retirable() { delete b; } /** @brief Schedule retire of this backup */ void scheduleRetire(ActionList &al) { assert(!b); const std::string backupPath = (device->store->path + PATH_SEP + hostName + PATH_SEP + volumeName + PATH_SEP + id); if(command.verbose) IO::out.writef("INFO: removing %s\n", backupPath.c_str()); if(command.act) { b = new BulkRemove(backupPath); b->uses(device->name); al.add(b); } } /** @brief Clean up after retire of this backup */ void retired() { const std::string backupPath = (device->store->path + PATH_SEP + hostName + PATH_SEP + volumeName + PATH_SEP + id); if(command.act) { if(b->getStatus()) { error("removing %s: %s", backupPath.c_str(), SubprocessFailed::format("rm", b->getStatus()).c_str()); return; } // Remove incomplete indicator std::string incompletePath = backupPath + ".incomplete"; if(unlink(incompletePath.c_str()) < 0 && errno != ENOENT) { error("removing %s", incompletePath.c_str(), strerror(errno)); return; } // Update database Database::Statement(config.getdb(), "DELETE FROM backup" " WHERE host=? AND volume=? AND device=? AND id=?", SQL_STRING, &hostName, SQL_STRING, &volumeName, SQL_STRING, &device->name, SQL_STRING, &id, SQL_END).next(); } } }; // Schedulal retire of one volume or host static void identifyVolumes(std::vector &retire, std::set &volume_directories, std::set &host_directories, const std::string &hostName, const std::string &volumeName) { // Verify action with user if(volumeName == "*") { if(config.findHost(hostName)) { if(!check("Really retire host '%s'?", hostName.c_str())) return; } } else { if(config.findVolume(hostName, volumeName)) { if(!check("Really retire volume '%s:%s'?", hostName.c_str(), volumeName.c_str())) return; } } // Find all the backups to retire { Database::Statement stmt(config.getdb()); if(volumeName == "*") stmt.prepare("SELECT volume,device,id FROM backup" " WHERE host=?", SQL_STRING, &hostName, SQL_END); else stmt.prepare("SELECT volume,device,id FROM backup" " WHERE host=? AND volume=?", SQL_STRING, &hostName, SQL_STRING, &volumeName, SQL_END); while(stmt.next()) { std::string deviceName = stmt.get_string(1); config.identifyDevices(Store::Enabled); Device *device = config.findDevice(deviceName); if(!device) { // User should use --retire-device instead error("backup on unknown device %s (use --retire-device)", deviceName.c_str()); continue; } if(!device->store) { error("backup on unavailable device %s", deviceName.c_str()); continue; } if(device->store->state != Store::Enabled) { error("backup on disabled device %s", deviceName.c_str()); continue; } retire.push_back(Retirable(hostName, stmt.get_string(0), device, stmt.get_string(2))); // Zap all retired volume directories volume_directories.insert(device->store->path + PATH_SEP + hostName + PATH_SEP + stmt.get_string(0)); // ...and host directories if the whole host is being retired. if(volumeName == "*") host_directories.insert(device->store->path + PATH_SEP + hostName); } } } void retireVolumes() { // Sanity-check command for(auto &selection: command.selections) if(selection.sense == false) throw CommandError("cannot use negative selections with --retire"); // Identify backups to retire and directories to remove std::vector retire; std::set volume_directories, host_directories; for(auto &selection: command.selections) { if(selection.host == "*") throw CommandError("cannot retire all hosts"); identifyVolumes(retire, volume_directories, host_directories, selection.host, selection.volume); } // Schedule removal EventLoop e; ActionList al(&e); for(Retirable &r: retire) r.scheduleRetire(al); // Perform removal al.go(); // Clean up .incomplete files and db after removal for(Retirable &r: retire) r.retired(); // Clean up redundant directories for(auto &d: volume_directories) removeDirectory(d); for(auto &d: host_directories) removeDirectory(d); } rsbackup-3.0/src/Makefile.in0000664000175000017500000016402512635241702012757 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = rsbackup$(EXEEXT) noinst_PROGRAMS = test-date$(EXEEXT) test-io$(EXEEXT) \ test-directory$(EXEEXT) test-subprocess$(EXEEXT) \ test-unicode$(EXEEXT) test-timespec$(EXEEXT) \ test-command$(EXEEXT) test-select$(EXEEXT) \ test-confbase$(EXEEXT) test-check$(EXEEXT) \ test-device$(EXEEXT) test-host$(EXEEXT) test-volume$(EXEEXT) \ test-progress$(EXEEXT) test-database$(EXEEXT) \ test-tolines$(EXEEXT) test-globfiles$(EXEEXT) \ test-lock$(EXEEXT) test-split$(EXEEXT) \ test-parseinteger$(EXEEXT) test-prunedecay$(EXEEXT) \ test-eventloop$(EXEEXT) TESTS = test-date$(EXEEXT) test-io$(EXEEXT) test-directory$(EXEEXT) \ test-subprocess$(EXEEXT) test-unicode$(EXEEXT) \ test-timespec$(EXEEXT) test-command$(EXEEXT) \ test-select$(EXEEXT) test-confbase$(EXEEXT) \ test-check$(EXEEXT) test-device$(EXEEXT) test-host$(EXEEXT) \ test-volume$(EXEEXT) test-progress$(EXEEXT) \ test-database$(EXEEXT) test-tolines$(EXEEXT) \ test-globfiles$(EXEEXT) test-lock$(EXEEXT) test-split$(EXEEXT) \ test-parseinteger$(EXEEXT) test-prunedecay$(EXEEXT) \ test-eventloop$(EXEEXT) check-source subdir = src DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(dist_noinst_SCRIPTS) $(top_srcdir)/config.aux/depcomp \ $(top_srcdir)/config.aux/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = librsbackup_a_AR = $(AR) $(ARFLAGS) librsbackup_a_LIBADD = am_librsbackup_a_OBJECTS = Backup.$(OBJEXT) BulkRemove.$(OBJEXT) \ Check.$(OBJEXT) Command.$(OBJEXT) Conf.$(OBJEXT) \ Date.$(OBJEXT) DeviceAccess.$(OBJEXT) Device.$(OBJEXT) \ Directory.$(OBJEXT) Document.$(OBJEXT) Email.$(OBJEXT) \ error.$(OBJEXT) Errors.$(OBJEXT) FileLock.$(OBJEXT) \ Host.$(OBJEXT) HTML.$(OBJEXT) IO.$(OBJEXT) \ MakeBackup.$(OBJEXT) Progress.$(OBJEXT) Prune.$(OBJEXT) \ Report.$(OBJEXT) RetireDevices.$(OBJEXT) \ RetireVolumes.$(OBJEXT) Store.$(OBJEXT) stylesheet.$(OBJEXT) \ Subprocess.$(OBJEXT) Text.$(OBJEXT) Unicode.$(OBJEXT) \ Volume.$(OBJEXT) ConfBase.$(OBJEXT) toLines.$(OBJEXT) \ globFiles.$(OBJEXT) Database.$(OBJEXT) parseInteger.$(OBJEXT) \ split.$(OBJEXT) EventLoop.$(OBJEXT) nonblock.$(OBJEXT) \ Action.$(OBJEXT) librsbackup_a_OBJECTS = $(am_librsbackup_a_OBJECTS) am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am_rsbackup_OBJECTS = rsbackup.$(OBJEXT) PruneAge.$(OBJEXT) \ PruneNever.$(OBJEXT) PruneExec.$(OBJEXT) PruneDecay.$(OBJEXT) rsbackup_OBJECTS = $(am_rsbackup_OBJECTS) am__DEPENDENCIES_1 = rsbackup_DEPENDENCIES = librsbackup.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_test_check_OBJECTS = test-check.$(OBJEXT) test_check_OBJECTS = $(am_test_check_OBJECTS) test_check_DEPENDENCIES = librsbackup.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_command_OBJECTS = test-command.$(OBJEXT) test_command_OBJECTS = $(am_test_command_OBJECTS) test_command_DEPENDENCIES = librsbackup.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_test_confbase_OBJECTS = test-confbase.$(OBJEXT) test_confbase_OBJECTS = $(am_test_confbase_OBJECTS) test_confbase_DEPENDENCIES = librsbackup.a am_test_database_OBJECTS = test-database.$(OBJEXT) test_database_OBJECTS = $(am_test_database_OBJECTS) test_database_DEPENDENCIES = librsbackup.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_test_date_OBJECTS = test-date.$(OBJEXT) test_date_OBJECTS = $(am_test_date_OBJECTS) test_date_DEPENDENCIES = librsbackup.a am_test_device_OBJECTS = test-device.$(OBJEXT) test_device_OBJECTS = $(am_test_device_OBJECTS) test_device_DEPENDENCIES = librsbackup.a am_test_directory_OBJECTS = test-directory.$(OBJEXT) test_directory_OBJECTS = $(am_test_directory_OBJECTS) test_directory_DEPENDENCIES = librsbackup.a am_test_eventloop_OBJECTS = test-eventloop.$(OBJEXT) \ EventLoop.$(OBJEXT) test_eventloop_OBJECTS = $(am_test_eventloop_OBJECTS) test_eventloop_DEPENDENCIES = librsbackup.a am_test_globfiles_OBJECTS = test-globfiles.$(OBJEXT) test_globfiles_OBJECTS = $(am_test_globfiles_OBJECTS) test_globfiles_DEPENDENCIES = librsbackup.a am_test_host_OBJECTS = test-host.$(OBJEXT) test_host_OBJECTS = $(am_test_host_OBJECTS) test_host_DEPENDENCIES = librsbackup.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_test_io_OBJECTS = test-io.$(OBJEXT) test_io_OBJECTS = $(am_test_io_OBJECTS) test_io_DEPENDENCIES = librsbackup.a am_test_lock_OBJECTS = test-lock.$(OBJEXT) test_lock_OBJECTS = $(am_test_lock_OBJECTS) test_lock_DEPENDENCIES = librsbackup.a am_test_parseinteger_OBJECTS = test-parseinteger.$(OBJEXT) test_parseinteger_OBJECTS = $(am_test_parseinteger_OBJECTS) test_parseinteger_DEPENDENCIES = librsbackup.a am_test_progress_OBJECTS = test-progress.$(OBJEXT) test_progress_OBJECTS = $(am_test_progress_OBJECTS) test_progress_DEPENDENCIES = librsbackup.a am_test_prunedecay_OBJECTS = test-prunedecay.$(OBJEXT) \ PruneDecay.$(OBJEXT) test_prunedecay_OBJECTS = $(am_test_prunedecay_OBJECTS) test_prunedecay_DEPENDENCIES = librsbackup.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_test_select_OBJECTS = test-select.$(OBJEXT) test_select_OBJECTS = $(am_test_select_OBJECTS) test_select_DEPENDENCIES = librsbackup.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_test_split_OBJECTS = test-split.$(OBJEXT) test_split_OBJECTS = $(am_test_split_OBJECTS) test_split_DEPENDENCIES = librsbackup.a am_test_subprocess_OBJECTS = test-subprocess.$(OBJEXT) \ Subprocess.$(OBJEXT) Errors.$(OBJEXT) IO.$(OBJEXT) \ EventLoop.$(OBJEXT) nonblock.$(OBJEXT) Action.$(OBJEXT) test_subprocess_OBJECTS = $(am_test_subprocess_OBJECTS) test_subprocess_LDADD = $(LDADD) am_test_timespec_OBJECTS = test-timespec.$(OBJEXT) test_timespec_OBJECTS = $(am_test_timespec_OBJECTS) test_timespec_LDADD = $(LDADD) am_test_tolines_OBJECTS = test-tolines.$(OBJEXT) test_tolines_OBJECTS = $(am_test_tolines_OBJECTS) test_tolines_DEPENDENCIES = librsbackup.a am_test_unicode_OBJECTS = test-unicode.$(OBJEXT) test_unicode_OBJECTS = $(am_test_unicode_OBJECTS) test_unicode_DEPENDENCIES = librsbackup.a am_test_volume_OBJECTS = test-volume.$(OBJEXT) test_volume_OBJECTS = $(am_test_volume_OBJECTS) test_volume_DEPENDENCIES = librsbackup.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) SCRIPTS = $(dist_noinst_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/config.aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(librsbackup_a_SOURCES) $(rsbackup_SOURCES) \ $(test_check_SOURCES) $(test_command_SOURCES) \ $(test_confbase_SOURCES) $(test_database_SOURCES) \ $(test_date_SOURCES) $(test_device_SOURCES) \ $(test_directory_SOURCES) $(test_eventloop_SOURCES) \ $(test_globfiles_SOURCES) $(test_host_SOURCES) \ $(test_io_SOURCES) $(test_lock_SOURCES) \ $(test_parseinteger_SOURCES) $(test_progress_SOURCES) \ $(test_prunedecay_SOURCES) $(test_select_SOURCES) \ $(test_split_SOURCES) $(test_subprocess_SOURCES) \ $(test_timespec_SOURCES) $(test_tolines_SOURCES) \ $(test_unicode_SOURCES) $(test_volume_SOURCES) DIST_SOURCES = $(librsbackup_a_SOURCES) $(rsbackup_SOURCES) \ $(test_check_SOURCES) $(test_command_SOURCES) \ $(test_confbase_SOURCES) $(test_database_SOURCES) \ $(test_date_SOURCES) $(test_device_SOURCES) \ $(test_directory_SOURCES) $(test_eventloop_SOURCES) \ $(test_globfiles_SOURCES) $(test_host_SOURCES) \ $(test_io_SOURCES) $(test_lock_SOURCES) \ $(test_parseinteger_SOURCES) $(test_progress_SOURCES) \ $(test_prunedecay_SOURCES) $(test_select_SOURCES) \ $(test_split_SOURCES) $(test_subprocess_SOURCES) \ $(test_timespec_SOURCES) $(test_tolines_SOURCES) \ $(test_unicode_SOURCES) $(test_volume_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/config.aux/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/config.aux/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_LIBS = @BOOST_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GCOV = @GCOV@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBPTHREAD = @LIBPTHREAD@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ LYX_TARGETS = @LYX_TARGETS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ SQLITE3_LIBS = @SQLITE3_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. # # 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 . noinst_LIBRARIES = librsbackup.a dist_noinst_SCRIPTS = check-source AM_CFLAGS = $(SQLITE3_CFLAGS) librsbackup_a_SOURCES = Backup.cc BulkRemove.cc Check.cc Command.cc \ Conf.cc \ Date.cc DeviceAccess.cc Device.cc Directory.cc Document.cc Email.cc \ error.cc Errors.cc FileLock.cc Host.cc HTML.cc IO.cc MakeBackup.cc \ Progress.cc Prune.h Prune.cc Report.cc \ RetireDevices.cc RetireVolumes.cc Store.cc stylesheet.cc \ Subprocess.cc Text.cc Unicode.cc Volume.cc Command.h Conf.h Date.h \ Defaults.h DeviceAccess.h Document.h Email.h Errors.h FileLock.h IO.h \ rsbackup.h Store.h Subprocess.h Utils.h ConfBase.cc \ toLines.cc globFiles.cc Database.h Database.cc Report.h \ parseInteger.cc split.cc EventLoop.cc EventLoop.h nonblock.cc \ Action.cc Action.h BulkRemove.h rsbackup_SOURCES = rsbackup.cc PruneAge.cc PruneNever.cc PruneExec.cc \ PruneDecay.cc rsbackup_LDADD = librsbackup.a $(SQLITE3_LIBS) $(BOOST_LIBS) test_date_SOURCES = test-date.cc test_date_LDADD = librsbackup.a test_subprocess_SOURCES = test-subprocess.cc Subprocess.cc Errors.cc IO.cc \ EventLoop.cc nonblock.cc Action.cc test_unicode_SOURCES = test-unicode.cc test_unicode_LDADD = librsbackup.a test_io_SOURCES = test-io.cc test_io_LDADD = librsbackup.a test_directory_SOURCES = test-directory.cc test_directory_LDADD = librsbackup.a test_timespec_SOURCES = test-timespec.cc test_command_SOURCES = test-command.cc test_command_LDADD = librsbackup.a $(SQLITE3_LIBS) $(BOOST_LIBS) test_select_SOURCES = test-select.cc test_select_LDADD = librsbackup.a $(SQLITE3_LIBS) $(BOOST_LIBS) test_confbase_SOURCES = test-confbase.cc test_confbase_LDADD = librsbackup.a test_check_SOURCES = test-check.cc test_check_LDADD = librsbackup.a $(LIBPTHREAD) $(SQLITE3_LIBS) $(BOOST_LIBS) test_device_SOURCES = test-device.cc test_device_LDADD = librsbackup.a test_host_SOURCES = test-host.cc test_host_LDADD = librsbackup.a $(SQLITE3_LIBS) $(BOOST_LIBS) test_volume_SOURCES = test-volume.cc test_volume_LDADD = librsbackup.a $(SQLITE3_LIBS) $(BOOST_LIBS) test_progress_SOURCES = test-progress.cc test_progress_LDADD = librsbackup.a test_database_SOURCES = test-database.cc test_database_LDADD = librsbackup.a $(SQLITE3_LIBS) $(BOOST_LIBS) test_tolines_SOURCES = test-tolines.cc test_tolines_LDADD = librsbackup.a test_globfiles_SOURCES = test-globfiles.cc test_globfiles_LDADD = librsbackup.a test_lock_SOURCES = test-lock.cc test_lock_LDADD = librsbackup.a test_split_SOURCES = test-split.cc test_split_LDADD = librsbackup.a test_parseinteger_SOURCES = test-parseinteger.cc test_parseinteger_LDADD = librsbackup.a test_prunedecay_SOURCES = test-prunedecay.cc PruneDecay.cc test_prunedecay_LDADD = librsbackup.a $(SQLITE3_LIBS) $(BOOST_LIBS) test_eventloop_SOURCES = test-eventloop.cc EventLoop.cc test_eventloop_LDADD = librsbackup.a all: all-am .SUFFIXES: .SUFFIXES: .cc .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) librsbackup.a: $(librsbackup_a_OBJECTS) $(librsbackup_a_DEPENDENCIES) $(EXTRA_librsbackup_a_DEPENDENCIES) $(AM_V_at)-rm -f librsbackup.a $(AM_V_AR)$(librsbackup_a_AR) librsbackup.a $(librsbackup_a_OBJECTS) $(librsbackup_a_LIBADD) $(AM_V_at)$(RANLIB) librsbackup.a install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) rsbackup$(EXEEXT): $(rsbackup_OBJECTS) $(rsbackup_DEPENDENCIES) $(EXTRA_rsbackup_DEPENDENCIES) @rm -f rsbackup$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(rsbackup_OBJECTS) $(rsbackup_LDADD) $(LIBS) test-check$(EXEEXT): $(test_check_OBJECTS) $(test_check_DEPENDENCIES) $(EXTRA_test_check_DEPENDENCIES) @rm -f test-check$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_check_OBJECTS) $(test_check_LDADD) $(LIBS) test-command$(EXEEXT): $(test_command_OBJECTS) $(test_command_DEPENDENCIES) $(EXTRA_test_command_DEPENDENCIES) @rm -f test-command$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_command_OBJECTS) $(test_command_LDADD) $(LIBS) test-confbase$(EXEEXT): $(test_confbase_OBJECTS) $(test_confbase_DEPENDENCIES) $(EXTRA_test_confbase_DEPENDENCIES) @rm -f test-confbase$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_confbase_OBJECTS) $(test_confbase_LDADD) $(LIBS) test-database$(EXEEXT): $(test_database_OBJECTS) $(test_database_DEPENDENCIES) $(EXTRA_test_database_DEPENDENCIES) @rm -f test-database$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_database_OBJECTS) $(test_database_LDADD) $(LIBS) test-date$(EXEEXT): $(test_date_OBJECTS) $(test_date_DEPENDENCIES) $(EXTRA_test_date_DEPENDENCIES) @rm -f test-date$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_date_OBJECTS) $(test_date_LDADD) $(LIBS) test-device$(EXEEXT): $(test_device_OBJECTS) $(test_device_DEPENDENCIES) $(EXTRA_test_device_DEPENDENCIES) @rm -f test-device$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_device_OBJECTS) $(test_device_LDADD) $(LIBS) test-directory$(EXEEXT): $(test_directory_OBJECTS) $(test_directory_DEPENDENCIES) $(EXTRA_test_directory_DEPENDENCIES) @rm -f test-directory$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_directory_OBJECTS) $(test_directory_LDADD) $(LIBS) test-eventloop$(EXEEXT): $(test_eventloop_OBJECTS) $(test_eventloop_DEPENDENCIES) $(EXTRA_test_eventloop_DEPENDENCIES) @rm -f test-eventloop$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_eventloop_OBJECTS) $(test_eventloop_LDADD) $(LIBS) test-globfiles$(EXEEXT): $(test_globfiles_OBJECTS) $(test_globfiles_DEPENDENCIES) $(EXTRA_test_globfiles_DEPENDENCIES) @rm -f test-globfiles$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_globfiles_OBJECTS) $(test_globfiles_LDADD) $(LIBS) test-host$(EXEEXT): $(test_host_OBJECTS) $(test_host_DEPENDENCIES) $(EXTRA_test_host_DEPENDENCIES) @rm -f test-host$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_host_OBJECTS) $(test_host_LDADD) $(LIBS) test-io$(EXEEXT): $(test_io_OBJECTS) $(test_io_DEPENDENCIES) $(EXTRA_test_io_DEPENDENCIES) @rm -f test-io$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_io_OBJECTS) $(test_io_LDADD) $(LIBS) test-lock$(EXEEXT): $(test_lock_OBJECTS) $(test_lock_DEPENDENCIES) $(EXTRA_test_lock_DEPENDENCIES) @rm -f test-lock$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_lock_OBJECTS) $(test_lock_LDADD) $(LIBS) test-parseinteger$(EXEEXT): $(test_parseinteger_OBJECTS) $(test_parseinteger_DEPENDENCIES) $(EXTRA_test_parseinteger_DEPENDENCIES) @rm -f test-parseinteger$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_parseinteger_OBJECTS) $(test_parseinteger_LDADD) $(LIBS) test-progress$(EXEEXT): $(test_progress_OBJECTS) $(test_progress_DEPENDENCIES) $(EXTRA_test_progress_DEPENDENCIES) @rm -f test-progress$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_progress_OBJECTS) $(test_progress_LDADD) $(LIBS) test-prunedecay$(EXEEXT): $(test_prunedecay_OBJECTS) $(test_prunedecay_DEPENDENCIES) $(EXTRA_test_prunedecay_DEPENDENCIES) @rm -f test-prunedecay$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_prunedecay_OBJECTS) $(test_prunedecay_LDADD) $(LIBS) test-select$(EXEEXT): $(test_select_OBJECTS) $(test_select_DEPENDENCIES) $(EXTRA_test_select_DEPENDENCIES) @rm -f test-select$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_select_OBJECTS) $(test_select_LDADD) $(LIBS) test-split$(EXEEXT): $(test_split_OBJECTS) $(test_split_DEPENDENCIES) $(EXTRA_test_split_DEPENDENCIES) @rm -f test-split$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_split_OBJECTS) $(test_split_LDADD) $(LIBS) test-subprocess$(EXEEXT): $(test_subprocess_OBJECTS) $(test_subprocess_DEPENDENCIES) $(EXTRA_test_subprocess_DEPENDENCIES) @rm -f test-subprocess$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_subprocess_OBJECTS) $(test_subprocess_LDADD) $(LIBS) test-timespec$(EXEEXT): $(test_timespec_OBJECTS) $(test_timespec_DEPENDENCIES) $(EXTRA_test_timespec_DEPENDENCIES) @rm -f test-timespec$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_timespec_OBJECTS) $(test_timespec_LDADD) $(LIBS) test-tolines$(EXEEXT): $(test_tolines_OBJECTS) $(test_tolines_DEPENDENCIES) $(EXTRA_test_tolines_DEPENDENCIES) @rm -f test-tolines$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_tolines_OBJECTS) $(test_tolines_LDADD) $(LIBS) test-unicode$(EXEEXT): $(test_unicode_OBJECTS) $(test_unicode_DEPENDENCIES) $(EXTRA_test_unicode_DEPENDENCIES) @rm -f test-unicode$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_unicode_OBJECTS) $(test_unicode_LDADD) $(LIBS) test-volume$(EXEEXT): $(test_volume_OBJECTS) $(test_volume_DEPENDENCIES) $(EXTRA_test_volume_DEPENDENCIES) @rm -f test-volume$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_volume_OBJECTS) $(test_volume_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Action.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Backup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BulkRemove.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Check.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Command.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Conf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ConfBase.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Database.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Date.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Device.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DeviceAccess.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Directory.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Document.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Email.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Errors.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EventLoop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FileLock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HTML.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Host.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IO.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MakeBackup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Progress.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Prune.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PruneAge.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PruneDecay.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PruneExec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PruneNever.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Report.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RetireDevices.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RetireVolumes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Store.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Subprocess.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Text.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Unicode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Volume.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/globFiles.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonblock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parseInteger.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsbackup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/split.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stylesheet.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-check.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-command.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-confbase.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-database.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-date.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-device.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-directory.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-eventloop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-globfiles.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-host.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-io.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-lock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-parseinteger.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-progress.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-prunedecay.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-select.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-split.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-subprocess.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-timespec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-tolines.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-unicode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-volume.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/toLines.Po@am__quote@ .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ else \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test-date.log: test-date$(EXEEXT) @p='test-date$(EXEEXT)'; \ b='test-date'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-io.log: test-io$(EXEEXT) @p='test-io$(EXEEXT)'; \ b='test-io'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-directory.log: test-directory$(EXEEXT) @p='test-directory$(EXEEXT)'; \ b='test-directory'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-subprocess.log: test-subprocess$(EXEEXT) @p='test-subprocess$(EXEEXT)'; \ b='test-subprocess'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-unicode.log: test-unicode$(EXEEXT) @p='test-unicode$(EXEEXT)'; \ b='test-unicode'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-timespec.log: test-timespec$(EXEEXT) @p='test-timespec$(EXEEXT)'; \ b='test-timespec'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-command.log: test-command$(EXEEXT) @p='test-command$(EXEEXT)'; \ b='test-command'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-select.log: test-select$(EXEEXT) @p='test-select$(EXEEXT)'; \ b='test-select'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-confbase.log: test-confbase$(EXEEXT) @p='test-confbase$(EXEEXT)'; \ b='test-confbase'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-check.log: test-check$(EXEEXT) @p='test-check$(EXEEXT)'; \ b='test-check'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-device.log: test-device$(EXEEXT) @p='test-device$(EXEEXT)'; \ b='test-device'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-host.log: test-host$(EXEEXT) @p='test-host$(EXEEXT)'; \ b='test-host'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-volume.log: test-volume$(EXEEXT) @p='test-volume$(EXEEXT)'; \ b='test-volume'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-progress.log: test-progress$(EXEEXT) @p='test-progress$(EXEEXT)'; \ b='test-progress'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-database.log: test-database$(EXEEXT) @p='test-database$(EXEEXT)'; \ b='test-database'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-tolines.log: test-tolines$(EXEEXT) @p='test-tolines$(EXEEXT)'; \ b='test-tolines'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-globfiles.log: test-globfiles$(EXEEXT) @p='test-globfiles$(EXEEXT)'; \ b='test-globfiles'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-lock.log: test-lock$(EXEEXT) @p='test-lock$(EXEEXT)'; \ b='test-lock'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-split.log: test-split$(EXEEXT) @p='test-split$(EXEEXT)'; \ b='test-split'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-parseinteger.log: test-parseinteger$(EXEEXT) @p='test-parseinteger$(EXEEXT)'; \ b='test-parseinteger'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-prunedecay.log: test-prunedecay$(EXEEXT) @p='test-prunedecay$(EXEEXT)'; \ b='test-prunedecay'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-eventloop.log: test-eventloop$(EXEEXT) @p='test-eventloop$(EXEEXT)'; \ b='test-eventloop'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) check-source.log: check-source @p='check-source'; \ b='check-source'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS stylesheet.cc: ${top_srcdir}/doc/rsbackup.css ${top_srcdir}/scripts/txt2src stylesheet < $^ > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: rsbackup-3.0/src/Report.cc0000644000175000017500000002771612626341243012500 00000000000000// Copyright © 2011-2015 Richard Kettlewell. // // 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 . #include #include "rsbackup.h" #include "Document.h" #include "Conf.h" #include "Command.h" #include "IO.h" #include "Database.h" #include "Report.h" #include "Utils.h" #include #include #include #include // Split up a color into RGB components void Report::unpackColor(unsigned color, int rgb[3]) { rgb[0] = (color >> 16) & 255; rgb[1] = (color >> 8) & 255; rgb[2] = color & 255; } // Pack a color from RGB components unsigned Report::packColor(const int rgb[3]) { return rgb[0] * 65536 + rgb[1] * 256 + rgb[2]; } // Pick a color as a (clamped) linear combination of two endpoints unsigned Report::pickColor(unsigned zero, unsigned one, double param) { int zeroRgb[3], oneRgb[3], resultRgb[3]; unpackColor(zero, zeroRgb); unpackColor(one, oneRgb); if(param < 0) param = 0; if(param > 1) param = 1; resultRgb[0] = zeroRgb[0] * (1 - param) + oneRgb[0] * param; resultRgb[1] = zeroRgb[1] * (1 - param) + oneRgb[1] * param; resultRgb[2] = zeroRgb[2] * (1 - param) + oneRgb[2] * param; return packColor(resultRgb); } // Generate the list of warnings void Report::reportWarnings() { char buffer[1024]; Document::List *l = new Document::List(); for(auto &d: config.unknownDevices) { l->entry("Unknown device " + d); ++devices_unknown; } for(auto &h: config.unknownHosts) { l->entry("Unknown host " + h); ++hosts_unknown; } for(auto &h: config.hosts) { const std::string &hostName = h.first; Host *host = h.second; for(auto &v: host->unknownVolumes) { l->entry("Unknown volume " + v + " on host " + hostName); ++volumes_unknown; } } if(backups_missing) { snprintf(buffer, sizeof buffer, "WARNING: %d volumes have no backups.", backups_missing); l->entry(buffer); } if(backups_partial) { snprintf(buffer, sizeof buffer, "WARNING: %d volumes are not fully backed up.", backups_partial); l->entry(buffer); } if(backups_out_of_date) { snprintf(buffer, sizeof buffer, "WARNING: %d volumes are out of date.", backups_out_of_date); l->entry(buffer); } if(backups_failed) { snprintf(buffer, sizeof buffer, "WARNING: %d volumes failed latest backup.", backups_failed); l->entry(buffer); } if(l->nodes.size() > 0) { d.heading("Warnings", 2); d.append(l); } else delete l; } // Generate the summary table Document::Table *Report::reportSummary() { Document::Table *t = new Document::Table(); t->addHeadingCell(new Document::Cell("Host", 1, 3)); t->addHeadingCell(new Document::Cell("Volume", 1, 3)); t->addHeadingCell(new Document::Cell("Oldest", 1, 3)); t->addHeadingCell(new Document::Cell("Total", 1, 3)); t->addHeadingCell(new Document::Cell("Devices", 2 * config.devices.size(), 1)); t->newRow(); for(auto &d: config.devices) t->addHeadingCell(new Document::Cell(d.second->name, 2, 1)); t->newRow(); for(auto attribute((unused)) &d: config.devices) { t->addHeadingCell(new Document::Cell("Newest")); t->addHeadingCell(new Document::Cell("Count")); } t->newRow(); for(auto &h: config.hosts) { Host *host = h.second; t->addCell(new Document::Cell(host->name, 1, host->volumes.size())) ->style = "host"; for(auto &v: host->volumes) { Volume *volume = v.second; // See if every device has a backup bool missingDevice = false; for(auto &d: config.devices) { Device *device = d.second; if(!contains(volume->perDevice, device->name)) missingDevice = true; } t->addCell(new Document::Cell(volume->name)) ->style = "volume"; t->addCell(new Document::Cell(volume->oldest != Date() ? volume->oldest.toString() : "none")); t->addCell(new Document::Cell(new Document::String(volume->completed))) ->style = missingDevice ? "bad" : "good"; bool out_of_date = true; size_t devices_used = 0; for(auto &d: config.devices) { const Device *device = d.second; Volume::PerDevice &perDevice = volume->perDevice[device->name]; if(perDevice.count) { // At least one successful backups Document::Cell *c = t->addCell(new Document::Cell(perDevice.newest.toString())); int newestAge = Date::today() - perDevice.newest; if(newestAge <= volume->maxAge) { double param = (pow(2, (double)newestAge / volume->maxAge) - 1) / 2.0; c->bgcolor = pickColor(config.colorGood, config.colorBad, param); out_of_date = false; } else { c->style = "bad"; } ++devices_used; } else { // No succesful backups! t->addCell(new Document::Cell("none")) ->style = "bad"; } t->addCell(new Document::Cell(new Document::String(perDevice.count))) ->style = perDevice.count ? "good" : "bad"; // Look for the most recent attempt at this device const Backup *most_recent_backup = nullptr; for(const Backup *b: boost::adaptors::reverse(volume->backups)) { if(b->getStatus() == COMPLETE && b->deviceName == device->name) { most_recent_backup = b; break; } } if(most_recent_backup && most_recent_backup->rc != 0) ++backups_failed; } if(devices_used < config.devices.size()) { if(devices_used == 0) ++backups_missing; else ++backups_partial; } else if(out_of_date) ++backups_out_of_date; t->newRow(); } } return t; } // Return true if this is a suitable log for the report bool Report::suitableLog(const Volume *volume, const Backup *backup) { // Empty logs are never shown. if(!backup->contents.size()) return false; switch(command.logVerbosity) { case Command::All: // Show everything return true; case Command::Errors: // Show all error logs return backup->rc != 0; case Command::Recent: // Show the most recent error log for the device return backup == volume->mostRecentFailedBackup(backup->getDevice()); case Command::Latest: // Show the most recent logfile for the device return backup == volume->mostRecentBackup(backup->getDevice()); case Command::Failed: // Show the most recent logfile for the device, if it is an error return (backup->rc && backup == volume->mostRecentBackup(backup->getDevice())); default: throw std::logic_error("unknown log verbosity"); } } // Generate the report of backup logfiles for a volume void Report::reportLogs(const Volume *volume) { Document::LinearContainer *lc = nullptr; Host *host = volume->parent; // Backups for a volume are ordered primarily by date and secondarily by // device. The most recent backups are the most interesting so they are // displayed in reverse. std::set devicesSeen; for(const Backup *backup: boost::adaptors::reverse(volume->backups)) { // Only include logs of failed backups if(suitableLog(volume, backup)) { if(!lc) { d.heading("Host " + host->name + " volume " + volume->name + " (" + volume->path + ")", 3); lc = new Document::LinearContainer(); lc->style = "volume"; d.append(lc); } Document::Heading *heading = new Document::Heading(backup->date.toString() + " device " + backup->deviceName + " volume " + backup->volume->parent->name + ":" + backup->volume->name, 4); if(!contains(devicesSeen, backup->deviceName)) heading->style = "recent"; lc->append(heading); Document::Verbatim *v = new Document::Verbatim(); v->style = "log"; v->append(backup->contents); lc->append(v); } devicesSeen.insert(backup->deviceName); } } // Generate the report of backup logfiles for everything void Report::reportLogs() { // Sort by host/volume first, then date, device *last* for(auto &h: config.hosts) { Host *host = h.second; for(auto &v: host->volumes) { Volume *volume = v.second; reportLogs(volume); } } } // Generate the report of pruning logfiles Document::Node *Report::reportPruneLogs() { Document::Table *t = new Document::Table(); t->addHeadingCell(new Document::Cell("Created", 1, 1)); t->addHeadingCell(new Document::Cell("Pruned", 1, 1)); t->addHeadingCell(new Document::Cell("Host", 1, 1)); t->addHeadingCell(new Document::Cell("Volume", 1, 1)); t->addHeadingCell(new Document::Cell("Device", 1, 1)); t->addHeadingCell(new Document::Cell("Reason", 1, 1)); t->newRow(); const int64_t cutoff = Date::now() - 86400 * config.reportPruneLogs; Database::Statement stmt(config.getdb(), "SELECT host,volume,device,time,pruned,log" " FROM backup" " WHERE (status=? OR status=?) AND pruned >= ?" " ORDER BY pruned DESC", SQL_INT, PRUNING, SQL_INT, PRUNED, SQL_INT64, cutoff, SQL_END); while(stmt.next()) { Backup backup; char timestr[64]; std::string hostName = stmt.get_string(0); std::string volumeName = stmt.get_string(1); std::string deviceName = stmt.get_string(2); time_t when = stmt.get_int64(3); time_t pruned = stmt.get_int64(4); std::string reason = stmt.get_blob(5); strftime(timestr, sizeof timestr, "%Y-%m-%d", localtime(&when)); t->addCell(new Document::Cell(timestr)); strftime(timestr, sizeof timestr, "%Y-%m-%d", localtime(&pruned)); t->addCell(new Document::Cell(timestr)); t->addCell(new Document::Cell(hostName)); t->addCell(new Document::Cell(volumeName)); t->addCell(new Document::Cell(deviceName)); t->addCell(new Document::Cell(reason)); t->newRow(); } return t; } // Generate the full report void Report::generate() { backups_missing = 0; backups_partial = 0; backups_out_of_date = 0; backups_failed = 0; devices_unknown = 0; hosts_unknown = 0; volumes_unknown = 0; d.title = "Backup report (" + Date::today().toString() + ")"; d.heading(d.title); /* Generating the summary has a side effect of filling in the summary * counters */ Document::Table *report = reportSummary(); // Unknown objects ---------------------------------------------------------- reportWarnings(); // Summary table ------------------------------------------------------------ d.heading("Summary", 2); d.append(report); // Logfiles ----------------------------------------------------------------- d.heading("Logfiles", 2); reportLogs(); // Prune logs --------------------------------------------------------------- d.heading("Pruning logs", 3); // TODO anchor d.append(reportPruneLogs()); // Generation time ---------------------------------------------------------- Document::Paragraph *p = d.para("Generated "); if(getenv("RSBACKUP_TODAY")) p->append(new Document::String("")); else { time_t now; time(&now); p->append(new Document::String(ctime(&now))); } } rsbackup-3.0/src/Errors.cc0000664000175000017500000000356412450336324012475 00000000000000// Copyright © 2011, 2012, 2014 Richard Kettlewell. // // 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 . #include #include "Errors.h" #include #include #include #include #if HAVE_EXECINFO_H # include #endif std::string SubprocessFailed::format(const std::string &name, int wstat) { if(WIFSIGNALED(wstat)) { int sig = WTERMSIG(wstat); return (name + ": " + strsignal(sig) + (WCOREDUMP(wstat) ? " (core dumped)" : "")); } else if(WIFSTOPPED(wstat)) { int sig = WSTOPSIG(wstat); return (name + ": " + strsignal(sig)); } else if(WIFEXITED(wstat)) { char buffer[64]; int rc = WEXITSTATUS(wstat); snprintf(buffer, sizeof buffer, "%d", rc); return (name + ": exited with status " + buffer); } else { char buffer[64]; snprintf(buffer, sizeof buffer, "%#x", wstat); return (name + ": exited with wait status " + buffer); } } Error::Error(const std::string &msg): std::runtime_error(msg) { #if HAVE_EXECINFO_H stacksize = backtrace(stack, sizeof stack / sizeof *stack); #endif } void Error::trace(FILE *fp) { #if HAVE_EXECINFO_H char **names = backtrace_symbols(stack, stacksize); for(int i = 0; i < stacksize; ++i) fprintf(fp, "%s\n", names[i]); free(names); #endif } rsbackup-3.0/src/ConfBase.cc0000664000175000017500000001003612621677062012700 00000000000000// Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. // // 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 . #include #include "rsbackup.h" #include "Conf.h" #include "Utils.h" #include #include std::string ConfBase::quote(const std::string &s) { bool need_quote = false; if(!s.size()) need_quote = true; else if(s[0] == '#') need_quote = true; else { for(auto c: s) { if(isspace(c)) need_quote = true; if(c == '\\' || c == '"') need_quote = true; } } if(!need_quote) return s; std::stringstream ss; ss << '"'; for(auto c: s) { if(c == '\\' || c == '"') ss << '\\'; ss << c; } ss << '"'; return ss.str(); } std::string ConfBase::quote(const std::vector &vs) { std::stringstream ss; for(size_t n = 0; n < vs.size(); ++n) { if(n) ss << ' '; ss << quote(vs[n]); } return ss.str();} std::string ConfBase::indent(int step) { return std::string(step, ' '); } void ConfBase::write(std::ostream &os, int step, bool verbose) const { describe_type *d = verbose && !getParent() ? describe : nodescribe; d(os, "# Maximum time with no backups before flagging host in report", step); d(os, "# max-age DAYS", step); os << indent(step) << "max-age " << maxAge << '\n'; d(os, "", 0); d(os, "# Prune policy for this " + what(), step); d(os, "# prune-policy age|decay|exec|never", step); os << indent(step) << "prune-policy " << prunePolicy << '\n'; d(os, "", 0); d(os, "# Prune parameters", step); d(os, "# prune-parameter NAME VALUE", step); d(os, "# prune-parameter --remove NAME", step); for(auto &p: pruneParameters) os << indent(step) << "prune-parameter " << quote(p.first) << ' ' << quote(p.second) << '\n'; // Any parameters set in our parent but not present here must have been // removed. ConfBase *parent = getParent(); if(parent) for(auto &p: parent->pruneParameters) if(!contains(pruneParameters, p.first)) os << indent(step) << "prune-parameter --remove " << quote(p.first) << '\n'; d(os, "", 0); d(os, "# Command to run prior to making a backup", step); d(os, "# pre-backup-hook COMMAND ...", step); if(preBackup.size()) os << indent(step) << "pre-backup-hook " << quote(preBackup) << '\n'; d(os, "", 0); d(os, "# Command to run after making a backup", step); d(os, "# post-backup-hook COMMAND ...", step); if(postBackup.size()) os << indent(step) << "post-backup-hook " << quote(postBackup) << '\n'; d(os, "", 0); d(os, "# Maximum time to wait for rsync to complete", step); d(os, "# rsync-timeout SECONDS", step); if(rsyncTimeout) os << indent(step) << "rsync-timeout " << rsyncTimeout << '\n'; d(os, "", 0); d(os, "# Maximum time to wait before giving up on a host", step); d(os, "# ssh-timeout SECONDS", step); os << indent(step) << "ssh-timeout " << sshTimeout << '\n'; d(os, "", 0); d(os, "# Maximum time to wait for a hook to complete", step); d(os, "# hook-timeout SECONDS", step); if(hookTimeout) os << indent(step) << "hook-timeout " << hookTimeout << '\n'; d(os, "", 0); } void ConfBase::describe(std::ostream &os, const std::string &description, int step) { if(description.size()) os << indent(step) << description; os << '\n'; } void ConfBase::nodescribe(std::ostream &, const std::string &, int) { } rsbackup-3.0/src/Backup.cc0000644000175000017500000000642212626351237012425 00000000000000// Copyright © 2011, 2014, 2015 Richard Kettlewell. // // 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 . #include #include "Conf.h" #include "Store.h" #include "Database.h" #include #include // Return the path to this backup std::string Backup::backupPath() const { const Host *host = volume->parent; const Device *device = host->parent->findDevice(deviceName); const Store *store = device->store; assert(store != nullptr); return (store->path + PATH_SEP + host->name + PATH_SEP + volume->name + PATH_SEP + id); } void Backup::insert(Database &db, bool replace) const { const std::string command = replace ? "INSERT OR REPLACE" : "INSERT"; Database::Statement(db, (command + " INTO backup" " (host,volume,device,id,time,pruned,rc,status,log)" " VALUES (?,?,?,?,?,?,?,?,?)").c_str(), SQL_STRING, &volume->parent->name, SQL_STRING, &volume->name, SQL_STRING, &deviceName, SQL_STRING, &id, SQL_INT64, (sqlite_int64)time, SQL_INT64, (sqlite_int64)pruned, SQL_INT, rc, SQL_INT, status, SQL_STRING, &contents, SQL_END).next(); } void Backup::update(Database &db) const { Database::Statement(db, "UPDATE backup SET rc=?,status=?,log=?,time=?,pruned=?" " WHERE host=? AND volume=? AND device=? AND id=?", SQL_INT, rc, SQL_INT, status, SQL_STRING, &contents, SQL_INT64, (sqlite_int64)time, SQL_INT64, (sqlite_int64)pruned, SQL_STRING, &volume->parent->name, SQL_STRING, &volume->name, SQL_STRING, &deviceName, SQL_STRING, &id, SQL_END).next(); } void Backup::remove(Database &db) const { Database::Statement(db, "DELETE FROM backup" " WHERE host=? AND volume=? AND device=? AND id=?", SQL_STRING, &volume->parent->name, SQL_STRING, &volume->name, SQL_STRING, &deviceName, SQL_STRING, &id, SQL_END).next(); } void Backup::setStatus(int n) { if(status != n) { status = n; if(volume) volume->calculate(); } } const char *const backup_status_names[] = { "unknown", "underway", "complete", "failed", "pruning", "pruned" }; rsbackup-3.0/src/EventLoop.cc0000664000175000017500000001321012621702266013123 00000000000000// Copyright © 2015 Richard Kettlewell. // // 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 . #include #include "Utils.h" #include "EventLoop.h" #include "Errors.h" #include #include #include #include #include #include #include void Reactor::onReadable(EventLoop *, int, const void *, size_t) { throw std::logic_error("Reactor::onReadable"); } void Reactor::onReadError(EventLoop *, int, int) { throw std::logic_error("Reactor::onReadError"); } void Reactor::onWritable(EventLoop *, int) { throw std::logic_error("Reactor::onWritable"); } void Reactor::onTimeout(EventLoop *, const struct timespec &) { throw std::logic_error("Reactor::onTimeout"); } void Reactor::onWait(EventLoop *, pid_t, int, const struct rusage &) { throw std::logic_error("Reactor::onWait"); } EventLoop::EventLoop() { if(sigpipe[0] >= 0) throw std::logic_error("EventLoop::EventLoop"); struct sigaction sa; sigset_t ss; sigemptyset(&ss); sigaddset(&ss, SIGCHLD); if(sigprocmask(SIG_BLOCK, &ss, nullptr) < 0) throw SystemError("sigprocmask", errno); sa.sa_handler = EventLoop::signalled; sigfillset(&sa.sa_mask); sa.sa_flags = SA_RESTART; if(sigaction(SIGCHLD, &sa, nullptr) < 0) throw SystemError("sigaction", errno); if(pipe(sigpipe) < 0) throw SystemError("pipe", errno); nonblock(sigpipe[0]); nonblock(sigpipe[1]); whenReadable(sigpipe[0], this); } EventLoop::~EventLoop() { sigset_t ss; signal(SIGCHLD, SIG_DFL); sigemptyset(&ss); sigaddset(&ss, SIGCHLD); if(sigprocmask(SIG_UNBLOCK, &ss, nullptr) < 0) throw SystemError("sigprocmask", errno); close(sigpipe[0]); close(sigpipe[1]); sigpipe[0] = sigpipe[1] = -1; } void EventLoop::signalled(int) { int save_errno = errno; ssize_t written = write(sigpipe[1], "", 1); (void)written; errno = save_errno; } int EventLoop::sigpipe[2] = { -1, -1 }; void EventLoop::whenReadable(int fd, Reactor *r) { readers[fd] = r; reconf = true; } void EventLoop::cancelRead(int fd) { readers.erase(fd); reconf = true; } void EventLoop::whenWritable(int fd, Reactor *r) { writers[fd] = r; reconf = true; } void EventLoop::cancelWrite(int fd) { writers.erase(fd); reconf = true; } void EventLoop::whenTimeout(const struct timespec &t, Reactor *r) { timeouts.insert({t, r}); reconf = true; } void EventLoop::whenWaited(pid_t pid, Reactor *r) { waiters[pid] = r; reconf = true; } void EventLoop::wait() { sigset_t ss; if(sigprocmask(SIG_SETMASK, nullptr, &ss) < 0) throw SystemError("sigprocmask", errno); sigdelset(&ss, SIGCHLD); while(readers.size() > 1 || writers.size() > 0 || waiters.size() > 0) { fd_set rfds, wfds; struct timespec ts, *tsp; int maxfd = -1, n; if(timeouts.size() > 0) { auto it = timeouts.begin(); struct timespec now, first = it->first; getTimestamp(now); if(now >= first) { Reactor *r = it->second; timeouts.erase(it); r->onTimeout(this, now); continue; } ts = first - now; if(ts.tv_sec >= 10) ts.tv_sec = 10; tsp = &ts; } else tsp = nullptr; FD_ZERO(&rfds); FD_ZERO(&wfds); for(auto &r: readers) { int fd = r.first; FD_SET(fd, &rfds); maxfd = std::max(maxfd, fd); } for(auto &w: writers) { int fd = w.first; FD_SET(fd, &wfds); maxfd = std::max(maxfd, fd); } n = pselect(maxfd + 1, &rfds, &wfds, nullptr, tsp, &ss); if(n < 0) { if(errno != EINTR) throw IOError("pselect", errno); } else if(n > 0) { reconf = false; for(auto &r: readers) { int fd = r.first; if(FD_ISSET(fd, &rfds)) { char buffer[4096]; ssize_t nbytes = read(fd, buffer, sizeof buffer); if(nbytes < 0) { if(errno == EINTR || errno == EAGAIN) continue; r.second->onReadError(this, fd, errno); } else r.second->onReadable(this, fd, buffer, nbytes); if(reconf) break; } } for(auto &w: writers) { int fd = w.first; if(FD_ISSET(fd, &wfds)) { w.second->onWritable(this, fd); if(reconf) break; } } } } } void EventLoop::onReadable(EventLoop *, int, const void *, size_t) { pid_t pid; struct rusage ru; int status; while(waiters.size() > 0) { pid = wait4(-1, &status, WNOHANG, &ru); if(pid < 0) { if(errno != EINTR) throw SystemError("wait4", errno); } if(pid <= 0) return; auto it = waiters.find(pid); if(it != waiters.end()) { Reactor *r = it->second; waiters.erase(it); r->onWait(this, pid, status, ru); } } } void EventLoop::getTimestamp(struct timespec &now) { #ifdef CLOCK_MONOTONIC if(clock_gettime(CLOCK_MONOTONIC, &now) < 0) throw IOError("clock_gettime", errno); #else struct timeval tv; if(gettimeofday(&tv, nullptr) < 0) throw IOError("gettimeofday", errno); now.tv_sec = tv.tv_sec; now.tv_nsec = tv.tv_sec * 1000; #endif } rsbackup-3.0/src/test-globfiles.cc0000664000175000017500000000376512452265667014164 00000000000000// Copyright © 2015 Richard Kettlewell. // // 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 . #include #include "Utils.h" #include #include #include #include #include #include void create(const char *path) { int fd = open(path, O_WRONLY|O_CREAT, 0666); assert(fd >= 0); close(fd); } int main() { const char *tmpdir; char *dir; std::vector files; tmpdir = getenv("TMPDIR"); if(!tmpdir) tmpdir = "/tmp"; assert(asprintf(&dir, "%s/XXXXXX", tmpdir) > 0); assert(mkdtemp(dir)); assert(chdir(dir) >= 0); globFiles(files, "nothing", 0); assert(files.size() == 0); files.push_back("spong"); globFiles(files, "nothing", 0); assert(files.size() == 0); globFiles(files, "*", 0); assert(files.size() == 0); globFiles(files, "*", GLOB_NOCHECK); assert(files.size() == 1); assert(files[0] == "*"); create("a"); globFiles(files, "*", 0); assert(files.size() == 1); assert(files[0] == "a"); globFiles(files, "b", 0); assert(files.size() == 0); create("b"); globFiles(files, "*", 0); assert(files.size() == 2); assert(files[0] == "a"); assert(files[1] == "b"); globFiles(files, "b", 0); assert(files.size() == 1); assert(files[0] == "b"); int r = system(("rm -rf " + (std::string)dir).c_str()); (void)r; // Work around GCC/Glibc stupidity return 0; } rsbackup-3.0/src/nonblock.cc0000664000175000017500000000175612607557643013044 00000000000000// Copyright © 2015 Richard Kettlewell. // // 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 . #include #include "rsbackup.h" #include "Errors.h" #include "Utils.h" #include #include void nonblock(int fd) { int ret = fcntl(fd, F_GETFL); if(ret < 0) throw SystemError("fcntl", errno); if(fcntl(fd, F_SETFL, ret | O_NONBLOCK) < 0) throw SystemError("fcntl", errno); } rsbackup-3.0/src/Device.cc0000664000175000017500000000161112620463022012402 00000000000000// Copyright © 2011, 2014, 2015 Richard Kettlewell. // // 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 . #include #include "Conf.h" bool Device::valid(const std::string &name) { return name.size() > 0 && name.at(0) != '-' && name.find_first_not_of(DEVICE_VALID) == std::string::npos; } rsbackup-3.0/src/Document.cc0000664000175000017500000000420012621677062012772 00000000000000// Copyright © 2011, 2012, 2015 Richard Kettlewell. // // 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 . #include #include "Document.h" #include "Utils.h" #include // LinearContainer ------------------------------------------------------------ Document::LinearContainer::~LinearContainer() { deleteAll(nodes); } // String --------------------------------------------------------------------- Document::String::String(int n) { char buffer[64]; snprintf(buffer, sizeof buffer, "%d", n); text = buffer; } // Table ---------------------------------------------------------------------- Document::Table::~Table() { deleteAll(cells); } int Document::Table::width() const { int w = 0; for(const Cell *cell: cells) { int ww = cell->x + cell->w; if(ww > w) w = ww; } return w; } int Document::Table::height() const { int h = 0; for(const Cell *cell: cells) { int hh = cell->y + cell->h; if(hh > h) h = hh; } return h; } Document::Cell *Document::Table::addCell(Cell *cell) { addCell(cell, x, y); while(occupied(x, y)) ++x; return cell; } void Document::Table::newRow() { x = 0; ++y; while(occupied(x, y)) ++x; } Document::Cell *Document::Table::addCell(Cell *cell, int x, int y) { cell->x = x; cell->y = y; cells.push_back(cell); return cell; } Document::Cell *Document::Table::occupied(int x, int y) const { for(Cell *cell: cells) { if(x >= cell->x && x < cell->x + cell->w && y >= cell->y && y < cell->y + cell->h) return cell; } return nullptr; } rsbackup-3.0/src/test-volume.cc0000664000175000017500000000224312620463022013471 00000000000000// Copyright © 2014-15 Richard Kettlewell. // // 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 . #include #include "Conf.h" #include #include int main() { assert(!Volume::valid("")); assert(Volume::valid( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.")); assert(!Volume::valid("/")); assert(!Volume::valid("~")); assert(!Volume::valid("\x80")); assert(!Volume::valid(" ")); assert(!Volume::valid("\x1F")); assert(!Volume::valid("-whatever")); assert(Host::valid("what-are-the-civilian-applications")); return 0; } rsbackup-3.0/src/Email.cc0000664000175000017500000000351612621703203012237 00000000000000// Copyright © 2011, 2012, 2015 Richard Kettlewell. // // 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 . #include #include "Email.h" #include "Conf.h" #include "Errors.h" #include "IO.h" #include "Command.h" void Email::send() const { if(to.size() == 0) throw std::logic_error("no recipients for email"); std::vector command = { config.sendmail, "-t", // recipients from header "-oee", // request bounce xor error "-oi", // de-magic '.' "-odb" // background delivery }; IO mail; mail.popen(command, WriteToPipe, ::command.verbose); if(from.size()) mail.writef("From: %s\n", from.c_str()); mail.writef("To: "); for(size_t n = 0; n < to.size(); ++n) { if(n) mail.writef(", "); mail.writef("%s", to[n].c_str()); } mail.writef("\n"); mail.writef("Subject: %s\n", subject.c_str()); mail.writef("MIME-Version: 1.0\n"); mail.writef("User-Agent: rsbackup/" VERSION "\n"); mail.writef("Content-Type: %s\n", type.c_str()); mail.writef("\n"); mail.write(content); if(content.size() && content[content.size() - 1] != '\n') mail.write("\n"); mail.close(); } rsbackup-3.0/src/test-device.cc0000664000175000017500000000207412620463022013423 00000000000000// Copyright © 2014 Richard Kettlewell. // // 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 . #include #include "Conf.h" #include #include int main() { assert(!Device::valid("")); assert(Device::valid( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.")); assert(!Device::valid("/")); assert(!Device::valid("~")); assert(!Device::valid("\x80")); assert(!Device::valid(" ")); assert(!Device::valid("\x1F")); return 0; } rsbackup-3.0/src/FileLock.h0000664000175000017500000000352012626574404012553 00000000000000//-*-C++-*- // Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. // // 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 . #ifndef FILELOCK_H #define FILELOCK_H /** @file FileLock.h * @brief File locking */ #include /** @brief Hold an flock() lock on a file */ class FileLock { public: /** @brief Constructor * @param path File to lock * * The constructor does not acquire the lock. */ FileLock(const std::string &path); FileLock(const FileLock &) = delete; FileLock &operator=(const FileLock &) = delete; /** @brief Destructor * * Releases the lock if is held. */ ~FileLock(); /** @brief Acquire the lock * @param wait If true, block until lock can be acquire; else give up * @return true if the lock was acquired * * Returns immediately if the lock is already held. Note that this is not a * recursive lock! */ bool acquire(bool wait = true); /** @brief Release the lock * * The lock must be held. */ void release(); private: /** @brief Path to lockfile */ std::string path; /** @brief Open lockfile, or -1 */ int fd = -1; /** @brief @c true when lock is held */ bool held = false; /** @brief @c Ensure @p fd is open */ void ensureOpen(); }; #endif /* FILELOCK_H */ rsbackup-3.0/src/PruneAge.cc0000664000175000017500000000411212620463022012710 00000000000000// Copyright © 2015 Richard Kettlewell. // // 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 . #include #include "rsbackup.h" #include "Conf.h" #include "Prune.h" #include "Utils.h" #include /** @brief The @c age pruning policy */ class PruneAge: public PrunePolicy { public: PruneAge(): PrunePolicy("age") {} void validate(const Volume *volume) const override { parseInteger(get(volume, "prune-age", DEFAULT_PRUNE_AGE), 1); parseInteger(get(volume, "min-backups", DEFAULT_MIN_BACKUPS), 1); } void prunable(std::vector &onDevice, std::map &prune, int) const override { const Volume *volume = onDevice.at(0)->volume; int pruneAge = parseInteger(get(volume, "prune-age", DEFAULT_PRUNE_AGE), 1); int minBackups = parseInteger(get(volume, "min-backups", DEFAULT_MIN_BACKUPS), 1); size_t left = onDevice.size(); for(Backup *backup: onDevice) { int age = Date::today() - backup->date; // Keep backups that are young enough if(age <= pruneAge) continue; // Keep backups that are on underpopulated devices if(left <= static_cast(minBackups)) continue; std::ostringstream ss; ss << "age " << age << " > " << pruneAge << " and remaining " << onDevice.size() << " > " << minBackups; prune[backup] = ss.str(); --left; } } } prune_age; rsbackup-3.0/src/globFiles.cc0000664000175000017500000000350212534527675013135 00000000000000// Copyright © 2014 Richard Kettlewell. // // 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 . #include #include "rsbackup.h" #include "Utils.h" #include "Errors.h" #include #include extern "C" { static int globFilesError(const char *epath, int errno_value); }; static std::string globErrorPath; static int globErrno; void globFiles(std::vector &files, const std::string &pattern, int flags) { glob_t g; memset(&g, 0, sizeof g); try { switch(glob(pattern.c_str(), flags, globFilesError, &g)) { case GLOB_NOSPACE: throw SystemError("glob: out of memory"); case GLOB_ABORTED: throw SystemError(globErrorPath, globErrno); default: throw SystemError("glob: unrecognized return value"); case GLOB_NOMATCH: case 0: break; } files.clear(); for(size_t n = 0; n < g.gl_pathc; ++n) files.push_back(g.gl_pathv[n]); } catch(std::runtime_error &) { globfree(&g); throw; } globfree(&g); } static int globFilesError(const char *epath, int errno_value) { // Not re-entrant (stupid API design). Fortunately this isn't a threaded // program... globErrorPath = epath; globErrno = errno_value; return -1; } rsbackup-3.0/src/test-timespec.cc0000664000175000017500000000257412330764571014015 00000000000000// Copyright © 2014 Richard Kettlewell. // // 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 . #include #include "Utils.h" int main() { const struct timespec ts[] = { { 0, 0 }, { 0, 500 * 1000000 }, { 1, 0 }, { 1, 500 * 1000000 }, }; #define NTS (sizeof ts / sizeof *ts) for(size_t i = 0; i < NTS; ++i) { for(size_t j = 0; j < NTS; ++j) { if(i < j) { assert(!(ts[i] >= ts[j])); assert(!(ts[i] == ts[j])); } else if(i == j) { assert(ts[i] >= ts[j]); assert(ts[i] == ts[j]); } else { assert(ts[i] >= ts[j]); assert(!(ts[i] == ts[j])); } assert(ts[i] - ts[i] == ts[0]); } } assert(ts[2] - ts[1] == ts[1]); assert(ts[3] - ts[2] == ts[1]); assert(ts[3] - ts[1] == ts[2]); return 0; } rsbackup-3.0/src/test-prunedecay.cc0000664000175000017500000000253512631027577014342 00000000000000// Copyright © 2015 Richard Kettlewell. // // 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 . #include #include "Prune.h" #include #include static const int v12[] = { 0,1,1,2,2,2,2,3,-1 }; static const int v22[] = { 0,0,1,1,1,1,2,2,2,2,2,2,2,2,3,-1 }; static const int v13[] = { 0,1,1,1,2,2,2,2,2,2,2,2,2,3,-1 }; static const int v23[] = { 0,0,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,-1 }; static void check(int w, int s, const int *v) { int a = 1; while(*v >= 0) { int n = prune_decay_bucket(w, s, a); //printf("w=%d s=%d a=%d n=%d expected %d\n", w, s, a, n, *v); assert(n == *v); ++v; ++a; } } int main(void) { check(1, 2, v12); check(2, 2, v22); check(1, 3, v13); check(2, 3, v23); return 0; } rsbackup-3.0/src/error.cc0000664000175000017500000000223412327163346012350 00000000000000// Copyright © 2014 Richard Kettlewell. // // 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 . #include #include "rsbackup.h" #include "IO.h" int errors; static void error_generic(const char *tag, const char *fmt, va_list ap) { IO::err.writef("%s: ", tag); IO::err.vwritef(fmt, ap); IO::err.write("\n"); } void error(const char *fmt, ...) { va_list ap; va_start(ap, fmt); error_generic("ERROR", fmt, ap); va_end(ap); ++errors; } void warning(const char *fmt, ...) { va_list ap; va_start(ap, fmt); error_generic("WARNING", fmt, ap); va_end(ap); } rsbackup-3.0/src/Host.cc0000644000175000017500000000765312621640033012132 00000000000000// Copyright © 2011, 2014, 2015 Richard Kettlewell. // // 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 . #include #include "Conf.h" #include "Subprocess.h" #include "Command.h" #include #include #include void Host::select(bool sense) { for(auto &v: volumes) v.second->select(sense); } bool Host::selected() const { for(auto &v: volumes) if(v.second->selected()) return true; return false; } bool Host::valid(const std::string &name) { return name.size() > 0 && name.at(0) != '-' && name.find_first_not_of(HOST_VALID) == std::string::npos; } void Host::addVolume(Volume *v) { volumes[v->name] = v; } Volume *Host::findVolume(const std::string &volumeName) const { auto it = volumes.find(volumeName); return it != volumes.end() ? it->second : nullptr; } std::string Host::userAndHost() const { return (user.size() ? user + "@" + hostname : hostname); } std::string Host::sshPrefix() const { std::string s = userAndHost(); return s == "localhost" ? "" : s + ":"; } bool Host::available() const { // localhost is always available if(hostname == "localhost") return true; return invoke(nullptr, "true", (const char *)nullptr) == 0; } void Host::write(std::ostream &os, int step, bool verbose) const { describe_type *d = verbose ? describe : nodescribe; os << indent(step) << "host " << quote(name) << '\n'; step += 4; ConfBase::write(os, step, verbose); d(os, "", step); d(os, "# Hostname for SSH", step); d(os, "# hostname NAME", step); os << indent(step) << "hostname " << quote(hostname) << '\n'; d(os, "", step); d(os, "# Username for SSH; default is not to supply a username", step); d(os, "# user NAME", step); if(user.size()) os << indent(step) << "user " << quote(user) << '\n'; d(os, "", step); d(os, "# Treat host being down as an error", step); d(os, "# always-up true|false", step); os << indent(step) << "always-up " << (alwaysUp ? "true" : "false") << '\n'; d(os, "", step); d(os, "# Glob pattern for devices this host will be backed up to", step); d(os, "# devices PATTERN", step); if(devicePattern.size()) os << indent(step) << "devices " << quote(devicePattern) << '\n'; d(os, "", step); d(os, "Priority for this host (higher priority = backed up earlier)", step); d(os, "# priority INTEGER", step); os << indent(step) << "priority " << priority << '\n'; for(auto &v: volumes) { os << '\n'; v.second->write(os, step, verbose); } } int Host::invoke(std::string *capture, const char *cmd, ...) const { std::vector args; const char *arg; va_list ap; if(hostname != "localhost") { args.push_back("ssh"); if(sshTimeout > 0) { char buffer[64]; snprintf(buffer, sizeof buffer, "%d", sshTimeout); args.push_back(std::string("-oConnectTimeout=") + buffer); } args.push_back(userAndHost()); } args.push_back(cmd); va_start(ap, cmd); while((arg = va_arg(ap, const char *))) args.push_back(arg); va_end(ap); Subprocess sp(args); if(capture) { sp.capture(1, capture); return sp.runAndWait(true); } else { sp.nullChildFD(1); sp.nullChildFD(2); return sp.runAndWait(false); } } ConfBase *Host::getParent() const { return parent; } std::string Host::what() const { return "host"; } rsbackup-3.0/src/Conf.h0000644000175000017500000005411212626653516011753 00000000000000// -*-C++-*- // Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. // // 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 . #ifndef CONF_H #define CONF_H /** @file Conf.h * @brief Program configuration */ #include #include #include #include #include #include #include "Defaults.h" #include "Date.h" class Store; class Device; class Host; class Volume; class Database; class Backup; /** @brief Base for Volume, Host and Conf * * Volume, Host and Conf share certain parameters, which are inherited from * container to contained. They are implemented in this class. */ class ConfBase { public: /** @brief Constructor with no parent * * All parameters are given their default values. * * @see @ref Defaults.h */ ConfBase() = default; ConfBase(const ConfBase &) = delete; ConfBase& operator=(const ConfBase &) = delete; /** @brief Constructor that inherits from a parent * @param parent Parent container */ ConfBase(ConfBase *parent): maxAge(parent->maxAge), prunePolicy(parent->prunePolicy), pruneParameters(parent->pruneParameters), preBackup(parent->preBackup), postBackup(parent->postBackup), rsyncTimeout(parent->rsyncTimeout), sshTimeout(parent->sshTimeout), hookTimeout(parent->hookTimeout), devicePattern(parent->devicePattern) {} virtual ~ConfBase() = default; /** @brief Maximum comfortable age of most recent backup * * Corresponds to @c max-age. */ int maxAge = DEFAULT_MAX_AGE; /** @brief Name of pruning policy */ std::string prunePolicy = DEFAULT_PRUNE_POLICY; /** @brief Pruning policy parameters */ std::map pruneParameters; /** @brief Pre-backup hook */ std::vector preBackup; /** @brief Post-backup hook */ std::vector postBackup; /** @brief rsync timeout */ int rsyncTimeout = 0; /** @brief Timeout to pass to SSH */ int sshTimeout = DEFAULT_SSH_TIMEOUT; /** @brief hook timeout */ int hookTimeout = 0; /** @brief Device pattern to be used */ std::string devicePattern = "*"; /** @brief Write this node to a stream * @param os Output stream * @param step Indent depth * @param verbose Include informative annotations */ virtual void write(std::ostream &os, int step, bool verbose) const; /** @brief Return the parent of this configuration node * @return Parent node or null pointer */ virtual ConfBase *getParent() const = 0; /** @brief Return a description of this node */ virtual std::string what() const = 0; protected: /** @brief Quote a string for use in the config file * @param s String to quote * @return Possibly quoted form of @p s */ static std::string quote(const std::string &s); /** @brief Quote a list of strings for use in the config file * @param vs String to quote * @return @p vs with appropriate quoting */ static std::string quote(const std::vector &vs); /** @brief Construct indent text * @param step Indent depth * @return String containing enough spaces */ static std::string indent(int step); /** @brief Type for description functions * @param os Output stream * @param description Description * @param step Indent depth * * See ConfBase::write and overloads for use. */ typedef void describe_type(std::ostream &, const std::string &, int); /** @brief Describe a configuration item * @param os Output stream * @param description Description * @param step Indent depth * * See ConfBase::write and overloads for use. */ static void describe(std::ostream &os, const std::string &description, int step); /** @brief No-op placeholder used instead of ConfBase::describe * @param os Output stream * @param description Description * @param step Indent depth * * See ConfBase::write and overloads for use. */ static void nodescribe(std::ostream &os, const std::string &description, int step); friend void test_quote(); friend void test_quote_vector(); friend void test_indent(); }; /** @brief Type of map from host names to hosts * * @see Conf::hosts */ typedef std::map hosts_type; /** @brief Type of map from store names to stores * * @see Conf::stores */ typedef std::map stores_type; /** @brief Type of map from device names to devices * * @see Conf::devices **/ typedef std::map devices_type; /** @brief Represents the entire configuration of rsbackup. */ class Conf: public ConfBase { public: /** @brief Map of host names to configuration */ hosts_type hosts; /** @brief Map of store names to configuration */ stores_type stores; /** @brief Map of device names to configuration */ devices_type devices; /** @brief Maximum device usage * * Corresponds to @c max-usage. Currently not implemented. */ int maxUsage = DEFAULT_MAX_USAGE; /** @brief Maximum file usage * * Corresponds to @c max-file-usage. Currently not implemented. */ int maxFileUsage = DEFAULT_MAX_FILE_USAGE; /** @brief Permit public stores */ bool publicStores = false; /** @brief Log directory */ std::string logs = DEFAULT_LOGS; /** @brief Lockfile path */ std::string lock; /** @brief Age to keep pruning logs */ int keepPruneLogs = DEFAULT_KEEP_PRUNE_LOGS; /** @brief Age to report pruning logs */ int reportPruneLogs = DEFAULT_PRUNE_REPORT_AGE; /** @brief Path to @c sendmail */ std::string sendmail = DEFAULT_SENDMAIL; /** @brief Pre-access hook */ std::vector preAccess; /** @brief Post-access hook */ std::vector postAccess; /** @brief Path to stylesheet for HTML report output * * If empty, a built-in one will be used. */ std::string stylesheet; /** @brief RGB triple for 'good' color code */ unsigned colorGood = COLOR_GOOD; /** @brief RGB triple for 'bad' color code */ unsigned colorBad = COLOR_BAD; /** @brief Read the master configuration file * @throws IOError if a file cannot be read * @throws ConfigError if the contents of a file are malformed */ void read(); /** @brief Validate a read configuration file */ void validate() const; /** @brief (De-)select one or more volumes * @param hostName Name of host containing volume to select * @param volumeName Name of volume to select or "*" for all * @param sense True to select, false to dselect */ void selectVolume(const std::string &hostName, const std::string &volumeName, bool sense = true); /** @brief Add a host * @param h New host * * The host name must not be in use. */ void addHost(Host *h); /** @brief Find a host by name * @param hostName Host to find * @return Host, or null pointer */ Host *findHost(const std::string &hostName) const; /** @brief Find a volume by name * @param hostName Name of host containing volume * @param volumeName Name of volume to find * @return Volume, or null pointer */ Volume *findVolume(const std::string &hostName, const std::string &volumeName) const; /** @brief Find a device by name * @param deviceName Name of device to find * @return Device, or null pointer */ Device *findDevice(const std::string &deviceName) const; /** @brief Read logfiles * * Safe to call multiple times - the second and subsequent calls are * ignored. */ void readState(); /** @brief Identify devices * @param states Bitmap of store states to consider * * Safe to call multiple times. */ void identifyDevices(int states); /** @brief Unrecognized device names found in logs * * Set by readState(). */ std::set unknownDevices; /** @brief Unrecognized host names found in logs * * Set by readState(). */ std::set unknownHosts; /** @brief Total number of unknown objects * * Set by readState(). */ int unknownObjects = 0; /** @brief Get the database access object * @return Reference to database object * * Creates tables if they don't exist. */ Database &getdb(); ConfBase *getParent() const override; std::string what() const override; void write(std::ostream &os, int step, bool verbose) const override; private: /** @brief Read a single configuration file * @param path Path to file to read * @throws IOError if @p path cannot be read * @throws ConfigError if the contents of @p path are malformed */ void readOneFile(const std::string &path); /** @brief Read a configuration file or directory * @param path Path to file or directory to read * @throws IOError if a file cannot be read * @throws ConfigError if the contents of a file are malformed * * If @p path is a directory then the files in it are read (via @ref * readOneFile; there is no recursion). Dotfiles and backup files (indicated * by a trailing "~") are skipped. * * Otherwise the behavior is the same as @ref readOneFile(). */ void includeFile(const std::string &path); friend struct IncludeDirective; /** @brief (De-)select all hosts * @param sense @c true to select all hosts, @c false to deselect them all */ void selectAll(bool sense = true); /** @brief (De-)select a host * @param hostName Host to select or @c * * @param sense @c true to select hosts, @c false to deselect * * If @p hostName is @c * then all hosts are (de-)selected, as by @ref * selectAll(). */ void selectHost(const std::string &hostName, bool sense = true); /** @brief Set to @c true when logfiles have been read * Set by @ref readState(). */ bool logsRead = false; /** @brief Set to @c true when devices have been identified * Set by @ref identifyDevices(). */ int devicesIdentified = false; /** @brief Database access object */ Database *db = nullptr; /** @brief Create database tables */ void createTables(); /** @brief Validate and add a backup to a volume * @param backup Populated backup * @param hostName Host owning @p backup * @param volumeName Volume owning @p backup * @param forceWarn Force warnings on. * * Identifies the volume from the parameters, fills in @p Backup::volume, and * adds the backup to the volume's list of backups. If the backup belongs to * an unknown device, host or volume, logs this but does not add it to * anything. */ void addBackup(Backup &backup, const std::string &hostName, const std::string &volumeName, bool forceWarn = false); }; /** @brief Represents a backup device */ class Device { public: /** @brief Constructor * @param name_ Name of device */ Device(const std::string &name_): name(name_) {} /** @brief Name of device */ std::string name; /** @brief Store for this device, or null pointer * * Set by Store::identify(). */ Store *store = nullptr; /** @brief Validity test for device names * @param n Name of device * @return true if @p n is a valid device name, else false */ static bool valid(const std::string &n); }; /** @brief Type of map from volume names to volumes * @see Host::volumes */ typedef std::map volumes_type; /** @brief Represents a host */ class Host: public ConfBase { public: /** @brief Constructor * @param parent_ Parent configuration * @param name_ Name of host */ Host(Conf *parent_, const std::string &name_): ConfBase(static_cast(parent_)), parent(parent_), name(name_), hostname(name_) { parent->addHost(this); } /** @brief Parent configuration */ Conf *parent; /** @brief Name of host */ std::string name; /** @brief Volumes for this host */ volumes_type volumes; /** @brief Remote username */ std::string user; /** @brief Remote hostname */ std::string hostname; /** @brief True if host is expected to always be up */ bool alwaysUp = false; /** @brief Priority of this host */ int priority = 0; /** @brief Unrecognized volume names found in logs * * Set by Conf::readState(). */ std::set unknownVolumes; /** @brief Test whether host is selected * @return True if any volume for this host is selected */ bool selected() const; /** @brief (De-)select all volumes * @param sense True to select all volumes, false to deselect */ void select(bool sense); /** @brief Add a volume * @param v Pointer to new volume * * The volume name must not be in use. */ void addVolume(Volume *v); /** @brief Find a volume by name * @param volumeName Name of volume to find * @return Volume or null pointer */ Volume *findVolume(const std::string &volumeName) const; /** @brief SSH user+host string * @return String to pass to SSH client */ std::string userAndHost() const; /** @brief SSH prefix * @return Either "" or "user@host:" */ std::string sshPrefix() const; /** @brief Test if host available * @return true if host is available */ bool available() const; /** @brief Test whether a host name is valid * @param n Host name * @return true if @p n is a valid host name */ static bool valid(const std::string &n); /** @brief Invoke a command on the host and return its exit status * @param capture Where to put capture stdout, or null pointer * @param cmd Command to invoke * @param ... Arguments to command, terminatd by a null pointer * @return Exit status */ int invoke(std::string *capture, const char *cmd, ...) const; ConfBase *getParent() const override; std::string what() const override; void write(std::ostream &os, int step, bool verbose) const override; }; /** @brief Possible states of a backup */ enum BackupStatus { /** @brief %Backup status unknown */ UNKNOWN = 0, /** @brief %Backup is underway */ UNDERWAY = 1, /** @brief %Backup is complete */ COMPLETE = 2, /** @brief %Backup failed */ FAILED = 3, /** @brief Pruning is underway */ PRUNING = 4, /** @brief Pruning is complete */ PRUNED = 5 }; /** @brief Names of @ref BackupStatus constants */ extern const char *const backup_status_names[]; /** @brief Represents the status of one backup */ class Backup { /** @brief Status of this backup * * @see BackupStatus */ int status = UNKNOWN; public: /** @brief Wait status from @c rsync * * This is a wait status as returned by @c waitpid and similar functions. 0 * means the backup succeeded. It is meaningless if @ref Backup::status is * @ref UNKNOWN or @ref UNDERWAY. */ int rc = 0; /** @brief Date of backup * * This reflects the day the backup was started. */ Date date; /** @brief Id of backup * * In the current implementation these are days represented by YYYY-MM-DD * format. However, IDs are treated as opaque strings, so this could be * changed. * * Note though that when importing logs from older versions of rsbackup (in * Conf::readState) the filename is assumed to start YYYY-MM-DD and this is * imported as both the time of the backup and its ID. */ std::string id; /** @brief Time of backup * * This reflects the time that the backup was started. */ time_t time = 0; /** @brief Time backup pruned * * The meaning of this member depends on the value of @ref Backup::status * * If the current status is @ref PRUNING then it reflects the time that it * was decided to prune the backup. * * If the current status is @ref PRUNED then it reflects the time that the * pruning operation completed. * * For any other status, the value is meaningless. */ time_t pruned = 0; /** @brief Device containing backup */ std::string deviceName; /** @brief Log contents */ std::string contents; /** @brief Volume backed up */ Volume *volume = nullptr; /** @brief Ordering on backups * @param that Other backup * * Backups are ordered by date first and by device name for backups of the * same date. */ inline bool operator<(const Backup &that) const { int c; if((c = date - that.date)) return c < 0; if((c = deviceName.compare(that.deviceName))) return c < 0; return false; } /** @brief Return path to backup */ std::string backupPath() const; /** @brief Return containing device * * @todo could this be null pointer if device has been retired? */ Device *getDevice() const; /** @brief Insert this backup into the database * @param db Database to update * @param replace Replace existing row if present */ void insert(Database &db, bool replace = false) const; /** @brief Update this backup in the database * @param db Database to update */ void update(Database &db) const; /** @brief Remove this backup from the database * @param db Database to update */ void remove(Database &db) const; /** @brief Retrieve status of this backup * @return Status (see @ref BackupStatus) */ inline int getStatus() const { return status; } /** @brief Set the status of this backup * @param n New status (see @ref BackupStatus) * * Calls Volume::calculate if necessary. */ void setStatus(int n); }; /** @brief Comparison for backup pointers */ struct compare_backup { /** @brief Comparison operator * @param a A backup * @param b Another backup * @return true Ordering */ bool operator()(Backup *a, Backup *b) const { return *a < *b; } }; /** @brief Type of an ordered set of backups * @see Volume::backups */ typedef std::set backups_type; /** @brief Represents a single volume (usually, filesystem) to back up */ class Volume: public ConfBase { public: /** @brief Construct a volume * @param parent_ Host containing volume * @param name_ Volume name * @param path_ Path to volume */ Volume(Host *parent_, const std::string &name_, const std::string &path_): ConfBase(static_cast(parent_)), parent(parent_), name(name_), path(path_) { parent->addVolume(this); } /** @brief Host containing volume */ Host *parent; /** @brief Volume name */ std::string name; /** @brief Path to volume */ std::string path; /** @brief List of exclusion patterns for this volume */ std::vector exclude; /** @brief Traverse mount points if true */ bool traverse = false; /** @brief File to check before backing up */ std::string checkFile; /** @brief Check that root path is a mount point before backing up */ bool checkMounted = false; /** @brief Return true if volume is selected */ bool selected() const { return isSelected; } /** @brief (De-)select volume * @param sense true to select, false to de-select */ void select(bool sense); /** @brief Check whether a proposed volume name is valid * @param n Proposed volume name * @return true if valid, else false */ static bool valid(const std::string &n); /** @brief Test if volume available * @return true if volume is available */ bool available() const; /** @brief Known backups of this volume */ backups_type backups; /** @brief Per-device information about this volume */ struct PerDevice { /** @brief Number of backups of volume on device */ int count = 0; /** @brief Oldest backup of volume on device */ Date oldest; /** @brief Newest backup of volume on device */ Date newest; }; /** @brief Number of completed backups */ int completed = 0; /** @brief Date of oldest backup (on any device) */ Date oldest; /** @brief Date of newest backup (on any device) */ Date newest; /** @brief Type for @ref perDevice */ typedef std::map perdevice_type; /** @brief Map of device names to per-device information */ perdevice_type perDevice; /** @brief Add a backup */ void addBackup(Backup *backup); /** @brief Remove a backup */ bool removeBackup(const Backup *backup); /** @brief Find the most recent backup * @param device If not null pointer, only consider backups from this device * @return Most recent backup or null pointer */ const Backup *mostRecentBackup(const Device *device = nullptr) const; /** @brief Find the most recent failedbackup * @param device If not null pointer, only consider backups from this device * @return Most recent failed backup or null pointer */ const Backup *mostRecentFailedBackup(const Device *device = nullptr) const; ConfBase *getParent() const override; std::string what() const override; void write(std::ostream &os, int step, bool verbose) const override; private: /** @brief Set to @c true if this volume is selected */ bool isSelected = false; /** @brief Recalculate statistics * * After calling this method the following members will accurately reflect * the contents of the @ref backups container: * - @ref completed * - @ref oldest * - @ref newest * - @ref perDevice * * @ref perDevice will not contain any entries with @ref PerDevice::count * equal to 0. */ void calculate(); friend void Backup::setStatus(int); }; inline Device *Backup::getDevice() const { return volume->parent->parent->findDevice(deviceName); } /** @brief Global configuration */ extern Conf config; #endif /* CONF_H */ rsbackup-3.0/src/split.cc0000664000175000017500000000404612571037171012352 00000000000000// Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. // // 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 . #include #include "rsbackup.h" #include "Errors.h" #include "Utils.h" // Split a string into words. Words are separated by whitespace but can also // be quoted; inside quotes a backslash escapes any character. A '#' where the // start of a word would be introduces a comment which consumes the rest of the // line. void split(std::vector &bits, const std::string &line) { bits.clear(); std::string::size_type pos = 0; std::string s; while(pos < line.size()) { char c = line.at(pos); switch(c) { case ' ': case '\t': case '\r': case '\f': ++pos; break; case '#': return; case '"': s.clear(); ++pos; while(pos < line.size() && line.at(pos) != '"') { if(line.at(pos) == '\\') { ++pos; if(pos >= line.size()) throw SyntaxError("unterminated string"); } s += line.at(pos); ++pos; } if(pos >= line.size()) throw SyntaxError("unterminated string"); ++pos; bits.push_back(s); break; case '\\': throw SyntaxError("unquoted backslash"); default: s.clear(); while(pos < line.size() && !isspace(line.at(pos)) && line.at(pos) != '"' && line.at(pos) != '\\') { s += line.at(pos); ++pos; } bits.push_back(s); break; } } } rsbackup-3.0/src/toLines.cc0000664000175000017500000000223012452265667012640 00000000000000// Copyright © 2014, 2015 Richard Kettlewell. // // 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 . #include #include "rsbackup.h" #include "Utils.h" size_t toLines(std::vector &lines, const std::string &s) { lines.clear(); size_t pos = 0; const size_t limit = s.size(); while(pos < limit) { size_t nl = s.find('\n', pos); if(nl == std::string::npos) break; lines.push_back(s.substr(pos, nl - pos)); pos = nl + 1; } if(pos < limit) lines.push_back(s.substr(pos, limit - pos)); return lines.size(); } rsbackup-3.0/src/Text.cc0000664000175000017500000001522212621700247012136 00000000000000// Copyright © 2011, 2015 Richard Kettlewell. // // 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 . #include #include "Document.h" #include "Utils.h" #include "Errors.h" #include #include #include #include void Document::LinearContainer::renderTextContents(std::ostream &os) const { for(auto &node: nodes) node->renderText(os); } void Document::String::renderText(std::ostream &os) const { os << text; } void Document::LinearContainer::renderText(std::ostream &os) const { renderTextContents(os); } void Document::wordWrapText(std::ostream &os, const std::string &s, size_t width, size_t indent, bool indentFirst) { size_t x = 0; std::string::size_type pos = 0; bool first = true; while(pos < s.size()) { // Skip whitespace if(isspace(s[pos])) { ++pos; continue; } // Find the length of this word std::string::size_type len = 0; while(pos + len < s.size() && !isspace(s[pos + len])) ++len; if(x) { if(x + len + 1 <= width) { os << ' '; ++x; } else { os << '\n'; x = 0; } } else { if(indentFirst || !first) for(size_t i = 0; i < indent; ++i) os << ' '; } os.write(s.data() + pos, len); x += len; pos += len; } if(x) os << '\n'; } void Document::Paragraph::renderText(std::ostream &os) const { // Convert to a single string std::stringstream ss; renderTextContents(ss); wordWrapText(os, ss.str(), 80); // TODO configurable width os << '\n'; } void Document::Verbatim::renderText(std::ostream &os) const { renderTextContents(os); os << '\n'; } void Document::List::renderText(std::ostream &os) const { for(size_t n = 0; n < nodes.size(); ++n) { char prefix[64]; std::stringstream ss; nodes[n]->renderText(ss); switch(type) { case OrderedList: snprintf(prefix, sizeof prefix, " %zu. ", n + 1); os << prefix; break; case UnorderedList: strcpy(prefix, " * "); break; } os << prefix; wordWrapText(os, ss.str(), 80 - strlen(prefix), strlen(prefix), false); } os << '\n'; } void Document::ListEntry::renderText(std::ostream &os) const { renderTextContents(os); } void Document::Heading::renderText(std::ostream &os) const { if(level > 6) throw std::runtime_error("heading level too high"); switch(level) { case 1: os << "==== "; renderTextContents(os); os << " ===="; os << '\n'; break; case 2: os << "=== "; renderTextContents(os); os << " ==="; os << '\n'; break; case 3: os << "== "; renderTextContents(os); os << " =="; os << '\n'; break; case 4: case 5: case 6: os << "* "; renderTextContents(os); os << '\n'; break; } os << '\n'; } void Document::Cell::renderText(std::ostream &os) const { renderTextContents(os); } void Document::Table::renderText(std::ostream &os) const { // First pass: compute column widths based on single-column cells const int tableColumns = width(), tableRows = height(); std::vector columnWidths; for(int xpos = 0; xpos < tableColumns; ++xpos) { size_t columnWidth = 0; for(int ypos = 0; ypos < tableRows; ++ypos) { Cell *cell = occupied(xpos, ypos); // We only consider single-width cells if(cell && cell->w == 1) { std::stringstream ss; cell->renderText(ss); size_t w = ss.str().size(); if(w > columnWidth) columnWidth = w; } } columnWidths.push_back(columnWidth); } // Second pass: add extra space to accomodate multiple-column cells for(int xpos = 0; xpos < tableColumns; ++xpos) { for(int ypos = 0; ypos < tableRows; ++ypos) { Cell *cell = occupied(xpos, ypos); if(cell && cell->x == xpos && cell->w > 1) { std::stringstream ss; cell->renderText(ss); // Determine the space available size_t availableWidth = 3 * (cell->w - 1); for(int i = 0; i < cell->w; ++i) availableWidth += columnWidths[xpos + i]; if(ss.str().size() <= availableWidth) continue; // If there's a shortage of space, bump up the first column columnWidths[xpos] += ss.str().size() - availableWidth; } } } // We lay out as | | | ... | // Third pass: render the table for(int ypos = 0; ypos < tableRows; ++ypos) { for(int xpos = 0; xpos < tableColumns; ++xpos) { Cell *cell = occupied(xpos, ypos); if(cell) { if(cell->y == ypos) { if(cell->x == xpos) { // First row/column of the cell // Determine the space available size_t availableWidth = 3 * (cell->w - 1); for(int i = 0; i < cell->w; ++i) availableWidth += columnWidths[xpos + i]; if(xpos) os << ' '; os << "| "; std::stringstream ss; cell->renderText(ss); size_t left = availableWidth - ss.str().size(); if(cell->heading) { for(size_t i = 0; i < left / 2; ++i) os << ' '; left -= left / 2; os << ss.str(); } else os << ss.str(); for(size_t i = 0; i < left; ++i) os << ' '; } else { // 2nd or subsequent column of the cell } } else { // 2nd or subsequent row of the cell if(xpos) os << ' '; os << "| "; for(size_t i = 0; i < columnWidths[xpos]; ++i) os << ' '; } } else { // Unfilled cell if(xpos) os << ' '; os << "| "; for(size_t i = 0; i < columnWidths[xpos]; ++i) os << ' '; } } os << '|'; os << '\n'; } os << '\n'; } void Document::RootContainer::renderText(std::ostream &os) const { renderTextContents(os); } void Document::renderText(std::ostream &os) const { content.renderText(os); } rsbackup-3.0/configure0000775000175000017500000063606412635241702012041 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for rsbackup 3.0. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: rjk@greenend.org.uk about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='rsbackup' PACKAGE_TARNAME='rsbackup' PACKAGE_VERSION='3.0' PACKAGE_STRING='rsbackup 3.0' PACKAGE_BUGREPORT='rjk@greenend.org.uk' PACKAGE_URL='' ac_unique_file="src/Conf.cc" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS LYX_TARGETS GCOV LIBPTHREAD BOOST_LIBS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG SQLITE3_LIBS SQLITE3_CFLAGS EGREP GREP CXXCPP RANLIB am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE ac_ct_CC CFLAGS CC ac_ct_AR AR am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CXX CPPFLAGS LDFLAGS CXXFLAGS CXX host_os host_vendor host_cpu host build_os build_vendor build_cpu build AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking with_gcov with_lyx ' ac_precious_vars='build_alias host_alias target_alias CXX CXXFLAGS LDFLAGS LIBS CPPFLAGS CCC CC CFLAGS CXXCPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR SQLITE3_CFLAGS SQLITE3_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures rsbackup 3.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/rsbackup] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of rsbackup 3.0:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gcov Enable coverage testing --with-lyx Use LyX to compile PDF Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CC C compiler command CFLAGS C compiler flags CXXCPP C++ preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path SQLITE3_CFLAGS C compiler flags for SQLITE3, overriding pkg-config SQLITE3_LIBS linker flags for SQLITE3, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF rsbackup configure 3.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_cxx_try_run LINENO # ------------------------ # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_cxx_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_run # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_cxx_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_compile # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ---------------------------------- ## ## Report this to rjk@greenend.org.uk ## ## ---------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_mongrel # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by rsbackup $as_me 3.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in config.aux "$srcdir"/config.aux; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in config.aux \"$srcdir\"/config.aux" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. am__api_version='1.14' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='rsbackup' VERSION='3.0' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' ac_config_headers="$ac_config_headers config.h" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 $as_echo_n "checking whether the C++ compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C++ compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5 $as_echo_n "checking for C++ compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test -n "$ac_tool_prefix"; then for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} { $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 $as_echo_n "checking the archiver ($AR) interface... " >&6; } if ${am_cv_ar_interface+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am_cv_ar_interface=ar cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int some_variable = 0; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 $as_echo "$am_cv_ar_interface" >&6; } case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) as_fn_error $? "could not determine $AR interface" "$LINENO" 5 ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac case "$host_os" in *bsd* ) CPPFLAGS="${CPPFLAGS} -isystem /usr/local/include" LDFLAGS="${LDFLAGS} -L/usr/local/lib" ;; linux-gnu ) # For backtrace to work properly LDFLAGS="${LDFLAGS} -rdynamic" ;; esac for ac_header in paths.h execinfo.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done case "$host" in *apple-darwin* ) # Use system sqlite3 SQLITE3_LIBS=-lsqlite3 ;; * ) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SQLITE3" >&5 $as_echo_n "checking for SQLITE3... " >&6; } if test -n "$SQLITE3_CFLAGS"; then pkg_cv_SQLITE3_CFLAGS="$SQLITE3_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sqlite3\""; } >&5 ($PKG_CONFIG --exists --print-errors "sqlite3") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SQLITE3_CFLAGS=`$PKG_CONFIG --cflags "sqlite3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$SQLITE3_LIBS"; then pkg_cv_SQLITE3_LIBS="$SQLITE3_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sqlite3\""; } >&5 ($PKG_CONFIG --exists --print-errors "sqlite3") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SQLITE3_LIBS=`$PKG_CONFIG --libs "sqlite3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then SQLITE3_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "sqlite3" 2>&1` else SQLITE3_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "sqlite3" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SQLITE3_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (sqlite3) were not met: $SQLITE3_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables SQLITE3_CFLAGS and SQLITE3_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables SQLITE3_CFLAGS and SQLITE3_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else SQLITE3_CFLAGS=$pkg_cv_SQLITE3_CFLAGS SQLITE3_LIBS=$pkg_cv_SQLITE3_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi ;; esac boost="-lboost_filesystem -lboost_system" BOOST_LIBS=${boost} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv_open in -liconv" >&5 $as_echo_n "checking for iconv_open in -liconv... " >&6; } if ${ac_cv_lib_iconv_iconv_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liconv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char iconv_open (); int main () { return iconv_open (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_iconv_iconv_open=yes else ac_cv_lib_iconv_iconv_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_iconv_open" >&5 $as_echo "$ac_cv_lib_iconv_iconv_open" >&6; } if test "x$ac_cv_lib_iconv_iconv_open" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBICONV 1 _ACEOF LIBS="-liconv $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 $as_echo_n "checking for clock_gettime in -lrt... " >&6; } if ${ac_cv_lib_rt_clock_gettime+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char clock_gettime (); int main () { return clock_gettime (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_rt_clock_gettime=yes else ac_cv_lib_rt_clock_gettime=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 $as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRT 1 _ACEOF LIBS="-lrt $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for backtrace in -lexecinfo" >&5 $as_echo_n "checking for backtrace in -lexecinfo... " >&6; } if ${ac_cv_lib_execinfo_backtrace+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lexecinfo $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char backtrace (); int main () { return backtrace (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_execinfo_backtrace=yes else ac_cv_lib_execinfo_backtrace=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_execinfo_backtrace" >&5 $as_echo "$ac_cv_lib_execinfo_backtrace" >&6; } if test "x$ac_cv_lib_execinfo_backtrace" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBEXECINFO 1 _ACEOF LIBS="-lexecinfo $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking type of second argument to iconv()" >&5 $as_echo_n "checking type of second argument to iconv()... " >&6; } if ${rjk_cv_iconv_inptr+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { iconv_t cd = 0; char *in, *out; size_t n; iconv(cd, &in, &n, &out, &n); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : rjk_cv_iconv_inptr="char **" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { iconv_t cd = 0; const char *in; char *out; size_t n; iconv(cd, &in, &n, &out, &n); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : rjk_cv_iconv_inptr="const char **" else rjk_cv_iconv_inptr="unknown" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $rjk_cv_iconv_inptr" >&5 $as_echo "$rjk_cv_iconv_inptr" >&6; } case "$rjk_cv_iconv_inptr" in unknown ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine argument type, winging it" >&5 $as_echo "$as_me: WARNING: cannot determine argument type, winging it" >&2;} $as_echo "#define ICONV_FIXUP /**/" >>confdefs.h ;; "char **" ) $as_echo "#define ICONV_FIXUP /**/" >>confdefs.h ;; "const char **" ) cat >>confdefs.h <<_ACEOF #define ICONV_FIXUP (${rjk_cv_iconv_inptr}) _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_create=yes else ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : LIBPTHREAD=-lpthread else missing_libraries="$missing_libraries libpthread" fi $as_echo "#define _GNU_SOURCE 1" >>confdefs.h GCOV=${GCOV:-true} # Check whether --with-gcov was given. if test "${with_gcov+set}" = set; then : withval=$with_gcov; if test $withval = yes; then CXXFLAGS="${CXXFLAGS} -O0 -fprofile-arcs -ftest-coverage" GCOV=`echo $CXX | sed s'/[cg]++/gcov/;s/ .*$//'`; fi fi GCOV=$GCOV # Check whether --with-lyx was given. if test "${with_lyx+set}" = set; then : withval=$with_lyx; else with_lyx=check fi if test "x$with_lyx" = xcheck; then : if type lyx >/dev/null 2>&1; then : with_lyx=yes fi fi if test "x$with_lyx" != xno; then : LYX_TARGETS=pdf fi if test "x$GXX" = xyes; then CXXFLAGS="$CXXFLAGS -std=c++11 -Wall -W -Werror -Wpointer-arith -Wwrite-strings" fi ac_config_files="$ac_config_files Makefile src/Makefile tests/Makefile doc/Makefile tools/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by rsbackup $as_me 3.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ rsbackup config.status 3.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi rsbackup-3.0/Makefile.am0000664000175000017500000000211212450015474012143 00000000000000# Copyright © 2011, 2014 Richard Kettlewell. # # 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 . SUBDIRS=src tests doc tools EXTRA_DIST=scripts/txt2src scripts/htmlman scripts/dist \ scripts/fakeshell.sh \ debian/changelog debian/control debian/copyright \ debian/doc.rsbackup \ debian/rsbackup.conffiles debian/rsbackup.postinst debian/rules \ debian/rsbackup.postrm \ README.md echo-distdir: @echo $(distdir) echo-version: @echo $(VERSION) clean-local: rm -f */*.gcno rm -f */*.gcda rm -f */*.gcov rsbackup-3.0/COPYING0000664000175000017500000010451311733350121011144 00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . rsbackup-3.0/configure.ac0000664000175000017500000000664312635241545012417 00000000000000# Copyright © 2011-15 Richard Kettlewell. # # 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 . AC_PREREQ([2.61]) AC_INIT([rsbackup], [3.0], [rjk@greenend.org.uk]) AC_CONFIG_AUX_DIR([config.aux]) AM_INIT_AUTOMAKE([foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) AC_CONFIG_SRCDIR([src/Conf.cc]) AM_CONFIG_HEADER([config.h]) AC_CANONICAL_HOST AC_LANG([C++]) AC_PROG_CXX AM_PROG_AR AC_PROG_RANLIB AC_SET_MAKE AC_C_BIGENDIAN case "$host_os" in *bsd* ) CPPFLAGS="${CPPFLAGS} -isystem /usr/local/include" LDFLAGS="${LDFLAGS} -L/usr/local/lib" ;; linux-gnu ) # For backtrace to work properly LDFLAGS="${LDFLAGS} -rdynamic" ;; esac AC_CHECK_HEADERS([paths.h execinfo.h]) case "$host" in *apple-darwin* ) # Use system sqlite3 AC_SUBST([SQLITE3_CFLAGS],[]) AC_SUBST([SQLITE3_LIBS],[-lsqlite3]) ;; * ) PKG_CHECK_MODULES([SQLITE3],[sqlite3]) ;; esac boost="-lboost_filesystem -lboost_system" AC_SUBST([BOOST_LIBS],[${boost}]) AC_CHECK_LIB([iconv],[iconv_open]) AC_CHECK_LIB([rt],[clock_gettime]) AC_CHECK_LIB([execinfo],[backtrace]) AC_CACHE_CHECK([type of second argument to iconv()], [rjk_cv_iconv_inptr],[ AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([#include ],[ iconv_t cd = 0; char *in, *out; size_t n; iconv(cd, &in, &n, &out, &n); ])], [rjk_cv_iconv_inptr="char **"], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([#include ],[ iconv_t cd = 0; const char *in; char *out; size_t n; iconv(cd, &in, &n, &out, &n); ])], [rjk_cv_iconv_inptr="const char **"], [rjk_cv_iconv_inptr="unknown"])]) ]) case "$rjk_cv_iconv_inptr" in unknown ) AC_MSG_WARN([cannot determine argument type, winging it]) AC_DEFINE([ICONV_FIXUP],[],[fixup string for second argument to iconv()]) ;; "char **" ) AC_DEFINE([ICONV_FIXUP],[],[fixup string for second argument to iconv()]) ;; "const char **" ) AC_DEFINE_UNQUOTED([ICONV_FIXUP],[(${rjk_cv_iconv_inptr})],[fixup string for second argument to iconv()]) ;; esac AC_CHECK_LIB([pthread], [pthread_create], [AC_SUBST(LIBPTHREAD,[-lpthread])], [missing_libraries="$missing_libraries libpthread"]) AC_DEFINE([_GNU_SOURCE], [1], [use GNU extensions]) RJK_GCOV AC_ARG_WITH([lyx], [AS_HELP_STRING([--with-lyx], [Use LyX to compile PDF])], [], [with_lyx=check]) AS_IF([test "x$with_lyx" = xcheck], [AS_IF([type lyx >/dev/null 2>&1],[with_lyx=yes])]) AS_IF([test "x$with_lyx" != xno],[LYX_TARGETS=pdf]) AC_SUBST([LYX_TARGETS]) if test "x$GXX" = xyes; then CXXFLAGS="$CXXFLAGS -std=c++11 -Wall -W -Werror -Wpointer-arith -Wwrite-strings" fi AH_BOTTOM([#ifdef __GNUC__ # define attribute(x) __attribute__(x) #else # define attribute(x) #endif]) AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile doc/Makefile tools/Makefile]) AC_OUTPUT rsbackup-3.0/README.md0000664000175000017500000000306412621210237011367 00000000000000rsbackup ======== rsbackup backs up your computer(s) to removable hard disks. The backup is an ordinary filesystem tree, and hard links between repeated backups are used to save space. Old backups are automatically pruned after a set period of time. Installation ------------ You will need: * [rsync](http://samba.anu.edu.au/rsync/) * [SQLite](http://www.sqlite.org/) * [Boost](http://www.boost.org/) * A C++11 compiler On Debian/Ubuntu systems, [get rsbackup.deb](http://www.greenend.org.uk/rjk/rsbackup) and install that. On other systems: ./autogen.sh # only if you got it from git ./configure make sudo make install Documentation ------------- Read [the tutorial manual](http://www.greenend.org.uk/rjk/rsbackup/rsbackup-manual.html) first. For reference information, see the man page: man rsbackup Bugs ---- Report bugs via [Github](https://github.com/ewxrjk/rsbackup/issues). Licence ------- Copyright © 2010-2015 Richard Kettlewell 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 . rsbackup-3.0/acinclude.m40000664000175000017500000000207312103242262012276 00000000000000# Copyright © 2011 Richard Kettlewell. # # 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 . AC_DEFUN([RJK_GCOV],[ GCOV=${GCOV:-true} AC_ARG_WITH([gcov], [AS_HELP_STRING([--with-gcov], [Enable coverage testing])], [[if test $withval = yes; then CXXFLAGS="${CXXFLAGS} -O0 -fprofile-arcs -ftest-coverage" GCOV=`echo $CXX | sed s'/[cg]++/gcov/;s/ .*$//'`; fi]]) AC_SUBST([GCOV],[$GCOV]) ]) rsbackup-3.0/doc/0000775000175000017500000000000012635241747010751 500000000000000rsbackup-3.0/doc/decay.lyx0000664000175000017500000001747712601750104012515 00000000000000#LyX 2.1 created this file. For more info see http://www.lyx.org/ \lyxformat 474 \begin_document \begin_header \textclass article \use_default_options true \maintain_unincluded_children false \language english \language_package default \inputencoding auto \fontencoding global \font_roman default \font_sans default \font_typewriter default \font_math auto \font_default_family default \use_non_tex_fonts false \font_sc false \font_osf false \font_sf_scale 100 \font_tt_scale 100 \graphics default \default_output_format default \output_sync 0 \bibtex_command default \index_command default \paperfontsize default \spacing single \use_hyperref false \papersize a4paper \use_geometry true \use_package amsmath 1 \use_package amssymb 1 \use_package cancel 1 \use_package esint 1 \use_package mathdots 1 \use_package mathtools 1 \use_package mhchem 1 \use_package stackrel 1 \use_package stmaryrd 1 \use_package undertilde 1 \cite_engine basic \cite_engine_type default \biblio_style plain \use_bibtopic false \use_indices false \paperorientation portrait \suppress_date false \justification true \use_refstyle 1 \index Index \shortcut idx \color #008000 \end_index \leftmargin 3cm \topmargin 3cm \rightmargin 3cm \bottommargin 3cm \secnumdepth 3 \tocdepth 3 \paragraph_separation indent \paragraph_indentation default \quotes_language english \papercolumns 1 \papersides 1 \paperpagestyle default \tracking_changes false \output_changes false \html_math_output 0 \html_css_as_file 0 \html_be_strict false \end_header \begin_body \begin_layout Title rsbackup decay pruning \end_layout \begin_layout Author Richard Kettlewell \end_layout \begin_layout Date 2015-09-12 \end_layout \begin_layout Abstract Pruning policies are provided with a collection of backups with ages counted in days. The \family typewriter decay \family default pruning policy is designed to keep all backups up to a (presumably small) limit and then thin out any older backups and keep older backups at a rate which decays over time. This article describes and justifies the implementation. \end_layout \begin_layout Section* Parameters \end_layout \begin_layout Standard The policy has the following parameters: \end_layout \begin_layout Standard \begin_inset Tabular \begin_inset Text \begin_layout Plain Layout Name \end_layout \end_inset \begin_inset Text \begin_layout Plain Layout Value \end_layout \end_inset \begin_inset Text \begin_layout Plain Layout Description \end_layout \end_inset \begin_inset Text \begin_layout Plain Layout \family typewriter decay-start \end_layout \end_inset \begin_inset Text \begin_layout Plain Layout \begin_inset Formula $p\ge0$ \end_inset \end_layout \end_inset \begin_inset Text \begin_layout Plain Layout Age within which to keep all backups \end_layout \end_inset \begin_inset Text \begin_layout Plain Layout \family typewriter decay-window \end_layout \end_inset \begin_inset Text \begin_layout Plain Layout \begin_inset Formula $w>0$ \end_inset \end_layout \end_inset \begin_inset Text \begin_layout Plain Layout Size of the decay window \end_layout \end_inset \begin_inset Text \begin_layout Plain Layout \family typewriter decay-scale \end_layout \end_inset \begin_inset Text \begin_layout Plain Layout \begin_inset Formula $s>1$ \end_inset \end_layout \end_inset \begin_inset Text \begin_layout Plain Layout Scaling of the decay window. \end_layout \end_inset \begin_inset Text \begin_layout Plain Layout \family typewriter decay-limit \end_layout \end_inset \begin_inset Text \begin_layout Plain Layout \begin_inset Formula $l>0$ \end_inset \end_layout \end_inset \begin_inset Text \begin_layout Plain Layout Limit beyond which to keep no backups. \end_layout \end_inset \end_inset \end_layout \begin_layout Section* Description \end_layout \begin_layout Subsection* Preliminaries \end_layout \begin_layout Standard An initial time window is preserved (i.e. not pruned) by subtracting \begin_inset Formula $p$ \end_inset and discarding from further consideration any backup with an age \begin_inset Formula $a\le0$ \end_inset . \end_layout \begin_layout Standard Any backups older than \begin_inset Formula $l$ \end_inset are pruned unless this would cause there to be no backups left whatsoever. The presence of a single backup, inside or outside, the initial time window is sufficient to cause ancient backups to be pruned. \end_layout \begin_layout Subsection* Decay Buckets \end_layout \begin_layout Standard With these two issues dealt with, the remaining backups are organized into buckets \begin_inset Formula $B_{n}$ \end_inset of size \begin_inset Formula $ws^{n}$ \end_inset for integer \begin_inset Formula $n\ge0$ \end_inset . This is illustrated as follows: \begin_inset Formula \[ a\in B_{n}\iff\begin{cases} \begin{alignedat}{2}0<\thinspace & a\le w & (n=0)\\ w<\thinspace & a\le w+ws & (n=1)\\ w+ws<\thinspace & a\le w+ws+ws^{2} & \ (n=2)\\ & ... \end{alignedat} \end{cases} \] \end_inset \end_layout \begin_layout Standard In general, \begin_inset Formula \[ a\in B_{n}\iff R_{n-1}1$ \end_inset ). \end_layout \end_body \end_document rsbackup-3.0/doc/rsbackup.10000664000175000017500000007302312626610465012567 00000000000000.TH rsbackup 1 .\" Copyright (c) 2011, 2012, 2014, 2015 Richard Kettlewell .\" .\" 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 . .SH NAME rsbackup \- rsync-based backup utility .SH SYNOPSIS \fBrsbackup\fR [\fIOPTIONS\fR] [\fB\-\-\fR] [\fISELECTOR\fR...] .br \fBrsbackup \-\-retire [\fIOPTIONS\fR] [\fB\-\-\fR] [\fISELECTOR\fR...] .br \fBrsbackup \-\-retire\-device [\fIOPTIONS\fR] [\fB\-\-\fR] \fIDEVICE\fR... .SH DESCRIPTION Backs up files from one or more (remote) destinations to a single backup storage directory, preserving their contents, layout, ownership, permissions, timestamps and hardlink structure. .PP Incremental backups are achieved by hard-linking identical files within successive backups of the same files. .SH OPTIONS .SS "Action Options" At least one of these options must be specified. When multiple actions are specified, they are executed in the order shown below. .TP .B \-\-backup\fR, \fB-b Make a backup of the selected volumes. At most one backup of a given volume will be made per day. .TP .B \-\-retire\-device Retire the named devices. Retiring a device only means deleting the records of it. Files on the device itself are not touched. .IP If the device is still listed in the configuration file then you will be asked whether you really want to retire it; you can suppress this check with the \fB\-\-force\fR option. .TP .B \-\-retire Retire the named hosts and volumes. Retiring a volume means deleting any available backups for the volume and the records of them. Records corresponding to backups on unavailable devices are not removed. .IP If you just want to remove backup records for retired volumes but want to keep the backups, you should either manually remove the records (see \fBSCHEMA\fR below), or rename it within the volume. .IP If the volume is still listed in the configuration file then you will be asked whether you really want to retire it; you can suppress this check with the \fB\-\-force\fR option. .TP .B \-\-prune\fR, \fB\-p Prune old backups of selected volumes. See \fBPRUNING\fR below. .TP .BR \-\-prune\-incomplete, \fB\-P Prune incomplete backups of selected volumes. Any backups that failed before completion will be removed. .TP .B \-\-html \fIPATH\fR, \fB\-H \fIPATH Write an HTML report to \fIPATH\fR. The report covers all volumes, not just selected ones. \fIPATH\fR can be \fB\-\fR to write to standard output. .TP .B \-\-text \fIPATH\fR, \fB\-T \fIPATH Write a plain text report to \fIPATH\fR. The report covers all volumes, not just selected ones. \fIPATH\fR can be \fB\-\fR to write to standard output. .TP .B \-\-email \fIADDRESS\fR, \fB\-e \fIADDRESS Email a report to \fIADDRESS\fR. The contents is equivalent to the output of \fB\-\-text\fR and \fB\-\-html\fR. .TP .B \-\-dump\-config Writes the parsed configuration file to standard output. Must not be combined with any other action option. .IP With \fB\-\-verbose\fR, the configuration file is annotated with descriptive comments. .SS "General Options" .TP .B \-\-config \fIPATH\fR, \fB\-c \fIPATH The path to the configuration file. The default is .IR /etc/rsbackup/config . .TP .B \-\-store \fIPATH\fR, \fB\-s \fIPATH Specify the destination directory to back up to. Using this option (possibly more than once) is equivalent to removing the \fBstore\fR directives from the configuration file and replacing them with the paths give in \fB\-\-store\fR options. .IP This option implicitly enables the \fB\-\-warn\-store\fR option. .TP .B \-\-verbose\fR, \fB\-v Enable verbose mode. Various messages will be displayed to report progress and the rsync \fB\-\-quiet\fR option is suppressed. .TP .B \-\-dry\-run\fR, \fB\-n Enable dry-run mode. Commands will be displayed but nothing will actually be done. .TP .B \-\-force\fR, \fB\-f Suppress checks made when retiring devices and volumes. .TP .B \-\-wait\fR, \fB\-w Waits rather than giving up if another copy of \fBrsbackup\fR is running. .TP .B \-\-database\fR, \fB-D \fIPATH Override the path to the backup database. .TP .B \-\-help\fR, \fB\-h Display a usage message. .TP .B \-\-version\fR, \fB\-V Display the version number. .SS "Report Verbosity" .TP .B \-\-logs \fIVERBOSITY\fR Controls which logfiles for a given volume/device pair to include in the report. The possible values of \fIVERBOSITY\fR are: .RS .TP .B all Includes all nonempty logfiles, even if the backup succeeded. .TP .B errors Includes all error logfiles. .TP .B recent Includes only the most recent error logfile. .TP .B latest Includes only the latest logfile, even if the backup succeeded. .TP .B failed Includes only the most recent logfile but only if that attempt failed. This is the default. .RE .SS "Warning Options" .TP .B \-\-warn\-unknown Display warnings for unknown devices, hosts and volumes. (Warnings will always be included in the report, this refers to runtime error output.) .TP .B \-\-warn\-store Display warnings for unsuitable store directories and unavailable devices. .TP .B \-\-warn\-unreachable Display warnings for unreachable hosts. .TP .B \-\-no\-warn\-partial Suppress warnings for rsync "partial transfer" diagnostics (which are on by default). .TP .B \-\-warn\-all\fR, \fB\-W Enable all \fB\-\-warn\-\fR options. .TP .B \-\-no\-errors Suppress display of errors from rsync. .SS "Volume Selection" The list of selectors on the command line determines what subset of the known volumes are backed up, pruned or retired. The following selectors are possible: .TP 16 .I HOST Select all volumes for the host. .TP .IR HOST : VOLUME Select the volume. .TP .BI - HOST Deselect all volumes for the host. .TP .BI - HOST : VOLUME Deselect the volume. .TP .B * Select all volumes. .PP If no hosts or volumes are specified on the command line then all volumes are selected for backing up or pruning. For retiring, you must explicitly select hosts or volumes to retire and only positive selections are possible. .SH "CONFIGURATION FILE" The config file contains global directives and a series of host stanzas. Each host stanze in turn contains host directives and volume stanzas. Although it is not enforced it is suggested that host and volume stanzas are indented. .PP Comments are introduced by an initial "#". .PP Command arguments may be quoted, using "double quotes". Quotes and backslashes within quoted strings are escaped with backslashes. .SS "Global Directives" Global directives control some general aspect of the program. .TP .B colors \fIGOOD \fIBAD The colors used to represent good states (a recent backup) and bad states (no sufficiently recent backup). .IP \fIGOOD\fR and \fIBAD\fR are integer values representing RGB triples. It is most convenient to write them in hex, e.g. as \fB0x\fIRRGGBB\fR. For example, black is \fB0x000000\fR, red is \fB0xFF0000\fR, and so on. .TP .B device \fIDEVICE\fR Names a device. This can be used multiple times. The store must have a file called \fISTORE\fB/device\-id\fR which contains a known device name. Backups will only be made to known devices. .IP When a device is lost or destroyed, remove its device entry and use the \-\-prune\-unknown option to delete records of backups on it. .IP Device names may contain letters, digits, dots and underscores. .TP .B include \fIPATH\fR Include another file as part of the configuration. If \fIPATH\fR is a directory then the files within it are included (excluding dotfiles, backup and recovery files). .TP .B keep\-prune\-logs \fIDAYS\fR The number of days to keep records of pruned backups for. The default is 31. .TP .B lock \fIPATH\fR Enable locking. If this directive is present then \fIPATH\fR will be used as a lockfile for operations that change anything (\-\-backup, \-\-prune, etc). .IP The lock is made by opening \fIPATH\fR and calling \fBflock\fR(2) on it with \fBLOCK_EX\fR. .TP .B logs \fIPATH\fR The directory to store logfiles and backup records. The default is \fI/var/log/backup\fR. .TP .B post\-access\-hook \fICOMMAND\fR... A command to execute after all backup and prune operations. This is executed only once per invocation of \fBrsbackup\fR. A backup is still considered to have succeeded even if the post-access hook fails (i.e. exits nonzero). See \fBHOOKS\fR below. .TP .B pre\-access\-hook \fICOMMAND\fR... A command to execute before anything that accesses any backup devices (i.e. backup and prune operations). This is executed only once per invocation of \fBrsbackup\fR and if it fails (i.e. exits nonzero) then \fBrsbackup\fR terminates immediately. See \fBHOOKS\fR below. .TP .B public true\fR|\fBfalse If true, backups are public. Normally backups must only be accessible by the calling user. This option suppresses the check. .TP .B report\-prune\-logs \fIDAYS\fR The number of days of pruning logs to put in hte report. The default is 3. .TP .B sendmail \fIPATH\fR The path to the executable to use for sending email. The default is platform-dependent but typically \fI/usr/sbin/sendmail\fR. The executable should support the \fB-t\fR, \fB-oee\fR, \fB-oi\fR and \fB-odb\fR options. .TP .B store \fIPATH\fR A path at which a backup device may be mounted. This can be used multiple times. .TP .B store-pattern \fIPATTERN\fR A \fBglob\fR(7) pattern matching paths at which a backup device may be mounted. This can be used multiple times. .TP .B stylesheet \fIPATH The path to the stylesheet to use in the HTML report. If this is absent then a built-in default stylesheet is used. .SS "Inheritable Directives" Inheritable directives control an aspect of one or more backups. They can be specified at the global level or in a \fBhost\fR or \fBvolume\fR stanza (see below). If one appears in multiple places then volume settings override host settings and host settings override global settings. .TP .B hook\-timeout \fISECONDS How long to wait before concluding a hook has hung, in seconds. The default is 0, which means to wait indefinitely. .TP .B max\-age \fIDAYS\fR The maximum age of the most recent backup before you feel uncomfortable. The default is 3, meaning that if a volume hasn't been backed up in the last 3 days it will have red ink in the HTML report. .TP .B min\-backups \fICOUNT\fR The minimum number of backups for each volume to keep on each store, when pruning. The default is 1. .IP (This is an alias for \fBprune\-parameter min\-backups\fR and will be removed in a future version.) .TP .B post\-backup\-hook \fICOMMAND\fR... A command to execute after finishing a backup, or after it failed. A backup is still considered to have succeeded even if the post-backup hook fails (exits nonzero). See \fBHOOKS\fR below. .TP .B pre\-backup\-hook \fICOMMAND\fR... A command to execute before starting a backup. If this hook fails (i.e. exits nonzero) then the backup is not made and the post-backup hook will not be run. See \fBHOOKS\fR below. .IP This hook can override the source path for the backup by writing a new source path to standard output. .TP .B prune\-age \fIDAYS\fR The age at which a backup may be pruned. The default is 366, meaning a backup will never be pruned until it is at least a whole year old. .IP (This is an alias for \fBprune\-parameter prune\-age\fR and will be removed in a future version.) .TP .B prune\-parameter \fINAME\fR \fIVALUE\fR Set a parameter for the pruning policy. See \fBPRUNING\fR below. .TP .B prune\-parameter \-\-remove \fINAME\fR Remove a parameter for pruning policy. .TP .B prune\-policy \fINAME\fR The pruning policy to use. See \fBPRUNING\fR below. .TP .B rsync\-timeout \fISECONDS How long to wait before concluding rsync has hung, in seconds. The default is 0, which means to wait indefinitely. .TP .B ssh\-timeout \fISECONDS\fR How long to wait before concluding a host is down, in seconds. The default is 60. .SS "Host Directives" A host stanza is started by a \fBhost\fR directive. .TP .B host \fIHOST\fR Introduce a host stanza. The name is used for the backup directory for this host. .PP The following directives, and \fBvolume\fR stanzas (see below), can appear in a host stanza: .TP .B always\-up true\fR|\fBfalse If true, the host is expected to always be available. If it is not then a warning will be issued when making a backup if it is not. Failed attempts to make a backup will also be recorded as failures for always-up hosts (normally hosts that cannot be reached are silently skipped). .TP .B devices \fIPATTERN\fR A \fBglob\fR(3) pattern restricting the devices that this host will be backed up to. .IP Note that only backup creation honors this restriction. Pruning and retiring do not. .TP .B hostname \fIHOSTNAME\fR The SSH hostname for this host. The default is the name from the host stanza. .IP The hostname \fBlocalhost\fR is treated specially: it is assumed to always be identical to the local system, so files will be read from the local filesystem. .TP .B priority \fIINTEGER\fR The priority of this host. Hosts are backed up in descending priority order. The default priority is 0. .TP .B user \fIUSERNAME\fR The SSH username for this host. The default is not to supply a username. .PP In addition, inheritable directives can appear in a host stanza, and override any appearance of them at the global level. .PP Conventionally the contents of a host stanza are indented. .PP Remote hosts are accessed by SSH. The user \fBrsbackup\fR runs as must be able to connect to the remote host (and without a password being entered if it is to be run from a cron job or similar). .SS "Volume Directives" A volume stanza is started by a \fBvolume\fR directive. .TP .B volume \fIVOLUME PATH\fR Introduce a volume stanza. The name is used for the backup directory for this volume. The path is the absolute path on the host. .PP The following directives can appear in a volume stanza: .TP .B check-file \fIPATH\fR Checks that \fIPATH\fR exists before backing up the volume. \fIPATH\fR may be either an absolute path or a relative path (to the root of the volume). It need not be inside the volume though the usual use would be to check for a file which is always present there. .IP This check is done before executing the \fBpre\-backup\-hook\fR, so it applies to the real path to the volume, not the rewritten path. .TP .B check-mounted true\fR|\fBfalse If true, checks that the volume's path is a mount point before backing up the volume. .IP This check is done before executing the \fBpre\-backup\-hook\fR, so it applies to the real path to the volume, not the rewritten path. .IP Note that if multiple \fBcheck-\fR options are used, all checks must pass for the volume to be backed up. .TP .B exclude \fIPATTERN\fR An exclusion for this volume. The pattern is passed to the rsync \fB\-\-exclude\fR option. This directive may appear multiple times per volume. .IP See the rsync man page for full details. .TP .B traverse true\fR|\fBfalse If true, traverse mount points. This suppresses the rsync \fB\-\-one\-file\-system\fR option. .PP In addition, inheritable directives can appear in a volume stanza, and override any appearance of them at the host or global level. .PP Conventionally the contents of a volume stanza are indented. .SH PRUNING This is process of removing old backups (using the \fB--prune\fR option). The pruning policy used to determine which backups to remove is set with the inheritable \fBprune-policy\fR directive, and parameters to the policy set via the \fBprune-parameter\fR directive. .PP The available policies are listed below. The default policy is \fBage\fR. .SS age This policy deletes backups older than a minimum age, provided a minimum number of backups on a device remain available. The following pruning parameters are supported: .TP .B min\-backups The minimum number of backups of the volume to maintain on the device. Pruning will never cause the number of backups to fall below this value. The default (and minimum) is 1. .TP .B prune\-age The age after backups become eligible for pruning, in days. Only backups more than this many days old will be pruned. The default is 366 and the minimum is 1. .PP For backwards compatibility, these values can also be set using the directives of the same name. This will be disabled in a future version. .SS decay This policy thins out backups older than a minimum age, using a configurable decay pattern that arranges to keep a declining number of backups with age. The following pruning parameters are supported: .TP .B decay\-start The age after backups become eligible for pruning, in days. Only backups more than this many days old will be pruned. The default is 1 and the minimum is 1. .TP .B decay-limit The age after which backups are always pruned, in days. Backups older than this will always be pruned unless this would leave no backups at all. The default is 366 and the minimum is 1. .TP .B decay\-scale The scale at which the decay window is expanded. The default is 2 and the minimum is 2. .TP .B decay\-window The size of the decay window. The default is 1 and the minimum is 1. .SS exec This policy executes a subprogram with parameters and additional information supplied in the environment. .PP The following parameters are supported: .TP .B path The path to the subprogram to execute. .PP Any additional parameters are supplied to the subprogram via environment variables, prefixed with \fBPRUNE_\fR. Additionally the following environment variables are set: .TP .B PRUNE_DEVICE The name of the device containing the backup. .TP .B PRUNE_HOST The name of the host. .TP .B PRUNE_ONDEVICE The list of backups on the device, by age in days. This list excludes any that have already been scheduled for pruning, and includes the backup under consideration (i.e. the value of \fBBACKUP_AGE\fR will appear in this list). .TP .B PRUNE_TOTAL The total number of backups of this volume on any device. Note that it does not include backups on other devices that have just been selected for pruning by another call to the subprogram. .TP .B PRUNE_VOLUME The name of the volume. .PP These environment variables all override any parameters with clashing names. .PP The output should be a list of backups to prune, one per line (in any order). Each line should contain the age in days of the backup to prune (i.e. the same value as appeared in \fBPRUNE_ONDEVICE\fR), followed by a colon, followed by the reason that this backup is to be pruned. .PP As a convenience, if the argument to \fBprune\-policy\fR starts with \fB/\fR then the \fBexec\fR policy is chosen with the policy name as the \fBpath\fR parameter. .SS never This policy never deletes any backups. .SH HOOKS A hook is a command executed by \fBrsbackup\fR just before or just after some action. The command is passed directly to \fBexecvp\fR(3); to use a shell command, therefore, either wrap it in a script or invoke the shell with the \fB-c\fR option. .PP All hooks are run in \fB\-\-dry\-run\fR mode. Hook scripts must honor \fBRSBACKUP_ACT\fR which will be set to \fBfalse\fR in this mode and \fBtrue\fR otherwise. .SS "Access Hooks" Access hooks are executed (once) before doing anything that will access backup devices (even just to read them). .PP The following environment variables are set when an access hook is executed: .TP .B RSBACKUP_ACT Set to \fBfalse\fR in \fB\-\-dry\-run\fR mode and \fBtrue\fR otherwise. .TP .B RSBACKUP_DEVICES A space-separated list of known device names. .TP .B RSBACKUP_HOOK The name of the hook (i.e. \fBpre-access-hook\fR, etc). This allows a single hook script to serve as the implementation for multiple hooks. .SS "Backup Hooks" Backup hooks are executed just before or just after a backup is made. .PP The following environment variables are set when a backup hook is executed: .TP .B RSBACKUP_ACT Set to \fBfalse\fR in \fB\-\-dry\-run\fR mode and \fBtrue\fR otherwise. .TP .B RSBACKUP_DEVICE The target device name for the backup. .IP Note that this may be removed in a future version. .TP .B RSBACKUP_HOOK The name of the hook (i.e. \fBpre-backup-hook\fR, etc). This allows a single hook script to serve as the implementation for multiple hooks. .TP .B RSBACKUP_HOST The name of the host. .TP .B RSBACKUP_SSH_HOSTNAME The SSH hostname of the host. .IP Recall that \fBrsbackup\fR treats the hostname \fBlocalhost\fR specially. If the hook also needs to do so then it must duplicate this logic. .TP .B RSBACKUP_SSH_TARGET The SSH hostname and username combined for passing to \fBssh\fR(1). .IP This will be \fIusername\fB@\fIhostname\fR or just \fIhostname\fR depending on whether a SSH username was set. .TP .B RSBACKUP_SSH_USERNAME The SSH username of the host. If no SSH username was set, this variable will not be set. .TP .B RSBACKUP_STATUS (Only for \fBpost-backup-hook\fR). Either \fBok\fR or \fBfailed\fR. .TP .B RSBACKUP_STORE The path to the store directory where the device is mounted. .TP .B RSBACKUP_VOLUME The name of the volume. .TP .B RSBACKUP_VOLUME_PATH The path to the volume. .PP The error output from backup hooks is stored in the same backup record as the output from \fBrsync\fR. .PP .BR NOTE : The current behavior is that the pre/post backup hooks are run separately for each backup. In a future version, they may be run only once for all backups of a given volume, in which case \fBRSBACKUP_DEVICE\fR will no longer be set. .PP See \fBrsbackup-snapshot-hook\fR(1) for a hook program that can be used to back up from Linux LVM snapshots. .SH "BACKUP LIFECYCLE" .SS "Adding A New Host" To add a new host create a \fBhost\fR entry for it in the configuration file. .PP To back up the local host, specify \fBhostname localhost\fR. Otherwise you can usually omit \fBhostname\fR. .PP You may want to set host-wide values for \fBprune\-age\fR, \fBmax\-age\fR and \fBmin\-backups\fR. .PP A host with no volumes has no effect. .SS "Adding A New Volume" To add a new volume create a \fBvolume\fR entry for it in the relevant \fBhost\fR section of the configuration file. .PP Add \fBexclude\fR options to skip files you don't want to back up. This might include temporary files and the contents of "trash" directories. .PP If the volume contains mount points, and you want to back up the contents of the subsiduary filesystems, then be sure to include the \fBtraverse\fR option. .PP You may want to set per-volume values for \fBprune\-age\fR, \fBmax\-age\fR and \fBmin\-backups\fR. .SS "Adding A New Device" To add a new device, format and mount it and create a \fIdevice\-id\fR file in its top-level directory. Add a \fBdevice\fR entry for it in the configuration file and a \fBstore\fR entry mentioning its usual mount point. .PP Under normal circumstances you should make sure that the backup filesystem is owned by root and mode 0700. .SS "Making Backups" To backup up all available volumes to all available devices: .in +4n .nf rsbackup \-\-backup .fi .in You will probably want to automate this. To only back up a limited set of volumes specify selection arguments on the command line. .SS "Pruning Backups" To prune old backups: .in +4n .nf rsbackup \-\-prune \-\-prune\-incomplete .fi .in You will probably want to automate this. .PP An "incomplete backup" occurs when a backup of a volume fails or is interrupted before completion. They are not immediately deleted because \fBrsync\fR may be able to use the files already transferred to save effort on subsequent backups on the same day, or (if there are no complete backups to use for this purpose) later days. .SS "Retiring A Host" Retiring a host means removing all backups for it. The suggested approach is to remove configuration for it and then use \fBrsbackup \-\-retire \fIHOST\fR to remove its backups too. You can do this the other way around but you will be prompted to check you really meant to remove backups for a host still listed in the configuration file. .PP If any of the backups for the host are on a retired device you should retire that device first. .SS "Retiring A Volume" Retiring a volume means removing all backups for it. It is almost the same as retiring a whole host but the command is \fBrsbackup \-\-retire \fIHOST\fB:\fIVOLUME\fR. .PP You can retire multiple hosts and volumes in a single command. .SS "Retiring A Device" Retiring a device just means removing the records for it. Use \fBrsbackup \-\-retire\-device \fIDEVICE\fR to do this. The contents of the device are not modified; if you want that you must do it manually. .PP You can retire multiple devices in a single command. .SH RESTORING Restore costs extra l-) .SS "Manual Restore" The backup has the same layout, permissions etc as the original system, so it's perfectly possible to simply copy files from a backup directory to their proper location. .PP Be careful to get file ownership right. The backup is stored with the same numeric user and group ID as the original system used. .PP Until a backup is completed, or while one is being pruned, a corresponding \fB.incomplete\fR file will exist. Check for such a file before restoring any given backup. .SS "Restoring With rsync" Supposing that host \fBchymax\fR has a volume called \fBusers\fR in which user home directories are backed up, and user \fBrjk\fR wants their entire home directory to be restored, an example restore command might be: .in +4n .nf rsync \-aSHz \-\-numeric\-ids /store/chymax/users/2010-04-01/rjk/. chymax:~rjk/. .fi .in .PP You could add the \fB\-\-delete\fR option if you wanted to restore to exactly the status quo ante, or at the opposite extreme \fB\-\-existing\fR if you only wanted to restore files that had been deleted. .PP You might prefer to rsync back into a staging area and then pick files out manually. .SS "Restoring with tar" You could tar up a backup directory (or a subset of it) and then untar it on the target. Remember to use the \fB\-\-numeric\-owner\fR option to tar. .SH "STORE VALIDITY" A store may be in the following states: .IP \fBavailable The store can be used for a backup. .IP \fBunavailable The store cannot be used for a backup. Normally this does not generate an error but \fB\-\-warn\-store\fR can be used to report warnings for all unavailable stores, and if no store is available then the problems with the unavailable stores are described. .IP \fBbad The store cannot be used for a backup. This always generates an error message, but does not prevent backups to other stores taking place. .IP "\fBfatally broken" The store cannot be used for a backup. The program will be terminated. .PP The states are recognized using the following tests (in this order): .IP \(bu If the store path does not exist, the store is bad. .IP \(bu If the store does not have a \fBdevice\-id\fR file then it is unavailable. If it has one but reading it raises an error then it is bad. .IP \(bu If the store's \fBdevice\-id\fR file contains an unknown device name then it is bad. .IP \(bu If the store's \fBdevice\-id\fR file names the same device as some other store then it is fatally broken. .IP \(bu If the store is not owned by \fBroot\fR then it is bad. This check can be overridden with the \fBpublic\fR directive. .IP \(bu If the store can be read or written by group or world then it is bad. This check can be overridden with the \fBpublic\fR directive. .SH FILES .TP .I /etc/rsbackup/config Configuration file. .TP .I LOGS/backups.db The backup records. See \fBSCHEMA\fR below. .TP .I STORE/HOST/VOLUME/YYYY\-MM\-DD One backup for a volume. .TP .I STORE/HOST/VOLUME/YYYY\-MM\-DD.incomplete Flag file for an incomplete backup. .SH SCHEMA .I backups.db is a SQLite database. It contains a single table with the following definition: .nf CREATE TABLE backup ( host TEXT, volume TEXT, device TEXT, id TEXT, time INTEGER, pruned INTEGER, rc INTEGER, status INTEGER, log BLOB, PRIMARY KEY (host,volume,device,id) ) .fi Each row represents a completed backup. The meanings of the fields are as follows: .TP 10 .B host The name of the host the backup was taken from. .TP .B volume The name of the volume the backup was taken from. .TP .B device The name of the device the backup was written to. .TP .B id The unique identifier for the backup. Currently this is the date the backup was made, in the format YYYY-MM-DD but this may be changed in the future. .TP .B time The time that the backup was started, as a \fBtime_t\fR. .TP .B pruned The time that backup pruning started (if it is underway) or finished (if it is complete), as a \fBtime_t\fR. .TP .B rc The exit status of the backup process. 0 means success. .TP .B status Status of this backup. See below. .TP .B log The log output of \fBrsync\fR(1) and hooks. If the backup status is pruning or pruned (see below) then this contains the reason for the pruning. .PP Possible status values are: .TP .B 0 Unknown status. Not normally seen. .TP .B 1 Internally this means the backup is underway. If seen externally after \fBrsbackup\fR terminates it means the backup is incomplete. .TP .B 2 Backup is complete. .TP .B 3 Backup has failed. .TP .B 4 Pruning has started. .TP .B 5 Pruning has completed. .PP \fBrsbackup\fR is not designed with concurrent access to this table in mind. Therefore it is recommended that you only modify its contents when the program is not running. .SH "HISTORICAL BEHAVIOR" Older versions of \fBrsbackup\fR stored the logs for each backup in a separate file. If such files are encountered then \fBrsbackup\fR will automatically populate \fIbackups.db\fR from them and then delete them. .PP Older versions of \fBrsbackup\fR logged pruning information to a pruning logfile. These files will be deleted at the same rate as records of pruned backups in the database. They are not included in the report. .SH "SEE ALSO" \fBrsbackup.cron\fR(1), \fBrsbackup\-mount\fR(1), \fBrsbackup-snapshot-hook\fR(1), \fBrsync\fR(1) .SH AUTHOR Richard Kettlewell rsbackup-3.0/doc/decay.pdf0000664000175000017500000032175012606231224012444 00000000000000%PDF-1.5 % 3 0 obj << /Length 2426 /Filter /FlateDecode >> stream xY[o~ϯУYI fA[۝-R* _sHJmړ8ӢOCw.0ZWjEq0Y#]m =ER8 ހG٢N|U:6n\ʅm-veb(2V/0pc8~v%qX-zCHu];9&Xƿcg*djX;clQz_`#3&KSI.C C]9]Rr@׸lR 1g-z"{{;.{n~{{hƲ8C+IֻMm(w`٧!ׂΠ!#>:מ݌4HlgTrf$ѐ3 [ˈ2fץo8hˏ'%z+'}x ъ k )܉e g| `tB $x A.g;ϔ+Ob#eh^)wAV><X|ކ$&Dϣ $ߚ r$ A5bx".@: H*jj)̠VfWLAxXOտ\(Ɗ+\R[ ܞG$]ӫM@Ih .j_ϣ: {D$+1]@ӕEhpEѱh,S*@ zI4mH 9 y'2؏$4ʗ+e,ᘟ_,w//-|^\ #|K{>Ip_:" h8' A9-v> ܰxJWSt8(H^x†!Çƣj*4Y dѽq/᭹"%_40R~ox]H T0vŧ1@=2TKNkw :i o!+Ra\->Ym"sCPi$iM{9S#{@kiH/+-{5yd,CxER LoDUx7u#*<[ѺHSǸ iڙ>vO]B|-'~"xo͸jiut['Ova~@1La4! zO?SULfc F0;IUlk{s9Ԙ_0`Z|ܯR9\JJa$7Q9 PƁ ◩qJ TGJP/;=tz$ CO4|/绕rGf誮8~#lxuD2 /LWZRhM;JiyMBΞg*Q ;0I+#r :g!g~ZG6Gr0,p0 p!4=x%(d`@WXb!aPGQ d;oΉ.A|琮[)CM*g endstream endobj 24 0 obj << /Length 967 /Filter /FlateDecode >> stream xWM8WX- 0UP7 7xkħ;L endstream endobj 29 0 obj << /Length 235 /Filter /FlateDecode >> stream xڥ @\z Z< fNSuPԹG> stream xҽ 0-}V NlGpPz&M@ᗄ$$BgK|<p8s93d-!%_Vve9rȑx)QTŔxe4GzMa)["ei=AikLM!Ch.TC#ig^woJ-$KHWeN'Q<6?K endstream endobj 31 0 obj << /Length 185 /Filter /FlateDecode >> stream x3735V0PasC3 CB.3s I$r9yr+s{E=}JJS ]  b<]co100U@  P3 v,f[=n/O~085 )cpzrr\ endstream endobj 32 0 obj << /Length 232 /Filter /FlateDecode >> stream x}ϽN0Jl;Ta?pۜ7kBjikVb7/;8jC'_o6RsS-3[&0`Q0|T*M *pӌ_2 $Lo1ÔJc4|ݜ~82;eSz)<8`͊N9y{2hl endstream endobj 33 0 obj << /Length 214 /Filter /FlateDecode >> stream xڭ1 @E'l&G\@7E1#BBBQRgEv>'S &3!3c4#NqRdn uS:]L> stream xu=n@gbi|eYGH@TDjh> X VyyD%JC80/*v[ dvջ\/_Gvxv+١hJʞ2Ն(W FOFFl@&%`}b zdeL,>2~dgygL[41Ƕ hKyJ BasQ D endstream endobj 35 0 obj << /Length 131 /Filter /FlateDecode >> stream x3634R0P0b#KsCB.#1s<L=\ %E\N \. ц \. 5 7?D # P?P1?H{pzrrD endstream endobj 36 0 obj << /Length 220 /Filter /FlateDecode >> stream xϱn0 HrObB*L 22*+cc" F,YϲA/~o:ϜuʰXoiTYp'3d|6dFcLxsr‘"?D+c~DRdZ+-ЭAR.ZT7rBʰU. (]«],D> 4Hsz/iNW^`ص endstream endobj 37 0 obj << /Length 107 /Filter /FlateDecode >> stream x3634R0P0bc3KCB.#S I$r9yr+r{E=}JJS ]  b<]0q7c.WO@.S endstream endobj 38 0 obj << /Length 209 /Filter /FlateDecode >> stream x? P C!;Bs_ZA,T;:9::( n>'GoqQzJcߗdڍZE5eujh}OSXcu4vB{%gQh@&lJ2DxbΪUdK 9T`P+XU.> stream x3332Q0Pa3 ebUej 䃹 \.'O.pSS.}(BIQi*S!BA,C}?7T10@ 6P?|'W [ endstream endobj 40 0 obj << /Length 161 /Filter /FlateDecode >> stream x3137U0P0bcSCB.cK I$r9yr+[r{E=}JJS ]  b<]oH?1"~`? L7?bl'W n endstream endobj 41 0 obj << /Length 223 /Filter /FlateDecode >> stream xE1N@ E?b%790;"E"T (AKq%GH"4o4v]_+^sk{w6[{T^o(=fKdJ~|Q_stgj8UR:EZ ʷcVG@VjU'3rع: Fg u1vM#bj2;4@* endstream endobj 42 0 obj << /Length 173 /Filter /FlateDecode >> stream x3135S0P0R5T0P03VH1*26 (@ds<M=\ %E\N \. ц \. Xv8'=3,X w'C=`?`A<7@ ? r  ,t endstream endobj 43 0 obj << /Length 166 /Filter /FlateDecode >> stream x+@i*6#06&$  (D@@/G[58"e9P!Zj Z)%eʡ^Rv3:N[|LuM+C]MD ! a9PIcУd/-x>o;w*!aVB78\ d endstream endobj 44 0 obj << /Length 267 /Filter /FlateDecode >> stream x}ϽJ@Rn7p h~(b`]VbB !y&)Sdw̙SRqKu&Zso\iLs9 gRiή1笹ַRpBGn6b-eFGZ0Ucc^pG))$)Y= Ư㗥itjuGj wAlhA_Bg6UT2u2Ho^_˄>> endstream endobj 51 0 obj << /Length 103 /Filter /FlateDecode >> stream x313T0P0W04S06W02TH1*2 (B$s<,=L=}JJS ]  b<]0 szrr$~ endstream endobj 52 0 obj << /Length 191 /Filter /FlateDecode >> stream xm= @ x Ղ?` A+ RK E[)S,;h%Xfh< }:ex\T:8^pVQ>EmqF;)C}FE$ sXBט^Hȃ@?|bezYETZ_q-`R!a~K<.Kj/\ endstream endobj 53 0 obj << /Length 182 /Filter /FlateDecode >> stream xڍ1 @EIk9 n!he!Vjihh%GL2Φօ}g?ofǜlS>'t#k5?;2{Zd܆L]rBC\"iJzD=[5/jLAOQ~ߏ@B_Zh4J5Ϋ^RMuZ9uEJ endstream endobj 54 0 obj << /Length 193 /Filter /FlateDecode >> stream xڕα@ .<} L &`qRG;[pqᾤ 5)+H+9s<^&|XLפ*L,r0S⺡MNMC $z11wx!"><Zi&N?>cH RaH'c ˁ:ѴmO, YK endstream endobj 55 0 obj << /Length 201 /Filter /FlateDecode >> stream xmPE4K BBrmM>}}V́;ܹiԥS=T'u9&a+NFF⻥OK+ VZ[( f#2;܃J>PDCv@Z }•cC 7'* 4u.7mp b2rcZI_ endstream endobj 56 0 obj << /Length 132 /Filter /FlateDecode >> stream x313T0P0bcKS#CB.cC I$r9yr+r{E=}JJS. @-\.  @x@@?C1;}pA|.WO@.O) endstream endobj 57 0 obj << /Length 115 /Filter /FlateDecode >> stream x313T0P0b ebUel䃹 \.'O.pc.}(BIQi*Sm`Pz<7,{\W endstream endobj 58 0 obj << /Length 171 /Filter /FlateDecode >> stream xڽ= @[&G\@7!Q1#X^,7[n8ȃW3r9Al&]'-\,cx܎` s0 n ==Cbq1 SeKvI'mr/)T8R`5zf endstream endobj 59 0 obj << /Length 155 /Filter /FlateDecode >> stream x313T0P0bcc3CB.1s<L =\ %E\N @QhX.O$$PD2`$ȃ@H&?:7 q.WO@.ll endstream endobj 60 0 obj << /Length 183 /Filter /FlateDecode >> stream x}=@XLvNBLH0XF[٣Q8ab^2}KJ)*%Kw4 +@@)juE]VQzB[_P :9o.A@9(dq%7@'a/=ߵG.^Tyh p A!\\[>P: endstream endobj 61 0 obj << /Length 158 /Filter /FlateDecode >> stream xڭ1 @ПJuj!Fp A+ RKAEh9JAqc![̃I`4-ØԈmjw쎜{Vky\Y\/|9êe_Hx+5C8#$RC\B"xo<Iw endstream endobj 62 0 obj << /Length 185 /Filter /FlateDecode >> stream xM1 @4!s7q5@T0XErr,,2ԎgDM&rv=pr^ًYMyaoY!RrGB7 }KD#"eZSW!("PB Ca}96A=> stream x313T0P0bc 3CB.cS I$r9yr+r{E=}JJS ]  b<] @AH2`h AA~[@ Lx:B endstream endobj 64 0 obj << /Length 174 /Filter /FlateDecode >> stream x313T0P0bcc3CB.1s<L =\ %E\N @QhX.O `?aC00~ @2?Dv`N2~+ߎ #ȏߏ`` ?G#g``?A6 H@RՓ+ ɝm endstream endobj 65 0 obj << /Length 237 /Filter /FlateDecode >> stream xEαj@ dz)CB=ҩCɔdnvj:t&=$%p!:d-"zX!ZnhyxDQd}LKႲ)ֳ[{vȭ+OPy5 @U-G[;z[*lB;v\ɼHer;SHR Z88 ~Ka{ endstream endobj 69 0 obj << /Length 189 /Filter /FlateDecode >> stream xڝ1 @EL70s @BBZZ( 9Z#XZ:IVt« 3Or#xjBN%7nt8SjImYǤ+]'RzΚT;l@TJ @ hxjze/ ]a;AdD/ak+?iTRS" }G@ endstream endobj 70 0 obj << /Length 188 /Filter /FlateDecode >> stream xڝ1 @EL/ :ͮA"EVbE$Nxg1q߄l">h.!Ǧ^OXRcR 7'e|ޏՌ5ٔs@ th~//iKxO`LГtIVx?>(=Cuڕ/@RriniMoEBs endstream endobj 71 0 obj << /Length 131 /Filter /FlateDecode >> stream x-1 @E?^ xЙmV"RP:ٙ&Nwo\%红V\xA=y1:nwՇ Y/ t4M22DT&2+<*B# endstream endobj 72 0 obj << /Length 94 /Filter /FlateDecode >> stream x3230W0PaCsKCB.K &r9yr+Xr{O_T.}gC.}hCX.Oz 0X [\w endstream endobj 73 0 obj << /Length 101 /Filter /FlateDecode >> stream x3230W0PaCsc3CB.K 'r9yr+Xr{=}JJS ]  b<]d7`= 1S'W fp" endstream endobj 74 0 obj << /Length 208 /Filter /FlateDecode >> stream xѱ@?Xf!FHJ"BJ--|1}_aau=΁egM]p,+qeL?&wXis)|›p1$Myƀv3|-{Pe!,GpPghFdPCWT-kCj( gf"{![ޗAftC endstream endobj 75 0 obj << /Length 235 /Filter /FlateDecode >> stream xmj1 ^=;Od-$AhO=Xބͣ{N"Q6>fB&?N'izmf4Z||DJƠz.rM/T%V~rEP@X8 \IU{3bY1Ez$'i=Sː†LBp6Pu 8:R [49޲&&Z'XΝ_%m endstream endobj 76 0 obj << /Length 194 /Filter /FlateDecode >> stream x3331V0PaS SsCB.S I$r9yr+p{E=}JJS ]  b<]Bc``D@.0L1S?UB7@`JJ=SP (<9P@=mrC%hAC!@ y`> stream x333P0P0bSKSsCB.SS I$r9yr+r{E=}JJS ]  b<]?T b78) s)hb y.WO@.!7 endstream endobj 78 0 obj << /Length 106 /Filter /FlateDecode >> stream x3ԳT0P0aKSsCB.#3 I$r9yr+q{E=}JJS ]  b<]acW3v\ endstream endobj 79 0 obj << /Length 140 /Filter /FlateDecode >> stream x35ԳT0P0bKSsCB.S I$r9yr+r{E=}JJS ]  b<]d3 eR/i& 0 d`L?`@!\=Afl endstream endobj 80 0 obj << /Length 243 /Filter /FlateDecode >> stream xUпJ@/.0fMN?Sge!VjihkR\AKT֩$EuwM1f``w%=.>jRWRkRnKO/VSYZR7T@fm큼0 {düۘ=4]L3Ȧa@bli@T|`MLjb4L1dtFW$G *.|ؙtI6Dc endstream endobj 81 0 obj << /Length 256 /Filter /FlateDecode >> stream xUϱN0 )K~h{=B @!Z̏F%Psw|J8êt0r^jE>U KWk=?ܻbuyJz_uEk?ƌ!fl#>3Z;@'7x &&ȖNm9R0!G/aEFD+E$ьMX^>a-M=:upǴ-i}GA^{sywָ+=# endstream endobj 82 0 obj << /Length 150 /Filter /FlateDecode >> stream x3Գ4W0P0bSsJ1*2" Fr.'~1PKW4K)YKE!P E?<@0g`A bP>T*L`)`J+F Hʃr Wr endstream endobj 83 0 obj << /Length 240 /Filter /FlateDecode >> stream xm1j0g1> stream xu1K0W v8b vtr@?')ΝCMHH^K^Y/PX.8\> stream xm; @ . Vf.1L!he!Vji(X({8Qښ}i<"Ńf{Qj{T3Qes:.{TŘ4 5E&6%/_x/PAP02g0yp&dBw:+0}ATyM6Ӣ5l.5iK|T endstream endobj 86 0 obj << /Length 198 /Filter /FlateDecode >> stream x3134V0P0R5T01V0PH1*21PASKLr.'~PKW4K)YKE!P ETD0S$00|`A; 00* ?8Q"I&PMb`߁q ̍:]'W ckA endstream endobj 87 0 obj << /Length 182 /Filter /FlateDecode >> stream xڍA `'?(   AZDjX.̣y҅Tcu 7f: 5P L % MBb%_/#jƒ&Ύ҄Z{Ue5TƩ-ՇW6j@-OӉ;*`{^[bTd7 wSZ= endstream endobj 88 0 obj << /Length 198 /Filter /FlateDecode >> stream x3134V0P0V5T01Q0PH1*21PASKLr.'~PKW4K)YKE!P ETz !HԱ` |P=iu D)ph<krF=A?0`> stream x]1 @\B/ 8M(+Tr!bI q23;9nvdC)lGUgwIBf6$32d@fr@&m)2ϩ\^sϵ2HQRQO5QJrh MTrL@V@ endstream endobj 90 0 obj << /Length 141 /Filter /FlateDecode >> stream x3236W0P0bcSKCB.# I$r9yr+Yp{E=}JJS ]*c<]70| C`003a`\=&[ endstream endobj 91 0 obj << /Length 237 /Filter /FlateDecode >> stream xڍJ1ƿ00 v^@9Å+T[}> stream x3134V0P0bS CB.C I$r9yr+r{E=}JJS. @-\. ?&iNa`D~700n?D䇁$7 \\\y endstream endobj 93 0 obj << /Length 122 /Filter /FlateDecode >> stream x3230W0P0aCS3CB.C I$r9yr+Zp{E=}JJS ]  b<]0@A@8~? q0\=(CE` endstream endobj 94 0 obj << /Length 196 /Filter /FlateDecode >> stream xڵ1 @Еir3'p.#BBRPQr0E:? d37u.{ʧHrCqJzƁGz$15x2`ts [R?L3؂rkm;x3HKv@%.oԐ nn**ɍ@ÔDr endstream endobj 95 0 obj << /Length 108 /Filter /FlateDecode >> stream x3230W0P0aCS CB.C I$r9yr+Zp{E=}JJS ]  b<]?0! ̃`qzrrƂQ. endstream endobj 96 0 obj << /Length 177 /Filter /FlateDecode >> stream x33R0Pa3scsCB.3 I$r9yr+p{E=}JJS ]  b<]?`@=:773n? Da`N``` O7Nszrr#߈ endstream endobj 97 0 obj << /Length 147 /Filter /FlateDecode >> stream x3134V0P0bcsCB.C I$r9yr+r{E=}JJS. @-\. ?00`D~70n?D䇁$0I.WO@.e% endstream endobj 98 0 obj << /Length 188 /Filter /FlateDecode >> stream xڍ1@E #0e6 &naRK v9GTd)HN^f̦ǚ95(EqߜR{cRkI ? ldM*H&g8^WSQdHVR!J*- i~ nN/ookg$AH> wlzZIK endstream endobj 99 0 obj << /Length 196 /Filter /FlateDecode >> stream xڝα @ HByuj;:9::(>Zp"]qQ |CB?2ܓ1G!#I:Ramd$V$fO"tٓH$R^K6ʯ\UW0/%>T5*4hy~> stream x3635R0PacCcsCB.# I$r9yr+Yp{E=}JJS ]  b<]3P?n3 ~o0ah`?PszrrjF endstream endobj 101 0 obj << /Length 195 /Filter /FlateDecode >> stream x=αJ@Xf x{`TSwZ * W6`"8%Gf|q~K.4pR^j<> stream x363T0P0T5T0P05TH1*22 (Ads≮=\ %E\N \. ц \.   W  @ @,?(fQ 0pC sC3=;?f.WO@.uH endstream endobj 103 0 obj << /Length 153 /Filter /FlateDecode >> stream x3134V0P0R5T01Q06WH1*21 ([@ds<L =\ %E\N @QhX.O `J`pB`왏I@.WO@.1c endstream endobj 104 0 obj << /Length 183 /Filter /FlateDecode >> stream xU̱ P#k[WJ' rjj Ɔh>`Phj @ B\Q#HEldȗ$"Sg3:.{|LVkRj_ ..X ,g0i) <p&A=j|c(vk]b=(ԿOI |F? endstream endobj 105 0 obj << /Length 233 /Filter /FlateDecode >> stream xU=KPs Xxv(zb`A' Q|A7|~Lx`7UN?8g!Aj"z$r~nhdHڙdrO/$GcHN* WUP6Aߴ45q " bx%tq_cGŲh;L t5<fOk2|+ZlECd(IBY_ endstream endobj 106 0 obj << /Length 210 /Filter /FlateDecode >> stream xMν @ )(> stream xUj@Yi nZ$sSEGQ|x I;=F(N8^D!qiIs ǔB3I-1QYAg//74gZv* 0ÿ+]SCE@QsϰF,IqSn/'gCb^mmjg`1'>ڟK endstream endobj 108 0 obj << /Length 183 /Filter /FlateDecode >> stream x%1 @@$|'0+AA),DQI:IUuO)Fh~!;:c̐ېዬQ֑)HpIH]RY#H[m(l2Oe-?uC endstream endobj 109 0 obj << /Length 121 /Filter /FlateDecode >> stream x3135R0P0bc3SSCB.# I$r9yr+Yp{E=}JJS ]  b<]0001; aX*6T?0'W N endstream endobj 110 0 obj << /Length 228 /Filter /FlateDecode >> stream xmαJ@o"0M^ป'pWSZY `eh>J+5E~;Yct_^iC-/+9u'Zst }{} ,, %s'l"aAZқMY'W Tc| endstream endobj 114 0 obj << /Length 258 /Filter /FlateDecode >> stream x1n0` x'b R"5SS۱Cd(9BFcWGRZ}l_Y1S#=e}EeEzYNzm6|<>I/O^捪ko?n>CK(I֪ov^سs`'rVr\w I˼ދ/np=g?;ؗ= 13rً E7Z1ӌk kmgj.=WMs endstream endobj 115 0 obj << /Length 209 /Filter /FlateDecode >> stream xڳԳ0U0P0b c #CB.s I$r9yr+[p{E=}JJS ]  b<]8J,fn0ªc5CX@Y bGb}e1ce H,ln~ #BBP`pb~Y 0SFY䱠I'W T4# endstream endobj 116 0 obj << /Length 270 /Filter /FlateDecode >> stream xڕJ@'LsL 'BB> stream xڵN0/`?BdS` Heꀘh XI-#d`stgۿ~Iy)x 5_XQ&oG\7vWEF<z{O5 Tb!ȣO!2J`@;PP<;Gg3E9c̈*l09t / inm';)),bߘ^Jq݂zlgF endstream endobj 118 0 obj << /Length 244 /Filter /FlateDecode >> stream xڅJ1g"0M!`Dy[ZYZZ(ںy}<•aǙP1|?IO :1H=>cTPc;Ocw!^_[^ʙ;V8?dmgPj\Rq :dĄ* |Vbn;gE d1o( ؁ahDBc!D[o1En %in6N:\Z` æ]H_I<?y뭜 endstream endobj 119 0 obj << /Length 138 /Filter /FlateDecode >> stream x3635Q0Pacc CB.# I$r9yr+Yp{E=}JJS ]  b<]``0f+ɃԂ 0a@\\\٥; endstream endobj 120 0 obj << /Length 232 /Filter /FlateDecode >> stream xҽjA W#>WZL+vrp!ET+ -vXqt;';됱j-->xsiNY-gOّy+#CYEI O$Rx%4DJʤn ׮UH@Y$߸Np⧤D@(Ax^ 9Eۄip xviC endstream endobj 121 0 obj << /Length 184 /Filter /FlateDecode >> stream xѱ@ & &]xHLtr0NUy{ጃ zw6d4JBGqlfiG{1+P)QEz@-ibc|!Pi ౮!`{.TV6ߡA_y48+po endstream endobj 122 0 obj << /Length 231 /Filter /FlateDecode >> stream xڵ0kHnЂ0 &2`A3<#02^KL%!_s{I!.qa@CT9 +@P% 7 v+@x0> stream x͒N@ ]uG_.!MBH 02<Gx۹F:.˓"J:lN錞c|,5<WO(m(KѭEGWbtK=b$(#!@5@oJ 4{aŌfJ`o}4.lO%wm_mte4](z`_TU` endstream endobj 124 0 obj << /Length 169 /Filter /FlateDecode >> stream x;0 t#' VbTD$02`nQzT dj20XY陞c+4xRps?aq@iA W<ix=   E^6ɱC:_:Wѫ}O_ /h m Ij^ endstream endobj 125 0 obj << /Length 259 /Filter /FlateDecode >> stream x]1N@4;ۊB$\ Q%ڬ\vY)yTk.拊57 UIJ/Kn6O\k*ybx[~|nXp8HDF#々~7'QȔ^;LKZ+45qj@.dtv!"ieh֔j]dV絳Su ?hgcfKxhGZ endstream endobj 126 0 obj << /Length 186 /Filter /FlateDecode >> stream x3534S0P0R5T01Q07SH1*21 (Cds<L =\ %E\N @QhX.OON2bH$;&=A$3?8HAN7PJ`$H `( E` qzrr:p endstream endobj 130 0 obj << /Length 181 /Filter /FlateDecode >> stream xmν @ hB{ ֣CB`A'qRGEݣ#8v(r;W-rFEnIJsMpaӡ=+nmuEVTmXP~®G@+i9oH~,x!a(RRQѾI0>F^XnFIxP\wFZh endstream endobj 131 0 obj << /Length 171 /Filter /FlateDecode >> stream xu10 E]u%GO@D "" & Xi310~)M='TUùT/Z;R OQ5o3veGڎ@$>,% F" 022??{|̐EX<(> "4Ci endstream endobj 132 0 obj << /Length 191 /Filter /FlateDecode >> stream xڕͱ 0  zO`Z#NZN⤎:vwEpwI䓩|LN)^d<'2ezK&C-zE\)E].duEq"΁A BsT܆g4ʁ!Fdx?V,HHJ|E]1V};=E|9g1 endstream endobj 133 0 obj << /Length 178 /Filter /FlateDecode >> stream x]= @_H&GȜ,#BBB6h9Jr%D;x?3,fጿ|N&WMr 7*kJlrJ7RZox])-w+V⣞H]ζhh@ҶhN0>"NXuM{pTR endstream endobj 134 0 obj << /Length 211 /Filter /FlateDecode >> stream xEͱ@ [DGy$`NK;:q$>(y-Sb _̌M2C e4Ndx2:&4|OXwdrQD]|.)E}J+@up 94h;EV7Jzd1qe@DG8Gdhs\7ru[|zT endstream endobj 138 0 obj << /Length 187 /Filter /FlateDecode >> stream x3Գ0S0P0W5P02S05SH1* @&P\.'O.pC .}8BIQi*S!BA, | 2 6  @b"*y0c`!TDp9@:U@A r |`u@=pՓ+ ; endstream endobj 139 0 obj << /Length 188 /Filter /FlateDecode >> stream x3Գ0S0P0Q5P02V05SH1* *ɥ`hU()*Mw pV0wQ6T0tQ8A1> :;0c`!~4p96`Tvywu`@qzrrlO9 endstream endobj 140 0 obj << /Length 90 /Filter /FlateDecode >> stream x3236V0P0bCS CB. &r9yr+Xp{O_T.}gC.}hCX.O@Pgj* endstream endobj 141 0 obj << /Length 158 /Filter /FlateDecode >> stream x3133S0P0b#ScCB.rAɹ\N\ &\@Q.}O_T.}gC.}hX.O 000c`? $l: `$H $n@@<bu endstream endobj 142 0 obj << /Length 167 /Filter /FlateDecode >> stream x3532S0P0b SCCB. I$r9yr+p{E=}JJS|hCX.Oc` 00a`&}?&H~d$z9&#ldv l3 Dr m endstream endobj 143 0 obj << /Length 145 /Filter /FlateDecode >> stream x3531S0P0bS#SCCB. I$r9yr+Xp{E=}JJS|hCX.O@l`]+|2D=Ɍd C$Brzrrb endstream endobj 144 0 obj << /Length 188 /Filter /FlateDecode >> stream xm= @O,iraP hSZYZZ(Zg;$@:xwfL܎Æ[!Měd(ެw4H/dOz"t6%=8$2Ί[o@`K ( 5/ .P/ Eu% WV]6d<3SQ endstream endobj 145 0 obj << /Length 186 /Filter /FlateDecode >> stream x3133S0P0R5T01P05RH1*26 \.'O.pcs.}0BIQi*S!BA,;`a$?``|w: 0@ &~L b<"o@ga`nn:4z.WO@.d endstream endobj 146 0 obj << /Length 174 /Filter /FlateDecode >> stream xڍͱ 0[:խ4ISNZN⤎O˧2:5Er߽> stream xڥα@ .8%7`A+f(<EHh mӿQ8M HЄSRҁEj=ٟ0S6$Rd Ft܎ȲՌ8@/~/^kڠ} N5N:W& fOi),ϟ)pQ#mx^1ھo$\_XEq endstream endobj 148 0 obj << /Length 180 /Filter /FlateDecode >> stream x]1@G(H֎. h"AL0Xmq=–\ky5C+Bb>)Qp4] ;+Ik~ܟgfd{!4PW ׈Ӣ홾pLUAu_-U R`kE@4z1nв-}@ endstream endobj 149 0 obj << /Length 143 /Filter /FlateDecode >> stream x3231W0P0b# ScCB.#3 I$r9yr+q{E=}JJS ]*c<]00g`go`?P#IpL^r0Փ+ QK endstream endobj 150 0 obj << /Length 235 /Filter /FlateDecode >> stream xuJ@baĝ$.p` A+ J--Mk)Sg;KQuʵ՜*z:uK>'ZTܚKS^#s*.Ԯ@.BOCܶKxBb&'hcLi`_`/p`B1ANGKl`iMB.ɒ&)yc e6j4Lt }PW endstream endobj 151 0 obj << /Length 152 /Filter /FlateDecode >> stream x3133S0P0bCS#CB.c I$r9yr+[p{E=}JJS ]  b<]?000G%A3@?700gc`"0CpM  Apzrr^ endstream endobj 152 0 obj << /Length 116 /Filter /FlateDecode >> stream x3236V0P0bCKSCCB.C3 I$r9yr+q{E=}JJS|hCX.O {??`'\\\> stream x3231W0P5Q54S04W05TH1*22PA3s\r.'~PKW4K)YKE!P E aK{d?؁?5  @Nr xO endstream endobj 154 0 obj << /Length 190 /Filter /FlateDecode >> stream xڭ= @ )s7?&h%+TM"9B!4jơ׋B89 xӑXj%=%%1f|>]v})|֔lJ)bˠQ V0 ^Ѐ*T7tGX붻Hq9 7AJܘ)?$ͣkC endstream endobj 155 0 obj << /Length 103 /Filter /FlateDecode >> stream x3236V0P0bCKS#CB.C3 I$r9yr+q{E=}JJS ]  b<]C4'W F endstream endobj 156 0 obj << /Length 171 /Filter /FlateDecode >> stream x33Q0P0b3cccCB.3rAɹ\N\ f\@Q.}O_T.}gC.}hCX.O30P3>70~```o}A`?L`o4?4'W Yz0 endstream endobj 157 0 obj << /Length 142 /Filter /FlateDecode >> stream x3133S0P0bCccCB.c I$r9yr+[p{E=}JJS ]  b<]?`0P`%~4%07Ls endstream endobj 158 0 obj << /Length 178 /Filter /FlateDecode >> stream xڍ1 @DgXM@Vbvr%GH"k+lpc,SO1]Iĉ; e̎EȬLƮ~{ddr H_]XB5 R5t%Z# p/xZX(!T*ﳔ= endstream endobj 159 0 obj << /Length 189 /Filter /FlateDecode >> stream xڕαP?9CxVٚP&0+f}>•и.!a|?QKGZAW"_P8ԗ>> stream x3630Q0P0b# ccCB.#3 I$r9yr+q{E=}JJS ]*c<]0?70``@\\\`d@. endstream endobj 161 0 obj << /Length 187 /Filter /FlateDecode >> stream x== @WE\@\@7P),J--t٣Ao!׼7BNaHGFfwqBj:"5Tz 5^N8 5M):h<bmD|?5kb-_+k"69<;ŗldF Oa3%VZ@U endstream endobj 162 0 obj << /Length 142 /Filter /FlateDecode >> stream x3Գ0S0P0T5T02S01SH1*22 (Cds<L=\ %E\N \. ц \.  (>#1`` 0bq vl@NA.WO@.0> endstream endobj 163 0 obj << /Length 144 /Filter /FlateDecode >> stream x3133S0P0R5T01T06VH1*2 (@ds<-=\ %E\N \. ц \. D`gKДG%30~0PnA`aicG endstream endobj 164 0 obj << /Length 178 /Filter /FlateDecode >> stream xM̻ @BnV+A#Z *zy3!bEH`4_LK6ۚ%PC^+ړ(YRߐLŒx8mH'V$"+ 2g2#]}:> stream x3531S0P0T5T05Q06RH1*25 (Cds<L=\ %E\N \. ц \. ob9 ?d@ aS,2 T5J5){f %~Ac 0?fSP;b|PA1Փ+ >\YQ endstream endobj 166 0 obj << /Length 213 /Filter /FlateDecode >> stream xUαjA8`n^ ]רƀWI"ZT X}}qn/;˚ ߘ{^Z˪;Nw^Ie'ULxX>?!57zJňn_}ZpUm[ 4Ⱦ\(G?BrH]39|$.pJiU;B@O>F endstream endobj 170 0 obj << /Length 235 /Filter /FlateDecode >> stream xuбN0O8Sh_*>?_o/CG8jWqy[ixwTceÿMdu֭99S. /ȎJAf Q\iÜND.[j4 *A3=T(7 x܏/ endstream endobj 171 0 obj << /Length 190 /Filter /FlateDecode >> stream x]1n@A[ MG "0B)\Xb)5e@I2Zf+[WVUv)KᘂOm{ ' |п}=ZsiŻ+(9*Łd 0d#0q FCj0'LHClదE1>g endstream endobj 172 0 obj << /Length 177 /Filter /FlateDecode >> stream x334R0P0b3S#CB. HrW01r{*r;8+r(D*ry(0a8H~0Ne$@(??22<@0Jl q=`77I{ endstream endobj 173 0 obj << /Length 173 /Filter /FlateDecode >> stream xڍ1 @/)2'p7l!6b+PN)S,w-1ҲiVl-szۓJG2;}.[IW|\U % PHx$b Y( ׺H M=TSl@ڤ2$e§vN1NB endstream endobj 174 0 obj << /Length 138 /Filter /FlateDecode >> stream x3631W0P0bcccCB.cC I$r9yr+r{E=}JJS. @-\. ?|c` (@\\\M' endstream endobj 175 0 obj << /Length 175 /Filter /FlateDecode >> stream x-̱ @ @, ЭP+AAAޣݣopBiI?䷋yUQN6)Z:x2eyZtŦCBMyAlTiPP~Į%W^Z(?e~Ap^G]S)L4G^A,~&FP13|'pIKW endstream endobj 176 0 obj << /Length 143 /Filter /FlateDecode >> stream x363P0P0aKsCB.#3 I$r9yr+q{E=}JJS ]  b<]l0p P @,$'3701~?0pzrrLU endstream endobj 180 0 obj << /Length 94 /Filter /FlateDecode >> stream x363U0P0T0P0"CB.#3D"9ɓK?\ȌKCHx*r;8+r(D*ry(6#' endstream endobj 181 0 obj << /Length 295 /Filter /FlateDecode >> stream xeұJ@ )^@>IDb<VbB29,|2IHyEqwv0Wlfl~_ڑ0)>a:q{q kY Ԥ/Mj[:cЌvt֡XQ(jE/:A f SZ xv;]EoclZP7cC+O+h8"ΰk=8Eѳ>̡(Ɲ0M4yt^i$&"귁g^* endstream endobj 182 0 obj << /Length 252 /Filter /FlateDecode >> stream xڥҽj0p [hd`e3$)C 2@!!G3U?& w0 ,N=j7>FTҿUx4F=E_%\ᵀ=/ɸh endstream endobj 183 0 obj << /Length 229 /Filter /FlateDecode >> stream xuϱJAba yh+RPK E;1 tƽpS|?;?xžjs3TC=-r+SrgkkrKyrM͒a{ծlB-`a:`u)xuwGW2&e˯ɦnh huaǨk} [ bԪob"EzONoɌla endstream endobj 184 0 obj << /Length 203 /Filter /FlateDecode >> stream xڝ 0OKдv vtrAPGAEA0G#8:ANȹ-Lp;"dJ Z_V[UglJ#IWc>NҽIs-0pu@܀_x vZհu/{#ҡ^EA^UzN4 E A2;Wa V4'VhLr endstream endobj 185 0 obj << /Length 212 /Filter /FlateDecode >> stream xڽϱ0$7 x/$N$ &:9'utf,ƣ Fp $K8q b~bNe/DF4AFGi[?2%72byg6Nh:]hBQ֩L)϶?$nId[XmFiǞzՊuA63` ^j endstream endobj 186 0 obj << /Length 210 /Filter /FlateDecode >> stream xu1j0g<7 41'z(S$ MHXGQ|JW\(T 7uN3uki1}.Gq%Cf&u#U])Yϧz\R׹fi WOp_PI! I@*#f%#~,K{ǏT#,ΰq`(nYsLޖF^V2 endstream endobj 187 0 obj << /Length 167 /Filter /FlateDecode >> stream xα @ ;:'zx: 7:9: *:{G;s]!3pck8YǸh PsNA^/r9E l BuL[VeTɎdÞ@`_wV| 䈚 oafaosK endstream endobj 188 0 obj << /Length 125 /Filter /FlateDecode >> stream x323P0P0b#S3sCB.#C I$r9yr+r{E=}JJS. @-\. ? :  .WO@.P endstream endobj 189 0 obj << /Length 110 /Filter /FlateDecode >> stream x323P0P0b#S3KCB.#C I$r9yr+r{E=}JJS. @-\. ? C 1cqzrrp^ endstream endobj 190 0 obj << /Length 144 /Filter /FlateDecode >> stream x36׳4R0P0a3CB.c HrW06r{*r;8+r(D*ry(0`?l(g?6g u@lC{ pP endstream endobj 191 0 obj << /Length 160 /Filter /FlateDecode >> stream x36׳4R0P0R5T06V03TH1*26PA3#Lr.'~PKW4K)YKE!P Ea9$luPفX$N#Ccagc{  00?r Jm endstream endobj 192 0 obj << /Length 246 /Filter /FlateDecode >> stream xeɱJ@; $p M!澀dF 1` A+ Bv362e]X'qι>giF'5Tkè;.:TQ݆UwG_oTZSE%yB7zȷ CD`Al`^Ѓ\F&i!Qڤ5#+]VڂQS"w)͊S28`?ah֌+.1%t}z= endstream endobj 193 0 obj << /Length 207 /Filter /FlateDecode >> stream xڽ P FҡмVn?`A'qRGE7f}>BŚނ*3$|9VuQۀ}+5͞1%kTڤ|18Ux*%V738 \A&rOP deyܿ>X ?c\%#'q(IfNĴ) endstream endobj 194 0 obj << /Length 131 /Filter /FlateDecode >> stream x337U0PbC33CB.c# I$r9yr+q{E=}JJS ]  b<] >00013 A9 CaՓ+ t^@ endstream endobj 195 0 obj << /Length 259 /Filter /FlateDecode >> stream x]J@Of!"." E0pA.Z v |˝gH0??pNNmnҮwYUϹ勧7wk"nssa q[{_AꭅBaD4%;>#p{%*édlW]HO˷df 3ÂױtK҇FoMfl=o,"E"pLΉ~WhFF*4& !3DWZnvj endstream endobj 196 0 obj << /Length 238 /Filter /FlateDecode >> stream xڭбJ@?4y1[8O0Z *ښ<>=BKD+f+.yG\4P -Kn;r׼ΥLGrSm `# JT&e 0m?HMF3CP J@#J2 _.N^v2%5+w:gY9Cb)@;@f,BMB~2YGW e endstream endobj 197 0 obj << /Length 262 /Filter /FlateDecode >> stream xuJ@O};/I$7 \` A+ RKAE;Gˣ#L2&" _ɚ3.5%LErHk.2J__(\rNorn2 h!P#a]a:x-}bh~mh!?0B~! ?#;CsŨ^JԴIPG^`M !A#`xBo~^}gt tچpYzLG%NC:k>y endstream endobj 201 0 obj << /Length 287 /Filter /FlateDecode >> stream xڕѽN0> stream xӻJ@8Mބ VK E[7e $2E8gfA0%s' $iH&t#[eVw8134?LJ[L'd V$/%K DsХ0Gbڷ鲁fV [1>8Q.݄y4T1b<[. | ء ; \t~ۜ9AƧÇr:sLnʝrn7Іbӄ/ǵi H endstream endobj 203 0 obj << /Length 262 /Filter /FlateDecode >> stream xڵJ@%4y˼nn p` A+ J--PB\_SE;%_tB=ܵlkouLn}{ ?T\n0`Bh§"( v3,rV (R0(Z1̾?^3A RW^SML j3)0}1F3f liX6e*yX i}lM󣫖 S-zY endstream endobj 204 0 obj << /Length 290 /Filter /FlateDecode >> stream xѽJ@YRyM̝p` A+ P,& Aȸϐ%GǔRFtRN2ڹ{{\$\1/)n4 ܵ0C v-0ypiVp-PL"(JvWU+ov-cDgU7({_`7'4 lÅmsH/@םb'۸^UbUVlA1J1vހg9^[9^ endstream endobj 205 0 obj << /Length 267 /Filter /FlateDecode >> stream xڝJ1'lq0޼fpVb]hy}-86L /;q5%QwFO-kHfr;r +ZoyaC 2i寙5z>%k<&r,`vd+q3ߒ1^+ \oxE<@G*q/|Aoٸ=,8U(`ش fA-pڟڤPj"{mI倷YR endstream endobj 206 0 obj << /Length 351 /Filter /FlateDecode >> stream xڭJ0ǧȥº=z =umr!4LRuDg^W4;(M}h-ԣKCQ\jժԥ*NѮ̼<ޫbu~lX)U6_GzahB t ]2G6Da)hrcfEA1-?pλճ I}҈6ĥPgOn ܘ'+tc036u! 蒡AM"9%} |H=X9ZHv]ϽmE=LQVgq)ϜRT7D]n cƒ|M'b<%NZu>v endstream endobj 207 0 obj << /Length 142 /Filter /FlateDecode >> stream x3631R0P0bcCKSCB.#1s<L=\ %E\N \. ц \.  30oAr 5 T @;af f!`` ȘՓ+ > stream x=J@ )2'p2Dl +BB\K E;qy^a2E33EdȼҥOumYꭥA +]Ȝc2͹~z|#8іF_[]PI%ae,*=c<<6F< ӉY+ _ ^Lubފq,?vMectJAqO8:G}- ȘKH~cD='0t[g7׏iC endstream endobj 209 0 obj << /Length 207 /Filter /FlateDecode >> stream xѡ0[*#pO@@ %0&H@! $h%#L"uDKzz٢"\1CtAݓSi֫u{СuB U|0ۀؖB%/Q@Px_Qv؁ʲ#rO ^7\gpx'A~^ɼP/nC|U endstream endobj 210 0 obj << /Length 288 /Filter /FlateDecode >> stream xѱN0Ы2DHmNJȀS22`%4*1Cg[!uBbbt:Ftr6IF9s|bli%cLl^_0\tSv PiYY0٣-$Fi nQC$lrڢWF$\Ea}!~"bǠ?qQu{3}>t^ uCaΟ jeG)AmJIeŐ[W.翢j؄7,?ne endstream endobj 211 0 obj << /Length 185 /Filter /FlateDecode >> stream x? P ,dМVt* ίGQzN:xȗ@ iDrj* CDJbCbqNjILjn߮#r)o̙-S/XSeFԕ+^+k۪d%A3vX}X~ö"7iӊ^Ds. endstream endobj 212 0 obj << /Length 281 /Filter /FlateDecode >> stream xu1N0G\o$"-D $(PR[mr⛐#Lvq v '33n"O'5sj<=x/5j֝){S^˵)x|1jSn衦t8z[d yDbDΰt=ZbM΢yqPje^5X*>YY:#BIj!MlG-ƨH]$?r>Pc6A٠~I"vfD7(0l@/]3wׄ endstream endobj 213 0 obj << /Length 203 /Filter /FlateDecode >> stream xҿAr $7/eQII\!R Q,'s0eQ"ܟ3?(%V U Вn(6Y4n+|א<>ȭh\ E&tj8 endstream endobj 214 0 obj << /Length 335 /Filter /FlateDecode >> stream x}K0Wz(@œ`<'(LQo/w(/h3&ORH}Ev4d|ѫ7X%7Β~|dqwqOXZk z Ūe & 'NMpL7Vh2zeBC(,JX:6t%`֩FWC`ڃv1Kǚ ֒!KtQN6G%A>"10:@|yefx~x }P@QS@C))NIG%SԦHS ]W%O endstream endobj 218 0 obj << /Length1 1590 /Length2 6881 /Length3 0 /Length 7920 /Filter /FlateDecode >> stream xڍt4މ`޻b]֪%$Z AE^/?Ϟ<;33ƬoīaH^ $@IG($bc3" B^P8L?J)hv@QI@P@@_D8B :tpċM Ꮐ:9#/ JHv(CP0!! 7 C{N<_(` | _%tA?^FpG/ nP0v9@# mY/Os@>x vpw s8B =Um>9"ܼhG~*@ F@=^|^P_5 n A !~ E@y\W spU PAms "b'vu7eF{e@  ސ <( 8AaD6C:X 08O̯nAEE+( EbbA$0G8@|эW>DgB8 GKҭD/d+So/ wZHoՁ8@@srP/UA;&f ý ( _z ⅖o^~ (@ό>P@D:@~ #.tyAG8כ  0MCm"lnG=o;Z? =e@ѕ8ur7&7[$ < ?n@?:j7hooQ5nLmtyrZpחweH ۊSN^7D9~:guvg@Ewk e&DA[B( cAvt GF24oE1'9zܨY!]EhHV|U}[pAOp=5Ÿyw*taG?0FTZTDĚԂ HÅ%uJ>-Q\&ԄP ]\trP~ SuTz$X %ߢOLW\Ps+W)w/̏afX*dAP-`$QW-n;k GnO|Tu_~˒\7uOޱk`M wMs;8I"@93C])QEi+=rRZPHiZ߂ޯO5hF(_ 朳(PHwo2VY.8icٗndLyOEXѨ{cb/^<2j V3Sg[ Q̂!3-k웺Qd|"W#K5״y_\do, գtfSBm/l}P)`c X* H&VZ53e/b_ iU%,)/cxhXY-P̻em7?NkXۜs 1~n񃪰Ep;U7j*G?z!xܜBcf $a\]f~C͒=ͼ괔FN'6Hg0۴ΫNTщh]THGtD:vR-oV {V k]OýN%B &{/Ypi;p؟,}cӝ=5l$P-.]Mro{wA)Oz?"+m2%k8/)۬)CS1g6L='f"Akόi%zr4 7O N^(_xֿFpFs9 yM^ͣ!nE]\ IiPq Ѫ^=|p _7)ĈMtTj{yԧ"&L>X>GxvaOh&쏶n*=*bQ N+ Qqqh{ }uruuO'LG5F_=WXX=aF2$+ s~[>G8GN(6_hV|B4'<P:cIK?;5ɷ}0̤:}̧c+AN2dR[;eCAA#cھΐ0熡*AG28"Mn@7'/6bGsIs/2%m;'֝.R} ]EXP9I3OFAthk79~ͮ0 cg/ 0i"{ޒ`n]m7<5#Or{ak9?$%ang::WSC'H6GuzjXvp7+{ g nI؊y9#5?r`oL`"j  Qz "ʣ [Ep2338Ǚi^>mC("'&9n۴̻bTGJx+oB?u,I0M2R5lɆ)}I(˰!/$k6[E.͋>GkZ|nTt 6s%DȽٲxit~QofFLVeӁ*uI!juL}!c˱]veNH$B<{1F#VD4n|,r+[Ű2ǐU?5R QOuS=AQ&d {]?oDZ"UB`nfA!&m&|kpF֬Z!FL=!{hfc&E[ eTYwưe|Bx+;˸лJ ,!p0g˙{U?o-ubzb4IY1K}Jѫowf,3/L2SRco#} g': 2@myJJ[]*>AC= ;oEL)6 iĂ̐+%bM枅 {g=,t`clRJJ>?4֒\w"om&ٵhszƳc`;S1hqU¿*?ϋEN17;r`zWJE}g-!vL7!lߝ,M7vl50PaըK;Eoh4C&8L-#Nv%WD 焒1yWZIO0 N̉ h_f.d”EBGx{Lk4 s`YƲGe"g-N3{lOr0#v:"diŋѫZgE)ٵFOW 1j\ߪjpAi==ƥKiucI~acW S@V3a,6'rj;"9<|9ɬNxQ êw$MOAVØ;<}Aj3bi2^cEE Aq(Kc%qI K 2iR tF!=Y 5A8%M2>0aZR೹tំx2գ+"lSɵ Y>: ge{>6sSG.4&ZL*yd|{?5UqehUcyO;l*^=ˡH?94C&eZt!+Nv,L/CTVZ̓FA9b 6.[# 04+ wDOb+ JMI-LJ\.{YDdA;Ac=x_#^G.,{BG ùL֞ȏ!ΊEf`P `|jXh,QiLڝʞpl\^:.^FwYPNgS_W@"6[8ɅB<%2NcQk뮥qn7qJ҄bTƒ/??_5 5QfjOF\`T_x8Չ= 0-~AuyC8O]Su Ƈb#h|f G PFGmCwAd_:x_6;MҀ1ǘM/}471`Q7& 'o3b|xk05mx7qu׬ClJ{"lJ-T{$U(a߉Ϩp/8…^vhuiz8?`ä^NN˚.X{ݚFU|fܽ®G5>|yKKZXCy4G"v^ o7K㍻oXl`ikyکZ3G&_prAӈ]9XogXw55)Jgl79xt[ n_^(﨟9=B>#QٙC~O=5jS(ܛtҭ!dKe vkzhIE'~cj^{M|TeuR50sz2c@/+f~iC;sxT\rN4T/tfrom ' ~bǾӢ=XyH]d}&Œ;pAe̮g66Jޮ'=qҽ;m&,UX;_rJ15#OJ?a orD{r:W +B76 RgO? d? W}r endstream endobj 220 0 obj << /Length1 1582 /Length2 8236 /Length3 0 /Length 9287 /Filter /FlateDecode >> stream xڍT]6LKI4CJҢ 5РRҝHw(!%t(|}k֚\{ؘ¬!*0W/?H@| >! ێf A 0W10ΦFa wg _D_T@a j h\!H|6Ew@ݭ#Æ/..G8@ڀ]`nE3f+ ===.H>^ E9!Hb ]2@4>|6f# ;3⊼ qw w Եpd? <'_ѿA]\`Wo= hP<o" {`;[T iQH>$wiڬjsqE@l p\a#;2l@#W;D]/Ν ?6{ @/ ?w5ap] PwPbuO;3O|wN~?Ow :{յ5* +(ABbѻ kUw~'߻FgDׄp;Nn}??UH?ǟuq']wh&?gWb uw_: |7w i"U^Pßn{0$snl6tw# cP>]m`O@XF wwcj C + u`C>hP$&E@?$E/":C'1 ?K  f/0tzb@515oxAla6!!򴞼[cROx ,pQkYoUU,t.g}7뽅xUvcoЧ|阧ޘ$+0H#Gt=Md(Qm.Ԣ7j2>zeά)yYE:8]"y2sA'Ou6h c~Oس-i|ww\W-!rUu\>~qI&P&Q׃i aWcbry,}FZp#B 8{dcW_MjL̲pN/agg=Cρ{T%gM'ړ,5&@FI[|B9a + iIn="xX7/vVj$a||'jϮQQIVfe6Vs4 ޾ܭN`4~ $p 9[eڰc'l[no>n'YEWVdd7 sg`='$_2d@ZGx;t=TߚCr_2BVɶ9İ '$y?$D 8&ZueLEs˫J]`+[1r7_|(d""Yx*ANl0P[qUY\8!TP6PEr}0xrJ9\im"OCظty+989k(6 KXO੠UV퐔/ŭ:u5%B"jVg?L ^;:>Hk^rQӜ3;5 $oj{[(^:Y^OJ1M) }4k0 ,~>:rR5p]3~ɞԺitY /ks5G5Jnhױ/ˉ`SLbG2dnQ+~ۚZEF@M L;/\zC>ߟI""xjp ׌#IoҞN$ѤQ6SJhD V |[d u^!Y*J}|gTI0yDZ_O>`OOx;smh|D2bŒ}M]"7EykH!܂Qhk;<E\ ߦ"00zGdQv4? 6I25!m0qr7߈W`j,]3'8m8}YmggA_7pWDی3/䦼Z?B ^Kڬӷ#rZ)-9OYBH P l~P\ zi)}Oh|_>.@+[݀׶GrШkntt1(޹+>2n5&ñR^_M_OvK}:b{ o 0_$(O3c" sU ~I_zkG PJ1B/^Rdµ6MJ%eG3O['pyX!x.SJ0+G+ p,&s;e۩#ɼ g<~ZQ( ASN?I"$+SVV@hObnoظDhf㤆G1+v={QВehe۩즟SCikc;޽K4 m L,zSE۹;>8)_(r@L7 `A.&gU~ƹp@pfy91RLb9\k\˷wGT,f82Zxb֓qrH^|qaTaO#;VmP. >_B%̚8j_^ Q{i}ɣXv z~T*l]k}#~a.TeUgű85-&gc'!\F9sMRb<XϺI5K?yKӝX+GR|[8Dc:1HЎWVn"[FUwdW+i6#RafrZ `s}WbG4\=Fa4[ 6C.ͪ2e_5{ W[+2vc?̰Jo+U&X" %r8d!;G$ggބdh^AZ!c~"(,@ W]!ĺRG.;ZY қX9,ɫN6n="OoHѢeSsG'J惴j]6d7h O {(׳@`TXR/k x",c,<$B1U6pX&IWޱ 3n%E˅2%7>T›d$|EcW-mxW${?sO2<ZBU8xGDTTuK{Z Kiq{?X3DNħLxrɝ ~7 Ե1 F LlA-m~V|mSM!J>tv0_JӁfi$OXDQ< zQZsVVr[6#8<a*l& 5 D_75zSaT$ bHBʅgNrzǣqQê(Cv4wg5 Yh֢Y6d 9ꧻVp{,by ;*Q́0lPjn5JaQ 9xk.ߨHJ| 館ioUXu g>_\sJ?G~IPz#iָt-CuVJbRdo M$UZ%腂~d/F!YpH^}[d';xS#iwP.+Z&71i` q;v7+ltx֗Ex4;tqx"&R8B7Ö4憯Ҟ?Jw\ ] ՏF+4!RR[Z+0ѩ U#9 Q5+]{͸\죁eb_eIXrNz'A㺩'.1zREc3"97T@JzO$abQ>J-]$}*\,-$Q~p=K43P\pBOTycJ-H b^@Y,e]Hj'Q&VatB|^^^_HxL[>b/JaT8 ;)2 >J ☴sahֵw6Rt{iX$;J`01kOlؿ-hв y/ܵg:bo)c.snN[_âRwd"Do >LӍ/+|)kFXK3 p]4j~KnN(RWRc%p&97{NգT6o{xEpR~Oĝ_PGiE4 MV!ֱ[R:xgUQ#}zzPE hj}6&zX,Ła`WC3O|4)iBz.reS]E,ۓO>ȎᴙkHΧ^>Vk^z*qbҊQ"7'8SvIӊHKoۯtX)kk%JN=;4--;Ea3diULlڤ۔-/FG;񁈚(ḃ¦8 K`+r'1n"4r v~'E K}5}pNa0ֳ҂jW8\=&3 7-߄:]Gw+3Qv بuT|X $$~c165(SKr~8ԾMC$QC ѧC^mns]Ip670MwSCP%Dc+`Z4;b;Prǻ-#>Ej$i(/z6F 1X]}A^nE$;5%|Yhz+G + ֥MOV^t&>1OS:)Zzߧ01z}h8pئ2M0PԚ8~:rQ`gjS%m)88b*`W/;=%;tHUDTDGH7F* o-j?z’tXM3cMh Ǎt3%Qc= ? i ;|g˚JQ8*|l0 1-QG}ϵd[x[麍IuӧD7AU mY_W:hS$+ƌ>9UuA {nC 1 IwC8kٜzAR*pG[|qu,C_Q*7ˌLЖ;ng)> ڞB #dc&>tEDh}L,:v&:<LjfGꪺqx K"ot= |i k>J=䫆6EǯAQ~)mX\F *4w[%^#b9e$'= y nԧeG O쾍AvK_XaxBHґ׶1)A2JxEña.D0y'#[ χo]5#qJLC_GNɵK]qM/|uQJ,q>NS e?C_}w8bs;Vfk'mN7yq Uj^]v1ԅ͞1z?.VZ1ZUMVQP(Ge݀9 u2 ]qbSk6|Tβ1t8qCezy( <[>Un# )PhϠFE8{21ˣ,%>QY32_rDBcɜz3.>&1='mz4GKfs$O+6F:m̛>l{ʓ21WLksk-4Q ̈6g)"ܲsZ=-u]ؑVy\%\,\ wHRR}HDkR75ʴKhc)L2߷̑_{YҹJAQ6P ,{-K5Tq:|1RL@5{›SRJFb@vs`{%vERRT:3ᢴip\)ݘi,ݾwO=ԋ٧M.#]&]<#-y>z&dĆsԼ3!zf {pZ)F~݆oȌ]h o{=gh-IJmTzctF+ML+\pkl-p4Z9Ԡ㠜>/1dhz@@ZmcaԪoJp1E\pz ct ޕ3?^k"j(=L@E7Ŭ8{ (QF"Wņv)(ΙcޭÈcf Bg"o ;b9@}=^ $Ǧ}x!d057lά0.]|6Qq /d͍Dg^q\rԼv< Z-!E2SQ끊 ~^Hhk]Z׸گ(C_wvkD`b%{eM #%N=LJ|.QV,f*> stream xڍtT6 H 1t% ҝJ 03 !t7Ht !%)ߨ9y}kz{_{{ # Qxq@]uq!uB(©!e7 @^H_@(@qp+.PE+Ւ v,!pi uDh q ,aP?J"N<<GWn'hC].P+Gɸq][qP%p[A]:J '(X+W!w2{6kʍDr p_@+q (!i-5_Zܮ0_#*ey, GOD]ϟp kVnN\` BVфwtuX(B$D=gN1Wݐ08HD @ ?UZ; A ㇹ* /Km|3IrHzǻ U25mdŠ)Kc//#R_3w\&xT=<0g'0zhkwqc5\ax3FnÇ'U lN6'wJR+.W<5z\(st- #lnN]6m Gz]!+Fqmq =f48Yuubzymw^G: l&;=Ӣ]Y7?a,29Q?7^ٳKXj#VvH,LyP A?+V{bEZ ^YSu)yE~ozzuXylԷӼ2LlI(Ny2İ7uM*T%9fߓzM\8:w AmMoB3?Lf'n-3Zd1S^m d_zט#jt ;#'_jLo&zXG 'F)tH T F8#<^&;Φ ǁhY20OnY7eKtϻ=*!ŒHj眃;EAL?% xA#_JEHW+Nyi}^vߛ`e=%g 谐+A 2+SFyQECQ˥AV68oo,󜎹Ixu+FM]c?ElXkGwwh\s"E%I<'S^5RaEA%6;")h[J䩞$/i j%]+m00]ASKӺ *LZяb_qi(d }.K;T(_ sp_rAnAJ;d]%nL!b?`3coS9ݛЭygDdkvx?7?+5 _84@gy.~Hӌ'~hWr-y?m{z@fvdr z̭>3z (#*O@XXrwyrUw(~stݍBmB0s:DS6aw*ݮo[}E>8t}Evh]%eoy nxsDz%͆WD5K `60zAveg .8vO˻-3`VA[1UoCK­fBdPӣN\f/=G;nH9ӍT΃p63roU.<齳݄g ˽1&nMn!sFLt8їT3.~ەR,Ɖ&ReLhT /%9U/?ަi{t-3r0`kf^WYE2axIz(R~ ɝkvM08+դh͊1cp+)'M'-T9xhU8w{Nz^jəP<~Ե^&@k)9ݛ\XJ }ݡx!엶$C'IC#M 7{𜇉;Mcq^Ӊ=g&lJ&[g}1BI8hdM1@ܯ ^N41Ə, &"~y?=#.ӕ&+hx( -%w:jko}4} i6ӱ2O$}4@˜-B(fnobzl.OoZ-b{Z""ZS;KT+ 3}];!d$ ^ NowoJL8Qm_>ʋ9 1Woc 6خw[hrs>sVlKZl8N߶u;l!TD?uީcw)%2fцDh)E9@b5FS#ԃ)yti5/;SD|ws x` KqvnOP&C솼ggP`U*HxM6AOE[z$aχ:xM}LI¬,oN !|w5kieW_YvFs~ 8W*aĺQ^=?EyNŧ_&vVhn]Į Γ{GQ͂5{fw#~{10űG:ЖIsy4)jzܘu60Jm/ab5g#&ϥfrZQqOnIӝMO鳞Jj>+.V W&[5 %[gZ<*dj^`q6WvG#(OJtm;b'Y[ 燛󡛋k[aOMľ7ްu$Ѱ_lW]xP }B[`¦atV0Wbi  ZHjJ73L`]e6"kj zklފB 98ܯ= Z$N endstream endobj 224 0 obj << /Length1 1478 /Length2 7248 /Length3 0 /Length 8243 /Filter /FlateDecode >> stream xڍwTj.H"C%!9 C AH %Htwtzsݻֽk֚ywag7Spp"| ~A)!H(((/((`g7!п`)抐_JP0)h;WP  AbR q)AA ]=`oP銀zؕ\<`NH59 @8ow #:`3}# B`P߿Bp8#nR>>>`O~W'Yn^ 4zB=_u.?؁0?#8 Ex=P r6P cǀWo ~ @\]? CzH_$/pe{`l69` B a_E8x `^P L  K @/YWxc?7o% ( .s`o( ߊK P'Ot4 u#Z  }F|T45TxTNQ'"~L}w}04('[t_k9f-ɭE!/7+[[.0_hz! ^A,Z $ 'my|0$[& C@]=a z4CDS ޜ_:Z1!Q1 @-@]t&1PD]=&* @ݽ}GÿIG ߰0{y @c zU k2#~9P_(01 X^{YJ!w|u^wp'?8VxD2u$?tYU:"6p`0O֗𥕁X~5=4V7M4w/;>-j_ZQSOGW VŴ/Q|&/BsSFhXp| |>0i Ŝ y6в>a:"P\OԤ ͞nfHv](fh.-sm#_N(ɫ`ѣ,"G?2;*6:>|K?)98LdRpQ>wmigERcY\螊eT[VTw%8B&Os:b fnѴ1A{äcp2받01oohU쒟r'4H}i ] -C R+1i/lgPk^+ꌴzL2ǴФ&V4Ӏyy+g`hYb>/iJ|`[ p0wecd嬉B$}Iptn[NXBwKǙ:yl-A]bp);c|:i>ƒ'EGğ*|R% w4q&ZJ4{14( qXkisȨ݄(;cN>,_4zX|j ӻpWF`^  ݲNٴϟ:i7mp,HˈF#N1&WUyhy6/>(a>P# KhGC٭wCWED-lO43>~)l[D 1h|,~ 6Gzx{a'XS-h~tr7Rui+=PTK02Mq݉|,'8dHLC ~q^Pɗ@=o@9 :mçbwzm_D=cYiφ}(F[o\Kk*7=B O]j-[ReRVh|/Ӻ;`] SKϷ-]ضOC[ tR,.YEWr߉]vTqAw:N4LTriF>y|CSOs%_꾪ոt=/ X#yP?5ptlpi0yZHU2m.8޹݇MǣxP jG9w. @Z=nPōgx.`8ObL͵lkw^:X+UЖ|t5}\߲XH~ZM ʄ/LHP#%XZ냫K,jdpY>Kl{T"}К)w,Q7}7t6gא*F5 U¿^={ֲ9)uAZ1͑wXv=Ip^E36<jp2k+H-&L>5顴A>j=O[ST7Ah0պxzm;DdEzz0Z QưN[ݟgQ?R=5NxWo;5LF0WFG[-\E @ԟ%M+s63<bw 3ײFSicHP0o](5qI6 m5G¸\&+U}-M,. S2Ή^ 0 P-5-lbЋ>I ⯠=Qǿo[8)xRn)[d yY;P:gzV̌yݬ||i,63*E= dmO6Bn+v@v^^<;K,{eך4_wOHG;h@};oN.q徦~G哤),֬iy70<{<ޚ(QiT:oAYOr%0>6$c8z΅K8R BuA6f|!ܽHOoZQX $e^)End8uS$f׵,bXkO%$D{J>[*d$4;}9tI1v LYܟpmXlg&mKO&sEG{d3P/ Jw2xtWjfL3zFx`cԈnb|[IGРڒqQ'&*[/F_rb>0%֘Gg.$&7Xrp_9"RnnXpO74{/EN"J}(,eR-ڳyd?ۄjN8 eYp{qW{nz5C$-Ef ES>ֽ5N<\(F 񙕔!fn2 R#"<9 X'qh˸}&$zT&~ْDZ/;iTѿǧBrõ~=k6g2KЎd8L0OWT ,x}Uqt )1śYl"R3s;y*s`OO}EB#(]IO1RX+N\.[ [➂{oCDuO%QnB5WX;_|) x e-%z<[+C $(8qi#;76Fi*0*6}ئYHcϭLQF νx1:4kzgSÌ>F܍*%៰)?H$=BL6].!tqQoplgll#(RcܿlvO q8 z-)]~Fwӯ)gxFmؚ%P ST2p1g^*tL]W(J0oнǍf-Gx3A͏z5u&~3VC; V\tE1ͮSHUC"^&AZ[֚sq)L-l8cXHžV)bH8ѭa}7td=&umiTe䱑ǵXo7/(Mo7@mA!/?37E8M%LiTV,dɓ҃t"`Iv8ۢIx4Gb1XnǁeU$ % :G Nm6!Ajɴ%z.T`]9C aI|bߧs=bA1Hx.1i%D5NGa&s3Jh1=Qz7=1Lg_ן-jVz) fMࡈ8BE˄\1lS>&,B0$ LkFEX?"ᔝp 7C]5<*xy2hHk+uJnuqMGXv);IKn %<gx <~fGR6l1-ĬGq¤"Zlz T^-|jR~F$?be=ހHdC3]1ڏ=Dx}"yZ S*!Ҙtlc_գJCͤ+oΐv~2& %xUmQ/.6_ռDmՒN'@./ 磻"/J@ʲAn<('Ig6VLk]3q*5ci|,e ]\aG's0ݭA2  cWѓxX3$M>T,/b5Y'i9uoF#ONb6g[qLfx7{{XWMCQF<(Й-_yܤ)֧"TZK_Vk2~9u_dF}{xNqNb܃<7]dQkLn|XZv@\&Čo(j5m6V/S^t-;FLφDO8p/z i&7?D:W{FD\Ⱥ)V$WCOF~wmki;ǷOe۲ޫ#bSoU*l(?5B^鴶y| x$a~\e+'sC3=)#; 88'5o>VUO6Iv(Q7}M̻Ԉ؂Mޜ5$>㭓`UjS5Q^5*Oy>1s[֩}.{3yx:m9ڜ8h G#͸CcБֻA8,CZCqiwTOέNl40*[ x٢=RfD-qiR}5gD(r6nCx¥f*B}*$Mq wdC@[šu$eQ@5mwS &~YDd$2YFs)z'SrcmݚiE#Qɧa_0Q,ͣ-_֍7jgmZqJ_sSFLXe(lϖ~AVZAC鮝 C w>qUdݽP->ڱl"gX U9n]~u}FbmeNRծ=I@2FӢa} 3;La$n"[qE5ESYRҽk%o1Ta~ #sߜ bK5Lȉ./Zpj:|j\q|Z|]NGZpoE0XbeG8@ \ڮ:T'{<0rrPes*eF`V>NDOoG*C{A-oZ @_  ]Ud1M<+Sǻ,JbaC n/ "+fzC1c@ $aUGN:zZj))?sX_(Q}Ab=b*KZ. R>w9nl0[F-f,+N7E>Ntq ju9 1=| Jr)$+7dqIwӟ+NZRWG[ .{fVF IY{k,3̼l9 a9/_|cN@٫Y)^eϺciHբz$M5sWH@P>qⅣ< K/ǐfȴy"3ӵ|VPL5"'Q&qX& Ibxn F'#B$>8 inD2r0K CMB9xF76lFra텪;)]-%WmUB¶?~|rkWͤTY*xi`]l_"Oc[_IR"^I;$ ;=U"xUܽA Ay["VSJ}u0/%Ԓ< Lq&"An%k.=kq7џFe\dډ*M-{Is/Kqr~}nfS]~CIex4Å#iJx˽jj& ct˻|oSUܡ4 d~eםw|!h TU3(Hh<_!mdQGW1eȡ.s<ăxۙ/\@%&x 3;%}l z7fJ~+rQ)j0dh6M_׶iyP@wab.Sn![d^["{L%H1n|+_K_pwӤ>=Vc}YxߡFiv;s:Gs|fWr֢@$ L%E–NϺ'#v~fIY{ 9ּӀ29I&WKGSSC)ϧ4pEVnHr5ЊIZ,3sNZT^_;B F{jZpP\Kݏkc$*2'HSd,F;'X$)v\h>XNG,F H9Q5 ,O3$h- -@vfiX6} O toO5Æ*)_n|y}JJ:n endstream endobj 226 0 obj << /Length1 1425 /Length2 6438 /Length3 0 /Length 7407 /Filter /FlateDecode >> stream xڍvTl7%1:IHKSj6rR ) RJJI4Ap@!0 'c0( hyaPo9BH@X 4]YX yX8 U..L @`h7\o Pp p7\hG16c 5@py @v`h@p.'\Bh? ~'j |pX ,W_aMBjH8 O] 9!PnJpY~p]Ϳ,ʀ`90 <@[+!`BxЍP<'X?C[o ]0@Nnd1@M0x [hw?濇 541]*uut /.)!II(&P_YE %t? 5}CXFhc@n_ovW;m?oZ_C E"#pMZ!o.J5MD`pW*p_ @MXį(KG*[',ͿBЮKRF`Aˆ !+<7 Gp 1_Ap_?B oDZ") ~2>xT ;/9NN S9^( tT!nNXgV~;K{LW>K g F>9脍/P]B$˿T!>s%[1tTV x/~RS+ޖrdp*) >ܝQH 1զ3r!/s! e^Aei N\Skpq :D:W8?pQ}(!4XmABuU,eI%d{8܄jku"\=Ź5MRMzSntk]IEyCs^?MW vnA~4%sE Fr \lRFt3NVCGn&,2΅K. =07dJ\ kPy3:l7'|aJCmrv="C _eܿa o?٥$nN]3yw#R=uXت:diNլ0K*L"$Xjck|CWٝMv[&n`v癸]SqGO^B/|Ys2A%V7V; )شyFú:)EјrF{Y˺0Y+y#k)4,Hw "ތ4P7UkV}+禬- }zt5)_D fQ(/j$qtZޥ<+>F냊̕P᥎N<+IFI^釉D4>]K΍&S(㼶 &S $Z.6c ҏK{+k[(>0l;u+G}oR`ĠOy u򖻾tlVl[ya9ޑhC6?FD\`r\Vq`(6}uN;D#pK}RΨ3,Cy T?n|v,Qx6S ݥ8=}bvbtr-Rb9vdڈsnc^()瑾Jӥ),1'x.UOLgJid]~q.w] JY; >,tn[H[w&ϫ1MuҜluT֦&"QՋc&r k/V-~ގ:F=<sBIX@#ً)/\ c"DR u.|YZG㳲+3x3 L q@4G Qsf𐡌%gzy^( 8_%9m}Eo+gP[753%ҶpúصF"uX}K)񔳂:A{[6G6ٖ#.W]ӧo~fܺ Ũ ɔz⟖9׽j| 8:˗߉x>i`MЬ: xA\nkK~zMt9K;=t@<\lnIf/-tSGTG#\q(`hz#$GN|0dc09-TYf|:dhN{1I2Xl*R禕MvDPXmPmXnA5TMИŞ`;:saJM50Zt۾[ܧu͘>Qܚ%LY[,U;g1(*X=I2gI}kJFFr5HnfQ^ǧ?R0Do|P9Ciu8"DJݼjǯZ}rS4[̠SF+RdNlCX90&X+H.*H9~/V.Sl_Wڪ626ݟ Qf~ta%zHFRV6^XJ@SXXO_  ~0BB&tPOxv);kAHW]h$E .UiNl۩Tmޖ}CFV"0n:X 53ʗhr樘8oy?S ae{/P}➍ɽdg1'Wfi0|ڭfҥλUUt{hgmѾ)9_l.+bsY 5gÈÍ{R fM5MsJr}BmIlGoq9u]faM;z}EOmy%܉֤']OޏC%:96-nrMSUҋVֱ xS*{W>sXt\;'FӟQfqM,\?Efkǎr|[bvX^k6TgO m[STA?b?{wOo]R 2[`qUl[*)H_%y %8q`[4 eh7c>cMQ)9G2"@~xi)mk*k}?$mo1O/UjؗJv͋] U|v',_Z“4ҦM0sssy0'5zp- ƛ9 Yg>۴o^'⿊uqZ1mu y(EU-_J-OW7xjɮhS`:ݤZqۍ-[߁ U#R+|S>t)ƉAKaAƞOy,N.K0O,S#6V,K`8qPW [J,mlby }*6Lĝ.Z):պHӓ!VPqHh#]( Q05Xɻ 5vּK}qg+g>E7cEyo^-W!}y%Oºqw9D*- jJ#(x2fK?yitJVR3˒glU\rwJI]o(5A d% =9^pKBEK\;JW@u!_<YH=,= ou&>54?!zh`duL_\+rZq6.TyCgx149`ΨѲ+|5*Ӳu[ahl~}3;$P!!vsLȍ9L.NT9qS)A'3X|ex$㚿Jw7SMo墀4顰qf'ɾ͇5e-<_̧RvގYA|$qBJ<[KȝYZ%Sr(̽jIBGHao-))PY um ", 4/I۾gnWxv 5>ۡ:zQnKjvݔ2 Iͧ"۠<G܋s\EgW~~&p|y[ tRK+ĵ kaoӒyK:ËʹŨ)IHp"u&Y2 9/edBO5s237">g?҂ku6ۨ{p5DվI-E4\iCfON OS1-ʬ*Sj֔P]^`sJx}E~R`sypL>H2!٢=; ?bڴӐӥ+a!F>--dݠ1t<˾KdM_@߶OPѬД8OCBގ J:7rɁ9Bu dl7JmD[}B>zR%wNX9d5"榶 &N7#oX3u-wøKo |?M"# Y$"391Mt/ 8v6f ]^ta -y~(趛f;N'qٕ&zaqiH0de`s |L2w^nv% ?@xrIJ %3~1<]$\~52R`1 u{|x w [d=1Wc!?u% 3썓/ِU_6W6}xG-˗|a|* [!ERYOq|}[mP~{kVƁ O8(ѩ0#LGVsLyb7%zY'?)qD9xaX^v뉥tS[MN̶Q]=C('R.g-;9%yDk+ݗ2!w=nX*ȳZ]յL'ݒoa֭:NjSW8'Zܸx@"߽͂\+UK3wu}u_=JĽB,ѐ9 47}@g2HӃT3eJ%"'lW_IV7yD&ubYj O:z]bOˁ \e⛨b/iI-pD8/0Hں5 V5p19Ahldfr;GtvلFSVKVqV5=_ҀTV"?8c[M\SE90^t6(-:XAb?;wBogk˥tMIj endstream endobj 228 0 obj << /Length1 1497 /Length2 6820 /Length3 0 /Length 7828 /Filter /FlateDecode >> stream xڍx4־ ZC:zލ0fČN z-Z$D BM_֬5;y>{3QϐGVÐ<@ 9? x,,F$쉀aP#Q6%{$ 4~A&=%JG6/@#X~g$j (ow;.`wԎ {(~.DzHڻ#x2`F=_%tƋ0r p''2@! 0 r9=Z]0Yy/_ 9 P0@WE8w@~nPأ*>D" _5 :fe" C"~PWs`pX+'W^|0#/_ 6g0  _yͨ<'T ^ࠀ8B@Hwtg'` Dɏד5Jap-301 p_@8G\ GWs:SK t(PB_QWwF*^Po!P(z!QS G쿩? vx7GM<h~!^;;A ?c75oP G@~0(/ 0ԐP%5CW;6aר0 5`bH Uc B@ ??Al( ~j*VB6'*oᡊ{&} 8H2eDU<zOl`0uYv#;Z,ʨ@ZWV}jH4Mog}`zG8hV&q>%%[Mh΋O%= ;삘1 _sĜy9jnEx2Hx $R+ߦeboO5DjH5 RS5Zh LԥQv犇:SuC>oj /H>3G@Ֆ]ŬRv1}\'-`5ԞW\kk~.hi.!7_:C*6񹂈cݍTTOCuk!7烐j34nۛ8g:d܃)oIL8E ^[`LUI 9i$A"#E#l\sH9bBRϕt/Ո?k >^>DܰyO]d> r6 P2 fW|6DtaPq-icB_wΛ c,齳-d>fUkRfvx&~IWa 0^4-;K'mq$ת'>v4<]b}|LW䍟<kGJaX1BkgQm$Ifz'Zj+jxd#l]^ԁpkS:\Ӳ9PVZ$./U NqEC e+8\NSTG AP ϵ65ܣB#4tGfſ{}[䜩dNa/9UHrҹ{7~Vbdbb"SL+k7$ߙN P% 77fxw73H7H,b֒K9cpt@1c3__pNΖ`b,>EtG^J1g9Q}Dߍt)=>n$pXO)@srAy¼л/iʲ}nAZxT}U=Dc+)CML.ڲi ބ+zMU4TaXF1(~Ytx.GDA Pt, a$n*~usҳ3i%R[99 c Aׯ Nlg~/^Y`4©?ьrӕ<9mH xbN4k>>ʝ j?I`BvTfYiB f`"(66"]؏,< /]8kUWǹ~.ơ)T_Э3_Lk7J'I^њ\#88>ݳQTZH ogBj}뛰Iāӌq#Р˛@3ºzX\/A[ixt\!}ҁ$#ay_S3뚳TҎ3qL|.4Խz![ 5Mr ?mOg7zM3+wP$J=T> [gK$,xYyQBVޡ|EG/Nƈ^5cG$OD{pP|g%)>w57|O< TeYHQ?T>yo{{lT:*M^:R(ŰOeX3MXVNZ:'tz=d}Džl-tPGyrj+#T4͔;;."˃_,MSN,z9ٝg̈a'IY쮙/)5[~i h:Y)Rv>GR`l鼽(c}!f˻*Zr.}|> +bͷiGfɱڱ%r杳/h>-; 8h2 ̣pj=+-Tt|}wӣP7Cf]n(Zevxp`r\`ȷe%)hgo+m݁AhțnRqm[PEcBꘪ+x󴶲IVW+=Nɨ(Y(,=HK$-w\'9jgIyO8jM/95ot ؘRr=cVx|jB#q7Nʢ"?<u|QXɲ S}v?&DĈu wWj.3=&[YAv].Q` 7b3`S`Ӏ|UAŤJSoԒd$ ɑw6$F(0Ɩ&꭫K2x"(1.^JϘw**.3D)']Źꠈ؆9H+Pek,˸9cu~T8@+ H/U$BRtzw6@/(y0#߻{F^NT&cz9{M 5\AQ/\z}qFDoГX0IXe#W IikM:ѸFcDX!iF7XǙY듚{pg|PZ+'(^cwDoLþYOZ꣏RE.ĸ?O=5졜ΆH>-lu-+ H+ৠv%pREd&Efs4fnI\|QM:`eH3N_3cS/X 3֐b⼷ ;4 `^.YVY4W]eGBeh; "tPt,X+*fzVZ\ٍ>fV3]E>yqE1- bP8Z?!-͗$Y#8hÉNcXi{Sh{C_ :KiGag^`{0({*" zG$qZ˔眦4~rpYs⹤~ne^N{^N 5!Xvo_م.n. 7ߡ'>t°+s8Žܯ$>D>诪o(Q+W¢G,k^ is؜86Q! rS0q lO_n9DFT(r*d*ot9ypxĒ|N+Υ=>y#\Xԍ|GC`lT+4sDT@JEds+zđKv iH4wCSITl[}t6C$bt"|lcqcL63ߜ68)Kz0Iu-湩"B7pu}9?SжV.BySԝ [g΋R(|}p?Ee%x&3"iI4]h8 ǤeL㚰VwrO%{iȔV܁kO7z ZMtS"q&.6u_SSIX~x~o{6D5y޳uZx_o^?9<Ȼc7:ό Yqr4?c Hg*{%sR'ig5$A'R~ PFVߤro3px0W'?1e_y} $gYlJzn3"c>'U7^wZؠC ιtF׭mgAb4_![oJyn~g6~\?3lh,k#]>WULT^xT+rS6wb_ҜB^iшWC6j[El^R(csoMfI)d<a%43m2#1oҘzM;~I j;sWެ_Z"M:ܗ>nNtqd[^6/{3N`mm8߉N|* 9dR~˯ n{|(W IzSk+k#9סrs欝hʈ43O lqQ)g?2)Pu@?&V ,;@d[薔?KspT𘙪k{(X=h cz)[-L˨4+OѦanNNr\'s#{`e_3'{$D{>&zGu|e=%42Jj)Xp;ѡ7 /xân/Eh X<-!|'AVn9VOq\ߏ[xmtllx~>cwLw{~2 o%5:E~3*ic]軳C03nEzjbf9ZW.e&7Kt>̞O) V UAT9)* շ8nOT=}qtkqr='_}25| 6#4$JQIw]Pbzt/=aEhHz*(3eegpľ闩+)}. n7em\}iGofBJ,* "#q Cޘ}oRw Ro)YՕUBHɣJ$+iFQ?tc}ue!1I>EN<>ŭҽvzy2Φނ6Ay< \Uy~G1q'B^.cnt N45+95AG{ík~:b=\#xWPb/>v~ݹe<UmMPg8|0]#&'ne~3+!,M?Ι0K%,@' r/yۆc>U..NKqi LpZ7BG = p-&˫#7gJƺ T= 40oUx%:]%!Z@ w, KΦ9/Vux%v7<tC?> stream xڍtT.(0HHw#C0t7R%R  !Hw7 8޵]7gw}EKG a U@Q< ^>1OMrH.H((4O:@HD_DR vYy*8ԅM䉄آ=y; E `8@:w G q[I tww;"60-@EAh&%b\k;  wAg­Hzs@ CVCx{6/f*NC G'0XM5^! E; `70l& P9\x]`F*>ey, GOB sp;5) UKACDl(#aaAQt~ |NkP_5GvPHWsE`j:ZY/  -/+? 2QTR3c227HH"\e5OcWn@U pG|B|-)77;;0Ͽh]Qh#67ǴP+GQ`6h1y0J /9P- ׷_1 ZCP}<3~!a{/$ id@S}$ѯkapW_(?*C\H~ ֿ z@!Dӓʐ ,X@A/bLu}&,e2 ʭB,UZZ3Kk?`p i~51Wѓ;3 q34;=uq qԱ.Oɘ<|&gl:+LX:[l"xGTB0&% d_gp.d%ݘD*Rj5Ft>$kyy1Dprd}r14+AJ|`݇@+2_`?IH~JrRлUZyqGл9P]D^b^j`7% ƻ|r: (eJ;PC ),?J!~73-gU`绘G8&WD<"2~=*AӠD}pt2ܭG oގm J: Л,qydpfJ_M]'bA[s1M_ M[WL顫~R8`Őw1xe=o 2C]̌קf"gt{,@gGf 8JOCHHC#L;[$ igneT+e'Ȕ_vVvONِAI7uҿ+4&[a1[xDW.g~54!A+/c]|x"Zugyco r >^j{Qv%ga?ݢحy&p5x[8u#vlTP`Q \:[';~u20#+K}=Ϸ;4’5~]P&ƛlRƀ5'_^K AR)3 50ȸåv}fc՘).;EEGgyVPJ޸^suvq8҄IW 4=<8JR>3dF u  .,Rcz*&#fH,0sNhmwtjd'R.vOȦ30Vll0.i i^W5f0p'vJ<^ZmҶ{5* ~HKphK3W/lc+>-2xҰ6q6mQț!H]=1h'(EY~'t[w >|P?[\/Y@8|!Zk7}PBL>SOK_XUIS׶}952#a4{^5S}gWWdʣNB7a2l_gc̲@e1U69Nyj #'.o8[ V$;-_2*<S9,u._8zD/;aߌ+2Ҽ3maW(?ORyfO^[cHgM'PhF iMkɭ=aK {;wG)BC][Dz=vsj~'P,WX[/Oa1k"C#JReGGKI-k}َI73hbއ+V-q ~ 3ëĿSȓvIn(/5'Uܖ۝5Ӳ~Rd?zmUY}5s.1oጁ(JXlP+nvs^سi/BR;@|8 }2VT&;#SdkiOZxz rq7p óFܽ_V7Gsh.bJmedfT6*;sBr(bWQN=HnSGpSSm[2!&f(5T FR 1^2svC8j%KzXSxsy yNu2`cPJ |Mvfig&ik'kQ6E6EpU(B i /;U8Rm+4T`a?bǀt7׬qNޔmğ=ȡYMGyG ৣNpF5}N$XvK @~Txr6 <0Ӱ%Dz^͟?NvǨP:&oer#M@qR#?_˸R;7.p~Y栖bz$J}$^:PE~L2]ZYd~oaG9fcUe98 hߞXTyJn[$I{|r~.E]Rvw>]!d}S!2>ta$K$8-,Kmsf҉9窏}-lKt*V~T<?z/!)9>>h֐}0e_=xji6j?fQ"v`>GO<0lNZh.4(u->;9Y&i{OHO8;E;-s3-J6[mދG?ԛIs]OFP<|wٲܟ&^a:h.260<`}c**m\IWrH߫ËiJ&TGB'2m mL}ʭ<_%zT,fJ{tHVg &P.~bjVSRuQR$μp53e&|*]ȪPm(^RTIYӱ 2]Q'BfKg;/'6y^`E)~՗?a3W~E>L:lߟpYpm{'*@]'Х'L÷[z2n hvZM2mjkFf̶GKv 4.`"oE22kIƳ II׶CՓM߀UUZvk胉[dO-(miONP%r>NQuOͰ#q 4I'qSJ<Ri"Zprt.XPii+hg| zy|kخ S̥ZbP/ap k5)5U ng,&BWX(y)je*=R/_Ոeڦ|%* 9{wF޺P6byy7KJh)${g`x̡D4F0Z|XkGhAq@љyd%Dn|R]]=n۲N/[qQgh7f1G~핳5 VQzKD0fQM^<̘x)=}ל +>z"rVkx b,c X83% pϳHҚ7,NJh1ǻvo }QsiVM|7{U<`#HeqW88*4%hδnpwZI9e[?NAQK9k]q!ƕ8N*ۂ|=V*b&:?3[37 qikh0Jb:'u@^DxcrbX+6Q'F'A7‡$ݪ)Gڶg$E_n L:oC|y]0-Of*JHW\  BOGpNvc^oZi+7^ zξGiNn< ĚssVXjY*{ۉ]z&m:[d9;9ER$諩^HL@Wop; |!+xR6na7j(nT)(MygxE&]N9>e}[uEpn2JNQw亪J%%BM43k!%_{ ~!kF=jYW=u^M0@240d߼W3_\ f\34ik?2I endstream endobj 233 0 obj << /Producer (pdfTeX-1.40.15) /Creator (TeX) /CreationDate (D:20151010164524+01'00') /ModDate (D:20151010164524+01'00') /Trapped /False /PTEX.Fullbanner (This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2015/dev/Debian) kpathsea version 6.2.1dev) >> endobj 20 0 obj << /Type /ObjStm /N 63 /First 531 /Length 3544 /Filter /FlateDecode >> stream x[[o7~ׯ],<;@&iv"ȃb+J23CΌeK#9e&UURUJ Jh]I[JWYHxSѕSy=UVUU PIR2a&0WЕu$UWJk䕲*wx7a6T2aX{2V&/\rLeXd*  j2U4a}B@&T;lǜȺ9_y˹PBpRah% N@d  `V d`EU3 K !+$ \\XE||"@$1<ڈ_lpqbr~$Pa >|a5J1iYռv5pfA|dmV|, cNu̎i|ڼgδ=涋`ֵykj(h~^?,'0ex/P'a%Is$#a> klw,֐V]6ol7EnyMUJtRjuO<叄֘}@kצ(_f5^^l߰F|uJܓ'߰lE zS{v=s6jG[3<c28Cj2b ?S)X?ֲv^ pZZ`: gׯ ݺYm/_Q Czkk恵b 걯jHEJ?[T:C!%4WƄ + ,*%ΤɐNR{fs ]j͸u` }󺾀 |W`(Y//@ʾp]C(~)50[\c* us۾?Y̑8+X3Iq)cҘ_ۭkι\]3mOqE>Ъ00vP $a*VF0fՀQ=0J s'X=@!).p3@YAZ/{w`\j4lԚ/d`RR`jƱbPI˛*~#fmnq|o-s@#ʾ*MU,TOy#))֎tucb}/ԌQ}4ZYz<6{ͣ⚯գZaUJHp֒|@GV4ǁpT ߞBBBXĘBRRRBT' }beOlauO)==$Fhwu)10 $HEe2M&Crvpœƹt86)H j! q8Hm6ؘJ'iKq@(7mre[He: |JӢ{*zҨ?ESC(5k\;O5Of_k cIِl[v0mlSZ g5FB(V"]w12A~~gHN'zo8B'ARȜ"'2cGl:j;pp,F `8™l0됏>f7i u;Lnn|3_gdݺ+P}WfUU8AL\!c>-_y`zax]\]hd೅R DJ֡':Bxe;姎K㴎}$f%!XIH?QsJ\=`k,xaǨPi:t??#jOp,}P/I2BJz∃=Մ=n?Yw emwE.aۮP6%J=i`Lvb;G6gw^ ETG^S}17Is Ot4W*q{%`7v ^MCFNSZ_j4-FcY!WÜ 0' H#m ֶh=PPXjdDaRm *4Ȕx#SZodJLipv`فgpv`YS=X1QI0}C̚]X!0Yj1Fמ?x}9ğ/BFze&rs 70gܡ8 O^M(kyKe ǖʬHss }Sk@6߾DY"DWGo{bEQky\U4š0B 9Ⱥ #zgķ@,Dhi(*P jK}0Aw@c~;1zW$n(#}<Hz]1oJ5mOKuj%&`e't;mp'~ ǎ⻳w\$IERv\DttoY1n",%K*xqVcvlګVzQ&{QRr5:n( #E}(_wHQ9^2P/sI;)BaMI*zH*_{H*'I'ir9_/ouI^|x#w5T' Q؉IsKcȋm/ 'Vv;Z?ZpWc;B}ך%o͗|3=__9ȅmsX^-yjt[^^v5O+ns9rz]n.۫_O$^b!,|wOowPq/}5y d`"qc欙7z1.Uslf6rul?$Kq?9=}IvSL-l= vm!9r^{O l£kPovRY, .nos{ui.֫!Io>=| ^4&Dޏ~_ o;-T'ؔpdAqqzŗx]!) Sw2r˛>~x7?DVVNHG>'v%20|O4׀zT2}ዏ1xϋõ3G>jB:&_}xu]~`PX{Zdiu{.=VRԑ_{$=t^Y Y򂣼 tFY򾺜Q5/ endstream endobj 234 0 obj << /Type /XRef /Index [0 235] /Size 235 /W [1 3 1] /Root 232 0 R /Info 233 0 R /ID [ ] /Length 695 /Filter /FlateDecode >> stream x%{LQs-^o~. hbrDm\қʥPBM+,l\23a1L,hs{==9 !Ĥ)F0!ąh"fDC"H4$|NHcjDIaZ=FdFQ"`_1  `s=p:À&d1"sІ`v 8Γz.p . man_MANS=rsbackup.1 rsbackup.cron.1 rsbackup-mount.1 rsbackup-snapshot-hook.1 EXTRA_DIST=$(man_MANS) rsbackup-debian.html disk-encryption.html \ rsbackup-docs.html \ rsbackup-manual.in.html rsbackup.css CHANGES.html testing.md \ decay.lyx decay.pdf MANHTML=rsbackup.1.html rsbackup.cron.1.html rsbackup-mount.1.html rsbackup-snapshot-hook.1.html all: rsbackup-manual.html $(LYX_TARGETS) html: $(MANHTML) pdf: decay.pdf rsbackup-manual.html: rsbackup-manual.in.html Makefile rm -f $@.new sed 's/_version_/${VERSION}/g' < ${srcdir}/rsbackup-manual.in.html > $@.new chmod 444 $@.new mv -f $@.new $@ %.1.html: %.1 $(top_srcdir)/scripts/htmlman $^ # You need lyx to do make dist(check) from git, but not just make. %.pdf: %.lyx if type lyx >/dev/null 2>&1; then lyx -e pdf2 $<; fi clean-local: rm -f *.new distclean-local: rm -f rsbackup-manual.html rm -f $(MANHTML) rsbackup-3.0/doc/rsbackup-manual.in.html0000664000175000017500000007262112601750104015242 00000000000000 rsbackup

rsbackup

Contents

1. Overview

rsbackup backs up your computer(s) to removable hard disks. The backup is an ordinary filesystem tree, and hard links between repeated backups are used to save space. Old backups are automatically pruned after a set period of time.

This guide describes how to set up and manage rsbackup. See the man page for detailed reference information.

2. Setting Up

2.1 Installation

The systems you want to back up are called clients. The system that has the backup hard disk(s) attached to it is called the server, and it is on this system that the rsbackup program runs. The server can itself be a client.

Each client must have an SSH server and rsync installed. For Debian and Ubuntu systems it should be sufficient to install them as follows (if you don’t have them already):

apt-get install openssh-server rsync

The server requires rsync and an SSH client. Again for Debian:

apt-get install openssh-client rsync

For other platforms, you must consult their documentation, or install them from source:

2.1.1 SSH Setup

The server’s root login needs to be able to SSH to each of the clients’ root logins without having to enter a password or confirm a key hash. You should consult the SSH documentation to set this up, but the general procedure, assuming you use RSA keys and OpenSSH, is as follows. If you are sufficiently familiar with SSH to do this without further documentation, skip to the next section.

On the server create an SSH key with:

sudo ssh-keygen

When asked for a passphrase, just hit return (but see below). Then copy ~root/.ssh/id_rsa.pub to each of the clients and append it to their ~root/.ssh/authorized_keys. At the same time, retrieve the clients’ host key hashes with:

ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub

As root on the server, ssh to each of the clients and verify their host keys hashes.

2.1.2 Installing rsbackup

To install rsbackup, go to www.greenend.org.uk/rjk/rsbackup and download the source code:

wget http://www.greenend.org.uk/rjk/rsbackup/rsbackup-_version_.tar.gz
tar xf rsbackup-_version_.tar.gz
cd rsbackup-_version_
make
sudo make install

(You will probably need to change the version number.)

On Debian systems you can use the pre-built .deb files:

wget http://www.greenend.org.uk/rjk/rsbackup/rsbackup__version__amd64.deb
sudo dpkg -i rsbackup__version__amd64.deb

(You will probably need to change the version number and perhaps the architecture.)

At this point it should be possible to read the man page, which contains reference information:

man rsbackup

2.1.3 Variations

  • What If The Server Is Also A Client?

    If you want to backup the backup server itself then you don’t need to set up the server to be able to SSH to itself. See below for how to configure this.

  • What If I’m Not The Superuser?

    rsbackup does not actually depend on being the superuser, although of course its functionality will be limited if it isn’t. However you could for instance use it to back up your home directory to your portable USB disk. The setup is the same except that you do it for your personal login rather than root and therefore don’t use sudo.

  • What If I Don’t Like Empty Passphrases?

    In this case you will have to find some other way of making the server’s private SSH key available when backups run. This is outside the scope of this document.

2.2 Configuration

rsbackup reads a configuration file from /etc/rsbackup/config. (Use the --config option to override this, if you prefer another location.) You will need to enter some global settings and then describe the backup clients.

2.2.1 Backup Storage

First you should define where backups will be stored. This guide will assume you use removable hard disks, but you can use permanently online backups too.

For each distinct backup device you need to define two things. The first is the mount point that the device will appear at. For example, if you have two backup disks and the mount points are /backup1 and /backup2 you would write the following:

store /backup1
store /backup2

The second is to define device names. Device names correspond to the contents of a single-line file called device-id in the root of the backup device. For instance, if you called your devices backup1 and backup2 you would write the following:

device backup1
device backup2

Of course, you must also create these files! For example:

echo backup1 > /backup1/device-id
echo backup2 > /backup2/device-id

rsbackup does not mind if the devices share a mount point (and only one is present at a time); any device may use any mount point as far as it’s concerned. You will probably find it more convenient to give them separate mount points though. If more than one device is mounted when you make a backup, backups will be made to all of them. You can use the --store option to select just one.

Although it would of course be convenient for users to be able to access backups of their files directly, it would also mean that they could go “back in time” past permission changes or deletions of private files belonging to one another. Therefore, the top directory of your backup devices should (usually) be owned by root and mode 0700 (i.e. -rwx------). By default, rsbackup will insist on this, although you can use the public option to change this behaviour.

chmod 700 /backup1 /backup2

Remember to update /etc/updatedb.conf to exclude your backup devices. Otherwise updatedb will spend ever-increasing amounts of time indexing your backups.

2.2.2 Global Parameters

Next you may want to define some global ageing parameters. These can be overridden for each volume you back up, so by defining global ones you are only setting defaults.

The first one you might want to set is the maximum age of the most recent backup. If any volume’s most recent backup is older than this many days then it will show up as red in the backup status report. The default is 3 days. To reduce it to (for instance) 1 day:

prune-parameter max-age 1

The second parameter to choose is the age at which backups are automatically pruned, i.e. deleted. The default is 366 days, ensuring that you will be able to “go back” up to a year. If you only wanted to go back a month you could reduce it as follows:

prune-parameter prune-age 31

Remember, these are defaults and can be overridden on a per-host or per-volume basis.

There are a few other global settings described in the man page. They will not be covered here.

2.2.3 Defining What To Back Up

The rest of the configuration file will define what to back up (and what to exclude).

There are two ways to organise your configuration file.

  1. You can put all the configuration for all the hosts in the main configuration file.

  2. You can put each host’s definitions in a file of its own and include them all. To do this put a line at the end of your configuration file as follows

    include /etc/rsbackup/hosts.d

    Then for each host create a file named after the host in this directory and use it to store the host’s configuration, as described below.

    The the Debian packaging of rsbackup uses this approach.

For each host to back up, you should write a host stanza. This will contain some host level settings and then a volume stanza for each part of the host’s filesystem back up.

Here is an example host stanza:

host sfere
  volume root /
  volume boot /boot
  volume home /home
    prune-parameter prune-age 366
    exclude /*/Desktop/Trash/*
    exclude /*/.local/share/Trash/*
    exclude /*/.mozilla/*/Cache/*
    exclude /*/.ccache
  volume var /var
    exclude /tmp/*

The meaning of this is as follows:

  • The first line contains the name of the host. This would normally be its DNS name (see below for an example of where it is not).

  • Each of the volume lines contains the name of a volume on the host and the path to that volume. By default, rsbackup will assume that each volume corresponds to a (mounted) filesystem and therefore not backup files from other filesystems.

  • In this case there are four volumes. root and boot are quite simple: all the files in them will be backed up.

  • home, however, is more complex. Firstly, it has a prune-age setting to ensure that it is kept for longer than the default lifetime. Secondly, it excludes various trash and cache directories.

    In the first three cases, it does this by backing up the directory but not its contents; they will be empty on the backup device. In the fourth case, it does not even backup the directory. Note that the exclusion patterns are rooted at the path to the volume - they are not absolute path names. (Consult the rsync documentation for --exclude for more information about these patterns.)

  • /var is similar to home in that a temporary directory is excluded.

An important note: the indentation is not significant to rsbackup - only to the reader. Anything that comes after a host directive and before the next host or volume directive is considered part of that host. Similarly anything that comes after a volume directive and before the next host or volume directive is considered part of that volume.

This example shows how to back up a host where the name differs from the DNS name. The important part is the hostname directive:

host lith
  hostname chymax
  volume lith /Volumes/Lith
    exclude "Temporary Internet Files"
    exclude /RECYCLER
    exclude /pagefile.sys
    exclude "/Documents and Settings/*/Local Settings/Temp"
    exclude "/System Volume Information/_restore*"

What is actually going on here is that lith is really the Windows partition on chymax. The computer usually runs Unix, with the Windows partition mounted for convenience. So to get lith’s files, it is necessary to ssh to chymax.

This example shows how to back up without using SSH at all:

host araminta
  hostname localhost
  volume root /
  volume boot /boot
  volume home /home
    prune-parameter prune-age 366
    exclude /*/Desktop/Trash/*
    exclude /*/.local/share/Trash/*
    exclude /*/.mozilla/*/Cache/*
    exclude /*/.ccache
  volume var /var
    exclude /tmp/*
  volume news /var/spool/news
    prune-parameter prune-age 14

In this case, araminta is actually the backup server, so using SSH would mean SSHing to itself. The hostname localhost is special-cased to avoid using SSH at all.

Here is example of backing up a laptop:

host kakajou
  max-age 7
  volume users /Users
    prune-parameter prune-age 366
    exclude /*/.Trash/*
    exclude /*/Library/Caches
    exclude /*/Library/VirtualBox/Machines/*/Snapshots
    exclude /*/Library/VirtualBox/**.vdi
  volume local /local
    prune-parameter prune-age 366
  volume etc /etc
  volume sw /sw

This host is usually asleep or not even in the house, so opportunities to back it up are rare. Therefore it has a host-wide max-age setting.

3. Manual Backups

3.1 Initial Backup

Before you actually make a backup, you should do a “dry run” to verify that rsbackup does what you expect.

rsbackup --backup --dry-run

This will print out the commands that it would run without actually executing them. It’s also a good way of verifying that the syntax of the configuration is correct.

Once you’re happy with the output, you can try making an initial backup:

rsbackup --backup --verbose

The --verbose option makes rsbackup report what it is doing as it progresses. In normal use you would omit it but it’s useful when setting up and crucial when debugging.

Depending on how much data you have (and how fast your disks and network are) the initial backup may take a very long time. I did my initial backups inside an instance of screen so that they couldn’t be affected by logging out, etc.

For each backup of each volume, an entry will be made in /var/log/backup/backups.db detailing what was backed up and recording any error output.

3.2 Pruning Old Backups

Pruning refers to deleting a volume’s old backups. During pruning, a backup will be deleted if it is older than the volume’s max-age setting, with the proviso that the most recent min-backups backups on each store will not be deleted.

To prune any backups that are due to be deleted:

rsbackup --prune --verbose

The details of what is pruned are logged to files in /var/log/backup.

3.3 Failed Backups

If a backup fails then it will be left in an incomplete state. You can tell rsbackup to pick up where it left off simply by running it again on the same day; if however you leave it until another day then that backup will never be completed. To delete any incomplete backups, therefore:

rsbackup --prune-incomplete --verbose

Backups are not pruned immediately because even if they are incomplete, the portion that succeeded may be useful to reduce the amount of data copied when you retry.

3.4 Retired Volumes

When you take a volume or host out of service, you need to tell rsbackup about this. The first part of this is to remove the corresponding volume or host sections in the configuration file. If you don’t do this then rsbackup will keep on trying to backup the obsolete volume or host.

The second part is to delete old backups for the volume and their corresponding records. If you don’t do this then the report will complain about them. This can be done with the --retire option:

rsbackup --retire HOST:VOLUME

...or:

rsbackup --retire HOST

All backups on available devices and their corresponding records will be deleted (possibly a slow process).

If you want to keep (say) the last backup for the volume then you should at least rename it aside, otherwise --retire will delete it; you may prefer to tar it up and compress it.

3.5 Status Reports

You can generate an HTML status report to a disk file:

rsbackup --html status.html

This will show:

  • Any backups to unknown devices. (See below.)
  • For each volume, the dates of the oldest backup, how many backups exist. The latter is red if there are any devices with no backups of the volume.
  • For each volume’s backup to a each device, the date of the newest backup on the device and the total number of backups on the device. The former is red if it violates the max-age setting for the volume and the latter is red if there are no backups of the volume on the device.
  • The rsync output for the last backup, if it failed. You can use the --logs option to make the logfile section more verbose.
  • Logfiles for pruning.

If you prefer plain text you can use --text instead of --html.

You can also request that the report by sent by email, with the --email option. This is intended for use when automating backups. The email contains both the plain text and the HTML versions, most mail clients should be able to pick whichever they are best able to display.

4. Automatic Backups

If you installed from a .deb then have a look at the Debian-specific documentation.

Manual backups might be perfectly adequate for you. However, computers are often better at remembering to perform scheduled tasks than humans are, so it may be better to run your backups as a cron job. For example, to run your backups, with pruning and a report, at 1am every day you might use the following crontab line:

0 1 * * * rsbackup --backup --prune --email root

This will automatically do a backup every night, prune any out-of-date backups, and mail a report to the system administrator.

You might want to add (for example) a weekly prune of incomplete backups:

0 8 * * 0 rsbackup --prune-incomplete

5. Snapshots

If you use Linux LVM then you may prefer to snapshot filesystems while they are being backed up, so that there is no possibility of files changing half way through the backup. This can be achieved by adding the following lines to your configuration file:

pre-backup-hook rsbackup-snapshot-hook
post-backup-hook rsbackup-snapshot-hook

Then for each volume that is to be snapshotted, create /snap/VOLUME on the target host. The volume name must be the one used by rsbackup, for instance root, boot, home or var in the first example above. Before each volume is backed up, a snapshot will automatically be created; it will be removed again after the backup is complete or on failure.

There is a man page for rsbackup-snapshot-hook detailing what it does and the options it can take.

6. Device Management

6.1 Lost Devices

Hard disks get lost or stolen, and fail. In this case rsbackup needs to be told that one of its devices has gone away. The first part of this is to delete the corresponding device directive in the configuration file (and the store directive, if that’s unique to the device).

The second part is to delete records for backups to the device. If you don’t do this then the report will complain about them. This can be done with the --retire-device option:

rsbackup --retire-device NAME

You can do these steps in either order, but if you delete the records first, you will be ask if you are sure. You can override this with the --force option.

--retire-device will never delete actual backups, only the backup records.

6.2 Upgrading Devices

If a backup device gets full you have several options:

  • Reduce the number of backups to be kept on it by lowering prune-age. But sooner or later you may reach the point where you just cannot keep backups as long as you like.

  • Introduce an entirely new, bigger device and take the old device out of service, either keeping it against a rainy day or destroying it as described above.

  • Copy all its contents to a new, bigger device, keeping the same device name. Remember to delete the old device-id file, or confusion may follow!

7. Restoring

Backups aren’t worth anything if you can’t restore, course.

7.1 Manual Restoration

The backup has the same layout, permissions etc as the original system, so it’s perfectly possible to simply copy files from a backup directory to their proper location. This is the most convenient way if you want to rescue only a small number of files.

Be careful to get file ownership right. The backup is stored with the same numeric user and group ID as the original system used. Put another way, the relationship between usernames and user IDs (and group names and group IDs) on the backup disk reflects the client, not the server (or any other machine the disk might be attached to).

Until a backup is completed, a corresponding .incomplete file will exist. Check for such a file before restoring any given backup.

7.2 Restoring With rsync

You can do bulk restores with rsync. For example, supposing that host chymax has a volume called users in which user home directories are backed up, and user rjk wants their entire home directory to be restored:

rsync -aSHz --numeric-ids /store/chymax/users/2010-04-01/rjk/. chymax:~rjk/.

-a means recursive into directories; preserve symlinks, permissions, modification times, groups, owners, device files and special files. -S means handle sparse files efficiently. -H means preserve hard links. -z means compress data for transfer; you might want to omit this if your CPU is slow.

--numeric-ids is important as backups are stored with the same numeric user and group IDs as the original system; no translation via name is performed.

8. Links, etc

rsbackup-3.0/doc/rsbackup.css0000664000175000017500000000314412327265357013220 00000000000000/* Copyright © 2011 Richard Kettlewell. * * 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 . */ body { color: black; background-color: white } a:link, a:visited, a:active { color: blue; text-decoration: underline } h1 { background-color: #e0ffe0; padding: 0.2em } h2 { background-color: #e0e0e0; padding: 0.2em } h3 { text-decoration: underline } a.h3 { margin-left: 1em } h1,h2,h3,h4 { font-family: sans-serif } table { border-collapse: collapse } th { background-color: #e0e0e0; border-left: 1px solid #e0e0e0; border-top: 1px solid #e0e0e0; border-right: 1px solid #e0e0e0 } td { border: 1px solid black; vertical-align: top; padding-left: 4px; padding-right: 4px } td.bad { background-color: #ff4040; color: #ffffff } td.good { background-color: #e0ffe0; color: #000000 } span.bad { color: #ff4040 } pre.log { background-color: #f0f0f0 } .example { border-left: 2px solid black; padding-left: 2px } div.volume { margin-left: 1em } .recent { color: #ff4040 } rsbackup-3.0/doc/disk-encryption.html0000664000175000017500000001720712327247125014702 00000000000000 Setting Up An Encrypted Disk

Setting Up An Encrypted Disk

This isn’t part of rsbackup proper, but since you might well want to encrypt your backups, the setup process is sketched here.

Threat Model

The main threat I’m interested in protecting against is that a petty criminal comes into possession of my backup disk either by stealing it from an offsite location, or because I manage to lose it somehow. I don’t want them able to read my email or gain access to website passwords (of which I have far too many to remember, and most of them don’t protect anything especially important).

I’m not especially interested in protecting my backups from the NSA. If an organisation with government-level resources were to take an interest in me, then realistically they have better tools available than stealing my backups.

The reason I document this is that, if you are interested in defending against better-resourced attacks than I am (for instance if you live in a country with a highly repressive government), the details below may not be suitable for you.

The Tools

The device mapper is the Linux kernel’s framework for creating virtual block devices. In this case, we are interested in creating a virtual block device that has the plain text corresponding to encrypted data on a physical block device.

dm-crypt is the low-level means of achieving this: writes to the virtual block device are encrypted and forwarded to the underlying physical device, and similarly reads from the virtual block devices are forwarded to the physical device and the content decrypted. The plain text will not be available if the correct key has not been supplied.

Linux Unified Key Setup (LUKS) is a specific encryption scheme that we’ll use.

cryptsetup is a command line tool we’ll use to set things up.

Setting Up An Encrypted Device

First create the partition to encrypt, using your favourite disk partitioner, lvcreate, or whatever. Any pre-existing contents will be destroyed, so take a backup if there is anything important there. I’ll assume below that the device name for the partition it /dev/sdb1, but obviously you should change this to whatever device you are using.

To create the LUKS data structures and establish a key:

# cryptsetup luksFormat /dev/sdb1

WARNING!
========
This will overwrite data on /dev/sdb1 irrevocably.

Are you sure? (Type uppercase yes): YES
Enter LUKS passphrase: 
Verify passphrase: 
Command successful.

As you can see, you must choose a passphrase. The default encryption key is 128 bits long, so it’s worth using a longer password than the traditional 8 characters, provided you can actually remember it. (A password you can’t remember is no use whatsoever.)

Note: cryptsetup also supports reading the key from a file. If keeping the key file safe somewhere (a couple of well-hidden USB sticks, say) is easier than remembering a suitably long passphrase, that might be more appropriate.

Note: cryptsetup offers a variety of cipher specifications. You may wish to review the available options and consult the cryptsetup FAQ rather than accepting the default.

At this point the encrypted partition exists but does not have any filesystem in it and the underlying plaintext is not accessible. It’s possible to detect the format:

# cat /dev/sdb1 | file -
/dev/stdin: LUKS encrypted file, ver 1 [aes, cbc-essiv:sha256, sha1] UUID: c3ad50a5-a379-4e72-9f92-cacf592

The next step is to create a virtual block device with the plaintext:

# cryptsetup luksOpen /dev/sdb1 backup3
Enter LUKS passphrase: 
key slot 0 unlocked.
Command successful.
# ls -l /dev/mapper/backup3 
brw-rw---- 1 root disk 254, 7 2010-03-14 15:54 /dev/mapper/backup3

You will need to re-enter the passphrase you chose earlier.

At this point you can create a filesystem:

# mkfs -j -Lbackup3 /dev/mapper/backup3 
mke2fs 1.41.3 (12-Oct-2008)
Filesystem label=backup3
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
62336 inodes, 248870 blocks
12443 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=255852544
8 block groups
32768 blocks per group, 32768 fragments per group
7792 inodes per group
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376

Writing inode tables: done                            
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 29 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

When I did this on a 4TB USB2-attached disk, it took about 40 minutes. So you might want to go away and do something else.

By default the filesystem will be regularly fsck’d. You can suppress this, if you want:

# tune2fs -c0 -i0 /dev/mapper/backup3

It’s now possible to mount the new filesystem:

# mount /dev/mapper/backup3 /mnt
# really ls -l /mnt
total 16
drwx------ 2 root root 16384 2010-03-14 15:55 lost+found
richard@araminta:~$ df -h /mnt
Filesystem             Size  Used Avail Use% Mounted on
/dev/mapper/backup3    957M  1.2M  908M   1% /mnt

So now you can create files, take backups, etc.

Note that just because the disk is encrypted does not imply that other users of the system cannot get at its contents while it’s mounted. The normal file permission rules apply.

To unmount and detach the disk:

# umount /mnt
# cryptsetup luksClose backup3
rsbackup-3.0/doc/testing.md0000664000175000017500000000330512452265667012675 00000000000000rsbackup testing ================ rsbackup contains, broadly speaking, three collections of tests. Unit Tests ---------- These are `src/test-*.cc` and test individual aspects of the source code. Currently they are strongest on utility functions and classes and weakest on the functional logic of rsbackup. Missing things include: * The `Backup` class. * Error/warning reporting. * Store identification. * Device access hook invocation. * Most of the implementation of the following classes: * `Host` * `Volume` * `Conf` * Most of the hard bits of the `Subprocess` class. * Much of the `Command` class. * Error handling in the following classes: * `Directory` * `IO` * `Unicode` * Functional logic such as `MakeBackup.cc` and `Prune.cc`. Functional Tests ---------------- These can be found in the `tests` directory. They execute the `rsbackup` commands in various ways and verify that the behavior and output are as expected. Missing things include: * Sending email. * Responses to subprocess, IO and database errors. * Prompting. * Warning options. * Config file syntax errors. * Certain config file options. * Store permission checking. * Handling of ‘incomplete’ backups. * Removal of old pruning records. * Remote backups (needs a ‘fake’ `ssh`). * Script Tests ------------ These are `tools/t-*` and test some of the scripts that accompany rsbackup. They use `scripts/fakeshell.sh` to mock commands invoked by the scripts. Missing: * `rsbackup-mount` * `rsbackup.cron` Running Tests ------------- Tests can be run via `make check` in the root directory, or in one of the individual directories listed above. To record test coverage information, configure with: ./configure --with-gcov rsbackup-3.0/doc/rsbackup-snapshot-hook.10000664000175000017500000000414212367135333015354 00000000000000.TH rsbackup 1 .\" Copyright (c) 2012, 2014 Richard Kettlewell .\" .\" 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 . .SH NAME rsbackup-snapshot-hook \- rsync-based backup utility .SH SYNOPSIS \fBrsbackup-snapshot-hook\fR [\fIOPTIONS\fR] .SH DESCRIPTION \fBrsbackup-snapshot-hook\fR creates and removes LVM snapshots when configured as a pre- or post-backup-hook for \fBrsbackup\fR(1). .PP Snapshots will only be created for volumes that have a corresponding directory in the snapshot directory. For instance, a snapshot will be created for the volume \fBroot\fR if \fI/snap/root\fR exists. (Use the \fB\-\-snaps\fR option to change the snapshot directory.) Such volumes must be stored in a logical volume. .PP Leftover snapshots are always unmounted and removed before creation. .PP Snapshots are given only a fraction of the size of the original volume. Use the \fB\-\-divisor\fR to change this. .PP After creation snapshots are fsck'd and mounted. If an error occurs in any part of the creation process, the partially snapshot created snapshot may be left in place (and ultimately be torn down when the post-backup-hook is run). .SH OPTIONS .TP .B \-\-snaps\fR, \fB\-s\fI PATH Set the path to the snapshot directory. The default is \fI/snap\fR. .TP .B \-\-divisor\fR, \fB\-d\fI DIVISOR Set the snapshot size ratio. The default is 5. .TP .B \-\-help\fR, \fB\-h Display usage message. .TP .B \-\-version\fR, \fB\-V Display version string. .SH "SEE ALSO" \fBrsbackup\fR(1), \fBlvm\fR(8) .SH AUTHOR Richard Kettlewell rsbackup-3.0/doc/rsbackup-docs.html0000664000175000017500000000417012103242262014300 00000000000000 rsbackup

rsbackup

Getting Started

Reference Information

Miscellaneous

  • Change history
  • rsbackup home page
  • rsbackup on Github
    • rsbackup-3.0/doc/rsbackup-debian.html0000664000175000017500000001113712103242262014573 00000000000000 rsbackup and Debian

      rsbackup and Debian

      The Debian package of rsbackup has some extra features. You could use these on other systems but on Debian they are set up to work automatically.

      /etc/rsbackup/config

      In the .deb package, the default /etc/rsbackup/config is as follows:

      # Location of lockfile
      lock /var/run/rsbackup.lock
      
      # User configuration
      include /etc/rsbackup/local
      
      # Hosts
      include /etc/rsbackup/hosts.d

      Normally you would not edit this file. Instead, put local configuration in /etc/rsbackup/local and a file for each host to back up into /etc/rsbackup/hosts.d.

      /etc/rsbackup/defaults

      There is an extra configuration file for the cron jobs, /etc/rsbackup/defaults. The default is as follows:

      #
      # List hosts to backup hourly, daily, weekly and monthly
      #  - set the empty string to back up no hosts (at that frequency)
      #  - use the special string "_all" to back up everything
      #
      hourly=""
      daily=_all
      weekly=""
      monthly=""
      
      #
      # Set report=hourly|daily|weekly|monthly to control frequency of
      # email reports.  (Hourly is probably a bit much!)  Only effective
      # if email is not "".
      #
      report=daily
      
      #
      # Set email=ADDRESS to have the report emailed to that address.
      #
      email=root
      
      #
      # Set prune=hourly|daily|weekly|monthly|never to control frequency of
      # automated pruning of old backups
      #
      prune=daily
      
      #
      # Set prune_incomplete=hourly|daily|weekly|monthly|never to control
      # frequency of automated pruning of incomplete backups
      #
      prune_incomplete=weekly
      
      #
      # Prefix to the rsbackup command
      # Use 'nice' and/or 'ionice' here
      #
      nicely=
      • hourly, daily, weekly and monthly define the hosts to back up at the given frequencies. You can set any (or all) of them to _all to back up all known hosts.

        Set them all to ""if you have some other arrangement for initiating backups.

        hourly is intended to be used to opportunistically back up hosts that are often down, for instance laptops and personal desktops. weekly and monthly are appropriate for hosts that almost never change.

      • Set email to the destination address for reports from the daily backup run, or comment out the line entirely to suppress email reports. If you want reports at some other frequency than daily, modify report.

      • Modify prune to control the frequency of pruning of old backups. It is recommended to leave this as daily, since deleting a week or more’s worth of backups takes a very long time.

      • Modify prune_incomplete to control the frequency of deleting incomplete backups. It is recommended to keep this at a lower frequency than you take backups, as otherwise rsync will not be able to use incomplete backups to optimize new ones.

      • Modify nicely to control the priority of rsbackup. For example, you might use:

        nicely="nice ionice -3"
      rsbackup-3.0/doc/Makefile.in0000664000175000017500000003740412635241702012735 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_LIBS = @BOOST_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GCOV = @GCOV@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBPTHREAD = @LIBPTHREAD@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ LYX_TARGETS = @LYX_TARGETS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ SQLITE3_LIBS = @SQLITE3_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. # # 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 . man_MANS = rsbackup.1 rsbackup.cron.1 rsbackup-mount.1 rsbackup-snapshot-hook.1 EXTRA_DIST = $(man_MANS) rsbackup-debian.html disk-encryption.html \ rsbackup-docs.html \ rsbackup-manual.in.html rsbackup.css CHANGES.html testing.md \ decay.lyx decay.pdf MANHTML = rsbackup.1.html rsbackup.cron.1.html rsbackup-mount.1.html rsbackup-snapshot-hook.1.html all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local dvi: dvi-am dvi-am: html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-local \ cscopelist-am ctags-am distclean distclean-generic \ distclean-local distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags-am \ uninstall uninstall-am uninstall-man uninstall-man1 all: rsbackup-manual.html $(LYX_TARGETS) html: $(MANHTML) pdf: decay.pdf rsbackup-manual.html: rsbackup-manual.in.html Makefile rm -f $@.new sed 's/_version_/${VERSION}/g' < ${srcdir}/rsbackup-manual.in.html > $@.new chmod 444 $@.new mv -f $@.new $@ %.1.html: %.1 $(top_srcdir)/scripts/htmlman $^ # You need lyx to do make dist(check) from git, but not just make. %.pdf: %.lyx if type lyx >/dev/null 2>&1; then lyx -e pdf2 $<; fi clean-local: rm -f *.new distclean-local: rm -f rsbackup-manual.html rm -f $(MANHTML) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: rsbackup-3.0/doc/rsbackup.cron.10000664000175000017500000000563512103242262013515 00000000000000.TH rsbackup.cron 1 .\" Copyright (c) 2011 Richard Kettlewell .\" .\" 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 . .SH NAME rsbackup.cron \- cron script for rsbackup .SH SYNOPSIS \fBrsbackup.cron\fR [\fIOPTIONS\fR] \fIFREQUENCY\fR .SH DESCRIPTION \fBrsbackup.cron\fR is invoked from cron to run automated backups, pruning and reporting. .PP \fIFREQUENCY\fR must be one of \fBhourly\fR, \fBdaily\fR, \fBweekly\fR or \fBmonthly\fR, corresponding to the frequency it is invoked at. .SH OPTIONS .TP .B \-\-dry\-run\fR, \fB-n Passes the \fB\-\-dry\-run\fR option to \fBrsbackup\fR. .TP .B \-\-verbose\fR, \fB-v Displays the \fBrsbackup\fR command before executing it. .TP .B \-\-help\fR, \fB-h Displays a usage message and terminates. .TP .B \-\-version\fR, \fB\-V Display version string. .SH CONFIGURATION Configuration is read from \fI/etc/rsbackup/defaults\fR. This is a shell script fragment and it should define the following variables: .TP .B hourly .TP .B daily .TP .B weekly .TP .B monthly Define the list of hosts to back up at a given frequency. Use the special string \fB_all\fR to back up all hosts. .TP .B report Defines the frequency to send an email report. .TP .B email Defines the destination address for the email report. .TP .B prune Defines the frequency of pruning old backups. .TP .B prune_incomplete Defines the frequency of pruning incomplete backups. .SS Example .nf # # List hosts to backup hourly, daily, weekly and monthly # - set the empty string to back up no hosts (at that frequency) # - use the special string "_all" to back up everything # hourly="" daily=_all weekly="" monthly="" # # Set report=hourly|daily|weekly|monthly to control frequency of # email reports. (Hourly is probably a bit much!) Only effective # if email is not "". # report=daily # # Set email=ADDRESS to have the report emailed to that address. # email=root # # Set prune=hourly|daily|weekly|monthly|never to control frequency of # automated pruning of old backups # prune=daily # # Set prune_incomplete=hourly|daily|weekly|monthly|never to control # frequency of automated pruning of incomplete backups # prune_incomplete=weekly # # Prefix to the rsbackup command # Use 'nice' and/or 'ionice' here. Remember to quote correctly. # nicely= .fi .SH "SEE ALSO" \fBrsbackup\fR(1), \fBrsbackup-mount\fR(1) .SH AUTHOR Richard Kettlewell rsbackup-3.0/doc/rsbackup-mount.10000664000175000017500000000465512327522303013723 00000000000000.TH rsbackup-mount 1 .\" Copyright (c) 2011, 2012, 2014 Richard Kettlewell .\" .\" 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 . .SH NAME rsbackup-mount \- mount encrypted or unencrypted disks used by rsbackup .SH SYNOPSIS \fBrsbackup-mount\fR [\fIOPTIONS\fR] [\fB\-\-\fR] [\fIDEVICES\fR] .SH DESCRIPTION \fBrsbackup-mount\fR mounts and unmounts encrypted or unencrypted partitions used as backup stores by \fBrsbackup\fR(1). .SH OPTIONS .TP .B \-\-unmount\fR, \fB\-u Unmount devices. (The default is to mount devices.) .TP .B \-\-check\fR, \fB\-c Check for available devices that aren't open. .TP .B \-\-dry\-run\fR, \fB\-n Do nothing, instead print the commands that would be executed. .TP .B \-\-key\-file \fIPATH\fR, \fB\-k \fIPATH Pass the argument \fB\-\-key\-file\fR \fIPATH\fR to \fBcryptsetup\fR. .TP .B \-\-help\fR, \fB\-h Display usage message. .TP .B \-\-version\fR, \fB\-V Display version string. .SH CONFIGURATION Configuration is read from \fI/etc/rsbackup/devices\fR. This is a shell script fragment. It should set \fBdevices\fR to a (space-separated) list of device names and for each device name \fID\fR, define \fID\fR\fB_uuid\fR to its UUID. To specify that a device is unencrypted (i.e. that it just requires mounting or unmounting), define \fID\fR\fB_plain\fR as a non-empty string for that device. (Have a look in \fI/dev/disk/by-uuid\fR to find device UUIDs). .SS Example .nf # List names of devices here devices="backup3 backup4" # For each device, define DEVICE_uuid # e.g. devicename_uuid=8f4171f0-007d-4083-a40c-407e5f9c24dd backup3_uuid=8f4171f0-007d-4083-a40c-407e5f9c24dd backup4_uuid=80a1ca0d-d07a-4195-9da1-8cbb9fbc11b9 # For any device that isn't encrypted, define DEVICE_plain # e.g. devicename_plain=1 backup3_plain=1 .fi .SH "SEE ALSO" \fBrsbackup\fR(1), \fBrsbackup.cron\fR(1) .SH AUTHOR Richard Kettlewell rsbackup-3.0/doc/CHANGES.html0000664000175000017500000003263212621637013012623 00000000000000 Changes To rsbackup

      Changes To rsbackup

      Please see rsbackup in git for detailed change history.

      Changes In rsbackup 3.0

      • Pruning now supports selectable, and pluggable, pruning policies. See the PRUNING section of the man page for further information. The default behavior matches previous versions. Fixes issue #7.
        Advance warning: the min-backups and prune-age directives are now deprecated in their current form and will produce a warning. In some future version they will be removed. Instead, use prune-parameter min-backups and prune-parameter prune-age.
      • Advance warning: the public, always-up, check-mounted and traverse directives now take an explicit boolean argument. Using them without an argument is now deprecated (but has not changed in meaning). In some future version the argument will become mandatory.
      • Removal of backups (when pruning, or retiring a volume) now parallelizes removal across devices. Fixes issue #24.
      • The rsync-timeout and hook-timeout directives are now inherited, as documented. ssh-timeout becomes inherited too. The sendmail directive is now documented.
      • Host and volume names may no longer start with “-”.
      • --dump-config --verbose now annotates its output. Some options missed by --dump-config are now output.
      • A C++11 compiler and Boost are now required.

      Changes In rsbackup 2.1

      • rsbackup.cron will always run the prune and report steps, even if the earlier steps fail.
      • rsbackup-snapshot-hook copes better with aliases for logical volumes. Fixes issue #23.
      • Pruning logs in the report are now limited by the report-prune-logs configuration setting.

      Changes In rsbackup 2.0

      • Incompatible change: pre-backup and post-backup hooks are now run even in --dry-run mode. The environment variables RSBACKUP_ACT can be used by the script to distinguish the two situations. rsbackup-snapshot-hook has been modified accordingly. Fixes issue #9.
      • Incompatible change: The log format has changed. The old per-backup logfiles are gone, replaced by a SQLite database. Old installations are automatically upgraded. Fixes issue #11.
      • New check-mounted option verifies that a volume is mounted before backing it up. Fixes issue #13.
      • New store-pattern option allows stores to be specified by a glob pattern instead of individually. Fixes issue #5.
      • New stylesheet and colors options allow operator control of the stylesheet and coloration in the HTML version of the report. Fixes issue #6.
      • The semantics of lock are now documented. Fixes issue #20.
      • Shell scripts supplied with rsbackup no longer depend on Bash.
      • Dashes are now allowed in hostnames. Fixes issue #21.
      • The order in which hosts are backed up can now be controlled with the priority option. Fixes issue #19.
      • Reports now include counts of various error/warning conditions in the summary section; email reports reflect these in the subject line. The always-up option is slightly modified: backups of always-up hosts are attempted, resulting in error logs, even if they do not seem to be available. Fixes issue #22.
      • New --database option allows the path to the database to be overridden.

      Changes In rsbackup 1.2

      • Quoting and completeness fixes to --dump-config option.
      • OSX builds work again.
      • The cron scripts no longer attempt to run rsbackup.cron when it has been removed. Fixes Debian bug #766455.
      • Some fixes to Debian packaging.

      Changes In rsbackup 1.1

      • Error messages about missing unavailable devices with --store are now more accurate. Fixes issue #10.
      • The include command now skips filenames that start with #. Fixes issue #12.
      • The command-line parser now rejects invalid host and volume names (rather than accepting ones that will never match anything). Zero-length device, host and volume names are now rejected (in all contexts).
      • The test suite has been expanded, and supports concurrent execution if a sufficiently recent version of Automake is used. Fixes issue #14.
      • rsbackup-snapshot-hook no longer fails if fsck finds and fixes errors. It is also now tested. Fixes issue #15.

      Changes In rsbackup 1.0

      • New --dump-config option to verify configuration file parse.
      • New --check option to rsbackup-mount.
      • Configuration files are now read in a fixed order (issue #8).
      • The --force option no longer implies the --verbose option. (This was a bug.)
      • Minor bug fixes.

      Changes In rsbackup 0.4.4

      • Correct RSBACKUP_STATUS value passed to post-backup hook. (Bug spotted by Jacob Nevins.)

      Changes In rsbackup 0.4.2

      • --retire no longer fails if a host directory has already been removed.
      • Fixed recalculation of per-device backup counts, visible as self-inconsistent reports when generated in the same invocation of rsbackup as some other operation.

      Changes In rsbackup 0.4.1

      • Fix a crash with the --html option (Jon Amery).
      • Fix to --prune-incomplete option, which wouldn't work in the absence of some other option (Jacob Nevins).

      Changes In rsbackup 0.4

      • The new pre-access-hook and post-access-hook options support running “hook” scripts before and after any access to backup storage devices.
      • The new pre-backup-hook and post-backup-hook options support running “hook” scripts before and after a backup. Although these can be used for any purpose, the motivation is to enable the creation of LVM snapshots of the subject filesystems (and their destruction afterwards), resulting in more consistent backups. The supplied hook script only knows about the Linux logical volume system.
      • The new devices option allows a host or volume to be restricted to a subset of devices, identified by a filename glob pattern.
      • The new rsync-timeout option allows a time limit to be imposed on a backup.
      • The new check-file option allows backups of a volume to be suppressed when it is not available (for instance, because it is only sometimes mounted).
      • --verbose (and therefore --dry-run) is now more verbose.
      • --text and --html now accept - to write to standard output.
      • Improved error reporting.
      • Minor bug fixes and portability and build script improvements.
      • rsbackup-mount now supports unencrypted devices and separate key material files (contributed by Matthew Vernon).

      Changes In rsbackup 0.3

      • --prune honours command-line selections again.
      • The “oldest” backup for a host with no backups now shows up as “none” rather than “1980-01-01”.
      • The new --logs option controls which logfiles are included in the HTML report. The default is to only include the logfile of the most recent backup if it failed. Also, if the most recent attempt to backup a volume to a given device failed, its heading is highlighted (in red).
      • The tool scripts now have proper --version options. Single-letter command line options are now supported (in fact they existed in many cases already but weren’t documented).
      • Retiring a volume no longer makes a (futile and harmless!) attempt to remove . and ...
      • The .incomplete files used by the Perl script to indicate partial backups are now created by the C++ version too. They are created both before starting a backup and before pruning it. rsbackup itself does not rely on them itself but they are an important hint to the operator when doing bulk restores.
      • Logfiles of backups where pruning has commenced are now updated to reflect this, so that they will not be counted as viable backups in the report.
      • Error output from failed backups is now more visible. The old behaviour can be restored with the --no-errors option.
      • Missing or misconfigured stores are now reported in more detail. If it looks like a store is present but misconfigured (for instance, wrong permissions), this is always reported as an error. If it looks like the store is absent then this is only reported if --warn-store is given, but if no configured store is present then the problems found with all configured stores are listed. The documentation on how to set up stores has also been clarified.
      • Prune logs now include detail about why a backup was eligible for pruning.

      Changes In rsbackup 0.2

      rsbackup has been rewritten in C++. The behaviour is largely same except as follows:

      • New --text option generates a plaintext version of the report. In addition the email report includes both the text and HTML versions.
      • --prune-unknown is removed. It is replaced by --retire, which is used to remove backups of volumes (and hosts) that are no longer in use and --retire-device which is used to remove logs for devices that are no longer in use.
      • The rsync command now includes the --delete option, meaning that interrupted backups no longer include stray files from the first attempt.
      • .incomplete files are no longer created. Instead the logs are used to distinguish complete from incomplete backups.
      • Various --warn- options to control what is warned about.
      • New always-up option to indicate that a host is expected to always be available to back up.
      • There are now test scripts.
      rsbackup-3.0/tests/0000775000175000017500000000000012635241746011345 500000000000000rsbackup-3.0/tests/setup.sh0000664000175000017500000001007712621635675012771 00000000000000# Copyright © 2011, 2012, 2014 Richard Kettlewell. # # 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 . export WORKSPACE="${PWD}/w-${0##*/}" RSBACKUP="${VALGRIND} ${PWD}/../src/rsbackup --config ${WORKSPACE}/config ${VERBOSE}" PRUNE_POLICY="${PRUNE_POLICY:-age}" PRUNE_AGE="${PRUNE_AGE:-prune-age}" MIN_BACKUPS="${MIN_BACKUPS:-min-backups}" setup() { echo echo "* ==== $0 ====" rm -rf ${WORKSPACE} mkdir ${WORKSPACE} mkdir ${WORKSPACE}/store1 echo device1 > ${WORKSPACE}/store1/device-id echo "store ${WORKSPACE}/store1" > ${WORKSPACE}/config echo "device \"device1\"" >> ${WORKSPACE}/config mkdir ${WORKSPACE}/store2 echo device2 > ${WORKSPACE}/store2/device-id echo "store ${WORKSPACE}/store2" >>${WORKSPACE}/config echo "device device2" >> ${WORKSPACE}/config echo "public true" >> ${WORKSPACE}/config echo "pre-access-hook ${srcdir:-.}/hook" >> ${WORKSPACE}/config echo "post-access-hook ${srcdir:-.}/hook" >> ${WORKSPACE}/config echo "keep-prune-logs 1" >> ${WORKSPACE}/config echo "prune-policy ${PRUNE_POLICY}" >> ${WORKSPACE}/config [ -n "$PRUNE_PATH" ] && echo "prune-parameter path ${PRUNE_PATH}" >> ${WORKSPACE}/config [ -n "$DECAY_LIMIT" ] && echo "prune-parameter decay-limit ${DECAY_LIMIT}" >> ${WORKSPACE}/config mkdir ${WORKSPACE}/logs echo "logs ${WORKSPACE}/logs" >> ${WORKSPACE}/config echo "lock ${WORKSPACE}/lock" >> ${WORKSPACE}/config echo "host host1" >> ${WORKSPACE}/config echo " hostname localhost" >> ${WORKSPACE}/config [ "${PRUNE_AGE}" != none ] && echo " ${PRUNE_AGE} 2" >> ${WORKSPACE}/config echo " volume volume1 ${WORKSPACE}/volume1" >> ${WORKSPACE}/config [ "${MIN_BACKUPS}" != none ] && echo " ${MIN_BACKUPS} 1" >> ${WORKSPACE}/config echo " pre-backup-hook ${srcdir:-.}/hook" >> ${WORKSPACE}/config echo " post-backup-hook ${srcdir:-.}/hook" >> ${WORKSPACE}/config echo " check-file file1" >> ${WORKSPACE}/config echo " volume volume2 ${WORKSPACE}/volume2" >> ${WORKSPACE}/config [ "${MIN_BACKUPS}" != none ] && echo " ${MIN_BACKUPS} 2" >> ${WORKSPACE}/config echo " volume volume3 ${WORKSPACE}/volume3" >> ${WORKSPACE}/config [ "${MIN_BACKUPS}" != none ] && echo " ${MIN_BACKUPS} 2" >> ${WORKSPACE}/config echo " devices *2" >> ${WORKSPACE}/config mkdir ${WORKSPACE}/volume1 echo one > ${WORKSPACE}/volume1/file1 mkdir ${WORKSPACE}/volume1/dir1 echo two > ${WORKSPACE}/volume1/dir1/file2 mkdir ${WORKSPACE}/volume2 echo three > ${WORKSPACE}/volume2/file3 mkdir ${WORKSPACE}/volume2/dir2 echo four > ${WORKSPACE}/volume2/dir2/file4 echo five > ${WORKSPACE}/volume2/dir2/file5 mkdir ${WORKSPACE}/volume3 echo six > ${WORKSPACE}/volume3/file6 mkdir -p ${WORKSPACE}/got } cleanup() { rm -rf "${WORKSPACE}" } compare() { if diff -ruN "$1" "$2" > ${WORKSPACE}/diffs; then : else echo "*** $1 and $2 unexpectedly differ" cat ${WORKSPACE}/diffs exit 1 fi } exists() { if ! [ -e "$1" ]; then echo "*** $1 does not exist" exit 1 fi } absent() { if [ -e "$1" ]; then echo "*** $1 unexpectedly exists" exit 1 fi if [ -e "$1.incomplete" ]; then echo "*** $1.incomplete unexpectedly exists" exit 1 fi } s() { echo ">" "$@" "#" ${RSBACKUP_TODAY} >&2 if [ -z "$STDERR" ]; then if [ -z "${RSBACKUP_TODAY}" ]; then RUN="${RUN}" "$@" else RUN="${RUN}" RSBACKUP_TODAY="${RSBACKUP_TODAY}" "$@" fi else if "$@" 2> "$STDERR"; then cat "$STDERR" >&2 else cat "$STDERR" >&2 false fi fi } exec 3>&2 rsbackup-3.0/tests/retire-device0000775000175000017500000000543112460720465013741 00000000000000#! /bin/sh # Copyright © 2011, 2014, 2015 Richard Kettlewell. # # 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 . set -e . ${srcdir:-.}/setup.sh setup echo "| Create backup" RSBACKUP_TODAY=1980-01-01 s ${RSBACKUP} --backup --text ${WORKSPACE}/got/create.txt # volume1: 1980-01-01 # volume2: 1980-01-01 sqlite3 ${WORKSPACE}/logs/backups.db "SELECT host,volume,device,id,rc,status,log FROM backup" > ${WORKSPACE}/got/created-db.txt compare ${srcdir:-.}/expect/retire-device/created-db.txt ${WORKSPACE}/got/created-db.txt exists ${WORKSPACE}/store1/host1/volume1/1980-01-01 exists ${WORKSPACE}/store1/host1/volume2/1980-01-01 exists ${WORKSPACE}/store2/host1/volume1/1980-01-01 exists ${WORKSPACE}/store2/host1/volume2/1980-01-01 compare ${srcdir:-.}/expect/retire-device/create.txt ${WORKSPACE}/got/create.txt echo "| Edit config" sed < ${WORKSPACE}/config > ${WORKSPACE}/config.new 's/^device device2//' mv ${WORKSPACE}/config.new ${WORKSPACE}/config echo "| --dry-run should do nothing" RSBACKUP_TODAY=1980-01-01 s ${RSBACKUP} --retire-device --dry-run --text ${WORKSPACE}/got/dryrun.txt device2 sqlite3 ${WORKSPACE}/logs/backups.db "SELECT host,volume,device,id,rc,status,log FROM backup" > ${WORKSPACE}/got/created-db-bis.txt compare ${srcdir:-.}/expect/retire-device/created-db.txt ${WORKSPACE}/got/created-db-bis.txt exists ${WORKSPACE}/store1/host1/volume1/1980-01-01 exists ${WORKSPACE}/store1/host1/volume2/1980-01-01 exists ${WORKSPACE}/store2/host1/volume1/1980-01-01 exists ${WORKSPACE}/store2/host1/volume2/1980-01-01 compare ${srcdir:-.}/expect/retire-device/dryrun.txt ${WORKSPACE}/got/dryrun.txt echo "| Retire device2" RSBACKUP_TODAY=1980-01-01 s ${RSBACKUP} --retire-device --text ${WORKSPACE}/got/device2.txt device2 sqlite3 ${WORKSPACE}/logs/backups.db "SELECT host,volume,device,id,rc,status,log FROM backup" > ${WORKSPACE}/got/device2-db.txt compare ${srcdir:-.}/expect/retire-device/device2-db.txt ${WORKSPACE}/got/device2-db.txt exists ${WORKSPACE}/store1/host1/volume1/1980-01-01 exists ${WORKSPACE}/store1/host1/volume2/1980-01-01 exists ${WORKSPACE}/store2/host1/volume1/1980-01-01 exists ${WORKSPACE}/store2/host1/volume2/1980-01-01 compare ${srcdir:-.}/expect/retire-device/device2.txt ${WORKSPACE}/got/device2.txt cleanup rsbackup-3.0/tests/pruneexec0000775000175000017500000000423012601750105013173 00000000000000#! /bin/sh # Copyright © 2015 Richard Kettlewell. # # 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 . set -e PRUNE_POLICY=exec MIN_BACKUPS=none PRUNE_AGE=none PRUNE_PATH=${srcdir}/pruner.sh . ${srcdir:-.}/setup.sh setup echo "| Create backup" RSBACKUP_TODAY=1980-01-01 s ${RSBACKUP} --backup echo "| Create second backup" RSBACKUP_TODAY=1980-01-02 s ${RSBACKUP} --backup echo "| Create third backup" RSBACKUP_TODAY=1980-01-03 s ${RSBACKUP} --backup compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-01 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-02 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-03 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-01 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-02 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-03 echo "| Prune" RUN=pruneexec RSBACKUP_TODAY=1980-01-04 s ${RSBACKUP} --prune compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-01 absent ${WORKSPACE}/store1/host1/volume1/1980-01-02 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-03 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-01 absent ${WORKSPACE}/store1/host1/volume2/1980-01-02 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-03 sqlite3 ${WORKSPACE}/logs/backups.db "SELECT host,volume,device,id,rc,status,time,pruned,log FROM backup" > ${WORKSPACE}/got/pruneexec-db.txt compare ${srcdir:-.}/expect/pruneexec/pruneexec-db.txt ${WORKSPACE}/got/pruneexec-db.txt cleanup rsbackup-3.0/tests/configs/0000775000175000017500000000000012635241746012775 500000000000000rsbackup-3.0/tests/configs/pruneparam/0000775000175000017500000000000012635241746015147 500000000000000rsbackup-3.0/tests/configs/pruneparam/config0000664000175000017500000000017712620463022016247 00000000000000prune-parameter a b prune-parameter c d prune-parameter e f host spong prune-parameter a bb prune-parameter --remove c rsbackup-3.0/tests/configs/empty/0000775000175000017500000000000012635241746014133 500000000000000rsbackup-3.0/tests/configs/empty/config0000664000175000017500000000000012356017171015222 00000000000000rsbackup-3.0/tests/configs/include/0000775000175000017500000000000012635241746014420 500000000000000rsbackup-3.0/tests/configs/include/config.d/0000775000175000017500000000000012635241747016110 500000000000000rsbackup-3.0/tests/configs/include/config.d/z0000664000175000017500000000000712356017171016211 00000000000000host z rsbackup-3.0/tests/configs/include/config.d/backup~0000664000175000017500000000001412635237245017407 00000000000000host backup rsbackup-3.0/tests/configs/include/config.d/empty0000664000175000017500000000000012356017171017067 00000000000000rsbackup-3.0/tests/configs/include/config.d/#recovery#0000664000175000017500000000001612356017171017704 00000000000000host recovery rsbackup-3.0/tests/configs/include/config.d/.dotfile0000664000175000017500000000001512356017171017443 00000000000000Host dotfile rsbackup-3.0/tests/configs/include/config.d/a0000664000175000017500000000000712356017171016160 00000000000000host a rsbackup-3.0/tests/configs/include/config0000664000175000017500000000002112356017171015512 00000000000000include config.d rsbackup-3.0/tests/check-configs0000775000175000017500000000253012450336324013706 00000000000000#! /bin/sh # Copyright © 2014 Richard Kettlewell. # # 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 . set -e . ${srcdir:-.}/setup.sh RSBACKUP="${VALGRIND} ${PWD}/../src/rsbackup" rm -rf ${WORKSPACE} mkdir ${WORKSPACE} # in case of accident... if [ ! -f ${srcdir:-.}/configs/include/config.d/backup~ ]; then echo 'host backup' > ${srcdir:-.}/configs/include/config.d/backup~.$$ mv ${srcdir:-.}/configs/include/config.d/backup~.$$ \ ${srcdir:-.}/configs/include/config.d/backup~ fi for root in ${srcdir:-.}/configs/*; do exec 3>${WORKSPACE}/got.txt s cd ${root} s ${RSBACKUP} --config config ${VERBOSE} \ --dump-config >&3 s cd - compare ${srcdir:-.}/expect/${root##*configs/}.txt ${WORKSPACE}/got.txt rm -f ${WORKSPACE}/got.txt done rm -rf ${WORKSPACE} rsbackup-3.0/tests/pruneage0000775000175000017500000000155112601750105013006 00000000000000#! /bin/sh # Copyright © 2015 Richard Kettlewell. # # 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 . set -e # Same as prune but using the new style of prune policy parameter # setting PRUNE_AGE="prune-parameter prune-age" MIN_BACKUPS="prune-parameter min-backups" . ${srcdir:-.}/prune rsbackup-3.0/tests/Makefile.am0000664000175000017500000000606312620463022013311 00000000000000# Copyright © 2011-2015 Richard Kettlewell. # # 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 . TESTS=bashisms backup prune pruneage prunenever pruneexec prunedecay \ retire-device retire-volume store \ check-file check-configs \ check-mounted glob-store style upgrade EXTRA_DIST=${TESTS} setup.sh pruner.sh hook \ expect/retire-device/create.txt \ expect/retire-device/device2-db.txt \ expect/retire-device/created-db.txt \ expect/retire-device/device2.txt \ expect/retire-device/dryrun.txt \ expect/include.txt \ expect/retire-volume/volume2.html \ expect/retire-volume/dryrun.html \ expect/retire-volume/create.txt \ expect/retire-volume/volume2.txt \ expect/retire-volume/created-db.txt \ expect/retire-volume/dryrun.txt \ expect/retire-volume/all.txt \ expect/retire-volume/all.html \ expect/retire-volume/all-db.txt \ expect/retire-volume/volume2-db.txt \ expect/retire-volume/create.html \ expect/store/duplicate-stderr.txt \ expect/store/duplicate.html \ expect/store/overridden.txt \ expect/store/overridden.html \ expect/store/duplicate.txt \ expect/store/overridden-stderr.txt \ expect/upgrade/interrupted-db.txt \ expect/upgrade/simple-db.txt \ expect/prune/createsecond.txt \ expect/prune/null.txt \ expect/prune/dryrun-db.txt \ expect/prune/volume2.txt \ expect/prune/volume1.txt \ expect/prune/third.txt \ expect/prune/dryrun.txt \ expect/prune/null-db.txt \ expect/prune/unselected-db.txt \ expect/prune/created.txt \ expect/prune/volume2-db.txt \ expect/prune/volume1-db.txt \ expect/prune/everything-db.txt \ expect/prune/unselected.txt \ expect/prunedecay/prunedecay-db.txt \ expect/pruneexec/pruneexec-db.txt \ expect/prunenever/neverprune-db.txt \ expect/check-file/missing.html \ expect/check-file/missing.txt \ expect/style/styled.txt \ expect/style/styled.html \ expect/empty.txt \ expect/glob-store/everything.txt \ expect/glob-store/everything.html \ expect/backup/onehost.html \ expect/backup/dryrun.html \ expect/backup/everything.txt \ expect/backup/onevolume.html \ expect/backup/onevolume.txt \ expect/backup/dryrun.txt \ expect/backup/everything.html \ expect/backup/onehost.txt \ expect/pruneparam.txt \ configs/pruneparam/config \ configs/empty/config \ configs/include/config \ configs/include/config.d/z configs/include/config.d/backup~ \ configs/include/config.d/empty \ configs/include/config.d/\#recovery\# \ configs/include/config.d/.dotfile configs/include/config.d/a clean-local: rm -rf $(patsubst %,w-%,${TESTS}) rsbackup-3.0/tests/retire-volume0000775000175000017500000001161312460717754014017 00000000000000#! /bin/sh # Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. # # 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 . set -e . ${srcdir:-.}/setup.sh setup echo "| Create backup" RSBACKUP_TODAY=1980-01-01 s ${RSBACKUP} --backup --text ${WORKSPACE}/got/create.txt --html ${WORKSPACE}/got/create.html # volume1: 1980-01-01 # volume2: 1980-01-01 sqlite3 ${WORKSPACE}/logs/backups.db "SELECT host,volume,device,id,rc,status,log FROM backup" > ${WORKSPACE}/got/created-db.txt compare ${srcdir:-.}/expect/retire-volume/created-db.txt ${WORKSPACE}/got/created-db.txt exists ${WORKSPACE}/store1/host1/volume1/1980-01-01 exists ${WORKSPACE}/store1/host1/volume2/1980-01-01 exists ${WORKSPACE}/store2/host1/volume1/1980-01-01 exists ${WORKSPACE}/store2/host1/volume1/1980-01-01 compare ${srcdir:-.}/expect/retire-volume/create.txt ${WORKSPACE}/got/create.txt compare ${srcdir:-.}/expect/retire-volume/create.html ${WORKSPACE}/got/create.html echo "| Edit config" sed < ${WORKSPACE}/config > ${WORKSPACE}/config.new 's/^ *volume volume2.*//;s/^ *min-backups 2//' mv ${WORKSPACE}/config.new ${WORKSPACE}/config echo "| --dry-run should do nothing" RSBACKUP_TODAY=1980-01-01 RUN=dryrun s ${RSBACKUP} --retire --dry-run --text ${WORKSPACE}/got/dryrun.txt --html ${WORKSPACE}/got/dryrun.html host1:volume2 sqlite3 ${WORKSPACE}/logs/backups.db "SELECT host,volume,device,id,rc,status,log FROM backup" > ${WORKSPACE}/got/created-db-bis.txt compare ${srcdir:-.}/expect/retire-volume/created-db.txt ${WORKSPACE}/got/created-db-bis.txt exists ${WORKSPACE}/dryrun-dev-pre.ran exists ${WORKSPACE}/dryrun-dev-post.ran absent ${WORKSPACE}/dryrun-dev-pre.acted absent ${WORKSPACE}/dryrun-dev-post.acted exists ${WORKSPACE}/store1/host1/volume1/1980-01-01 exists ${WORKSPACE}/store1/host1/volume2/1980-01-01 exists ${WORKSPACE}/store2/host1/volume1/1980-01-01 exists ${WORKSPACE}/store2/host1/volume1/1980-01-01 compare ${srcdir:-.}/expect/retire-volume/dryrun.txt ${WORKSPACE}/got/dryrun.txt compare ${srcdir:-.}/expect/retire-volume/dryrun.html ${WORKSPACE}/got/dryrun.html echo "| retire volume2" RSBACKUP_TODAY=1980-01-01 RUN=retire s ${RSBACKUP} --verbose --retire --text ${WORKSPACE}/got/volume2.txt --html ${WORKSPACE}/got/volume2.html host1:volume2 sqlite3 ${WORKSPACE}/logs/backups.db "SELECT host,volume,device,id,rc,status,log FROM backup" > ${WORKSPACE}/got/volume2-db.txt compare ${srcdir:-.}/expect/retire-volume/volume2-db.txt ${WORKSPACE}/got/volume2-db.txt exists ${WORKSPACE}/retire-dev-pre.ran exists ${WORKSPACE}/retire-dev-post.ran exists ${WORKSPACE}/retire-dev-pre.acted exists ${WORKSPACE}/retire-dev-post.acted exists ${WORKSPACE}/store1/host1/volume1/1980-01-01 absent ${WORKSPACE}/store1/host1/volume2 exists ${WORKSPACE}/store2/host1/volume1/1980-01-01 absent ${WORKSPACE}/store2/host1/volume2 compare ${srcdir:-.}/expect/retire-volume/volume2.txt ${WORKSPACE}/got/volume2.txt compare ${srcdir:-.}/expect/retire-volume/volume2.html ${WORKSPACE}/got/volume2.html echo "| No negative selections for retire" if RSBACKUP_TODAY=1980-01-01 RUN=retire s ${RSBACKUP} --verbose --retire --force host1 -host1:volume3 2>${WORKSPACE}/errors; then echo "Unexpected success" exit 1 fi echo "| Cannot retire all hosts" if RSBACKUP_TODAY=1980-01-01 RUN=retire s ${RSBACKUP} --verbose --retire --force '*' 2>${WORKSPACE}/errors; then echo "Unexpected success" exit 1 fi echo "| Edit config" sed < ${WORKSPACE}/config > ${WORKSPACE}/config.new 's/^ *volume volume2.*//;s/^ *min-backups 2//' mv ${WORKSPACE}/config.new ${WORKSPACE}/config echo "| Retire all volumes" RSBACKUP_TODAY=1980-01-01 RUN=retire s ${RSBACKUP} --verbose --retire --force --text ${WORKSPACE}/got/all.txt --html ${WORKSPACE}/got/all.html host1 sqlite3 ${WORKSPACE}/logs/backups.db "SELECT host,volume,device,id,rc,status,log FROM backup" > ${WORKSPACE}/got/all-db.txt compare ${srcdir:-.}/expect/retire-volume/retire-volume-3.txt ${WORKSPACE}/got/all-db.txt exists ${WORKSPACE}/retire-dev-pre.ran exists ${WORKSPACE}/retire-dev-post.ran exists ${WORKSPACE}/retire-dev-pre.acted exists ${WORKSPACE}/retire-dev-post.acted absent ${WORKSPACE}/store1/host1/volume1 absent ${WORKSPACE}/store1/host1/volume2 absent ${WORKSPACE}/store2/host1/volume1 absent ${WORKSPACE}/store2/host1/volume2 compare ${srcdir:-.}/expect/retire-volume/all.txt ${WORKSPACE}/got/all.txt compare ${srcdir:-.}/expect/retire-volume/all.html ${WORKSPACE}/got/all.html cleanup rsbackup-3.0/tests/bashisms0000775000175000017500000000167612451030712013017 00000000000000#! /bin/sh # # Copyright © 2014 Richard Kettlewell. # # 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 . set -e if type checkbashisms >/dev/null 2>&1; then for s in setup.sh hook \ backup prune retire-device retire-volume store check-file check-configs \ check-mounted glob-store style; do checkbashisms -f -x -p "${srcdir:-.}/$s" done else exit 77 fi rsbackup-3.0/tests/expect/0000775000175000017500000000000012635241746012635 500000000000000rsbackup-3.0/tests/expect/retire-device/0000775000175000017500000000000012635241746015364 500000000000000rsbackup-3.0/tests/expect/retire-device/create.txt0000644000175000017500000000133212460670556017306 00000000000000==== Backup report (1980-01-01) ==== === Warnings === * WARNING: 1 volumes are not fully backed up. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | device2 | | | | | | Newest | Count | Newest | Count| | host1 | volume1 | 1980-01-01 | 2 | 1980-01-01 | 1 | 1980-01-01 | 1 | | | volume2 | 1980-01-01 | 2 | 1980-01-01 | 1 | 1980-01-01 | 1 | | | volume3 | 1980-01-01 | 1 | none | 0 | 1980-01-01 | 1 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason| Generated rsbackup-3.0/tests/expect/retire-device/device2-db.txt0000664000175000017500000000011412451031033017723 00000000000000host1|volume1|device1|1980-01-01|0|2| host1|volume2|device1|1980-01-01|0|2| rsbackup-3.0/tests/expect/retire-device/created-db.txt0000664000175000017500000000027612451031033020022 00000000000000host1|volume1|device1|1980-01-01|0|2| host1|volume1|device2|1980-01-01|0|2| host1|volume2|device1|1980-01-01|0|2| host1|volume2|device2|1980-01-01|0|2| host1|volume3|device2|1980-01-01|0|2| rsbackup-3.0/tests/expect/retire-device/device2.txt0000664000175000017500000000112412452266007017356 00000000000000==== Backup report (1980-01-01) ==== === Warnings === * WARNING: 1 volumes have no backups. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | | | | | | Newest | Count| | host1 | volume1 | 1980-01-01 | 1 | 1980-01-01 | 1 | | | volume2 | 1980-01-01 | 1 | 1980-01-01 | 1 | | | volume3 | none | 0 | none | 0 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason| Generated rsbackup-3.0/tests/expect/retire-device/dryrun.txt0000664000175000017500000000115612452266007017365 00000000000000==== Backup report (1980-01-01) ==== === Warnings === * Unknown device device2 * WARNING: 1 volumes have no backups. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | | | | | | Newest | Count| | host1 | volume1 | 1980-01-01 | 1 | 1980-01-01 | 1 | | | volume2 | 1980-01-01 | 1 | 1980-01-01 | 1 | | | volume3 | none | 0 | none | 0 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason| Generated rsbackup-3.0/tests/expect/pruneexec/0000775000175000017500000000000012635241746014633 500000000000000rsbackup-3.0/tests/expect/pruneexec/pruneexec-db.txt0000664000175000017500000000144512601750105017664 00000000000000host1|volume1|device1|1980-01-01|0|2|315532800|0| host1|volume1|device2|1980-01-01|0|2|315532800|0| host1|volume2|device1|1980-01-01|0|2|315532800|0| host1|volume2|device2|1980-01-01|0|2|315532800|0| host1|volume3|device2|1980-01-01|0|2|315532800|0| host1|volume1|device1|1980-01-02|0|5|315619200|315792000|zap host1|volume1|device2|1980-01-02|0|5|315619200|315792000|zap host1|volume2|device1|1980-01-02|0|5|315619200|315792000|zap host1|volume2|device2|1980-01-02|0|5|315619200|315792000|zap host1|volume3|device2|1980-01-02|0|5|315619200|315792000|zap host1|volume1|device1|1980-01-03|0|2|315705600|0| host1|volume1|device2|1980-01-03|0|2|315705600|0| host1|volume2|device1|1980-01-03|0|2|315705600|0| host1|volume2|device2|1980-01-03|0|2|315705600|0| host1|volume3|device2|1980-01-03|0|2|315705600|0| rsbackup-3.0/tests/expect/include.txt0000664000175000017500000000057512621636733014747 00000000000000max-age 3 prune-policy age ssh-timeout 60 public false logs /var/log/backup sendmail /usr/sbin/sendmail colors 0xe0ffe0 0xff4040 host a max-age 3 prune-policy age ssh-timeout 60 hostname a always-up false devices * priority 0 host z max-age 3 prune-policy age ssh-timeout 60 hostname z always-up false devices * priority 0 rsbackup-3.0/tests/expect/retire-volume/0000775000175000017500000000000012635241746015434 500000000000000rsbackup-3.0/tests/expect/retire-volume/volume2.html0000664000175000017500000000554412452266007017635 00000000000000 Backup report (1980-01-01)

      Backup report (1980-01-01)

      Warnings

      • WARNING: 1 volumes are not fully backed up.

      Summary

      Host Volume Oldest Total Devices
      device1 device2
      Newest Count Newest Count
      host1 volume1 1980-01-01 2 1980-01-01 1 1980-01-01 1
      volume3 1980-01-01 1 none 0 1980-01-01 1

      Logfiles

      Pruning logs

      Created Pruned Host Volume Device Reason

      Generated <timestamp>

      rsbackup-3.0/tests/expect/retire-volume/dryrun.html0000664000175000017500000000562212452266007017564 00000000000000 Backup report (1980-01-01)

      Backup report (1980-01-01)

      Warnings

      • Unknown volume volume2 on host host1
      • WARNING: 1 volumes are not fully backed up.

      Summary

      Host Volume Oldest Total Devices
      device1 device2
      Newest Count Newest Count
      host1 volume1 1980-01-01 2 1980-01-01 1 1980-01-01 1
      volume3 1980-01-01 1 none 0 1980-01-01 1

      Logfiles

      Pruning logs

      Created Pruned Host Volume Device Reason

      Generated <timestamp>

      rsbackup-3.0/tests/expect/retire-volume/create.txt0000664000175000017500000000133212452266007017351 00000000000000==== Backup report (1980-01-01) ==== === Warnings === * WARNING: 1 volumes are not fully backed up. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | device2 | | | | | | Newest | Count | Newest | Count| | host1 | volume1 | 1980-01-01 | 2 | 1980-01-01 | 1 | 1980-01-01 | 1 | | | volume2 | 1980-01-01 | 2 | 1980-01-01 | 1 | 1980-01-01 | 1 | | | volume3 | 1980-01-01 | 1 | none | 0 | 1980-01-01 | 1 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason| Generated rsbackup-3.0/tests/expect/retire-volume/volume2.txt0000664000175000017500000000121012452266007017472 00000000000000==== Backup report (1980-01-01) ==== === Warnings === * WARNING: 1 volumes are not fully backed up. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | device2 | | | | | | Newest | Count | Newest | Count| | host1 | volume1 | 1980-01-01 | 2 | 1980-01-01 | 1 | 1980-01-01 | 1 | | | volume3 | 1980-01-01 | 1 | none | 0 | 1980-01-01 | 1 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason| Generated rsbackup-3.0/tests/expect/retire-volume/created-db.txt0000664000175000017500000000027612451031033020072 00000000000000host1|volume1|device1|1980-01-01|0|2| host1|volume1|device2|1980-01-01|0|2| host1|volume2|device1|1980-01-01|0|2| host1|volume2|device2|1980-01-01|0|2| host1|volume3|device2|1980-01-01|0|2| rsbackup-3.0/tests/expect/retire-volume/dryrun.txt0000664000175000017500000000126012452266007017431 00000000000000==== Backup report (1980-01-01) ==== === Warnings === * Unknown volume volume2 on host host1 * WARNING: 1 volumes are not fully backed up. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | device2 | | | | | | Newest | Count | Newest | Count| | host1 | volume1 | 1980-01-01 | 2 | 1980-01-01 | 1 | 1980-01-01 | 1 | | | volume3 | 1980-01-01 | 1 | none | 0 | 1980-01-01 | 1 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason| Generated rsbackup-3.0/tests/expect/retire-volume/all.txt0000664000175000017500000000110412452266007016653 00000000000000==== Backup report (1980-01-01) ==== === Warnings === * WARNING: 2 volumes have no backups. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | device2 | | | | | | Newest | Count | Newest | Count| | host1 | volume1 | none | 0 | none | 0 | none | 0 | | | volume3 | none | 0 | none | 0 | none | 0 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason| Generated rsbackup-3.0/tests/expect/retire-volume/all.html0000664000175000017500000000544212452266007017011 00000000000000 Backup report (1980-01-01)

      Backup report (1980-01-01)

      Warnings

      • WARNING: 2 volumes have no backups.

      Summary

      Host Volume Oldest Total Devices
      device1 device2
      Newest Count Newest Count
      host1 volume1 none 0 none 0 none 0
      volume3 none 0 none 0 none 0

      Logfiles

      Pruning logs

      Created Pruned Host Volume Device Reason

      Generated <timestamp>

      rsbackup-3.0/tests/expect/retire-volume/all-db.txt0000664000175000017500000000000012451031033017214 00000000000000rsbackup-3.0/tests/expect/retire-volume/volume2-db.txt0000664000175000017500000000016212451031033020046 00000000000000host1|volume1|device1|1980-01-01|0|2| host1|volume1|device2|1980-01-01|0|2| host1|volume3|device2|1980-01-01|0|2| rsbackup-3.0/tests/expect/retire-volume/create.html0000664000175000017500000000605612452266007017506 00000000000000 Backup report (1980-01-01)

      Backup report (1980-01-01)

      Warnings

      • WARNING: 1 volumes are not fully backed up.

      Summary

      Host Volume Oldest Total Devices
      device1 device2
      Newest Count Newest Count
      host1 volume1 1980-01-01 2 1980-01-01 1 1980-01-01 1
      volume2 1980-01-01 2 1980-01-01 1 1980-01-01 1
      volume3 1980-01-01 1 none 0 1980-01-01 1

      Logfiles

      Pruning logs

      Created Pruned Host Volume Device Reason

      Generated <timestamp>

      rsbackup-3.0/tests/expect/prunenever/0000775000175000017500000000000012635241746015026 500000000000000rsbackup-3.0/tests/expect/prunenever/neverprune-db.txt0000664000175000017500000000135612601750105020253 00000000000000host1|volume1|device1|1980-01-01|0|2|315532800|0| host1|volume1|device2|1980-01-01|0|2|315532800|0| host1|volume2|device1|1980-01-01|0|2|315532800|0| host1|volume2|device2|1980-01-01|0|2|315532800|0| host1|volume3|device2|1980-01-01|0|2|315532800|0| host1|volume1|device1|1980-01-02|0|2|315619200|0| host1|volume1|device2|1980-01-02|0|2|315619200|0| host1|volume2|device1|1980-01-02|0|2|315619200|0| host1|volume2|device2|1980-01-02|0|2|315619200|0| host1|volume3|device2|1980-01-02|0|2|315619200|0| host1|volume1|device1|1980-01-03|0|2|315705600|0| host1|volume1|device2|1980-01-03|0|2|315705600|0| host1|volume2|device1|1980-01-03|0|2|315705600|0| host1|volume2|device2|1980-01-03|0|2|315705600|0| host1|volume3|device2|1980-01-03|0|2|315705600|0| rsbackup-3.0/tests/expect/pruneparam.txt0000664000175000017500000000062312621636756015475 00000000000000max-age 3 prune-policy age prune-parameter a b prune-parameter c d prune-parameter e f ssh-timeout 60 public false logs /var/log/backup sendmail /usr/sbin/sendmail colors 0xe0ffe0 0xff4040 host spong max-age 3 prune-policy age prune-parameter a bb prune-parameter e f prune-parameter --remove c ssh-timeout 60 hostname spong always-up false devices * priority 0 rsbackup-3.0/tests/expect/prunedecay/0000775000175000017500000000000012635241746014774 500000000000000rsbackup-3.0/tests/expect/prunedecay/prunedecay-db.txt0000664000175000017500000000257212601750105020170 00000000000000host1|volume1|device1|1980-01-01|0|5|315532800|316310400|age 9 > 8 and other backups exist host1|volume1|device2|1980-01-01|0|5|315532800|316310400|age 9 > 8 and other backups exist host1|volume1|device1|1980-01-02|0|5|315619200|315878400|age 3 > 1 and oldest in bucket 1 host1|volume1|device2|1980-01-02|0|5|315619200|315878400|age 3 > 1 and oldest in bucket 1 host1|volume1|device1|1980-01-03|0|5|315705600|316137600|age 5 > 1 and oldest in bucket 2 host1|volume1|device2|1980-01-03|0|5|315705600|316137600|age 5 > 1 and oldest in bucket 2 host1|volume1|device1|1980-01-04|0|5|315792000|316051200|age 3 > 1 and oldest in bucket 1 host1|volume1|device2|1980-01-04|0|5|315792000|316051200|age 3 > 1 and oldest in bucket 1 host1|volume1|device1|1980-01-05|0|2|315878400|0| host1|volume1|device2|1980-01-05|0|2|315878400|0| host1|volume1|device1|1980-01-06|0|5|315964800|316224000|age 3 > 1 and oldest in bucket 1 host1|volume1|device2|1980-01-06|0|5|315964800|316224000|age 3 > 1 and oldest in bucket 1 host1|volume1|device1|1980-01-07|0|2|316051200|0| host1|volume1|device2|1980-01-07|0|2|316051200|0| host1|volume1|device1|1980-01-08|0|2|316137600|0| host1|volume1|device2|1980-01-08|0|2|316137600|0| host1|volume1|device1|1980-01-09|0|2|316224000|0| host1|volume1|device2|1980-01-09|0|2|316224000|0| host1|volume1|device1|1980-01-10|0|2|316310400|0| host1|volume1|device2|1980-01-10|0|2|316310400|0| rsbackup-3.0/tests/expect/store/0000775000175000017500000000000012635241746013771 500000000000000rsbackup-3.0/tests/expect/store/duplicate-stderr.txt0000664000175000017500000000144712621640607017725 00000000000000WARNING: /config:14: the 'prune-age' directive is deprecated, use 'prune-parameter prune-age' instead WARNING: /config:16: the 'min-backups' directive is deprecated, use 'prune-parameter min-backups' instead WARNING: /config:21: the 'min-backups' directive is deprecated, use 'prune-parameter min-backups' instead WARNING: /config:23: the 'min-backups' directive is deprecated, use 'prune-parameter min-backups' instead WARNING: store '/store1' has duplicate device-id 'device1', also found on store '/store3' WARNING: cannot backup host1:volume1 to device2 - device suppressed due to --store WARNING: cannot backup host1:volume2 to device2 - device suppressed due to --store WARNING: cannot backup host1:volume3 to device2 - device suppressed due to --store rsbackup-3.0/tests/expect/store/duplicate.html0000664000175000017500000000604612452266007016551 00000000000000 Backup report (1980-01-01)

      Backup report (1980-01-01)

      Warnings

      • WARNING: 1 volumes have no backups.
      • WARNING: 2 volumes are not fully backed up.

      Summary

      Host Volume Oldest Total Devices
      device1 device2
      Newest Count Newest Count
      host1 volume1 1980-01-01 1 1980-01-01 1 none 0
      volume2 1980-01-01 1 1980-01-01 1 none 0
      volume3 none 0 none 0 none 0

      Logfiles

      Pruning logs

      Created Pruned Host Volume Device Reason

      Generated <timestamp>

      rsbackup-3.0/tests/expect/store/overridden.txt0000664000175000017500000000135112452266007016605 00000000000000==== Backup report (1980-01-01) ==== === Warnings === * WARNING: 1 volumes have no backups. * WARNING: 2 volumes are not fully backed up. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | device2 | | | | | | Newest | Count | Newest | Count| | host1 | volume1 | 1980-01-01 | 1 | 1980-01-01 | 1 | none | 0 | | | volume2 | 1980-01-01 | 1 | 1980-01-01 | 1 | none | 0 | | | volume3 | none | 0 | none | 0 | none | 0 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason| Generated rsbackup-3.0/tests/expect/store/overridden.html0000664000175000017500000000604612452266007016740 00000000000000 Backup report (1980-01-01)

      Backup report (1980-01-01)

      Warnings

      • WARNING: 1 volumes have no backups.
      • WARNING: 2 volumes are not fully backed up.

      Summary

      Host Volume Oldest Total Devices
      device1 device2
      Newest Count Newest Count
      host1 volume1 1980-01-01 1 1980-01-01 1 none 0
      volume2 1980-01-01 1 1980-01-01 1 none 0
      volume3 none 0 none 0 none 0

      Logfiles

      Pruning logs

      Created Pruned Host Volume Device Reason

      Generated <timestamp>

      rsbackup-3.0/tests/expect/store/duplicate.txt0000664000175000017500000000135112452266007016416 00000000000000==== Backup report (1980-01-01) ==== === Warnings === * WARNING: 1 volumes have no backups. * WARNING: 2 volumes are not fully backed up. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | device2 | | | | | | Newest | Count | Newest | Count| | host1 | volume1 | 1980-01-01 | 1 | 1980-01-01 | 1 | none | 0 | | | volume2 | 1980-01-01 | 1 | 1980-01-01 | 1 | none | 0 | | | volume3 | none | 0 | none | 0 | none | 0 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason| Generated rsbackup-3.0/tests/expect/store/overridden-stderr.txt0000664000175000017500000000127512621730376020116 00000000000000WARNING: /config:14: the 'prune-age' directive is deprecated, use 'prune-parameter prune-age' instead WARNING: /config:16: the 'min-backups' directive is deprecated, use 'prune-parameter min-backups' instead WARNING: /config:21: the 'min-backups' directive is deprecated, use 'prune-parameter min-backups' instead WARNING: /config:23: the 'min-backups' directive is deprecated, use 'prune-parameter min-backups' instead WARNING: cannot backup host1:volume1 to device2 - device suppressed due to --store WARNING: cannot backup host1:volume2 to device2 - device suppressed due to --store WARNING: cannot backup host1:volume3 to device2 - device suppressed due to --store rsbackup-3.0/tests/expect/upgrade/0000775000175000017500000000000012635241746014264 500000000000000rsbackup-3.0/tests/expect/upgrade/interrupted-db.txt0000664000175000017500000000152212451031033017653 00000000000000host1|volume1|device1|1980-01-01|0|2|OK: device=device1 host1|volume1|device2|1980-01-01|0|2|OK: device=device2 host1|volume1|device1|1980-01-02|0|2|OK: device=device1 host1|volume2|device1|1980-01-02|0|2|OK: device=device1 host1|volume1|device2|1980-01-02|0|2|OK: device=device2 host1|volume2|device2|1980-01-02|0|2|OK: device=device2 host1|volume3|device2|1980-01-02|0|2|OK: device=device2 host1|volume1|device1|1980-01-03|0|2|OK: device=device1 host1|volume2|device1|1980-01-03|0|2|OK: device=device1 host1|volume1|device2|1980-01-03|0|2|OK: device=device2 host1|volume2|device2|1980-01-03|0|2|OK: device=device2 host1|volume3|device2|1980-01-03|0|2|OK: device=device2 host1|volume1|device1|1980-01-04|5120|3|rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(549) [sender=3.0.9] ERROR: device=device1 error=0x1400 rsbackup-3.0/tests/expect/upgrade/simple-db.txt0000664000175000017500000000125412451031033016601 00000000000000host1|volume1|device1|1980-01-01|0|2|OK: device=device1 host1|volume1|device2|1980-01-01|0|2|OK: device=device2 host1|volume1|device1|1980-01-02|0|2|OK: device=device1 host1|volume2|device1|1980-01-02|0|2|OK: device=device1 host1|volume1|device2|1980-01-02|0|2|OK: device=device2 host1|volume2|device2|1980-01-02|0|2|OK: device=device2 host1|volume3|device2|1980-01-02|0|2|OK: device=device2 host1|volume1|device1|1980-01-03|0|2|OK: device=device1 host1|volume2|device1|1980-01-03|0|2|OK: device=device1 host1|volume1|device2|1980-01-03|0|2|OK: device=device2 host1|volume2|device2|1980-01-03|0|2|OK: device=device2 host1|volume3|device2|1980-01-03|0|2|OK: device=device2 rsbackup-3.0/tests/expect/prune/0000775000175000017500000000000012635241746013766 500000000000000rsbackup-3.0/tests/expect/prune/createsecond.txt0000664000175000017500000000133212452266007017077 00000000000000==== Backup report (1980-01-02) ==== === Warnings === * WARNING: 1 volumes are not fully backed up. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | device2 | | | | | | Newest | Count | Newest | Count| | host1 | volume1 | 1980-01-01 | 4 | 1980-01-02 | 2 | 1980-01-02 | 2 | | | volume2 | 1980-01-01 | 4 | 1980-01-02 | 2 | 1980-01-02 | 2 | | | volume3 | 1980-01-01 | 2 | none | 0 | 1980-01-02 | 2 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason| Generated rsbackup-3.0/tests/expect/prune/null.txt0000664000175000017500000000140112460721761015411 00000000000000==== Backup report (1980-02-01) ==== === Warnings === * WARNING: 1 volumes are not fully backed up. * WARNING: 2 volumes are out of date. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | device2 | | | | | | Newest | Count | Newest | Count| | host1 | volume1 | 1980-01-01 | 2 | 1980-01-01 | 1 | 1980-01-01 | 1 | | | volume2 | 1980-01-01 | 2 | 1980-01-01 | 1 | 1980-01-01 | 1 | | | volume3 | 1980-01-01 | 1 | none | 0 | 1980-01-01 | 1 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason| Generated rsbackup-3.0/tests/expect/prune/dryrun-db.txt0000664000175000017500000000076412451031033016342 00000000000000host1|volume1|device1|1980-01-01|0|2|315532800|0| host1|volume1|device2|1980-01-01|0|2|315532800|0| host1|volume2|device1|1980-01-01|0|2|315532800|0| host1|volume2|device2|1980-01-01|0|2|315532800|0| host1|volume3|device2|1980-01-01|0|2|315532800|0| host1|volume1|device1|1980-01-02|0|2|315619200|0| host1|volume1|device2|1980-01-02|0|2|315619200|0| host1|volume2|device1|1980-01-02|0|2|315619200|0| host1|volume2|device2|1980-01-02|0|2|315619200|0| host1|volume3|device2|1980-01-02|0|2|315619200|0| rsbackup-3.0/tests/expect/prune/volume2.txt0000664000175000017500000000213412601750105016023 00000000000000==== Backup report (1980-01-04) ==== === Warnings === * WARNING: 1 volumes are not fully backed up. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | device2 | | | | | | Newest | Count | Newest | Count| | host1 | volume1 | 1980-01-02 | 4 | 1980-01-03 | 2 | 1980-01-03 | 2 | | | volume2 | 1980-01-02 | 4 | 1980-01-03 | 2 | 1980-01-03 | 2 | | | volume3 | 1980-01-01 | 3 | none | 0 | 1980-01-03 | 3 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason | | 1980-01-01 | 1980-02-01 | host1 | volume1 | device1 | age 31 > 2 and remaining 2 > 1| | 1980-01-01 | 1980-02-01 | host1 | volume1 | device2 | age 31 > 2 and remaining 2 > 1| | 1980-01-01 | 1980-01-04 | host1 | volume2 | device1 | age 3 > 2 and remaining 3 > 2 | | 1980-01-01 | 1980-01-04 | host1 | volume2 | device2 | age 3 > 2 and remaining 3 > 2 | Generated rsbackup-3.0/tests/expect/prune/volume1.txt0000664000175000017500000000172312601750105016025 00000000000000==== Backup report (1980-02-01) ==== === Warnings === * WARNING: 1 volumes are not fully backed up. * WARNING: 2 volumes are out of date. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | device2 | | | | | | Newest | Count | Newest | Count| | host1 | volume1 | 1980-01-02 | 2 | 1980-01-02 | 1 | 1980-01-02 | 1 | | | volume2 | 1980-01-01 | 4 | 1980-01-02 | 2 | 1980-01-02 | 2 | | | volume3 | 1980-01-01 | 2 | none | 0 | 1980-01-02 | 2 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason | | 1980-01-01 | 1980-02-01 | host1 | volume1 | device1 | age 31 > 2 and remaining 2 > 1| | 1980-01-01 | 1980-02-01 | host1 | volume1 | device2 | age 31 > 2 and remaining 2 > 1| Generated rsbackup-3.0/tests/expect/prune/third.txt0000664000175000017500000000165412601750105015552 00000000000000==== Backup report (1980-01-03) ==== === Warnings === * WARNING: 1 volumes are not fully backed up. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | device2 | | | | | | Newest | Count | Newest | Count| | host1 | volume1 | 1980-01-02 | 4 | 1980-01-03 | 2 | 1980-01-03 | 2 | | | volume2 | 1980-01-01 | 6 | 1980-01-03 | 3 | 1980-01-03 | 3 | | | volume3 | 1980-01-01 | 3 | none | 0 | 1980-01-03 | 3 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason | | 1980-01-01 | 1980-02-01 | host1 | volume1 | device1 | age 31 > 2 and remaining 2 > 1| | 1980-01-01 | 1980-02-01 | host1 | volume1 | device2 | age 31 > 2 and remaining 2 > 1| Generated rsbackup-3.0/tests/expect/prune/dryrun.txt0000664000175000017500000000140112452266007015760 00000000000000==== Backup report (1980-02-01) ==== === Warnings === * WARNING: 1 volumes are not fully backed up. * WARNING: 2 volumes are out of date. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | device2 | | | | | | Newest | Count | Newest | Count| | host1 | volume1 | 1980-01-01 | 4 | 1980-01-02 | 2 | 1980-01-02 | 2 | | | volume2 | 1980-01-01 | 4 | 1980-01-02 | 2 | 1980-01-02 | 2 | | | volume3 | 1980-01-01 | 2 | none | 0 | 1980-01-02 | 2 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason| Generated rsbackup-3.0/tests/expect/prune/null-db.txt0000664000175000017500000000037212451031033015764 00000000000000host1|volume1|device1|1980-01-01|0|2|315532800|0| host1|volume1|device2|1980-01-01|0|2|315532800|0| host1|volume2|device1|1980-01-01|0|2|315532800|0| host1|volume2|device2|1980-01-01|0|2|315532800|0| host1|volume3|device2|1980-01-01|0|2|315532800|0| rsbackup-3.0/tests/expect/prune/unselected-db.txt0000664000175000017500000000147212601750105017154 00000000000000host1|volume1|device1|1980-01-01|0|5|315532800|318211200|age 31 > 2 and remaining 2 > 1 host1|volume1|device2|1980-01-01|0|5|315532800|318211200|age 31 > 2 and remaining 2 > 1 host1|volume2|device1|1980-01-01|0|2|315532800|0| host1|volume2|device2|1980-01-01|0|2|315532800|0| host1|volume3|device2|1980-01-01|0|2|315532800|0| host1|volume1|device1|1980-01-02|0|2|315619200|0| host1|volume1|device2|1980-01-02|0|2|315619200|0| host1|volume2|device1|1980-01-02|0|2|315619200|0| host1|volume2|device2|1980-01-02|0|2|315619200|0| host1|volume3|device2|1980-01-02|0|2|315619200|0| host1|volume1|device1|1980-01-03|0|2|315705600|0| host1|volume1|device2|1980-01-03|0|2|315705600|0| host1|volume2|device1|1980-01-03|0|2|315705600|0| host1|volume2|device2|1980-01-03|0|2|315705600|0| host1|volume3|device2|1980-01-03|0|2|315705600|0| rsbackup-3.0/tests/expect/prune/created.txt0000664000175000017500000000133212460721761016051 00000000000000==== Backup report (1980-01-01) ==== === Warnings === * WARNING: 1 volumes are not fully backed up. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | device2 | | | | | | Newest | Count | Newest | Count| | host1 | volume1 | 1980-01-01 | 2 | 1980-01-01 | 1 | 1980-01-01 | 1 | | | volume2 | 1980-01-01 | 2 | 1980-01-01 | 1 | 1980-01-01 | 1 | | | volume3 | 1980-01-01 | 1 | none | 0 | 1980-01-01 | 1 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason| Generated rsbackup-3.0/tests/expect/prune/volume2-db.txt0000664000175000017500000000160412601750105016407 00000000000000host1|volume1|device1|1980-01-01|0|5|315532800|318211200|age 31 > 2 and remaining 2 > 1 host1|volume1|device2|1980-01-01|0|5|315532800|318211200|age 31 > 2 and remaining 2 > 1 host1|volume2|device1|1980-01-01|0|5|315532800|315792000|age 3 > 2 and remaining 3 > 2 host1|volume2|device2|1980-01-01|0|5|315532800|315792000|age 3 > 2 and remaining 3 > 2 host1|volume3|device2|1980-01-01|0|2|315532800|0| host1|volume1|device1|1980-01-02|0|2|315619200|0| host1|volume1|device2|1980-01-02|0|2|315619200|0| host1|volume2|device1|1980-01-02|0|2|315619200|0| host1|volume2|device2|1980-01-02|0|2|315619200|0| host1|volume3|device2|1980-01-02|0|2|315619200|0| host1|volume1|device1|1980-01-03|0|2|315705600|0| host1|volume1|device2|1980-01-03|0|2|315705600|0| host1|volume2|device1|1980-01-03|0|2|315705600|0| host1|volume2|device2|1980-01-03|0|2|315705600|0| host1|volume3|device2|1980-01-03|0|2|315705600|0| rsbackup-3.0/tests/expect/prune/volume1-db.txt0000664000175000017500000000110012601750105016375 00000000000000host1|volume1|device1|1980-01-01|0|5|315532800|318211200|age 31 > 2 and remaining 2 > 1 host1|volume1|device2|1980-01-01|0|5|315532800|318211200|age 31 > 2 and remaining 2 > 1 host1|volume2|device1|1980-01-01|0|2|315532800|0| host1|volume2|device2|1980-01-01|0|2|315532800|0| host1|volume3|device2|1980-01-01|0|2|315532800|0| host1|volume1|device1|1980-01-02|0|2|315619200|0| host1|volume1|device2|1980-01-02|0|2|315619200|0| host1|volume2|device1|1980-01-02|0|2|315619200|0| host1|volume2|device2|1980-01-02|0|2|315619200|0| host1|volume3|device2|1980-01-02|0|2|315619200|0| rsbackup-3.0/tests/expect/prune/everything-db.txt0000664000175000017500000000177112601750105017207 00000000000000host1|volume1|device1|1980-01-01|0|5|315532800|318211200|age 31 > 2 and remaining 2 > 1 host1|volume1|device2|1980-01-01|0|5|315532800|318211200|age 31 > 2 and remaining 2 > 1 host1|volume2|device1|1980-01-01|0|5|315532800|315792000|age 3 > 2 and remaining 3 > 2 host1|volume2|device2|1980-01-01|0|5|315532800|315792000|age 3 > 2 and remaining 3 > 2 host1|volume3|device2|1980-01-01|0|5|315532800|347155200|age 365 > 2 and remaining 3 > 2 host1|volume1|device1|1980-01-02|0|5|315619200|347155200|age 364 > 2 and remaining 2 > 1 host1|volume1|device2|1980-01-02|0|5|315619200|347155200|age 364 > 2 and remaining 2 > 1 host1|volume2|device1|1980-01-02|0|2|315619200|0| host1|volume2|device2|1980-01-02|0|2|315619200|0| host1|volume3|device2|1980-01-02|0|2|315619200|0| host1|volume1|device1|1980-01-03|0|2|315705600|0| host1|volume1|device2|1980-01-03|0|2|315705600|0| host1|volume2|device1|1980-01-03|0|2|315705600|0| host1|volume2|device2|1980-01-03|0|2|315705600|0| host1|volume3|device2|1980-01-03|0|2|315705600|0| rsbackup-3.0/tests/expect/prune/unselected.txt0000664000175000017500000000165412601750105016573 00000000000000==== Backup report (1980-01-04) ==== === Warnings === * WARNING: 1 volumes are not fully backed up. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | device2 | | | | | | Newest | Count | Newest | Count| | host1 | volume1 | 1980-01-02 | 4 | 1980-01-03 | 2 | 1980-01-03 | 2 | | | volume2 | 1980-01-01 | 6 | 1980-01-03 | 3 | 1980-01-03 | 3 | | | volume3 | 1980-01-01 | 3 | none | 0 | 1980-01-03 | 3 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason | | 1980-01-01 | 1980-02-01 | host1 | volume1 | device1 | age 31 > 2 and remaining 2 > 1| | 1980-01-01 | 1980-02-01 | host1 | volume1 | device2 | age 31 > 2 and remaining 2 > 1| Generated rsbackup-3.0/tests/expect/check-file/0000775000175000017500000000000012635241746014627 500000000000000rsbackup-3.0/tests/expect/check-file/missing.html0000664000175000017500000000606612452266007017110 00000000000000 Backup report (1980-01-03)

      Backup report (1980-01-03)

      Warnings

      • WARNING: 1 volumes have no backups.
      • WARNING: 1 volumes are not fully backed up.

      Summary

      Host Volume Oldest Total Devices
      device1 device2
      Newest Count Newest Count
      host1 volume1 none 0 none 0 none 0
      volume2 1980-01-03 2 1980-01-03 1 1980-01-03 1
      volume3 1980-01-03 1 none 0 1980-01-03 1

      Logfiles

      Pruning logs

      Created Pruned Host Volume Device Reason

      Generated <timestamp>

      rsbackup-3.0/tests/expect/check-file/missing.txt0000664000175000017500000000140112452266007016747 00000000000000==== Backup report (1980-01-03) ==== === Warnings === * WARNING: 1 volumes have no backups. * WARNING: 1 volumes are not fully backed up. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | device2 | | | | | | Newest | Count | Newest | Count| | host1 | volume1 | none | 0 | none | 0 | none | 0 | | | volume2 | 1980-01-03 | 2 | 1980-01-03 | 1 | 1980-01-03 | 1 | | | volume3 | 1980-01-03 | 1 | none | 0 | 1980-01-03 | 1 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason| Generated rsbackup-3.0/tests/expect/style/0000775000175000017500000000000012635241746013775 500000000000000rsbackup-3.0/tests/expect/style/styled.txt0000664000175000017500000000133212452266007015753 00000000000000==== Backup report (1980-01-03) ==== === Warnings === * WARNING: 1 volumes are not fully backed up. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | device2 | | | | | | Newest | Count | Newest | Count| | host1 | volume1 | 1980-01-03 | 2 | 1980-01-03 | 1 | 1980-01-03 | 1 | | | volume2 | 1980-01-03 | 2 | 1980-01-03 | 1 | 1980-01-03 | 1 | | | volume3 | 1980-01-03 | 1 | none | 0 | 1980-01-03 | 1 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason| Generated rsbackup-3.0/tests/expect/style/styled.html0000664000175000017500000000275312452266007016110 00000000000000 Backup report (1980-01-03)

      Backup report (1980-01-03)

      Warnings

      • WARNING: 1 volumes are not fully backed up.

      Summary

      Host Volume Oldest Total Devices
      device1 device2
      Newest Count Newest Count
      host1 volume1 1980-01-03 2 1980-01-03 1 1980-01-03 1
      volume2 1980-01-03 2 1980-01-03 1 1980-01-03 1
      volume3 1980-01-03 1 none 0 1980-01-03 1

      Logfiles

      Pruning logs

      Created Pruned Host Volume Device Reason

      Generated <timestamp>

      rsbackup-3.0/tests/expect/empty.txt0000664000175000017500000000020112621636674014450 00000000000000max-age 3 prune-policy age ssh-timeout 60 public false logs /var/log/backup sendmail /usr/sbin/sendmail colors 0xe0ffe0 0xff4040 rsbackup-3.0/tests/expect/glob-store/0000775000175000017500000000000012635241746014712 500000000000000rsbackup-3.0/tests/expect/glob-store/everything.txt0000664000175000017500000000133212460713723017551 00000000000000==== Backup report (1980-01-03) ==== === Warnings === * WARNING: 1 volumes are not fully backed up. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | device2 | | | | | | Newest | Count | Newest | Count| | host1 | volume1 | 1980-01-03 | 2 | 1980-01-03 | 1 | 1980-01-03 | 1 | | | volume2 | 1980-01-03 | 2 | 1980-01-03 | 1 | 1980-01-03 | 1 | | | volume3 | 1980-01-03 | 1 | none | 0 | 1980-01-03 | 1 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason| Generated rsbackup-3.0/tests/expect/glob-store/everything.html0000664000175000017500000000605612460713723017706 00000000000000 Backup report (1980-01-03)

      Backup report (1980-01-03)

      Warnings

      • WARNING: 1 volumes are not fully backed up.

      Summary

      Host Volume Oldest Total Devices
      device1 device2
      Newest Count Newest Count
      host1 volume1 1980-01-03 2 1980-01-03 1 1980-01-03 1
      volume2 1980-01-03 2 1980-01-03 1 1980-01-03 1
      volume3 1980-01-03 1 none 0 1980-01-03 1

      Logfiles

      Pruning logs

      Created Pruned Host Volume Device Reason

      Generated <timestamp>

      rsbackup-3.0/tests/expect/backup/0000775000175000017500000000000012635241746014102 500000000000000rsbackup-3.0/tests/expect/backup/onehost.html0000664000175000017500000000605612452266007016370 00000000000000 Backup report (1980-01-02)

      Backup report (1980-01-02)

      Warnings

      • WARNING: 1 volumes are not fully backed up.

      Summary

      Host Volume Oldest Total Devices
      device1 device2
      Newest Count Newest Count
      host1 volume1 1980-01-01 4 1980-01-02 2 1980-01-02 2
      volume2 1980-01-02 2 1980-01-02 1 1980-01-02 1
      volume3 1980-01-02 1 none 0 1980-01-02 1

      Logfiles

      Pruning logs

      Created Pruned Host Volume Device Reason

      Generated <timestamp>

      rsbackup-3.0/tests/expect/backup/dryrun.html0000664000175000017500000000570712452266007016236 00000000000000 Backup report (1980-01-01)

      Backup report (1980-01-01)

      Warnings

      • WARNING: 3 volumes have no backups.

      Summary

      Host Volume Oldest Total Devices
      device1 device2
      Newest Count Newest Count
      host1 volume1 none 0 none 0 none 0
      volume2 none 0 none 0 none 0
      volume3 none 0 none 0 none 0

      Logfiles

      Pruning logs

      Created Pruned Host Volume Device Reason

      Generated <timestamp>

      rsbackup-3.0/tests/expect/backup/everything.txt0000664000175000017500000000133212452266007016740 00000000000000==== Backup report (1980-01-03) ==== === Warnings === * WARNING: 1 volumes are not fully backed up. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | device2 | | | | | | Newest | Count | Newest | Count| | host1 | volume1 | 1980-01-01 | 6 | 1980-01-03 | 3 | 1980-01-03 | 3 | | | volume2 | 1980-01-02 | 4 | 1980-01-03 | 2 | 1980-01-03 | 2 | | | volume3 | 1980-01-02 | 2 | none | 0 | 1980-01-03 | 2 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason| Generated rsbackup-3.0/tests/expect/backup/onevolume.html0000664000175000017500000000575412452266007016726 00000000000000 Backup report (1980-01-01)

      Backup report (1980-01-01)

      Warnings

      • WARNING: 2 volumes have no backups.

      Summary

      Host Volume Oldest Total Devices
      device1 device2
      Newest Count Newest Count
      host1 volume1 1980-01-01 2 1980-01-01 1 1980-01-01 1
      volume2 none 0 none 0 none 0
      volume3 none 0 none 0 none 0

      Logfiles

      Pruning logs

      Created Pruned Host Volume Device Reason

      Generated <timestamp>

      rsbackup-3.0/tests/expect/backup/onevolume.txt0000664000175000017500000000132212452266007016564 00000000000000==== Backup report (1980-01-01) ==== === Warnings === * WARNING: 2 volumes have no backups. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | device2 | | | | | | Newest | Count | Newest | Count| | host1 | volume1 | 1980-01-01 | 2 | 1980-01-01 | 1 | 1980-01-01 | 1 | | | volume2 | none | 0 | none | 0 | none | 0 | | | volume3 | none | 0 | none | 0 | none | 0 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason| Generated rsbackup-3.0/tests/expect/backup/dryrun.txt0000664000175000017500000000121212452266007016074 00000000000000==== Backup report (1980-01-01) ==== === Warnings === * WARNING: 3 volumes have no backups. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | device2 | | | | | | Newest | Count | Newest | Count| | host1 | volume1 | none | 0 | none | 0 | none | 0 | | | volume2 | none | 0 | none | 0 | none | 0 | | | volume3 | none | 0 | none | 0 | none | 0 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason| Generated rsbackup-3.0/tests/expect/backup/everything.html0000664000175000017500000000605612452266007017075 00000000000000 Backup report (1980-01-03)

      Backup report (1980-01-03)

      Warnings

      • WARNING: 1 volumes are not fully backed up.

      Summary

      Host Volume Oldest Total Devices
      device1 device2
      Newest Count Newest Count
      host1 volume1 1980-01-01 6 1980-01-03 3 1980-01-03 3
      volume2 1980-01-02 4 1980-01-03 2 1980-01-03 2
      volume3 1980-01-02 2 none 0 1980-01-03 2

      Logfiles

      Pruning logs

      Created Pruned Host Volume Device Reason

      Generated <timestamp>

      rsbackup-3.0/tests/expect/backup/onehost.txt0000664000175000017500000000133212452266007016233 00000000000000==== Backup report (1980-01-02) ==== === Warnings === * WARNING: 1 volumes are not fully backed up. === Summary === | Host | Volume | Oldest | Total | Devices | | | | | | device1 | device2 | | | | | | Newest | Count | Newest | Count| | host1 | volume1 | 1980-01-01 | 4 | 1980-01-02 | 2 | 1980-01-02 | 2 | | | volume2 | 1980-01-02 | 2 | 1980-01-02 | 1 | 1980-01-02 | 1 | | | volume3 | 1980-01-02 | 1 | none | 0 | 1980-01-02 | 1 | === Logfiles === == Pruning logs == | Created | Pruned | Host | Volume | Device | Reason| Generated rsbackup-3.0/tests/prunenever0000775000175000017500000000343512601750105013374 00000000000000#! /bin/sh # Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. # # 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 . set -e PRUNE_POLICY=never MIN_BACKUPS=none PRUNE_AGE=none . ${srcdir:-.}/setup.sh setup echo "| Create first backup" RSBACKUP_TODAY=1980-01-01 s ${RSBACKUP} --backup echo "| Create second backup" RSBACKUP_TODAY=1980-01-02 s ${RSBACKUP} --backup echo "| Create third backup" RSBACKUP_TODAY=1980-01-03 s ${RSBACKUP} --backup echo "| Prune affecting everything" RUN=prune4never RSBACKUP_TODAY=1981-01-01 s ${RSBACKUP} --prune compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-01 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-02 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-03 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-01 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-02 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-03 sqlite3 ${WORKSPACE}/logs/backups.db "SELECT host,volume,device,id,rc,status,time,pruned,log FROM backup" > ${WORKSPACE}/got/neverprune-db.txt compare ${srcdir:-.}/expect/prunenever/neverprune-db.txt ${WORKSPACE}/got/neverprune-db.txt cleanup rsbackup-3.0/tests/prunedecay0000775000175000017500000001702412601750105013341 00000000000000#! /bin/sh # Copyright © 2015 Richard Kettlewell. # # 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 . set -e PRUNE_POLICY=decay DECAY_LIMIT=8 . ${srcdir:-.}/setup.sh setup # With the default configuration the buckets look like this: # 0/1 days old - with decay-start # 2 days old - B0 # 3/4 days old - B1 # 5-8 days old - B2 echo "| Day 1" RSBACKUP_TODAY=1980-01-01 s ${RSBACKUP} --backup host1:volume1 RSBACKUP_TODAY=1980-01-01 s ${RSBACKUP} --prune # D1, 0 days old, within decay-start compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-01 echo "| Day 2" RSBACKUP_TODAY=1980-01-02 s ${RSBACKUP} --backup host1:volume1 RSBACKUP_TODAY=1980-01-02 s ${RSBACKUP} --prune # D1, 1 days old, within decay-start # D2, 0 days old, within decay-start compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-01 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-02 echo "| Day 3" RSBACKUP_TODAY=1980-01-03 s ${RSBACKUP} --backup host1:volume1 RSBACKUP_TODAY=1980-01-03 s ${RSBACKUP} --prune # D1, 2 days old, in B0 # D2, 1 days old, within decay-start # D3, 0 days old, within decay-start compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-01 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-02 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-03 echo "| Day 4" RSBACKUP_TODAY=1980-01-04 s ${RSBACKUP} --backup host1:volume1 RSBACKUP_TODAY=1980-01-04 s ${RSBACKUP} --prune # D1, 3 days old, in B1 # D2, 2 days old, in B0 # D3, 1 days old, within decay-start # D4, 0 days old, within decay-start compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-01 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-02 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-03 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-04 echo "| Day 5" RSBACKUP_TODAY=1980-01-05 s ${RSBACKUP} --backup host1:volume1 RSBACKUP_TODAY=1980-01-05 s ${RSBACKUP} --prune # D1, 4 days old, in B1 # D2, 3 days old, in B1, not oldest, prunable # D3, 2 days old, in B0 # D4, 1 days old, within decay-start # D5, 0 days old, within decay-start compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-01 absent ${WORKSPACE}/store1/host1/volume1/1980-01-02 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-03 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-04 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-05 echo "| Day 6" RSBACKUP_TODAY=1980-01-06 s ${RSBACKUP} --backup host1:volume1 RSBACKUP_TODAY=1980-01-06 s ${RSBACKUP} --prune # D1, 5 days old, in B2 # (D2 gone) # D3, 3 days old, in B1 # D4, 2 days old, in B0 # D5, 1 days old, within decay-start # D6, 0 days old, within decay-start compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-01 absent ${WORKSPACE}/store1/host1/volume1/1980-01-02 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-03 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-04 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-05 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-06 echo "| Day 7" RSBACKUP_TODAY=1980-01-07 s ${RSBACKUP} --backup host1:volume1 RSBACKUP_TODAY=1980-01-07 s ${RSBACKUP} --prune # D1, 6 days old, in B2 # (D2 gone) # D3, 4 days old, in B1 # D4, 3 days old, in B1, not oldest, prunable # D5, 2 days old, in B0 # D6, 1 days old, within decay-start # D7, 0 days old, within decay-start compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-01 absent ${WORKSPACE}/store1/host1/volume1/1980-01-02 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-03 absent ${WORKSPACE}/store1/host1/volume1/1980-01-04 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-05 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-06 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-07 echo "| Day 8" RSBACKUP_TODAY=1980-01-08 s ${RSBACKUP} --backup host1:volume1 RSBACKUP_TODAY=1980-01-08 s ${RSBACKUP} --prune # D1, 7 days old, in B2 # (D2 gone) # D3, 5 days old, in B2, not oldest, prunable # (D4 gone) # D5, 3 days old, in B1 # D6, 2 days old, in B0 # D7, 1 days old, within decay-start # D8, 0 days old, within decay-start compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-01 absent ${WORKSPACE}/store1/host1/volume1/1980-01-02 absent ${WORKSPACE}/store1/host1/volume1/1980-01-03 absent ${WORKSPACE}/store1/host1/volume1/1980-01-04 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-05 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-06 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-07 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-08 echo "| Day 9" RSBACKUP_TODAY=1980-01-09 s ${RSBACKUP} --backup host1:volume1 RSBACKUP_TODAY=1980-01-09 s ${RSBACKUP} --prune # D1, 8 days old, in B2 # (D2 gone) # (D3 gone) # (D4 gone) # D5, 4 days old, in B1 # D6, 3 days old, in B1, not oldest, prunable # D7, 2 days old, in B0 # D8, 1 days old, within decay-start # D9, 0 days old, within decay-start compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-01 absent ${WORKSPACE}/store1/host1/volume1/1980-01-02 absent ${WORKSPACE}/store1/host1/volume1/1980-01-03 absent ${WORKSPACE}/store1/host1/volume1/1980-01-04 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-05 absent ${WORKSPACE}/store1/host1/volume1/1980-01-06 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-07 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-08 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-09 echo "| Day 10" RSBACKUP_TODAY=1980-01-10 s ${RSBACKUP} --backup host1:volume1 RSBACKUP_TODAY=1980-01-10 s ${RSBACKUP} --prune # D1, 9 days old, in B3, beyond decay-limit, prunable # (D2 gone) # (D3 gone) # (D4 gone) # D5, 5 days old, in B2 # (D6 gone) # D7, 3 days old, in B1 # D8, 2 days old, in B0 # D9, 1 days old, within decay-start # D10, 0 days old, within decay-start absent ${WORKSPACE}/store1/host1/volume1/1980-01-01 absent ${WORKSPACE}/store1/host1/volume1/1980-01-02 absent ${WORKSPACE}/store1/host1/volume1/1980-01-03 absent ${WORKSPACE}/store1/host1/volume1/1980-01-04 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-05 absent ${WORKSPACE}/store1/host1/volume1/1980-01-06 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-07 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-08 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-09 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-10 sqlite3 ${WORKSPACE}/logs/backups.db "SELECT host,volume,device,id,rc,status,time,pruned,log FROM backup" > ${WORKSPACE}/got/prunedecay-db.txt compare ${srcdir:-.}/expect/prunedecay/prunedecay-db.txt ${WORKSPACE}/got/prunedecay-db.txt cleanup rsbackup-3.0/tests/pruner.sh0000775000175000017500000000247012601750105013125 00000000000000#! /bin/sh # Copyright © 2015 Richard Kettlewell. # # 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 . set -e assert() { if [ "$2" != "$3" ]; then echo "$1: expected '$2' but got '$3'" >&2 exit 1 fi } assert PRUNE_HOST host1 "$PRUNE_HOST" assert PRUNE_ONDEVICE "3 2 1" "$PRUNE_ONDEVICE" case "$PRUNE_VOLUME" in volume[12] ) expect_device1=6 expect_device2=5 ;; volume3 ) expect_device1=bogus expect_device2=3 ;; * ) echo "PRUNE_VOLUME: got '$PRUNE_VOLUME'" >&2 exit 1 ;; esac case "$PRUNE_DEVICE" in device1 ) assert PRUNE_TOTAL ${expect_device1} "$PRUNE_TOTAL" ;; device2 ) assert PRUNE_TOTAL ${expect_device2} "$PRUNE_TOTAL" ;; * ) echo "PRUNE_DEVICE: got '$PRUNE_DEVICE'" >&2 exit 1 ;; esac echo 2:zap rsbackup-3.0/tests/store0000775000175000017500000000555412621730376012355 00000000000000#! /usr/bin/env bash # Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. # # 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 . set -e . ${srcdir:-.}/setup.sh setup mv ${WORKSPACE}/store1 ${WORKSPACE}/store3 echo "| Create backup with overridden store" STDERR=${WORKSPACE}/got/overridden-stderr.txt RUN=store RSBACKUP_TODAY=1980-01-01 s ${RSBACKUP} --backup --store ${WORKSPACE}/store3 --text ${WORKSPACE}/got/overridden.txt --html ${WORKSPACE}/got/overridden.html exists ${WORKSPACE}/store-pre.ran exists ${WORKSPACE}/store-post.ran compare ${WORKSPACE}/volume1 ${WORKSPACE}/store3/host1/volume1/1980-01-01 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store3/host1/volume2/1980-01-01 absent ${WORKSPACE}/store1/host1/volume1 absent ${WORKSPACE}/store1/host1/volume2 absent ${WORKSPACE}/store2/host1/volume1 absent ${WORKSPACE}/store2/host1/volume2 compare ${srcdir:-.}/expect/store/overridden.txt ${WORKSPACE}/got/overridden.txt compare ${srcdir:-.}/expect/store/overridden.html ${WORKSPACE}/got/overridden.html sed < ${WORKSPACE}/got/overridden-stderr.txt > ${WORKSPACE}/got/overridden-stderr-sed.txt "s,${WORKSPACE},,g" compare ${srcdir:-.}/expect/store/overridden-stderr.txt ${WORKSPACE}/got/overridden-stderr-sed.txt echo "| Create backup with overridden duplicate store" cp -a ${WORKSPACE}/store3 ${WORKSPACE}/store1 rm -rf ${WORKSPACE}/store1/host1 STDERR=${WORKSPACE}/got/duplicate-stderr.txt RUN=store RSBACKUP_TODAY=1980-01-01 s ${RSBACKUP} --backup --store ${WORKSPACE}/store3 --text ${WORKSPACE}/got/duplicate.txt --html ${WORKSPACE}/got/duplicate.html exists ${WORKSPACE}/store-pre.ran exists ${WORKSPACE}/store-post.ran compare ${WORKSPACE}/volume1 ${WORKSPACE}/store3/host1/volume1/1980-01-01 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store3/host1/volume2/1980-01-01 absent ${WORKSPACE}/store1/host1/volume1 absent ${WORKSPACE}/store1/host1/volume2 absent ${WORKSPACE}/store2/host1/volume1 absent ${WORKSPACE}/store2/host1/volume2 sed < ${WORKSPACE}/got/duplicate-stderr.txt > ${WORKSPACE}/got/duplicate-stderr-sed.txt "s,${WORKSPACE},,g" compare ${srcdir:-.}/expect/store/duplicate.txt ${WORKSPACE}/got/duplicate.txt compare ${srcdir:-.}/expect/store/duplicate.html ${WORKSPACE}/got/duplicate.html compare ${srcdir:-.}/expect/store/duplicate-stderr.txt ${WORKSPACE}/got/duplicate-stderr-sed.txt cleanup rsbackup-3.0/tests/upgrade0000775000175000017500000001113412460721111012623 00000000000000#! /usr/bin/env bash # Copyright © 2014, 2015 Richard Kettlewell. # # 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 . set -e . ${srcdir:-.}/setup.sh setup export EXPECT_STATUS=ok echo "| --dry-run should do nothing" echo "OK: device=device1" > ${WORKSPACE}/logs/1980-01-01-device1-host1-volume1.log echo "OK: device=device2" > ${WORKSPACE}/logs/1980-01-01-device2-host1-volume1.log echo "OK: device=device1" > ${WORKSPACE}/logs/1980-01-02-device1-host1-volume1.log echo "OK: device=device1" > ${WORKSPACE}/logs/1980-01-02-device1-host1-volume2.log echo "OK: device=device2" > ${WORKSPACE}/logs/1980-01-02-device2-host1-volume1.log echo "OK: device=device2" > ${WORKSPACE}/logs/1980-01-02-device2-host1-volume2.log echo "OK: device=device2" > ${WORKSPACE}/logs/1980-01-02-device2-host1-volume3.log echo "OK: device=device1" > ${WORKSPACE}/logs/1980-01-03-device1-host1-volume1.log echo "OK: device=device1" > ${WORKSPACE}/logs/1980-01-03-device1-host1-volume2.log echo "OK: device=device2" > ${WORKSPACE}/logs/1980-01-03-device2-host1-volume1.log echo "OK: device=device2" > ${WORKSPACE}/logs/1980-01-03-device2-host1-volume2.log echo "OK: device=device2" > ${WORKSPACE}/logs/1980-01-03-device2-host1-volume3.log s ${RSBACKUP} --dry-run --text /dev/null exists ${WORKSPACE}/logs/1980-01-01-device1-host1-volume1.log exists ${WORKSPACE}/logs/1980-01-01-device2-host1-volume1.log exists ${WORKSPACE}/logs/1980-01-02-device1-host1-volume1.log exists ${WORKSPACE}/logs/1980-01-02-device1-host1-volume2.log exists ${WORKSPACE}/logs/1980-01-02-device2-host1-volume1.log exists ${WORKSPACE}/logs/1980-01-02-device2-host1-volume2.log exists ${WORKSPACE}/logs/1980-01-02-device2-host1-volume3.log exists ${WORKSPACE}/logs/1980-01-03-device1-host1-volume1.log exists ${WORKSPACE}/logs/1980-01-03-device1-host1-volume2.log exists ${WORKSPACE}/logs/1980-01-03-device2-host1-volume1.log exists ${WORKSPACE}/logs/1980-01-03-device2-host1-volume2.log exists ${WORKSPACE}/logs/1980-01-03-device2-host1-volume3.log absent ${WORKSPACE}/logs/backups.db echo "| test simple upgrade" s ${RSBACKUP} --text /dev/null absent ${WORKSPACE}/logs/1980-01-01-device1-host1-volume1.log absent ${WORKSPACE}/logs/1980-01-01-device2-host1-volume1.log absent ${WORKSPACE}/logs/1980-01-02-device1-host1-volume1.log absent ${WORKSPACE}/logs/1980-01-02-device1-host1-volume2.log absent ${WORKSPACE}/logs/1980-01-02-device2-host1-volume1.log absent ${WORKSPACE}/logs/1980-01-02-device2-host1-volume2.log absent ${WORKSPACE}/logs/1980-01-02-device2-host1-volume3.log absent ${WORKSPACE}/logs/1980-01-03-device1-host1-volume1.log absent ${WORKSPACE}/logs/1980-01-03-device1-host1-volume2.log absent ${WORKSPACE}/logs/1980-01-03-device2-host1-volume1.log absent ${WORKSPACE}/logs/1980-01-03-device2-host1-volume2.log absent ${WORKSPACE}/logs/1980-01-03-device2-host1-volume3.log sqlite3 ${WORKSPACE}/logs/backups.db "SELECT host,volume,device,id,rc,status,log FROM backup" > ${WORKSPACE}/got/simple-db.txt compare ${srcdir:-.}/expect/upgrade/simple-db.txt ${WORKSPACE}/got/simple-db.txt echo "| test interrupted upgrade" echo "rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(549) [sender=3.0.9]" > ${WORKSPACE}/logs/1980-01-04-device1-host1-volume1.log echo "ERROR: device=device1 error=0x1400" >> ${WORKSPACE}/logs/1980-01-04-device1-host1-volume1.log s ${RSBACKUP} --text /dev/null absent ${WORKSPACE}/logs/1980-01-04-device1-host1-volume1.log sqlite3 ${WORKSPACE}/logs/backups.db "SELECT host,volume,device,id,rc,status,log FROM backup" > ${WORKSPACE}/got/interrupted-db.txt compare ${srcdir:-.}/expect/upgrade/interrupted-db.txt ${WORKSPACE}/got/interrupted-db.txt echo "| test badly interrupted upgrade" echo "OK: device=device1" > ${WORKSPACE}/logs/1980-01-01-device1-host1-volume1.log s ${RSBACKUP} --text /dev/null absent ${WORKSPACE}/logs/1980-01-01-device1-host1-volume1.log sqlite3 ${WORKSPACE}/logs/backups.db "SELECT host,volume,device,id,rc,status,log FROM backup" > ${WORKSPACE}/got/badly-interrupted-db.txt compare ${srcdir:-.}/expect/upgrade/interrupted-db.txt ${WORKSPACE}/got/badly-interrupted-db.txt cleanup rsbackup-3.0/tests/prune0000775000175000017500000002003412460723046012335 00000000000000#! /bin/sh # Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. # # 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 . set -e . ${srcdir:-.}/setup.sh setup ## Check that min-backups is honored correctly echo "| Create backup" RSBACKUP_TODAY=1980-01-01 s ${RSBACKUP} --backup --text ${WORKSPACE}/got/created.txt compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-01 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-01 compare ${srcdir:-.}/expect/prune/created.txt ${WORKSPACE}/got/created.txt echo "| Null prune" RUN=null RSBACKUP_TODAY=1980-02-01 s ${RSBACKUP} --prune --text ${WORKSPACE}/got/null.txt absent ${WORKSPACE}/null-pre.ran absent ${WORKSPACE}/null-pos.ran absent ${WORKSPACE}/null-dev-pre.ran absent ${WORKSPACE}/null-dev-post.ran absent ${WORKSPACE}/null-dev-pre.acted absent ${WORKSPACE}/null-dev-post.acted compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-01 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-01 compare ${srcdir:-.}/expect/prune/null.txt ${WORKSPACE}/got/null.txt sqlite3 ${WORKSPACE}/logs/backups.db "SELECT host,volume,device,id,rc,status,time,pruned,log FROM backup" > ${WORKSPACE}/got/null-db.txt compare ${srcdir:-.}/expect/prune/null-db.txt ${WORKSPACE}/got/null-db.txt echo "| Create second backup" RSBACKUP_TODAY=1980-01-02 s ${RSBACKUP} --backup --text ${WORKSPACE}/got/createsecond.txt # volume1: 1980-01-01 1980-01-02 # volume2: 1980-01-01 1980-01-02 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-02 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-02 compare ${srcdir:-.}/expect/prune/createsecond.txt ${WORKSPACE}/got/createsecond.txt echo "| --dry-run should do nothing" RUN=dryrun RSBACKUP_TODAY=1980-02-01 s ${RSBACKUP} --prune --dry-run --text ${WORKSPACE}/got/dryrun.txt absent ${WORKSPACE}/dryrun-pre.ran absent ${WORKSPACE}/dryrun-post.ran exists ${WORKSPACE}/dryrun-dev-pre.ran exists ${WORKSPACE}/dryrun-dev-post.ran absent ${WORKSPACE}/dryrun-dev-pre.acted absent ${WORKSPACE}/dryrun-dev-post.acted compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-01 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-01 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-02 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-02 compare ${srcdir:-.}/expect/prune/dryrun.txt ${WORKSPACE}/got/dryrun.txt sqlite3 ${WORKSPACE}/logs/backups.db "SELECT host,volume,device,id,rc,status,time,pruned,log FROM backup" > ${WORKSPACE}/got/dryrun-db.txt compare ${srcdir:-.}/expect/prune/dryrun-db.txt ${WORKSPACE}/got/dryrun-db.txt echo "| Prune affecting volume1" RUN=prune1 RSBACKUP_TODAY=1980-02-01 s ${RSBACKUP} --prune --text ${WORKSPACE}/got/volume1.txt absent ${WORKSPACE}/prune1-pre.ran absent ${WORKSPACE}/prune1-post.ran exists ${WORKSPACE}/prune1-dev-pre.ran exists ${WORKSPACE}/prune1-dev-post.ran exists ${WORKSPACE}/prune1-dev-pre.acted exists ${WORKSPACE}/prune1-dev-post.acted absent ${WORKSPACE}/store1/host1/volume1/1980-01-01 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-01 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-02 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-02 sed < ${WORKSPACE}/got/volume1.txt > ${WORKSPACE}/got/volume1.sed.txt "s,${PWD}/w-prune,,g" compare ${srcdir:-.}/expect/prune/volume1.txt ${WORKSPACE}/got/volume1.sed.txt # volume1: 1980-01-02 # volume2: 1980-01-01 1980-01-02 sqlite3 ${WORKSPACE}/logs/backups.db "SELECT host,volume,device,id,rc,status,time,pruned,log FROM backup" > ${WORKSPACE}/got/volume1-db.txt compare ${srcdir:-.}/expect/prune/volume1-db.txt ${WORKSPACE}/got/volume1-db.txt ## Check that prune-age is honored correctly echo "| Create third backup" RSBACKUP_TODAY=1980-01-03 s ${RSBACKUP} --backup --text ${WORKSPACE}/got/third.txt # volume1: 1980-01-02 1980-01-03 # volume2: 1980-01-01 1980-01-02 1980-01-03 RSBACKUP_TODAY=1980-01-03 s ${RSBACKUP} --prune absent ${WORKSPACE}/store1/host1/volume1/1980-01-01 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-01 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-02 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-02 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-03 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-03 sed < ${WORKSPACE}/got/third.txt > ${WORKSPACE}/got/third.sed.txt "s,${PWD}/w-prune,,g" compare ${srcdir:-.}/expect/prune/third.txt ${WORKSPACE}/got/third.sed.txt echo "| Prune affecting unselected volume" RUN=prune2 RSBACKUP_TODAY=1980-01-04 s ${RSBACKUP} --prune --text ${WORKSPACE}/got/unselected.txt host1:volume1 absent ${WORKSPACE}/store1/host1/volume1/1980-01-01 absent ${WORKSPACE}/prune2-dev-pre.ran absent ${WORKSPACE}/prune2-dev-post.ran absent ${WORKSPACE}/prune2-dev-pre.acted absent ${WORKSPACE}/prune2-dev-post.acted compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-01 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-02 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-02 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-03 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-03 sed < ${WORKSPACE}/got/unselected.txt > ${WORKSPACE}/got/unselected.sed.txt "s,${PWD}/w-prune,,g" compare ${srcdir:-.}/expect/prune/unselected.txt ${WORKSPACE}/got/unselected.sed.txt sqlite3 ${WORKSPACE}/logs/backups.db "SELECT host,volume,device,id,rc,status,time,pruned,log FROM backup" > ${WORKSPACE}/got/unselected-db.txt compare ${srcdir:-.}/expect/prune/unselected-db.txt ${WORKSPACE}/got/unselected-db.txt echo "| Prune affecting volume2" RUN=prune3 RSBACKUP_TODAY=1980-01-04 s ${RSBACKUP} --prune --text ${WORKSPACE}/got/volume2.txt host1:volume2 absent ${WORKSPACE}/store1/host1/volume1/1980-01-01 absent ${WORKSPACE}/store1/host1/volume2/1980-01-01 exists ${WORKSPACE}/prune3-dev-pre.ran exists ${WORKSPACE}/prune3-dev-post.ran exists ${WORKSPACE}/prune3-dev-pre.acted exists ${WORKSPACE}/prune3-dev-post.acted compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-02 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-02 compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-03 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-03 sed < ${WORKSPACE}/got/volume2.txt > ${WORKSPACE}/got/volume2.sed.txt "s,${PWD}/w-prune,,g" compare ${srcdir:-.}/expect/prune/volume2.txt ${WORKSPACE}/got/volume2.sed.txt sqlite3 ${WORKSPACE}/logs/backups.db "SELECT host,volume,device,id,rc,status,time,pruned,log FROM backup" > ${WORKSPACE}/got/volume2-db.txt compare ${srcdir:-.}/expect/prune/volume2-db.txt ${WORKSPACE}/got/volume2-db.txt echo "| Prune affecting everything" RUN=prune4 RSBACKUP_TODAY=1981-01-01 s ${RSBACKUP} --prune sqlite3 ${WORKSPACE}/logs/backups.db "SELECT host,volume,device,id,rc,status,time,pruned,log FROM backup" > ${WORKSPACE}/got/everything-db.txt compare ${srcdir:-.}/expect/prune/everything-db.txt ${WORKSPACE}/got/everything-db.txt echo "| Repeat prune affecting everything" # should be idempotent RUN=prune5 RSBACKUP_TODAY=1981-02-01 s ${RSBACKUP} --prune sqlite3 ${WORKSPACE}/logs/backups.db "SELECT host,volume,device,id,rc,status,time,pruned,log FROM backup" > ${WORKSPACE}/got/everything-db-bis.txt compare ${srcdir:-.}/expect/prune/everything-db.txt ${WORKSPACE}/got/everything-db-bis.txt cleanup rsbackup-3.0/tests/Makefile.in0000664000175000017500000007741712635241702013342 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = tests DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/config.aux/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/config.aux/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/config.aux/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_LIBS = @BOOST_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GCOV = @GCOV@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBPTHREAD = @LIBPTHREAD@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ LYX_TARGETS = @LYX_TARGETS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ SQLITE3_LIBS = @SQLITE3_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Copyright © 2011-2015 Richard Kettlewell. # # 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 . TESTS = bashisms backup prune pruneage prunenever pruneexec prunedecay \ retire-device retire-volume store \ check-file check-configs \ check-mounted glob-store style upgrade EXTRA_DIST = ${TESTS} setup.sh pruner.sh hook \ expect/retire-device/create.txt \ expect/retire-device/device2-db.txt \ expect/retire-device/created-db.txt \ expect/retire-device/device2.txt \ expect/retire-device/dryrun.txt \ expect/include.txt \ expect/retire-volume/volume2.html \ expect/retire-volume/dryrun.html \ expect/retire-volume/create.txt \ expect/retire-volume/volume2.txt \ expect/retire-volume/created-db.txt \ expect/retire-volume/dryrun.txt \ expect/retire-volume/all.txt \ expect/retire-volume/all.html \ expect/retire-volume/all-db.txt \ expect/retire-volume/volume2-db.txt \ expect/retire-volume/create.html \ expect/store/duplicate-stderr.txt \ expect/store/duplicate.html \ expect/store/overridden.txt \ expect/store/overridden.html \ expect/store/duplicate.txt \ expect/store/overridden-stderr.txt \ expect/upgrade/interrupted-db.txt \ expect/upgrade/simple-db.txt \ expect/prune/createsecond.txt \ expect/prune/null.txt \ expect/prune/dryrun-db.txt \ expect/prune/volume2.txt \ expect/prune/volume1.txt \ expect/prune/third.txt \ expect/prune/dryrun.txt \ expect/prune/null-db.txt \ expect/prune/unselected-db.txt \ expect/prune/created.txt \ expect/prune/volume2-db.txt \ expect/prune/volume1-db.txt \ expect/prune/everything-db.txt \ expect/prune/unselected.txt \ expect/prunedecay/prunedecay-db.txt \ expect/pruneexec/pruneexec-db.txt \ expect/prunenever/neverprune-db.txt \ expect/check-file/missing.html \ expect/check-file/missing.txt \ expect/style/styled.txt \ expect/style/styled.html \ expect/empty.txt \ expect/glob-store/everything.txt \ expect/glob-store/everything.html \ expect/backup/onehost.html \ expect/backup/dryrun.html \ expect/backup/everything.txt \ expect/backup/onevolume.html \ expect/backup/onevolume.txt \ expect/backup/dryrun.txt \ expect/backup/everything.html \ expect/backup/onehost.txt \ expect/pruneparam.txt \ configs/pruneparam/config \ configs/empty/config \ configs/include/config \ configs/include/config.d/z configs/include/config.d/backup~ \ configs/include/config.d/empty \ configs/include/config.d/\#recovery\# \ configs/include/config.d/.dotfile configs/include/config.d/a all: all-am .SUFFIXES: .SUFFIXES: .log .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ else \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? bashisms.log: bashisms @p='bashisms'; \ b='bashisms'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) backup.log: backup @p='backup'; \ b='backup'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) prune.log: prune @p='prune'; \ b='prune'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) pruneage.log: pruneage @p='pruneage'; \ b='pruneage'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) prunenever.log: prunenever @p='prunenever'; \ b='prunenever'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) pruneexec.log: pruneexec @p='pruneexec'; \ b='pruneexec'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) prunedecay.log: prunedecay @p='prunedecay'; \ b='prunedecay'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) retire-device.log: retire-device @p='retire-device'; \ b='retire-device'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) retire-volume.log: retire-volume @p='retire-volume'; \ b='retire-volume'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) store.log: store @p='store'; \ b='store'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) check-file.log: check-file @p='check-file'; \ b='check-file'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) check-configs.log: check-configs @p='check-configs'; \ b='check-configs'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) check-mounted.log: check-mounted @p='check-mounted'; \ b='check-mounted'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) glob-store.log: glob-store @p='glob-store'; \ b='glob-store'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) style.log: style @p='style'; \ b='style'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) upgrade.log: upgrade @p='upgrade'; \ b='upgrade'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: all all-am check check-TESTS check-am clean clean-generic \ clean-local cscopelist-am ctags-am distclean distclean-generic \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am recheck tags-am \ uninstall uninstall-am clean-local: rm -rf $(patsubst %,w-%,${TESTS}) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: rsbackup-3.0/tests/check-mounted0000775000175000017500000000420312460714222013726 00000000000000#! /usr/bin/env bash # Copyright © 2014, 2015 Richard Kettlewell. # # 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 . set -e . ${srcdir:-.}/setup.sh . ${srcdir:-.}/../scripts/fakeshell.sh setup fake_init sed < ${WORKSPACE}/config > ${WORKSPACE}/config.new \ 's/check-file.*/check-mounted/' mv ${WORKSPACE}/config.new ${WORKSPACE}/config case $(uname -s) in Darwin | *BSD ) stat_opt=-f ;; * ) stat_opt=-c ;; esac fake_reset fake_cmd --must-run stat "echo 99; echo 99" \ --must-args $stat_opt %d ${WORKSPACE}/store1/host1/volume3 ${WORKSPACE}/store1/host1/volume3/.. echo "| Backup is skipped if check-mounted fails" rm -f ${WORKSPACE}/volume1/file1 RSBACKUP_TODAY=1980-01-03 s fake_run ${RSBACKUP} --backup --verbose absent ${WORKSPACE}/store1/host1/volume1 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-03 absent ${WORKSPACE}/store1/host1/volume3 compare ${WORKSPACE}/volume3 ${WORKSPACE}/store2/host1/volume3/1980-01-03 fake_reset fake_cmd --must-run stat "echo 99; echo 66" \ --must-args $stat_opt %d ${WORKSPACE}/store1/host1/volume3 ${WORKSPACE}/store1/host1/volume3/.. echo "| Backup is made if check-mounted succeeds" RUN=all RSBACKUP_TODAY=1980-01-03 s fake_run ${RSBACKUP} --backup exists ${WORKSPACE}/all-pre.acted exists ${WORKSPACE}/all-post.acted compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-03 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-03 absent ${WORKSPACE}/store1/host1/volume3 compare ${WORKSPACE}/volume3 ${WORKSPACE}/store2/host1/volume3/1980-01-03 cleanup rsbackup-3.0/tests/check-file0000775000175000017500000000251112460713607013200 00000000000000#! /bin/sh # Copyright © 2012, 2014, 2015 Richard Kettlewell. # # 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 . set -e . ${srcdir:-.}/setup.sh setup echo "| Backup is skipped if check-file missing" rm -f ${WORKSPACE}/volume1/file1 RSBACKUP_TODAY=1980-01-03 s ${RSBACKUP} --backup --verbose --text ${WORKSPACE}/got/missing.txt --html ${WORKSPACE}/got/missing.html absent ${WORKSPACE}/store1/host1/volume1 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-03 absent ${WORKSPACE}/store1/host1/volume3 compare ${WORKSPACE}/volume3 ${WORKSPACE}/store2/host1/volume3/1980-01-03 compare ${srcdir:-.}/expect/check-file/missing.txt ${WORKSPACE}/got/missing.txt compare ${srcdir:-.}/expect/check-file/missing.html ${WORKSPACE}/got/missing.html cleanup rsbackup-3.0/tests/hook0000775000175000017500000000352712450336324012152 00000000000000#! /bin/sh # Copyright © 2012-14 Richard Kettlewell. # # 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 . set -e #echo "Running hook..." #env | grep ^RSBACKUP | sort case "$RSBACKUP_HOOK" in pre-backup-hook ) if [ -e ${WORKSPACE}/hookdata ]; then echo >&3 "ERROR: hookdata already exists" exit 1 fi touch ${WORKSPACE}/hookdata what=pre ;; post-backup-hook ) if [ ! -e ${WORKSPACE}/hookdata ]; then echo >&3 "ERROR: hookdata does not exit" exit 1 fi rm -f ${WORKSPACE}/hookdata what=post if [ ! -z "${EXPECT_STATUS}" ] && [ "${RSBACKUP_STATUS}" != "${EXPECT_STATUS}" ]; then echo >&3 "ERROR: expected status '${EXPECT_STATUS}' got '${RSBACKUP_STATUS}'" exit 1 fi ;; pre-access-hook ) if [ -e ${WORKSPACE}/devhookdata ]; then echo >&3 "ERROR: devhookdata exists" exit 1 fi touch ${WORKSPACE}/devhookdata what=dev-pre ;; post-access-hook ) if [ ! -e ${WORKSPACE}/devhookdata ]; then echo >&3 "ERROR: devhookdata does not exist" exit 1 fi rm -f ${WORKSPACE}/devhookdata what=dev-post ;; * ) echo >&3 "ERROR: unknown hook $RSBACKUP_HOOK" exit 1 ;; esac if [ ! -z "${RUN}" ]; then touch ${WORKSPACE}/${RUN}-${what}.ran if ${RSBACKUP_ACT}; then touch ${WORKSPACE}/${RUN}-${what}.acted fi fi rsbackup-3.0/tests/style0000775000175000017500000000314712601750105012343 00000000000000#! /bin/sh # Copyright © 2014, 2015 Richard Kettlewell. # # 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 . set -e . ${srcdir:-.}/setup.sh setup export EXPECT_STATUS=ok echo "stylesheet ${WORKSPACE}/t.css" >>${WORKSPACE}/config echo "colors 0 0xFFFFFF" >> ${WORKSPACE}/config echo "alternative style sheet" > ${WORKSPACE}/t.css echo "not real" >> ${WORKSPACE}/t.css echo "| Create backup for everything with alternative stylesheet" RUN=all RSBACKUP_TODAY=1980-01-03 s ${RSBACKUP} --backup --text ${WORKSPACE}/got/styled.txt --html ${WORKSPACE}/got/styled.html exists ${WORKSPACE}/all-pre.acted exists ${WORKSPACE}/all-post.acted compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-03 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-03 absent ${WORKSPACE}/store1/host1/volume3 compare ${WORKSPACE}/volume3 ${WORKSPACE}/store2/host1/volume3/1980-01-03 compare ${srcdir:-.}/expect/style/styled.txt ${WORKSPACE}/got/styled.txt compare ${srcdir:-.}/expect/style/styled.html ${WORKSPACE}/got/styled.html cleanup rsbackup-3.0/tests/glob-store0000775000175000017500000000321512460714222013257 00000000000000#! /bin/sh # Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. # # 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 . set -e . ${srcdir:-.}/setup.sh setup export EXPECT_STATUS=ok sed < ${WORKSPACE}/config > ${WORKSPACE}/config.new \ '/^store /d'; echo "store-pattern ${WORKSPACE}/store*" >>${WORKSPACE}/config.new mv -f ${WORKSPACE}/config.new ${WORKSPACE}/config echo "| Create backup for everything using glob-pattern directive" RUN=all RSBACKUP_TODAY=1980-01-03 s ${RSBACKUP} --backup --text ${WORKSPACE}/got/everything.txt --html ${WORKSPACE}/got/everything.html exists ${WORKSPACE}/all-pre.acted exists ${WORKSPACE}/all-post.acted compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-03 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-03 absent ${WORKSPACE}/store1/host1/volume3 compare ${WORKSPACE}/volume3 ${WORKSPACE}/store2/host1/volume3/1980-01-03 compare ${srcdir:-.}/expect/glob-store/everything.txt ${WORKSPACE}/got/everything.txt compare ${srcdir:-.}/expect/glob-store/everything.html ${WORKSPACE}/got/everything.html cleanup rsbackup-3.0/tests/backup0000775000175000017500000000732712460735403012463 00000000000000#! /bin/sh # Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. # # 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 . set -e . ${srcdir:-.}/setup.sh setup export EXPECT_STATUS=ok echo "| --dry-run should do nothing" RUN=dryrun RSBACKUP_TODAY=1980-01-01 s ${RSBACKUP} --dry-run --backup --text ${WORKSPACE}/got/dryrun.txt --html ${WORKSPACE}/got/dryrun.html host1:volume1 exists ${WORKSPACE}/dryrun-dev-pre.ran exists ${WORKSPACE}/dryrun-dev-post.ran absent ${WORKSPACE}/dryrun-dev-pre.acted absent ${WORKSPACE}/dryrun-dev-post.acted exists ${WORKSPACE}/dryrun-pre.ran exists ${WORKSPACE}/dryrun-post.ran absent ${WORKSPACE}/dryrun-pre.acted absent ${WORKSPACE}/dryrun-post.acted absent ${WORKSPACE}/store1/host1/volume1/1980-01-01 absent ${WORKSPACE}/store1/host1/volume2 absent ${WORKSPACE}/store2/host1 compare ${srcdir:-.}/expect/backup/dryrun.txt ${WORKSPACE}/got/dryrun.txt compare ${srcdir:-.}/expect/backup/dryrun.html ${WORKSPACE}/got/dryrun.html echo "| Create backup for one volume" RUN=volume1 RSBACKUP_TODAY=1980-01-01 s ${RSBACKUP} --backup --text ${WORKSPACE}/got/onevolume.txt --html ${WORKSPACE}/got/onevolume.html host1:volume1 exists ${WORKSPACE}/volume1-dev-pre.ran exists ${WORKSPACE}/volume1-dev-post.ran exists ${WORKSPACE}/volume1-dev-pre.ran exists ${WORKSPACE}/volume1-dev-post.ran exists ${WORKSPACE}/volume1-pre.acted exists ${WORKSPACE}/volume1-post.acted exists ${WORKSPACE}/volume1-pre.acted exists ${WORKSPACE}/volume1-post.acted compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-01 absent ${WORKSPACE}/store1/host1/volume2 absent ${WORKSPACE}/store1/host1/volume3 absent ${WORKSPACE}/store2/host1/volume2 absent ${WORKSPACE}/store2/host1/volume3 compare ${srcdir:-.}/expect/backup/onevolume.txt ${WORKSPACE}/got/onevolume.txt compare ${srcdir:-.}/expect/backup/onevolume.html ${WORKSPACE}/got/onevolume.html echo "| Create backup for one host" RUN=host1 RSBACKUP_TODAY=1980-01-02 s ${RSBACKUP} --backup --text ${WORKSPACE}/got/onehost.txt --html ${WORKSPACE}/got/onehost.html host1 exists ${WORKSPACE}/host1-pre.acted exists ${WORKSPACE}/host1-post.acted compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-02 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-02 absent ${WORKSPACE}/store1/host1/volume3 compare ${WORKSPACE}/volume3 ${WORKSPACE}/store2/host1/volume3/1980-01-02 compare ${srcdir:-.}/expect/backup/onehost.txt ${WORKSPACE}/got/onehost.txt compare ${srcdir:-.}/expect/backup/onehost.html ${WORKSPACE}/got/onehost.html echo "| Create backup for everything" RUN=all RSBACKUP_TODAY=1980-01-03 s ${RSBACKUP} --backup --text ${WORKSPACE}/got/everything.txt --html ${WORKSPACE}/got/everything.html exists ${WORKSPACE}/all-pre.acted exists ${WORKSPACE}/all-post.acted compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-03 compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-03 absent ${WORKSPACE}/store1/host1/volume3 compare ${WORKSPACE}/volume3 ${WORKSPACE}/store2/host1/volume3/1980-01-03 compare ${srcdir:-.}/expect/backup/everything.txt ${WORKSPACE}/got/everything.txt compare ${srcdir:-.}/expect/backup/everything.html ${WORKSPACE}/got/everything.html cleanup rsbackup-3.0/Makefile.in0000664000175000017500000006273312635241702012173 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(srcdir)/config.h.in COPYING config.aux/ar-lib \ config.aux/compile config.aux/config.guess \ config.aux/config.sub config.aux/depcomp config.aux/install-sh \ config.aux/missing $(top_srcdir)/config.aux/ar-lib \ $(top_srcdir)/config.aux/compile \ $(top_srcdir)/config.aux/config.guess \ $(top_srcdir)/config.aux/config.sub \ $(top_srcdir)/config.aux/install-sh \ $(top_srcdir)/config.aux/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_LIBS = @BOOST_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GCOV = @GCOV@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBPTHREAD = @LIBPTHREAD@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ LYX_TARGETS = @LYX_TARGETS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ SQLITE3_LIBS = @SQLITE3_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Copyright © 2011, 2014 Richard Kettlewell. # # 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 . SUBDIRS = src tests doc tools EXTRA_DIST = scripts/txt2src scripts/htmlman scripts/dist \ scripts/fakeshell.sh \ debian/changelog debian/control debian/copyright \ debian/doc.rsbackup \ debian/rsbackup.conffiles debian/rsbackup.postinst debian/rules \ debian/rsbackup.postrm \ README.md all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-local mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-local cscope cscopelist-am ctags ctags-am dist dist-all \ dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz \ dist-zip distcheck distclean distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am echo-distdir: @echo $(distdir) echo-version: @echo $(VERSION) clean-local: rm -f */*.gcno rm -f */*.gcda rm -f */*.gcov # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: rsbackup-3.0/aclocal.m40000664000175000017500000014677312635241702011775 00000000000000# generated automatically by aclocal 1.14.1 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # 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 2 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # PKG_INSTALLDIR(DIRECTORY) # ------------------------- # Substitutes the variable pkgconfigdir as the location where a module # should install pkg-config .pc files. By default the directory is # $libdir/pkgconfig, but the default can be changed by passing # DIRECTORY. The user can override through the --with-pkgconfigdir # parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ]) dnl PKG_INSTALLDIR # PKG_NOARCH_INSTALLDIR(DIRECTORY) # ------------------------- # Substitutes the variable noarch_pkgconfigdir as the location where a # module should install arch-independent pkg-config .pc files. By # default the directory is $datadir/pkgconfig, but the default can be # changed by passing DIRECTORY. The user can override through the # --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ]) dnl PKG_NOARCH_INSTALLDIR # PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # ------------------------------------------- # Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])# PKG_CHECK_VAR # Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # Copyright (C) 2011-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_AR([ACT-IF-FAIL]) # ------------------------- # Try to determine the archiver interface, and trigger the ar-lib wrapper # if it is needed. If the detection of archiver interface fails, run # ACT-IF-FAIL (default is to abort configure with a proper error message). AC_DEFUN([AM_PROG_AR], [AC_BEFORE([$0], [LT_INIT])dnl AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([ar-lib])dnl AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) : ${AR=ar} AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], [AC_LANG_PUSH([C]) am_cv_ar_interface=ar AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a ]) AC_LANG_POP([C])]) case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) m4_default([$1], [AC_MSG_ERROR([could not determine $AR interface])]) ;; esac AC_SUBST([AR])dnl ]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # -*- Autoconf -*- # Obsolete and "removed" macros, that must however still report explicit # error messages when used, to smooth transition. # # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. AC_DEFUN([AM_CONFIG_HEADER], [AC_DIAGNOSE([obsolete], ['$0': this macro is obsolete. You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl AC_CONFIG_HEADERS($@)]) AC_DEFUN([AM_PROG_CC_STDC], [AC_PROG_CC am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc AC_DIAGNOSE([obsolete], ['$0': this macro is obsolete. You should simply use the 'AC][_PROG_CC' macro instead. Also, your code should no longer depend upon 'am_cv_prog_cc_stdc', but upon 'ac_cv_prog_cc_stdc'.])]) AC_DEFUN([AM_C_PROTOTYPES], [AC_FATAL([automatic de-ANSI-fication support has been removed])]) AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([acinclude.m4]) rsbackup-3.0/config.h.in0000664000175000017500000000464112635241722012145 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* Define to 1 if you have the header file. */ #undef HAVE_EXECINFO_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `execinfo' library (-lexecinfo). */ #undef HAVE_LIBEXECINFO /* Define to 1 if you have the `iconv' library (-liconv). */ #undef HAVE_LIBICONV /* Define to 1 if you have the `rt' library (-lrt). */ #undef HAVE_LIBRT /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_PATHS_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* fixup string for second argument to iconv() */ #undef ICONV_FIXUP /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* use GNU extensions */ #undef _GNU_SOURCE #ifdef __GNUC__ # define attribute(x) __attribute__(x) #else # define attribute(x) #endif rsbackup-3.0/config.aux/0000775000175000017500000000000012635241746012244 500000000000000rsbackup-3.0/config.aux/config.sub0000755000175000017500000010577512404676534014165 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2014 Free Software Foundation, Inc. timestamp='2014-09-11' # This file 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 . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: rsbackup-3.0/config.aux/compile0000755000175000017500000001624512423346767013554 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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 2, 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 . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: rsbackup-3.0/config.aux/config.guess0000755000175000017500000012355012404676534014511 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2014 Free Software Foundation, Inc. timestamp='2014-03-23' # This file 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 . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches with a ChangeLog entry to config-patches@gnu.org. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: rsbackup-3.0/config.aux/ar-lib0000755000175000017500000001330212423346767013261 00000000000000#! /bin/sh # Wrapper for Microsoft lib.exe me=ar-lib scriptversion=2012-03-01.08; # UTC # Copyright (C) 2010-2013 Free Software Foundation, Inc. # Written by Peter Rosin . # # 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 2, 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 . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # func_error message func_error () { echo "$me: $1" 1>&2 exit 1 } file_conv= # func_file_conv build_file # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv in mingw) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin) file=`cygpath -m "$file" || echo "$file"` ;; wine) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_at_file at_file operation archive # Iterate over all members in AT_FILE performing OPERATION on ARCHIVE # for each of them. # When interpreting the content of the @FILE, do NOT use func_file_conv, # since the user would need to supply preconverted file names to # binutils ar, at least for MinGW. func_at_file () { operation=$2 archive=$3 at_file_contents=`cat "$1"` eval set x "$at_file_contents" shift for member do $AR -NOLOGO $operation:"$member" "$archive" || exit $? done } case $1 in '') func_error "no command. Try '$0 --help' for more information." ;; -h | --h*) cat <. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: rsbackup-3.0/config.aux/missing0000755000175000017500000001533012423346767013567 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # 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 2, 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 . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: rsbackup-3.0/config.aux/install-sh0000755000175000017500000003325512423346767014202 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: rsbackup-3.0/config.aux/test-driver0000755000175000017500000001027712423346767014373 00000000000000#! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2013-07-13.22; # UTC # Copyright (C) 2011-2013 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 2, 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 . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <$log_file 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then estatus=1 fi case $estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: rsbackup-3.0/debian/0000775000175000017500000000000012635241746011425 500000000000000rsbackup-3.0/debian/rsbackup.conffiles0000664000175000017500000000025211550106302015027 00000000000000/etc/rsbackup/config /etc/rsbackup/defaults /etc/rsbackup/devices /etc/cron.hourly/rsbackup /etc/cron.daily/rsbackup /etc/cron.weekly/rsbackup /etc/cron.monthly/rsbackup rsbackup-3.0/debian/control0000644000175000017500000000152712626634560012753 00000000000000Source: rsbackup Maintainer: Debian rsbackup maintainers Uploaders: Matthew Vernon Priority: optional Standards-Version: 3.9.5.0 Section: admin Homepage: http://www.greenend.org.uk/rjk/rsbackup/ Build-Depends: lynx|lynx-cur,devscripts,sqlite3,libsqlite3-dev,libboost-dev Package: rsbackup Architecture: any Section: admin Depends: ${shlibs:Depends},rsync Recommends: openssh-server,openssh-client Description: rsync-based backup utility Backups are stored as complete filesystem trees on a (perhaps external) hard disk. Multiple backups use hard links between identical files to save space. . Backups may be taken from multiple machines (over SSH) and stored to multiple disks. . Backups may be made automatically, i.e. without relying on the operator to remember to make a backup. rsbackup-3.0/debian/rsbackup.postrm0000775000175000017500000000147212450015503014415 00000000000000#! /bin/sh # Copyright © 2014 Richard Kettlewell. # # 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 . set -e case "$1" in purge ) rm -f /etc/rsbackup/local [ -d /etc/rsbackup ] && rmdir --ignore-fail-on-non-empty /etc/rsbackup ;; esac rsbackup-3.0/debian/doc.rsbackup0000664000175000017500000000036511733351222013637 00000000000000Document: rsbackup Title: rsbackup Documentation Author: Richard Kettlewell Abstract: rsync-based backup system Section: System/Administration Format: HTML Index: /usr/share/doc/rsbackup/rsbackup-docs.html Files: /usr/share/doc/rsbackup/*.html rsbackup-3.0/debian/copyright0000664000175000017500000000153712534551051013275 00000000000000Copyright © 2010-2015 Richard Kettlewell 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 . On Debian GNU/Linux systems, the complete text of the GNU General Public License can be found in ‘/usr/share/common-licenses/GPL-3’ or in the dpkg source as the file ‘COPYING’ rsbackup-3.0/debian/changelog0000664000175000017500000001246012635241567013223 00000000000000rsbackup (3.0) unstable; urgency=low * Release 3.0 -- Richard Kettlewell Sat, 19 Dec 2015 11:45:55 +0000 rsbackup (2.1) unstable; urgency=low * Release 2.1 -- Richard Kettlewell Sat, 08 Aug 2015 15:21:23 +0100 rsbackup (2.0) unstable; urgency=low * Release 2.0 -- Richard Kettlewell Fri, 13 Feb 2015 17:40:14 +0000 rsbackup (1.2) unstable; urgency=low * Release 1.2. -- Richard Kettlewell Sun, 28 Dec 2014 15:13:59 +0000 rsbackup (1.1-3) unstable; urgency=low * Clean up /ets/rsbackup on purge (thanks to Andreas Beckmann for the bug report, and Richard Kettlewell (upstream) for the patch (Closes: #773181) -- Matthew Vernon Tue, 16 Dec 2014 21:42:19 +0000 rsbackup (1.1-2) unstable; urgency=low * Make cronjobs exit quietly if rsbackup.cron not present (i.e. package removed not purged) (Closes: #766455) -- Matthew Vernon Thu, 23 Oct 2014 11:35:09 +0100 rsbackup (1.1-1) unstable; urgency=low * New upstream version * Incorporate 1.0-2 changelog entry -- Matthew Vernon Tue, 21 Oct 2014 20:28:44 +0100 rsbackup (1.1) unstable; urgency=low * More accurate error messages about missing devices. * 'include' command skips filenames starting '#'. * Stricter checking of host and volume names. * Better fsck handling in the snapshot hook script. -- Richard Kettlewell Thu, 31 Jul 2014 20:19:24 +0100 rsbackup (1.0-2) unstable; urgency=low * binary-arch should depend on binary-${PACKAGE}, not binary-indep (Closes: #760609) -- Matthew Vernon Wed, 17 Sep 2014 23:06:06 +0100 rsbackup (1.0-1) unstable; urgency=low * Initial upload to Debian (Closes: #744305) * Bump standards version (no changes needed) * Maintainer set to a mailing list * Lintian-inspired improvements to rules file -- Matthew Vernon Sat, 05 Jul 2014 14:47:25 +0100 rsbackup (1.0) unstable; urgency=low * New --dump-config option to verify configuration file parse. * New --check option to rsbackup-mount. * Configuration files are now read in a fixed order (issue #8). * The --force option no longer implies the --verbose option. * Minor bug fixes. -- Richard Kettlewell Sat, 21 Jun 2014 13:24:19 +0100 rsbackup (0.4.4) unstable; urgency=low * Fix post-backup hook environment -- Richard Kettlewell Sat, 19 Apr 2014 18:43:06 +0100 rsbackup (0.4.3) unstable; urgency=low * Build Debian packages with hardening flags * Minor build/test improvements. -- Richard Kettlewell Mon, 13 Jan 2014 21:27:34 +0000 rsbackup (0.4.2) unstable; urgency=low * --retire no longer fails if a host directory does not exist. * Fix recalculation of per-device backup counts. -- Richard Kettlewell Fri, 25 Oct 2013 17:52:32 +0100 rsbackup (0.4.1) unstable; urgency=low * Release 0.4.1 -- Richard Kettlewell Sun, 19 May 2013 16:59:07 +0100 rsbackup (0.4) unstable; urgency=low * Release 0.4 -- Richard Kettlewell Sat, 02 Feb 2013 16:58:02 +0000 rsbackup (0.3) unstable; urgency=low * Release 0.3 -- Richard Kettlewell Sat, 24 Mar 2012 13:49:30 +0000 rsbackup (0.2) unstable; urgency=low * Release 0.2 * Rewritten in C++ * Text format report * --retire and --retire-device replace --prune-unknown * New --warn-* options * New always-up host directive * No longer create .incomplete files * Delete stray files in retried backups -- Richard Kettlewell Sat, 07 May 2011 12:05:34 +0100 rsbackup (0.1) unstable; urgency=low * Release 0.1 * 'nicely' option in rsbackup.defaults * Fixed permissions on installed files * Build script fixes from Peter Maydell -- Richard Kettlewell Sun, 03 Apr 2011 11:35:49 +0100 rsbackup (0.0.109) unstable; urgency=low * rsbackup.cron now prunes all volumes (if it prunes anything), not just the ones scheduled for backup at that moment. -- Richard Kettlewell Sat, 05 Feb 2011 11:38:02 +0000 rsbackup (0.0.107) unstable; urgency=low * For lower-frequency cronjobs, add --wait so the backup is reliably run. -- Richard Kettlewell Sun, 02 Jan 2011 12:28:13 +0000 rsbackup (0.0.100) unstable; urgency=low * Testing new cron arrangement. -- Richard Kettlewell Sun, 03 Oct 2010 10:42:41 +0100 rsbackup (0.0.99) unstable; urgency=low * Don't try to include deleted logfiles in the report. -- Richard Kettlewell Sun, 03 Oct 2010 10:45:55 +0100 rsbackup (0.0.98) unstable; urgency=low * Add min-backups setting to control how many backups per store are guaranteed to be kept. -- Richard Kettlewell Wed, 22 Sep 2010 12:23:30 +0100 rsbackup (0.0.97) unstable; urgency=low * Don't prune the last backup of a volume on each store (rather than the last backup of a volume). -- Richard Kettlewell Wed, 22 Sep 2010 11:48:29 +0100 rsbackup (0.0) unstable; urgency=low * Initial debian/*. -- Richard Kettlewell Fri, 07 May 2010 13:04:16 +0100 rsbackup-3.0/debian/rules0000775000175000017500000000745512631024340012421 00000000000000#! /usr/bin/make -f # Copyright © 2010-2015 Richard Kettlewell. # # 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 . INSTALL=install PACKAGE=rsbackup VERSION=2.1 CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) export CFLAGS CPPFLAGS CXXFLAGS LDFLAGS build-arch: build build-indep: build build: [ -e configure ] || ./autogen.sh ./configure --prefix=/usr --mandir=/usr/share/man --without-lyx ${CONFIGURE_EXTRA} $(MAKE) clean-${PACKAGE}: rm -rf debian/${PACKAGE} binary-${PACKAGE}: build rm -rf debian/${PACKAGE} mkdir -p debian/${PACKAGE}/DEBIAN mkdir -p debian/${PACKAGE}/etc/rsbackup/hosts.d mkdir -p debian/${PACKAGE}/etc/cron.hourly mkdir -p debian/${PACKAGE}/etc/cron.daily mkdir -p debian/${PACKAGE}/etc/cron.weekly mkdir -p debian/${PACKAGE}/etc/cron.monthly mkdir -p debian/${PACKAGE}/usr/share/doc/${PACKAGE} mkdir -p debian/${PACKAGE}/var/log/backup mkdir -p debian/${PACKAGE}/usr/share/doc-base cp debian/${PACKAGE}.conffiles debian/${PACKAGE}/DEBIAN/conffiles cp debian/${PACKAGE}.postinst debian/${PACKAGE}/DEBIAN/postinst cp debian/${PACKAGE}.postrm debian/${PACKAGE}/DEBIAN/postrm install -m 755 tools/rsbackup.hourly debian/${PACKAGE}/etc/cron.hourly/rsbackup install -m 755 tools/rsbackup.daily debian/${PACKAGE}/etc/cron.daily/rsbackup install -m 755 tools/rsbackup.weekly debian/${PACKAGE}/etc/cron.weekly/rsbackup install -m 755 tools/rsbackup.monthly debian/${PACKAGE}/etc/cron.monthly/rsbackup cp tools/rsbackup.config debian/${PACKAGE}/etc/rsbackup/config cp tools/rsbackup.defaults debian/${PACKAGE}/etc/rsbackup/defaults cp tools/rsbackup.devices debian/${PACKAGE}/etc/rsbackup/devices cp debian/changelog debian/${PACKAGE}/usr/share/doc/${PACKAGE}/changelog.Debian cp debian/doc.rsbackup debian/${PACKAGE}/usr/share/doc-base/rsbackup cp README.md debian/${PACKAGE}/usr/share/doc/${PACKAGE}/. lynx -dump -nolist doc/CHANGES.html > debian/${PACKAGE}/usr/share/doc/${PACKAGE}/changelog gzip -9nv debian/${PACKAGE}/usr/share/doc/${PACKAGE}/* cp doc/*.html doc/*.css debian/${PACKAGE}/usr/share/doc/${PACKAGE}/. cp debian/copyright debian/${PACKAGE}/usr/share/doc/${PACKAGE}/. $(MAKE) DESTDIR=`pwd`/debian/${PACKAGE} install strip --remove-section=.comment debian/${PACKAGE}/usr/bin/rsbackup gzip -9nv debian/${PACKAGE}/usr/share/man/man*/* dpkg-shlibdeps -Tdebian/substvars.rsbackup \ debian/rsbackup/usr/bin/* cd debian/${PACKAGE} && \ find -name DEBIAN -prune -o -type f -print \ | sed 's/^\.\///' \ | xargs md5sum > DEBIAN/md5sums dpkg-gencontrol -isp -p${PACKAGE} -Pdebian/${PACKAGE} \ -Tdebian/substvars.rsbackup chown -R root:root debian/${PACKAGE} chmod -R g-ws debian/${PACKAGE} dpkg --build debian/${PACKAGE} .. binary: binary-arch binary-indep binary-arch: binary-${PACKAGE} binary-indep: clean: clean-${PACKAGE} rm -f debian/files rm -f debian/debhelper.log [ ! -f Makefile ] || $(MAKE) distclean distcheck: $(MAKE) dist gzip -cd rsbackup-${VERSION}.tar.gz | tar xf - debian/rules -C rsbackup-${VERSION} build fakeroot debian/rules -C rsbackup-${VERSION} binary rm -rf rsbackup-${VERSION} ls -l rsbackup_${VERSION}_all.deb rsbackup-${VERSION}.tar.gz rsbackup-3.0/debian/rsbackup.postinst0000775000175000017500000000144412103242262014752 00000000000000#! /bin/sh # Copyright © 2010 Richard Kettlewell. # # 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 . set -e case "$1" in configure ) if [ ! -e /etc/rsbackup/local ]; then touch /etc/rsbackup/local fi ;; esac rsbackup-3.0/tools/0000775000175000017500000000000012635241747011344 500000000000000rsbackup-3.0/tools/rsbackup.config0000664000175000017500000000021411646266233014260 00000000000000# Location of lockfile lock /var/run/rsbackup.lock # User configuration include /etc/rsbackup/local # Hosts include /etc/rsbackup/hosts.d rsbackup-3.0/tools/Makefile.am0000664000175000017500000000377712601750105013320 00000000000000# Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. # # 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 . bin_SCRIPTS=rsbackup.cron rsbackup-mount rsbackup-snapshot-hook dist_noinst_SCRIPTS=srccheck EXTRA_DIST=rsbackup.config rsbackup.cron.in \ rsbackup.defaults rsbackup.devices \ rsbackup-mount.in rsbackup-snapshot-hook.in \ ${TESTS} CRONJOBS=rsbackup.daily rsbackup.hourly rsbackup.weekly rsbackup.monthly noinst_SCRIPTS=${CRONJOBS} TESTS=t-bashisms t-hook-ok t-hook-fsck-ok t-hook-fsck-fail t-hook-post t-hook-nosnap \ t-hook-dryrun rsbackup.cron: rsbackup.cron.in Makefile rm -f $@.new sed 's/_version_/${VERSION}/g' < ${srcdir}/rsbackup.cron.in > $@.new chmod 555 $@.new mv -f $@.new $@ rsbackup-mount: rsbackup-mount.in Makefile rm -f $@.new sed 's/_version_/${VERSION}/g' < ${srcdir}/rsbackup-mount.in > $@.new chmod 555 $@.new mv -f $@.new $@ rsbackup-snapshot-hook: rsbackup-snapshot-hook.in Makefile rm -f $@.new sed 's/_version_/${VERSION}/g' < ${srcdir}/rsbackup-snapshot-hook.in > $@.new chmod 555 $@.new mv -f $@.new $@ ${CRONJOBS}: Makefile rm -f $@.new echo '#! /bin/sh' > $@.new echo 'set -e' >> $@.new echo 'test -x ${bindir}/rsbackup.cron && exec ${bindir}/rsbackup.cron $(subst rsbackup.,,$@)' >> $@.new chmod 555 $@.new mv -f $@.new $@ clean-local: rm -f *.new distclean-local: rm -f rsbackup.cron rsbackup-mount rsbackup-snapshot-hook rm -f rsbackup.hourly rsbackup.daily rsbackup.weekly rsbackup.monthly rsbackup-3.0/tools/rsbackup.cron.in0000775000175000017500000000720712534527740014375 00000000000000#! /bin/sh # # Copyright © 2011, 2014, 2015 Richard Kettlewell. # # 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 . set -e # Functions ------------------------------------------------------------------- verbosely() { echo "$@" >&2 "$@" } # Initial settings ------------------------------------------------------------ backupargs="" pruneargs="" reportargs="" wait="" dryrun="" verbose="" nicely="" # Parse command line ---------------------------------------------------------- while [ $# -gt 0 ]; do case "$1" in -n | --dry-run ) dryrun="--dry-run" shift ;; -v | --verbose ) verbose=verbosely shift ;; -h | --help ) cat <&2 "rsbackup.cron: unknown option '$1'" exit 1 ;; * ) break ;; esac done # Get frequency frequency="$1" # Read configuration ---------------------------------------------------------- . /etc/rsbackup/defaults # Validate frequency ---------------------------------------------------------- # For lower frequencies, we always wait until we can take the lock. case "$frequency" in hourly ) hosts="$hourly" ;; daily ) hosts="$daily" wait="--wait" ;; weekly ) hosts="$weekly" wait="--wait" ;; monthly ) hosts="$monthly" wait="--wait" ;; * ) echo >&2 "rsbackup.cron: unrecognize frequency '$frequency'" exit 1 esac # Decide what to back up ------------------------------------------------------ case "$hosts" in "" ) ;; _all ) backupargs="$backupargs --backup" ;; * ) backupargs="$backupargs --backup $hosts" ;; esac # Decide whether to prune ----------------------------------------------------- # Prune old backups if [ "$prune" = "$frequency" ]; then pruneargs="$pruneargs --prune" fi # Prune incomplete backups if [ "$prune_incomplete" = "$frequency" ]; then pruneargs="$pruneargs --prune-incomplete" fi # Decide whether to generate a report ----------------------------------------- # Generate an email report if [ "$report" = "$frequency" ] && [ "$email" != "" ]; then reportargs="$reportargs --email $email" fi # Act ------------------------------------------------------------------------- # We separate pruning from backup up because otherwise only the # backed-up hosts are pruned. if [ "x$backupargs" != x ]; then $verbose $nicely rsbackup $wait $dryrun $backupargs || true fi if [ "x$pruneargs" != x ]; then $verbose $nicely rsbackup $wait $dryrun $pruneargs || true fi if [ "x$reportargs" != x ]; then $verbose $nicely rsbackup $wait $dryrun $reportargs || true fi # That's all ------------------------------------------------------------------ rsbackup-3.0/tools/t-hook-fsck-ok0000775000175000017500000000352412534532156013745 00000000000000#! /usr/bin/env bash # # Copyright © 2014, 2015 Richard Kettlewell. # # 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 . set -e . ${srcdir:-.}/../scripts/fakeshell.sh fake_init mkdir ${fake_work}/snaps mkdir ${fake_work}/snaps/rsb-volume fake_reset fake_cmd --must-run df "echo /dev/dm-0" \ --must-args /path/to/volume fake_cmd --must-run lvdisplay \ "echo ' Current LE 8192'; echo ' LV Path /dev/vg/lv'" \ --must-args /dev/mapper/vg-lv fake_cmd --must-run lvcreate \ --must-args --extents 1638 --name lv.snap --snapshot /dev/vg/lv fake_cmd --must-run fsck "exit 1" \ --must-args -a /dev/mapper/vg-lv.snap fake_cmd --must-run mount \ --must-args -o ro /dev/mapper/vg-lv.snap ${fake_work}/snaps/rsb-volume fake_cmd --must-run udevadm "echo /dev/dm-0 /dev/mapper/vg-lv /dev/junk" \ --must-args info -rqsymlink -n /dev/dm-0 fake_cmd --must-not-run umount fake_cmd --must-not-run lvremove fake_cmd --must-not-run ssh RSBACKUP_VOLUME=rsb-volume \ RSBACKUP_VOLUME_path=/path/to/volume \ RSBACKUP_SSH_TARGET=localhost \ RSBACKUP_HOOK=pre-backup-hook \ RSBACKUP_ACT=true \ fake_run --must-output "${fake_work}/snaps/rsb-volume" \ ./rsbackup-snapshot-hook -s ${fake_work}/snaps rsbackup-3.0/tools/rsbackup.devices0000664000175000017500000000034112103242262014417 00000000000000# List names of devices here devices="" # For each device, define DEVICE_uuid # e.g. devicename_uuid=8f4171f0-007d-4083-a40c-407e5f9c24dd # For any device that isn't encrypted, define DEVICE_plain # e.g. devicename_plain=1 rsbackup-3.0/tools/t-hook-dryrun0000775000175000017500000000253312534531471013731 00000000000000#! /usr/bin/env bash # # Copyright © 2014, 2015 Richard Kettlewell. # # 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 . set -e . ${srcdir:-.}/../scripts/fakeshell.sh fake_init mkdir ${fake_work}/snaps mkdir ${fake_work}/snaps/rsb-volume fake_reset fake_cmd --must-not-run df fake_cmd --must-not-run lvdisplay fake_cmd --must-not-run lvcreate fake_cmd --must-not-run fsck fake_cmd --must-not-run mount fake_cmd --must-not-run umount fake_cmd --must-not-run lvremove fake_cmd --must-not-run ssh fake_cmd --must-not-run udevadm RSBACKUP_VOLUME=rsb-volume \ RSBACKUP_VOLUME_path=/path/to/volume \ RSBACKUP_SSH_TARGET=localhost \ RSBACKUP_HOOK=pre-backup-hook \ RSBACKUP_ACT=false \ fake_run --must-output-empty \ ./rsbackup-snapshot-hook -s ${fake_work}/snaps rsbackup-3.0/tools/rsbackup-snapshot-hook.in0000775000175000017500000000731012535045030016207 00000000000000#! /bin/sh # # Copyright © 2012, 2014, 2015 Richard Kettlewell. # # 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 . set -e SNAPS=/snap DIVISOR=5 # By default LVM whines about any FDs it doesn't know about export LVM_SUPPRESS_FD_WARNINGS=1 x() { fatal_errors=true case "$1" in +e ) shift fatal_errors=false ;; esac echo "HOOK: EXEC:" "$@" >&2 if $fatal_errors; then "$@" else set +e "$@" status=$? set -e fi } while [ $# -gt 0 ]; do case "$1" in --help | -h ) cat <&2 exit 1 ;; esac done # The path where the snapshot will be mounted snap=$SNAPS/$RSBACKUP_VOLUME # How to execute commands on the host case $RSBACKUP_SSH_TARGET in localhost ) remote="" ;; * ) remote="ssh $RSBACKUP_SSH_TARGET" ;; esac # Only use snapshots if configured to do so if ${RSBACKUP_ACT:-false} && $remote test -e $snap; then # Identify the device name devname=$($remote df ${RSBACKUP_VOLUME_PATH}|awk '/^\// { print $1}') # Canonicalize the device name dev="" for alias in $(x $remote udevadm info -rqsymlink -n "$devname"); do case "$alias" in /dev/mapper/* ) dev="${alias}" break ;; esac done if [ "${dev}" = "" ]; then echo >&2 "ERROR: cannot parse device name $device" exit 1 fi lv=${dev#*-} snaplv=${lv}.snap snapdev=${dev%-*}-${snaplv} case ${RSBACKUP_HOOK} in pre-backup-hook ) # Tidy up any leftovers if $remote [ -e $snapdev ]; then x $remote umount $snap >&2 || true x $remote lvremove --force $snapdev >&2 || true fi # Find out the size of the source volume lvsz=$($remote lvdisplay $dev | awk '/Current LE/ { print $3 }') lvname=$($remote lvdisplay $dev | awk '/LV Path/ { print $3 }') if [ "$lvname" = "" ]; then lvname=$($remote lvdisplay $dev | awk '/LV Name/ { print $3 }') fi snaplvsz=$(($lvsz / $DIVISOR)) # Create and mount the snapshot x $remote lvcreate --extents $snaplvsz --name $snaplv --snapshot $lvname >&2 # Snapshots may need fscking before mounting # fsck status is a bitmap; 1 means that errors were corrected. # All the other nonzero bits are fatal. x +e $remote fsck -a $snapdev >&2 case $status in 0 | 1 ) ;; * ) x $remote lvremove --force $snapdev >&2 exit $status ;; esac x $remote mount -o ro $snapdev $snap >&2 # Backup from the snapshot, not the master echo $snap ;; post-backup-hook ) # Tidy up x $remote umount $snap >&2 x $remote lvremove --force $snapdev >&2 ;; esac fi rsbackup-3.0/tools/t-hook-post0000775000175000017500000000333112561410723013364 00000000000000#! /usr/bin/env bash # # Copyright © 2014, 2015 Richard Kettlewell. # # 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 . set -e . ${srcdir:-.}/../scripts/fakeshell.sh fake_init mkdir ${fake_work}/snaps mkdir ${fake_work}/snaps/rsb-volume fake_reset fake_cmd --must-run df "echo /dev/mapper/vg-lv" \ --must-args /path/to/volume fake_cmd --must-run lvdisplay \ "echo ' Current LE 8192'; echo ' LV Path /dev/vg/lv'" \ --must-args /dev/mapper/vg-lv fake_cmd --must-run umount \ --must-args ${fake_work}/snaps/rsb-volume fake_cmd --must-run lvremove \ --must-args --force /dev/mapper/vg-lv.snap fake_cmd --must-run udevadm "echo /dev/dm-0 /dev/mapper/vg-lv" \ --must-args info -rqsymlink -n /dev/mapper/vg-lv fake_cmd --must-not-run lvcreate fake_cmd --must-not-run fsck fake_cmd --must-not-run mount fake_cmd --must-not-run ssh RSBACKUP_VOLUME=rsb-volume \ RSBACKUP_VOLUME_path=/path/to/volume \ RSBACKUP_SSH_TARGET=localhost \ RSBACKUP_HOOK=post-backup-hook \ RSBACKUP_ACT=true \ fake_run --must-output-empty \ ./rsbackup-snapshot-hook -s ${fake_work}/snaps rsbackup-3.0/tools/Makefile.in0000664000175000017500000007413112635241702013326 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = tools DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(dist_noinst_SCRIPTS) $(top_srcdir)/config.aux/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" SCRIPTS = $(bin_SCRIPTS) $(dist_noinst_SCRIPTS) $(noinst_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/config.aux/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/config.aux/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_LIBS = @BOOST_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GCOV = @GCOV@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBPTHREAD = @LIBPTHREAD@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ LYX_TARGETS = @LYX_TARGETS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ SQLITE3_LIBS = @SQLITE3_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell. # # 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 . bin_SCRIPTS = rsbackup.cron rsbackup-mount rsbackup-snapshot-hook dist_noinst_SCRIPTS = srccheck EXTRA_DIST = rsbackup.config rsbackup.cron.in \ rsbackup.defaults rsbackup.devices \ rsbackup-mount.in rsbackup-snapshot-hook.in \ ${TESTS} CRONJOBS = rsbackup.daily rsbackup.hourly rsbackup.weekly rsbackup.monthly noinst_SCRIPTS = ${CRONJOBS} TESTS = t-bashisms t-hook-ok t-hook-fsck-ok t-hook-fsck-fail t-hook-post t-hook-nosnap \ t-hook-dryrun all: all-am .SUFFIXES: .SUFFIXES: .log .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tools/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ else \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? t-bashisms.log: t-bashisms @p='t-bashisms'; \ b='t-bashisms'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) t-hook-ok.log: t-hook-ok @p='t-hook-ok'; \ b='t-hook-ok'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) t-hook-fsck-ok.log: t-hook-fsck-ok @p='t-hook-fsck-ok'; \ b='t-hook-fsck-ok'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) t-hook-fsck-fail.log: t-hook-fsck-fail @p='t-hook-fsck-fail'; \ b='t-hook-fsck-fail'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) t-hook-post.log: t-hook-post @p='t-hook-post'; \ b='t-hook-post'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) t-hook-nosnap.log: t-hook-nosnap @p='t-hook-nosnap'; \ b='t-hook-nosnap'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) t-hook-dryrun.log: t-hook-dryrun @p='t-hook-dryrun'; \ b='t-hook-dryrun'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS .MAKE: check-am install-am install-strip .PHONY: all all-am check check-TESTS check-am clean clean-generic \ clean-local cscopelist-am ctags-am distclean distclean-generic \ distclean-local distdir dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am recheck tags-am uninstall uninstall-am \ uninstall-binSCRIPTS rsbackup.cron: rsbackup.cron.in Makefile rm -f $@.new sed 's/_version_/${VERSION}/g' < ${srcdir}/rsbackup.cron.in > $@.new chmod 555 $@.new mv -f $@.new $@ rsbackup-mount: rsbackup-mount.in Makefile rm -f $@.new sed 's/_version_/${VERSION}/g' < ${srcdir}/rsbackup-mount.in > $@.new chmod 555 $@.new mv -f $@.new $@ rsbackup-snapshot-hook: rsbackup-snapshot-hook.in Makefile rm -f $@.new sed 's/_version_/${VERSION}/g' < ${srcdir}/rsbackup-snapshot-hook.in > $@.new chmod 555 $@.new mv -f $@.new $@ ${CRONJOBS}: Makefile rm -f $@.new echo '#! /bin/sh' > $@.new echo 'set -e' >> $@.new echo 'test -x ${bindir}/rsbackup.cron && exec ${bindir}/rsbackup.cron $(subst rsbackup.,,$@)' >> $@.new chmod 555 $@.new mv -f $@.new $@ clean-local: rm -f *.new distclean-local: rm -f rsbackup.cron rsbackup-mount rsbackup-snapshot-hook rm -f rsbackup.hourly rsbackup.daily rsbackup.weekly rsbackup.monthly # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: rsbackup-3.0/tools/t-hook-fsck-fail0000775000175000017500000000343412534533166014251 00000000000000#! /usr/bin/env bash # # Copyright © 2014, 2015 Richard Kettlewell. # # 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 . set -e . ${srcdir:-.}/../scripts/fakeshell.sh fake_init mkdir ${fake_work}/snaps mkdir ${fake_work}/snaps/rsb-volume fake_reset fake_cmd --must-run df "echo /dev/mapper/vg-lv" \ --must-args /path/to/volume fake_cmd --must-run lvremove \ --must-args --force /dev/mapper/vg-lv.snap fake_cmd --must-run lvdisplay \ "echo ' Current LE 8192'; echo ' LV Path /dev/vg/lv'" \ --must-args /dev/mapper/vg-lv fake_cmd lvcreate \ --must-args --extents 1638 --name lv.snap --snapshot /dev/vg/lv fake_cmd fsck "exit 2" \ --must-args -a /dev/mapper/vg-lv.snap fake_cmd --must-run udevadm "echo /dev/dm-0 /dev/mapper/vg-lv" \ --must-args info -rqsymlink -n /dev/mapper/vg-lv fake_cmd --must-not-run umount fake_cmd --must-not-run mount fake_cmd --must-not-run ssh RSBACKUP_VOLUME=rsb-volume \ RSBACKUP_VOLUME_path=/path/to/volume \ RSBACKUP_SSH_TARGET=localhost \ RSBACKUP_HOOK=pre-backup-hook \ RSBACKUP_ACT=true \ fake_run --must-exit 2 --must-output-empty \ ./rsbackup-snapshot-hook -s ${fake_work}/snaps rsbackup-3.0/tools/t-bashisms0000775000175000017500000000153512450336324013257 00000000000000#! /bin/sh # # Copyright © 2014 Richard Kettlewell. # # 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 . set -e if type checkbashisms >/dev/null 2>&1; then for s in rsbackup.cron rsbackup-mount rsbackup-snapshot-hook; do checkbashisms -x -p "$s" done else exit 77 fi rsbackup-3.0/tools/t-hook-nosnap0000775000175000017500000000246612534531766013720 00000000000000#! /usr/bin/env bash # # Copyright © 2014, 2015 Richard Kettlewell. # # 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 . set -e . ${srcdir:-.}/../scripts/fakeshell.sh fake_init mkdir ${fake_work}/snaps fake_reset fake_cmd --must-not-run df fake_cmd --must-not-run lvdisplay fake_cmd --must-not-run lvcreate fake_cmd --must-not-run fsck fake_cmd --must-not-run mount fake_cmd --must-not-run umount fake_cmd --must-not-run lvremove fake_cmd --must-not-run ssh fake_cmd --must-not-run udevadm RSBACKUP_VOLUME=rsb-volume \ RSBACKUP_VOLUME_path=/path/to/volume \ RSBACKUP_SSH_TARGET=localhost \ RSBACKUP_HOOK=pre-backup-hook \ RSBACKUP_ACT=true \ fake_run --must-output-empty \ ./rsbackup-snapshot-hook -s ${fake_work}/snaps rsbackup-3.0/tools/rsbackup.defaults0000644000175000017500000000153711661256427014632 00000000000000# # List hosts to backup hourly, daily, weekly and monthly # - set the empty string to back up no hosts (at that frequency) # - use the special string "_all" to back up everything # hourly="" daily=_all weekly="" monthly="" # # Set report=hourly|daily|weekly|monthly to control frequency of # email reports. (Hourly is probably a bit much!) Only effective # if email is not "". # report=daily # # Set email=ADDRESS to have the report emailed to that address. # email=root # # Set prune=hourly|daily|weekly|monthly|never to control frequency of # automated pruning of old backups # prune=daily # # Set prune_incomplete=hourly|daily|weekly|monthly|never to control # frequency of automated pruning of incomplete backups # prune_incomplete=weekly # # Prefix to the rsbackup command # Use 'nice' and/or 'ionice' here. Remember to quote correctly. # nicely= rsbackup-3.0/tools/rsbackup-mount.in0000775000175000017500000000754612450336324014574 00000000000000#! /bin/sh # # Copyright © 2011, 2012, 2014 Richard Kettlewell. # # 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 . set -e action=mount act="" keyfile="" while [ $# -gt 0 ]; do case "$1" in --unmount | -u ) shift action=unmount ;; --check | -c ) shift action=check ;; --dry-run | -n ) shift act="echo" ;; --key-file | -k ) shift keyfile="$1" shift ;; --help | -h ) cat <&2 exit 1 ;; * ) break ;; esac done . /etc/rsbackup/devices if [ $# = 0 ]; then set $devices auto=true else auto=false fi # Set the parameters for the device as follows: # # uuid= # encrypted= # luks_device= (if encrypted=true) # luks_device_attached= # luks_device_open= device_parameters() { dev="$1" uuid=$(eval echo \$${dev}_uuid) plain=$(eval echo \$${dev}_plain) if [ -z "$plain" ]; then encrypted=true luks_device=/dev/disk/by-uuid/$uuid if [ -e ${luks_device} ]; then luks_device_attached=true if [ -e /dev/mapper/$device ]; then luks_device_open=true else luks_device_open=false fi else luks_device_attached=false fi else encrypted=false fi } case $action in mount ) for device; do device_parameters $device if $encrypted && ! $luks_device_attached && $auto; then echo >&2 "WARNING: $device not attached, skipping" continue fi if $encrypted && ! $luks_device_open; then if $luks_device_attached; then echo "Decrypting $device:" if [ -n "$keyfile" ]; then $act cryptsetup luksOpen --key-file "$keyfile" "${luks_device}" $device else $act cryptsetup luksOpen "${luks_device}" $device fi else echo >&2 "ERROR: $device not attached" exit 1 fi fi if [ -r /$device ] && [ -x /$device ]; then if [ ! -e /$device/device-id ]; then $act mount /$device else if ! $auto; then echo >&2 "WARNING: /$device/device-id already exists" fi fi else echo >&2 "ERROR: /$device is not accessible" exit 1 fi done ;; unmount ) for device; do if [ -e /$device/device-id ]; then $act umount /$device fi if [ -e /dev/mapper/$device ]; then $act cryptsetup luksClose $device fi done ;; check ) for device; do device_parameters $device if $encrypted && $luks_device_attached; then if ! $luks_device_open; then echo "$device is attached but not decrypted" elif [ ! -e /$device/device-id ]; then echo "$device is attached and open, but does not seem to be mounted" fi fi done ;; esac rsbackup-3.0/tools/t-hook-ok0000775000175000017500000000352112534531766013024 00000000000000#! /usr/bin/env bash # # Copyright © 2014, 2015 Richard Kettlewell. # # 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 . set -e . ${srcdir:-.}/../scripts/fakeshell.sh fake_init mkdir ${fake_work}/snaps mkdir ${fake_work}/snaps/rsb-volume fake_reset fake_cmd --must-run df "echo /dev/mapper/vg-lv" \ --must-args /path/to/volume fake_cmd --must-run lvdisplay \ "echo ' Current LE 8192'; echo ' LV Path /dev/vg/lv'" \ --must-args /dev/mapper/vg-lv fake_cmd --must-run lvcreate \ --must-args --extents 1638 --name lv.snap --snapshot /dev/vg/lv fake_cmd --must-run fsck \ --must-args -a /dev/mapper/vg-lv.snap fake_cmd --must-run mount \ --must-args -o ro /dev/mapper/vg-lv.snap ${fake_work}/snaps/rsb-volume fake_cmd --must-run udevadm "echo /dev/dm-0 /dev/mapper/vg-lv" \ --must-args info -rqsymlink -n /dev/mapper/vg-lv fake_cmd --must-not-run umount fake_cmd --must-not-run lvremove fake_cmd --must-not-run ssh RSBACKUP_VOLUME=rsb-volume \ RSBACKUP_VOLUME_path=/path/to/volume \ RSBACKUP_SSH_TARGET=localhost \ RSBACKUP_HOOK=pre-backup-hook \ RSBACKUP_ACT=true \ fake_run --must-output "${fake_work}/snaps/rsb-volume" \ ./rsbackup-snapshot-hook -s ${fake_work}/snaps rsbackup-3.0/tools/srccheck0000775000175000017500000000371012620463022012762 00000000000000#! /usr/bin/perl -w # # Copyright (C) 2015 Richard Kettlewell # # 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 . # use strict; our $errors = 0; sub error { print STDERR "$ARGV:$.: ", @_, "\n"; ++$errors; } my $comment = 0; while(<>) { # Whitespace discipline error("trailing whitespace") if / $/; error("tab character") if /\t/; # Strip C comments #print STDERR "$comment $_"; if($comment) { if(/\*\//) { $comment = 0; s/^.*?\*\///; #print STDERR "endc $_"; } else { $_ = "\n"; #print STDERR "allc $_"; } } else { s/\/\*.*?\*\///g; #print STDERR "strp $_"; if(/\/\*/) { s/\/\*.*$//; $comment = 1; #print STDERR "trim $_"; } } # Strip C++ comments (but not // inside strings) s/^(([^"]|\"([^\\\"]|\\.)*\")*?)\/\/.*/$1/; # if(cond) not if (cond) error("keyword '$1' followed by whitespace") if /\b(for|if|while|switch|sizeof|typeof)\s+\(/; # continuation operators at start of line, not end error("trailing operator") if /(&&|\|\||\+|\*|\/|-)\s*$/; error("NULL macro (use nullptr)") if /[^A-Z]NULL/; error("0 as null pointer (use nullptr)") if /\*\)0/; } continue { if(eof) { close ARGV; $comment = 0; } } exit !!$errors;