rsbackup-4.0/0000775000175000017500000000000013067504144010176 500000000000000rsbackup-4.0/scripts/0000775000175000017500000000000013067504143011664 500000000000000rsbackup-4.0/scripts/dist0000775000175000017500000000550613056231303012474 00000000000000#! /bin/sh # # This file is part of rsbackup # Copyright (C) 2010, 2011, 2013-16 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}_${debversion}_${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 # Make sure auto*-generated files are up to date s ./autogen.sh s ./configure # 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 debversion=$(dpkg-parsechangelog -ldebian/changelog -SVersion) source=${srcpkg}-${version} # source directory archive=${srcpkg}-${version}.tar.gz # tarball # Build .deb files s build araminta amd64 # jessie s build chroot:jessie32 i386 # jessie 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 gpg2 -a -b "$f" done cd .. ls -l products rsbackup-4.0/scripts/fakeshell.sh0000664000175000017500000001652012671570535014112 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-4.0/scripts/txt2src0000775000175000017500000000163612671570535013161 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-4.0/scripts/htmlman0000775000175000017500000000414212671570535013203 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-4.0/src/0000775000175000017500000000000013067504144010765 500000000000000rsbackup-4.0/src/PruneNever.cc0000664000175000017500000000207212671570535013315 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-4.0/src/EventLoop.h0000664000175000017500000002002613065536714012777 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 getMonotonicTime) * * 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 getMonotonicTime) * @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(); 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-4.0/src/test-lock.cc0000664000175000017500000000263612671570535013137 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-4.0/src/HTML.cc0000664000175000017500000001373213040671504011762 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::Image::renderHtml(std::ostream &os) const { renderHtmlOpenTag(os, "p", (char *)nullptr); renderHtmlOpenTag(os, "img", "src", url.c_str(), (char *)nullptr); renderHtmlCloseTag(os, "p"); } 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-4.0/src/Date.h0000664000175000017500000001214513040671504011732 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 Assignment operator * @param dateString Date in YYYY-MM-DD format */ Date &operator=(const std::string &dateString); /** @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 Increment date * @return Next day */ Date &operator++(); /** @brief Advance by 1 month * @return @c *this * * If the day ends up outside the month it is clipped to the last day. */ Date &addMonth(); /** @brief Convert to string * @return Date in "YYYY-MM-DD" format */ std::string toString() const; // YYYY-MM-DD /** @brief Convert to a string using a strftime format * @param fmt Format string for @c strftime * @return Date in target format */ std::string format(const char *fmt) const; /** @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); /** @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; 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 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-4.0/src/Email.h0000664000175000017500000000370212671570535012116 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-4.0/src/DeviceAccess.h0000664000175000017500000000205012671570535013403 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-4.0/src/test-confbase.cc0000664000175000017500000000276713056231303013755 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 "ConfBase.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-4.0/src/Subprocess.h0000664000175000017500000002100713065536714013214 00000000000000//-*-C++-*- // Copyright © 2011, 2012, 2014-2016 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 Configure reporting * @param reportCommand The command must be logged * @param reportNow Log command immediately * * If @p reportCommand is @c true then the command will be reported, either * now or just before execution. * * If @p reportNow is @c true then if the command is to be reported, it will * happen immediately. * * A command is never reported more than once. */ void reporting(bool reportCommand, bool reportNow); /** @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; } /** @brief Find @p name on the path * @param name Program to execute * @return Full path to @p name, or "" if not found */ static std::string pathSearch(const std::string &name); 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 Report what will or would be run */ void report(); /** @brief Timeout after which child is killed, in seconds * 0 means no timeout: the child may run indefinitely. */ int timeout = 0; 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; /** @brief True if the command has been logged */ bool reported = false; /** @brief True if the command needs to be logged */ bool reportNeeded = false; }; #endif /* SUBPROCESS_H */ rsbackup-4.0/src/Volume.h0000664000175000017500000001242213056231303012316 00000000000000// -*-C++-*- // Copyright © 2011, 2012, 2014-2016 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 VOLUME_H #define VOLUME_H /** @file Volume.h * @brief Configuration and state of a volume */ #include "ConfBase.h" class Host; /** @brief Type of an ordered set of backups * @see Volume::backups */ typedef std::set backups_type; /** @brief Possible states of a volume */ enum BackupRequirement { /** @brief Volume already backed up */ AlreadyBackedUp, /** @brief Device not usable */ NotThisDevice, /** @brief Volume not usable */ NotAvailable, /** @brief Volume can and should be backed up */ BackupRequired }; /** @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_); /** @brief Destructor */ ~Volume(); /** @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 Find the per-device information for @p device * @param device Device name * @return Per-device information or @c nullptr */ const PerDevice *findDevice(const std::string &device) const { auto it = perDevice.find(device); return it != perDevice.end() ? &it->second : nullptr; } /** @brief Add a backup * @return @c true if the backup was inserted, @c false if already present */ bool 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; /** @brief Identify whether this volume needs backing up on a particular device * @param device Target device * @return Volume state */ BackupRequirement needsBackup(Device *device); 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); }; #endif /* VOLUME_H */ rsbackup-4.0/src/Conf.cc0000664000175000017500000005024313060550036012077 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 "Backup.h" #include "Volume.h" #include "Host.h" #include "Store.h" #include "Errors.h" #include "IO.h" #include "Command.h" #include "Utils.h" #include "Database.h" #include "Prune.h" #include "ConfDirective.h" #include "Device.h" #include #include #include #include Conf::Conf() { std::vector args; args.push_back("120"); args.push_back("0.75"); deviceColorStrategy = ColorStrategy::create(DEFAULT_COLOR_STRATEGY, args); } Conf::~Conf() { delete deviceColorStrategy; deviceColorStrategy = nullptr; delete db; db = nullptr; for(auto &d: devices) delete d.second; devices.clear(); for(auto &s: stores) delete s.second; stores.clear(); for(auto &h: hosts) delete h.second; hosts.clear(); } 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, "# 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, "# 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, "# ---- Reporting ----", step); d(os, "", step); d(os, "# 'Good' and 'bad' colors for HTML report", step); d(os, "# color-good 0xRRGGBB", step); d(os, "# color-bad 0xRRGGBB", step); os << indent(step) << "color-good 0x" << colorGood << '\n' << indent(step) << "color-bad 0x" << colorBad << '\n'; d(os, "", step); if(reportPruneLogs) { d(os, "# How many days worth of pruning logs to report", step); d(os, "# report-prune-logs DAYS", step); os << indent(step) << "report-prune-logs " << reportPruneLogs << '\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, "# 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, "# Contents of report", step); d(os, "# report [+] KEY[:VALUE][?CONDITION]", step); d(os, "#", step); d(os, "# Keys:", step); d(os, "# generated -- generation time", step); d(os, "# history-graph -- graphical representation ofbackups", step); d(os, "# h1:HEADING -- level-1 heading", step); d(os, "# h2:HEADING -- level-2 heading", step); d(os, "# h3:HEADING -- level-3 heading", step); d(os, "# logs -- logs of failed backups", step); d(os, "# p:TEXT -- arbitrary text", step); d(os, "# prune-logs[:DAYS] -- pruning logs (default 3 days)", step); d(os, "# summary -- summary table", step); d(os, "# title:TITLE -- report title", step); d(os, "# warnings -- warning messages", step); d(os, "#", step); d(os, "# Conditions:", step); d(os, "# warnings -- true if there are warnings to display", step); writeVector(os, step, "report", report); d(os, "", step); d(os, "# ---- Graphs ----", step); d(os, "", step); d(os, "# Graph background color", step); d(os, "# color-graph-background 0xRRGGBB", step); os << indent(step) << "color-graph-background 0x" << colorGraphBackground << '\n'; d(os, "", step); d(os, "# Graph foreground color", step); d(os, "# color-graph-foreground 0xRRGGBB", step); os << indent(step) << "color-graph-foreground 0x" << colorGraphForeground << '\n'; d(os, "", step); d(os, "# Graph month guide color", step); d(os, "# color-month-guide 0xRRGGBB", step); os << indent(step) << "color-month-guide 0x" << colorMonthGuide << '\n'; d(os, "", step); d(os, "# Graph host guide color", step); d(os, "# color-host-guide 0xRRGGBB", step); os << indent(step) << "color-host-guide 0x" << colorHostGuide << '\n'; d(os, "", step); d(os, "# Graph volume guide color", step); d(os, "# color-volume-guide 0xRRGGBB", step); os << indent(step) << "color-volume-guide 0x" << colorVolumeGuide << '\n'; d(os, "", step); d(os, "# Strategy for picking device colors", step); d(os, "# device-color-strategy equidistant-value HUE", step); d(os, "# device-color-strategy equidistant-value HUE SATURATION", step); d(os, "# device-color-strategy equidistant-value HUE SATURATION MINVALUE MAXVALUE", step); d(os, "# device-color-strategy equidistant-hue HUE", step); d(os, "# device-color-strategy equidistant-hue HUE SATURATION VALUE", step); os << indent(step) << "device-color-strategy " << deviceColorStrategy->description() << '\n'; d(os, "", step); d(os, "# Horizontal padding", step); d(os, "# horizontal-padding PIXELS", step); os << indent(step) << "horizontal-padding " << horizontalPadding << '\n'; d(os, "", step); d(os, "# Vertical padding", step); d(os, "# vertical-padding PIXELS", step); os << indent(step) << "vertical-padding " << verticalPadding << '\n'; d(os, "", step); d(os, "# Minimum width of a backup indicator", step); d(os, "# backup-indicator-width PIXELS", step); os << indent(step) << "backup-indicator-width " << backupIndicatorWidth << '\n'; d(os, "", step); d(os, "# Minimum height of a backup indicator ", step); d(os, "# backup-indicator-height PIXELS", step); os << indent(step) << "backup-indicator-height " << backupIndicatorHeight << '\n'; d(os, "", step); d(os, "# Target width graph of graph", step); d(os, "# graph-target-width PIXELS", step); os << indent(step) << "graph-target-width " << graphTargetWidth << '\n'; d(os, "", step); d(os, "# Width of a backup indicator in the device key", step); d(os, "# backup-indicator-key-width PIXELS", step); os << indent(step) << "backup-indicator-key-width " << backupIndicatorKeyWidth << '\n'; d(os, "", step); d(os, "# Font description for host names", step); d(os, "# host-name-font FONT", step); os << indent(step) << "host-name-font " << hostNameFont << '\n'; d(os, "", step); d(os, "# Font description for volume names", step); d(os, "# volume-name-font FONT", step); os << indent(step) << "volume-name-font " << volumeNameFont << '\n'; d(os, "", step); d(os, "# Font description for device names", step); d(os, "# device-name-font FONT", step); os << indent(step) << "device-name-font " << deviceNameFont << '\n'; d(os, "", step); d(os, "# Font description for time labels", step); d(os, "# time-label-font FONT", step); os << indent(step) << "time-label-font " << timeLabelFont << '\n'; d(os, "", step); d(os, "# Layout", step); d(os, "# graph-layout [+] PART:COLUMN,ROW[:HV]", step); writeVector(os, step, "graph-layout", graphLayout); 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(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 const ConfDirective *d = ConfDirective::find(cc.bits[0]); if(d) { 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 = (warning_mask & WARNING_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 if(boost::filesystem::exists(logs)) { 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(WARNING_ALWAYS, "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(WARNING_ALWAYS, "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 = (warning_mask & WARNING_VERBOSE) && isatty(2); unsigned warning_type = forceWarn ? WARNING_ALWAYS : WARNING_UNKNOWN; /* Don't keep pruned backups around */ if(backup.getStatus() == PRUNED) return; if(!contains(devices, backup.deviceName)) { if(!contains(unknownDevices, backup.deviceName)) { if(progress) progressBar(IO::err, nullptr, 0, 0); warning(warning_type, "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(progress) progressBar(IO::err, nullptr, 0, 0); warning(warning_type, "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(progress) progressBar(IO::err, nullptr, 0, 0); warning(warning_type, "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 Backup *copy = new Backup(backup); bool inserted = volume->addBackup(copy); if(!inserted) delete copy; } // 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) { warning(WARNING_STORE, "%s", unavailableStoreException.what()); storeExceptions.push_back(unavailableStoreException); } catch(FatalStoreError &fatalStoreException) { if(states == Store::Enabled) throw; else warning(WARNING_STORE, "%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(!(warning_mask & WARNING_STORE)) 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(database.size() == 0) database = logs + "/backups.db"; if(command.act) { db = new Database(database); if(!db->hasTable("backup")) createTables(); } else { try { db = new Database(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-4.0/src/ConfDirective.cc0000664000175000017500000006077513060550036013751 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 "Device.h" #include "Backup.h" #include "Volume.h" #include "Host.h" #include "Store.h" #include "Errors.h" #include "Utils.h" #include "ConfDirective.h" #include // ConfDirective -------------------------------------------------------------- ConfDirective::ConfDirective(const char *name_, int min_, int max_): name(name_), min(min_), max(max_) { if(!directives) directives = new directives_type(); assert((*directives).find(name) == (*directives).end()); (*directives)[name] = this; } const ConfDirective *ConfDirective::find(const std::string &name) { auto it = directives->find(name); return it == directives->end() ? nullptr : it->second; } void ConfDirective::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 + "'"); } bool ConfDirective::get_boolean(const ConfContext &cc) const { if(cc.bits.size() == 1) { warning(WARNING_DEPRECATED, "%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"); } void ConfDirective::extend(const ConfContext &cc, std::vector &conf) const { if(cc.bits[1] == "+") conf.insert(conf.end(), &cc.bits[2], &cc.bits[cc.bits.size()]); else conf.assign(&cc.bits[1], &cc.bits[cc.bits.size()]); } directives_type *ConfDirective::directives; // HostOnlyDirective ---------------------------------------------------------- void HostOnlyDirective::check(const ConfContext &cc) const { if(cc.host == nullptr) throw SyntaxError("'" + name + "' command without 'host'"); if(cc.volume != nullptr && !inheritable) throw SyntaxError("'" + name + "' inside 'volume'"); ConfDirective::check(cc); } // VolumeOnlyDirective -------------------------------------------------------- void VolumeOnlyDirective::check(const ConfContext &cc) const { if(cc.volume == nullptr) throw SyntaxError("'" + name + "' command without 'volume'"); ConfDirective::check(cc); } // ColorDirective ------------------------------------------------------------- void ColorDirective::check(const ConfContext &cc) const { int args = cc.bits.size() - 1; ConfDirective::check(cc); if(args > 1 && args < 4) throw SyntaxError("wrong number of arguments to '" + name + "'"); if(args == 4) { if(cc.bits[1] == "rgb" || cc.bits[1] == "hsv") ; // OK else throw SyntaxError("invalid color representation '" + cc.bits[1] + "'"); } } void ColorDirective::set(ConfContext &cc) const { int args = cc.bits.size() - 1; if(args == 4) { if(cc.bits[1] == "rgb") set_rgb(cc, 2); else if(cc.bits[1] == "hsv") set_hsv(cc, 2); } else set_packed(cc, 1, 0); } void ColorDirective::set_rgb(ConfContext &cc, size_t n) const { set(cc, Color(parseFloat(cc.bits[n], 0, 1), parseFloat(cc.bits[n+1], 0, 1), parseFloat(cc.bits[n+2], 0, 1))); } void ColorDirective::set_hsv(ConfContext &cc, size_t n) const { set(cc, Color::HSV(parseFloat(cc.bits[n]), parseFloat(cc.bits[n+1], 0, 1), parseFloat(cc.bits[n+2], 0, 1))); } void ColorDirective::set_packed(ConfContext &cc, size_t n, int radix) const { set(cc, Color(parseInteger(cc.bits[n], 0, 0xFFFFFF, radix))); } // Global directives ---------------------------------------------------------- /** @brief The @c store directive */ static const struct StoreDirective: public ConfDirective { StoreDirective(): ConfDirective("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 ConfDirective { StorePatternDirective(): ConfDirective("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 ConfDirective { StyleSheetDirective(): ConfDirective("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 ConfDirective { ColorsDirective(): ConfDirective("colors", 2, 2) {} void set(ConfContext &cc) const override { warning(WARNING_DEPRECATED, "%s:%d: the 'colors' directive is deprecated, use 'color-good' and 'color-bad' instead", cc.path.c_str(), cc.line); 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 color-good directive */ static const struct ColorGoodDirective: public ColorDirective { ColorGoodDirective(): ColorDirective("color-good") {} void set(ConfContext &cc, const Color &c) const override { cc.conf->colorGood = c; } } color_good_directive; /** @brief The @c color-bad directive */ static const struct ColorBadDirective: public ColorDirective { ColorBadDirective(): ColorDirective("color-bad") {} void set(ConfContext &cc, const Color &c) const override { cc.conf->colorBad = c; } } color_bad_directive; /** @brief The @c device directive */ static const struct DeviceDirective: public ConfDirective { DeviceDirective(): ConfDirective("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 ConfDirective { MaxUsageDirective(): ConfDirective("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 ConfDirective { MaxFileUsageDirective(): ConfDirective("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 ConfDirective { PublicDirective(): ConfDirective("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 ConfDirective { LogsDirective(): ConfDirective("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 ConfDirective { LockDirective(): ConfDirective("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 ConfDirective { SendmailDirective(): ConfDirective("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 ConfDirective { PreAccessHookDirective(): ConfDirective("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 ConfDirective { PostAccessHookDirective(): ConfDirective("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 ConfDirective { KeepPruneLogsDirective(): ConfDirective("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 ConfDirective { ReportPruneLogsDirective(): ConfDirective("report-prune-logs", 1, 1) {} void set(ConfContext &cc) const override { warning(WARNING_DEPRECATED, "%s:%d: the 'report-prune-logs' directive is deprecated, use 'report' instead", cc.path.c_str(), cc.line); cc.conf->reportPruneLogs = parseInteger(cc.bits[1], 1); } } report_prune_logs_directive; /** @brief The @c include directive */ static const struct IncludeDirective: public ConfDirective { IncludeDirective(): ConfDirective("include", 1, 1) {} void set(ConfContext &cc) const override { cc.conf->includeFile(cc.bits[1]); } } include_directive; /** @brief The color-graph-background directive */ static const struct ColorGraphBackgroundDirective: public ColorDirective { ColorGraphBackgroundDirective(): ColorDirective("color-graph-background") {} void set(ConfContext &cc, const Color &c) const override { cc.conf->colorGraphBackground = c; } } color_graph_background_directive; /** @brief The color-graph-foreground directive */ static const struct ColorGraphForegroundDirective: public ColorDirective { ColorGraphForegroundDirective(): ColorDirective("color-graph-foreground") {} void set(ConfContext &cc, const Color &c) const override { cc.conf->colorGraphForeground = c; } } color_graph_foreground_directive; /** @brief The color-month-guide directive */ static const struct ColorMonthGuideDirective: public ColorDirective { ColorMonthGuideDirective(): ColorDirective("color-month-guide") {} void set(ConfContext &cc, const Color &c) const override { cc.conf->colorMonthGuide = c; } } color_month_guide_directive; /** @brief The color-host-guide directive */ static const struct ColorHostGuideDirective: public ColorDirective { ColorHostGuideDirective(): ColorDirective("color-host-guide") {} void set(ConfContext &cc, const Color &c) const override { cc.conf->colorHostGuide = c; } } color_host_guide_directive; /** @brief The color-volume-guide directive */ static const struct ColorVolumeGuideDirective: public ColorDirective { ColorVolumeGuideDirective(): ColorDirective("color-volume-guide") {} void set(ConfContext &cc, const Color &c) const override { cc.conf->colorVolumeGuide = c; } } color_volume_guide_directive; /** @brief The device-color-strategy directive */ static const struct DeviceColorStrategyDirective: public ConfDirective { DeviceColorStrategyDirective(): ConfDirective("device-color-strategy", 1, INT_MAX) {} void set(ConfContext &cc) const override { ColorStrategy *nc = ColorStrategy::create(cc.bits[1], cc.bits, 2); delete cc.conf->deviceColorStrategy; cc.conf->deviceColorStrategy = nc; } } device_color_strategy_directive; /** @brief The horizontal-padding directive */ static const struct HorizontalPaddingDirective: public ConfDirective { HorizontalPaddingDirective(): ConfDirective("horizontal-padding") {} void set(ConfContext &cc) const override { cc.conf->horizontalPadding = parseFloat(cc.bits[1], 0, std::numeric_limits::max()); } } horizontal_padding_directive; /** @brief The vertical-padding directive */ static const struct VerticalPaddingDirective: public ConfDirective { VerticalPaddingDirective(): ConfDirective("vertical-padding") {} void set(ConfContext &cc) const override { cc.conf->verticalPadding = parseFloat(cc.bits[1], 0, std::numeric_limits::max()); } } vertical_padding_directive; /** @brief The backup-indicator-width directive */ static const struct BackupIndicatorWidthDirective: public ConfDirective { BackupIndicatorWidthDirective(): ConfDirective("backup-indicator-width") {} void set(ConfContext &cc) const override { cc.conf->backupIndicatorWidth = parseFloat(cc.bits[1], std::numeric_limits::min(), std::numeric_limits::max()); } } backup_indicator_width_directive; /** @brief The backup-indicator-height directive */ static const struct BackupIndicatorHeightDirective: public ConfDirective { BackupIndicatorHeightDirective(): ConfDirective("backup-indicator-height") {} void set(ConfContext &cc) const override { cc.conf->backupIndicatorHeight = parseFloat(cc.bits[1], std::numeric_limits::min(), std::numeric_limits::max()); } } backup_indicator_height_directive; /** @brief The graph-target-width directive */ static const struct GraphTargetWidthDirective: public ConfDirective { GraphTargetWidthDirective(): ConfDirective("graph-target-width") {} void set(ConfContext &cc) const override { cc.conf->graphTargetWidth = parseFloat(cc.bits[1], 0, std::numeric_limits::max()); } } graph_target_width_directive; /** @brief The backup-indicator-key-width directive */ static const struct BackupIndicatorKeyWidthDirective: public ConfDirective { BackupIndicatorKeyWidthDirective(): ConfDirective("backup-indicator-key-width") {} void set(ConfContext &cc) const override { cc.conf->backupIndicatorKeyWidth = parseFloat(cc.bits[1], std::numeric_limits::min(), std::numeric_limits::max()); } } backup_indicator_key_width_directive; /** @brief The host-name-font directive */ static const struct HostNameFontDirective: public ConfDirective { HostNameFontDirective(): ConfDirective("host-name-font", 1, 1) {} void set(ConfContext &cc) const override { cc.conf->hostNameFont = cc.bits[1]; } } host_name_font_directive; /** @brief The volume-name-font directive */ static const struct VolumeNameFontDirective: public ConfDirective { VolumeNameFontDirective(): ConfDirective("volume-name-font", 1, 1) {} void set(ConfContext &cc) const override { cc.conf->volumeNameFont = cc.bits[1]; } } volume_name_font_directive; /** @brief The device-name-font directive */ static const struct DeviceNameFontDirective: public ConfDirective { DeviceNameFontDirective(): ConfDirective("device-name-font", 1, 1) {} void set(ConfContext &cc) const override { cc.conf->deviceNameFont = cc.bits[1]; } } device_name_font_directive; /** @brief The time-label-font directive */ static const struct TimeLabelFontDirective: public ConfDirective { TimeLabelFontDirective(): ConfDirective("time-label-font", 1, 1) {} void set(ConfContext &cc) const override { cc.conf->timeLabelFont = cc.bits[1]; } } time_label_font_directive; /** @brief The report directive */ static const struct ReportDirective: public ConfDirective { ReportDirective(): ConfDirective("report", 0, INT_MAX) {} void set(ConfContext &cc) const override { extend(cc, cc.conf->report); } } report_directive; /** @brief The graph-layout directive */ static const struct GraphLayoutDirective: public ConfDirective { GraphLayoutDirective(): ConfDirective("graph-layout", 0, INT_MAX) {} void set(ConfContext &cc) const override { extend(cc, cc.conf->graphLayout); } } graph_layout_directive; // Inheritable directives ----------------------------------------------------- /** @brief The @c max-age directive */ static const struct MaxAgeDirective: public ConfDirective { MaxAgeDirective(): ConfDirective("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 ConfDirective { MinBackupsDirective(): ConfDirective("min-backups", 1, 1) {} void set(ConfContext &cc) const override { warning(WARNING_DEPRECATED, "%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 ConfDirective { PruneAgeDirective(): ConfDirective("prune-age", 1, 1) {} void set(ConfContext &cc) const override { warning(WARNING_DEPRECATED, "%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 ConfDirective { PrunePolicyDirective(): ConfDirective("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 ConfDirective { PruneParameterDirective(): ConfDirective("prune-parameter", 2, 2) {} void check(const ConfContext &cc) const override { ConfDirective::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]); } /** @brief Test for valid @c prune-parameter names * @param name Candidate name * @return @c true if @name is valid */ 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 ConfDirective { PreBackupHookDirective(): ConfDirective("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 ConfDirective { PostBackupHookDirective(): ConfDirective("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 ConfDirective { RsyncTimeoutDirective(): ConfDirective("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 ConfDirective { HookTimeoutDirective(): ConfDirective("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 ConfDirective { SshTimeoutDirective(): ConfDirective("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 ConfDirective { HostDirective(): ConfDirective("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; rsbackup-4.0/src/Selection.cc0000664000175000017500000000463613056231303013142 00000000000000// Copyright © 2015, 2016 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 "Selection.h" #include "Errors.h" #include "Conf.h" #include "Backup.h" #include "Volume.h" #include "Host.h" 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 + "'"); } void VolumeSelections::add(const std::string &selection) { // Establish the sense of this entry bool sense; if(selection.size() == 0) throw CommandError("invalid selection"); size_t pos = 0; switch(selection.at(pos)) { case '-': case '!': sense = false; ++pos; break; default: sense = true; break; } size_t colon = selection.find(':', pos); if(colon != std::string::npos) { // A host:volume pair selections.push_back(Selection(selection.substr(pos, colon-pos), selection.substr(colon + 1), sense)); } else { // Just a host selections.push_back(Selection(selection.substr(pos), "*", sense)); } } void VolumeSelections::select(Conf &config) const { if(selections.size() == 0) config.selectVolume("*", "*", true); for(auto &selection: selections) config.selectVolume(selection.host, selection.volume, selection.sense); } rsbackup-4.0/src/IO.h0000664000175000017500000001413012671570535011373 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-4.0/src/test-database.cc0000664000175000017500000000446212671570535013752 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-4.0/src/check-source0000775000175000017500000000135412671570535013220 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-4.0/src/Date.cc0000664000175000017500000001136113040671504012067 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 "Date.h" #include "Errors.h" #include #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) { *this = dateString; } Date &Date::operator=(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]; return *this; } Date::Date(time_t when) { struct tm result; if(!localtime_r(&when, &result)) { std::stringstream ss; ss << "invalid time_t: " << when << ": " << strerror(errno); throw InvalidDate(ss.str()); } y = result.tm_year + 1900; m = result.tm_mon + 1; d = result.tm_mday; } Date &Date::operator++() { if(d < monthLength(y, m)) ++d; else { d = 1; if(++m > 12) { m -= 12; y += 1; } } return *this; } Date &Date::addMonth() { m += 1; if(m > 12) { m -= 12; y += 1; } d = std::min(d, monthLength(y, m)); return *this; } std::string Date::toString() const { char buffer[64]; snprintf(buffer, sizeof buffer, "%04d-%02d-%02d", y, m, d); return buffer; } std::string Date::format(const char *fmt) const { char buffer[256]; struct tm t; time_t when = toTime(); if(!localtime_r(&when, &t)) { std::stringstream ss; ss << "invalid time_t: " << when << ": " << strerror(errno); throw InvalidDate(ss.str()); } strftime(buffer, sizeof buffer, fmt, &t); 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-4.0/src/test-check.cc0000664000175000017500000000750312671570535013262 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-4.0/src/test-progress.cc0000664000175000017500000000360412671570535014047 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-4.0/src/Device.h0000664000175000017500000000261313056231303012247 00000000000000// -*-C++-*- // Copyright © 2011, 2012, 2014-2016 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 DEVICE_H #define DEVICE_H /** @file Device.h * @brief Configuration and state of a device */ #include class Store; /** @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); }; #endif /* DEVICE_H */ rsbackup-4.0/src/ColorStrategy.cc0000664000175000017500000001024213056231303014004 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 "Color.h" #include "Utils.h" #include "Errors.h" #include #include #include ColorStrategy::ColorStrategy(const char *name): name(name) { } std::string ColorStrategy::description() const { return name; } /** @brief A color strategy that maximizes distance between hues */ class EquidistantHue: public ColorStrategy { public: /** @brief Constructor * @param h Starting hue * @param s Saturation * @param v Value */ EquidistantHue(double h = 0, double s = 1, double v = 1): ColorStrategy("equidistant-hue"), hue(fmod(h, 360)), saturation(s), value(v) { } Color get(unsigned n, unsigned items) const override { double h = hue + 360.0 * n / items; return Color::HSV(h, saturation, value); } std::string description() const override { std::stringstream ss; ss << name << ' ' << hue << ' ' << saturation << ' ' << value; return ss.str(); } /** @brief Starting hue */ double hue; /** @brief Saturation */ double saturation; /** @brief Value */ double value; }; /** @brief A color strategy that maximizes distance between values */ class EquidistantValue: public ColorStrategy { public: /** @brief Constructor * @param h Base hue * @param s Saturation * @param minv Minimum value * @param maxv Maximum value * */ EquidistantValue(double h = 0, double s = 1, double minv = 0, double maxv = 1): ColorStrategy("equidistant-value"), hue(fmod(h, 360)), saturation(s), minvalue(minv), maxvalue(maxv) { } Color get(unsigned n, unsigned items) const override { double value = minvalue + static_cast(n) / (items-1) * (maxvalue - minvalue); return Color::HSV(hue, saturation, value); } std::string description() const override { std::stringstream ss; ss << name << ' ' << hue << ' ' << saturation; if(minvalue != 0 || maxvalue != 1) ss << ' ' << minvalue << ' ' << maxvalue; return ss.str(); } /** @brief Hue */ double hue; /** @brief Saturation */ double saturation; /** @brief Lowest value */ double minvalue; /** @brief Highest value */ double maxvalue; }; ColorStrategy *ColorStrategy::create(const std::string &name, std::vector ¶ms, size_t pos) { if(name == "equidistant-hue") { double h = 0, s = 1, v = 1; if(pos < params.size()) h = parseFloat(params[pos++]); if(pos < params.size()) s = parseFloat(params[pos++], 0, 1); if(pos < params.size()) v = parseFloat(params[pos++], 0, 1); if(pos < params.size()) throw SyntaxError("too many parameters for color strategy '" + name + "'"); return new EquidistantHue(h, s, v); } if(name == "equidistant-value") { double h = 0, s = 1, minv = 0, maxv = 1; if(pos < params.size()) h = parseFloat(params[pos++]); if(pos < params.size()) s = parseFloat(params[pos++], 0, 1); if(pos < params.size()) minv = parseFloat(params[pos++], 0, 1); if(pos < params.size()) maxv = parseFloat(params[pos++], 0, 1); if(minv >= maxv) throw SyntaxError("inconsistent parameters for color strategy '" + name + "'"); if(pos < params.size()) throw SyntaxError("too many parameters for color strategy '" + name + "'"); return new EquidistantValue(h, s, minv, maxv); } throw SyntaxError("unrecognized color strategy '" + name + "'"); } rsbackup-4.0/src/Unicode.cc0000664000175000017500000000330312671570535012610 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 && errno != E2BIG) throw SystemError(std::string("iconv: "), errno); u.append(buffer, (char32_t *)outptr - buffer); } } rsbackup-4.0/src/base64.cc0000664000175000017500000000350313040671504012275 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 #include "Utils.h" std::ostream &write_base64(std::ostream &os, const std::string &s, const char *alphabet) { size_t pos = 0, limit = s.size(); while(pos < limit) { unsigned b; int bit, bitlimit; switch(limit - pos) { default: b = static_cast(s.at(pos++)); b = 256 * b + static_cast(s.at(pos++)); b = 256 * b + static_cast(s.at(pos++)); bitlimit = 0; break; case 2: b = static_cast(s.at(pos++)); b = 256 * b + static_cast(s.at(pos++)); b = 256 * b; bitlimit = 8; break; case 1: b = static_cast(s.at(pos++)); b = 256 * b; b = 256 * b; bitlimit = 16; break; } bit = 3*6; while(bit + 6 > bitlimit) { os.put(alphabet[(b >> bit) & 0x3F]); bit -= 6; } while(bit >= 0) { os.put(alphabet[64]); bit -= 6; } } return os; } const char rfc4684_base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; rsbackup-4.0/src/test-subprocess.cc0000664000175000017500000000626513056231303014362 00000000000000// Copyright © 2012-16 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 #include static const char *warnings[64]; static size_t nwarnings; void warning(unsigned, 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; } void fatal(const char *, ...) { abort(); } 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-4.0/src/Store.cc0000664000175000017500000000561313065536714012323 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 "Device.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) { // Re-throw with the appropriate error type if(e.errno_value == ENOENT) throw UnavailableStore(e.what()); else throw BadStore(e.what()); } catch(...) { delete f; throw; } } rsbackup-4.0/src/test-io.cc0000664000175000017500000000341712671570535012614 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-4.0/src/test-date.cc0000664000175000017500000001132713040671504013106 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); static const struct { const char *before, *after; } day_increment_tests[] = { { "1995-01-01", "1995-01-02" }, { "1995-01-31", "1995-02-01" }, { "1995-02-28", "1995-03-01" }, { "1995-12-31", "1996-01-01" }, { "1996-02-28", "1996-02-29" }, { "1996-02-29", "1996-03-01" }, }; for(auto &t: day_increment_tests) { d = t.before; assert(d.toString() == t.before); ++d; printf("%s:%d: %s %s %s\n", __FILE__, __LINE__, t.before, t.after, d.toString().c_str()); assert(d.toString() == t.after); } static const struct { const char *before, *after; } month_increment_tests[] = { { "1995-01-01", "1995-02-01" }, { "1995-01-31", "1995-02-28" }, { "1995-02-28", "1995-03-28" }, { "1995-12-31", "1996-01-31" }, { "1996-01-28", "1996-02-28" }, { "1996-01-29", "1996-02-29" }, { "1996-01-30", "1996-02-29" }, { "1996-02-28", "1996-03-28" }, { "1996-02-29", "1996-03-29" }, }; for(auto &t: month_increment_tests) { d = t.before; assert(d.toString() == t.before); d.addMonth(); printf("%s:%d: %s %s %s\n", __FILE__, __LINE__, t.before, t.after, d.toString().c_str()); assert(d.toString() == t.after); } static const struct { const std::string a, b; int delta; } subtract_tests[] = { { "2015-12-01", "2015-11-01", 30 }, { "2016-02-01", "2016-01-01", 31 }, }; for(auto &t: subtract_tests) { Date a = t.a; assert(a.toString() == t.a); Date b = t.b; assert(b.toString() == t.b); int delta = a - b; printf("%s-%s=%d\n", a.toString().c_str(), b.toString().c_str(), delta); assert(delta == t.delta); } return 0; } rsbackup-4.0/src/Makefile.am0000664000175000017500000001145213065536714012752 00000000000000# Copyright © 2011, 2012, 2014-2016 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 rsbackup-graph 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 test-color test-base64 dist_noinst_SCRIPTS=check-source AM_CXXFLAGS=$(SQLITE3_CFLAGS) $(CAIROMM_CFLAGS) $(PANGOMM_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 Selection.h Selection.cc Color.h \ Color.cc parseFloat.cc Render.h Render.cc HistoryGraph.h \ HistoryGraph.cc ColorStrategy.cc ConfDirective.h ConfDirective.cc \ base64.cc substitute.cc timestamp.cc debug.cc ConfBase.h Volume.h \ Host.h Backup.h Device.h rsbackup_SOURCES=rsbackup.cc PruneAge.cc PruneNever.cc PruneExec.cc \ PruneDecay.cc rsbackup_LDADD=librsbackup.a $(SQLITE3_LIBS) $(BOOST_LIBS) rsbackup_graph_SOURCES=rsbackup-graph.cc PruneAge.cc PruneNever.cc \ PruneExec.cc PruneDecay.cc rsbackup_graph_LDADD=librsbackup.a $(SQLITE3_LIBS) $(BOOST_LIBS) $(CAIROMM_LIBS) $(PANGOMM_LIBS) test_date_SOURCES=test-date.cc test_date_LDADD=librsbackup.a test_color_SOURCES=test-color.cc test_color_LDADD=librsbackup.a test_subprocess_SOURCES=test-subprocess.cc Subprocess.cc Errors.cc IO.cc \ EventLoop.cc nonblock.cc Action.cc timestamp.cc debug.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_timespec_LDADD=librsbackup.a 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 test_base64_SOURCES=test-base64.cc test_base64_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 test-color test-base64 check-source stylesheet.cc: ${top_srcdir}/doc/rsbackup.css ${top_srcdir}/scripts/txt2src stylesheet < $^ > $@ rsbackup-4.0/src/Command.cc0000664000175000017500000002067713056231303012576 00000000000000// Copyright © 2011-16 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 "Utils.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); enable_warning(WARNING_STORE); break; case 'c': configPath = optarg; break; case 'w': wait = true; break; case 'n': act = false; enable_warning(WARNING_VERBOSE); break; case 'f': force = true; break; case 'v': enable_warning(WARNING_VERBOSE); 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: enable_warning(WARNING_UNKNOWN); break; case WARN_STORE: enable_warning(WARNING_STORE); break; case WARN_UNREACHABLE: enable_warning(WARNING_UNREACHABLE); break; case WARN_PARTIAL: enable_warning(WARNING_PARTIAL); break; case NO_WARN_PARTIAL: disable_warning(WARNING_PARTIAL); break; case REPEAT_ERRORS: enable_warning(WARNING_ERRORLOGS); break; case NO_REPEAT_ERRORS: disable_warning(WARNING_ERRORLOGS); break; case LOG_VERBOSITY: logVerbosity = getVerbosity(optarg); break; case 'W': enable_warning(static_cast(-1)); 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) selections.add(argv[n]); } else { if(retire) throw CommandError("no volumes specified to retire"); } } 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"); } } 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::~Command() { delete html; delete text; delete email; } Command command; std::string configPath = DEFAULT_CONFIG; std::string database; rsbackup-4.0/src/Volume.cc0000664000175000017500000001624013065536714012474 00000000000000// Copyright © 2011-2016 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 "Device.h" #include "Backup.h" #include "Volume.h" #include "Host.h" #include "Subprocess.h" #include "Utils.h" #include "Store.h" #include #include #include 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); } Volume::~Volume() { deleteAll(backups); } 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); } } bool Volume::addBackup(Backup *backup) { bool inserted = backups.insert(backup).second; if(inserted) calculate(); return inserted; } bool Volume::removeBackup(const Backup *backup) { for(auto it = backups.begin(); it != backups.end(); ++it) { Backup *s = *it; if(s == backup) { backups.erase(it); delete s; // 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; } BackupRequirement Volume::needsBackup(Device *device) { switch(fnmatch(devicePattern.c_str(), device->name.c_str(), FNM_NOESCAPE)) { case 0: break; case FNM_NOMATCH: return NotThisDevice; default: warning(WARNING_ALWAYS, "invalid device pattern '%s'", devicePattern.c_str()); /* fail safe - make the backup */ break; } Date today = Date::today(); for(const Backup *backup: backups) if(backup->rc == 0 && backup->date == today && backup->deviceName == device->name) return AlreadyBackedUp; // Already backed up if(!available()) return NotAvailable; return BackupRequired; } 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-4.0/src/PruneDecay.cc0000664000175000017500000000761113056231303013250 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 "Backup.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-4.0/src/Prune.cc0000664000175000017500000002711213065536714012316 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 "Device.h" #include "Backup.h" #include "Volume.h" #include "Host.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 #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) { assert(policies != nullptr); // policies not statically initialized 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(warning_mask & WARNING_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(warning_mask & WARNING_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(WARNING_DATABASE, "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(warning_mask & WARNING_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-4.0/src/test-tolines.cc0000664000175000017500000000227112671570535013657 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-4.0/src/test-select.cc0000664000175000017500000000553113056231303013444 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 "Backup.h" #include "Volume.h" #include "Host.h" #include #define SETUP() \ Conf c; \ auto h1 = new Host(&c, "h1"); \ auto h2 = new Host(&c, "h2"); \ auto h1v1 = new Volume(h1, "v1", "/v1"); \ auto h1v2 = new Volume(h1, "v2", "/v2"); \ auto h2v1 = new Volume(h2, "v1", "/v1"); \ auto h2v2 = new Volume(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-4.0/src/Host.h0000664000175000017500000000672013065536714012006 00000000000000// -*-C++-*- // Copyright © 2011, 2012, 2014-2016 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 HOST_H #define HOST_H /** @file Host.h * @brief Configuration and state of a host */ #include "ConfBase.h" /** @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 Destructor */ virtual ~Host(); /** @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; }; #endif /* HOST_H */ rsbackup-4.0/src/test-color.cc0000664000175000017500000000443713040671504013313 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 "Color.h" #include #include #include int main() { for(unsigned n = 0; n < 256; ++n) { Color c(n); unsigned u = c; printf("%s:%d: c=(%g,%g,%g) n=%u u=%u\n", __FILE__, __LINE__, c.red, c.green, c.blue, n, u); assert(u == n); c = Color(n << 8); u = c >> 8; printf("%s:%d: c=(%g,%g,%g) n=%u u=%u\n", __FILE__, __LINE__, c.red, c.green, c.blue, n, u); assert(u == n); c = Color(n << 16); u = c >> 16; printf("%s:%d: c=(%g,%g,%g) n=%u u=%u\n", __FILE__, __LINE__, c.red, c.green, c.blue, n, u); assert(u == n); } assert(Color::HSV(0, 1, 1) == Color(0xFF0000)); assert(Color::HSV(60, 1, 1) == Color(0xFFFF00)); assert(Color::HSV(120, 1, 1) == Color(0x00FF00)); assert(Color::HSV(180, 1, 1) == Color(0x00FFFF)); assert(Color::HSV(240, 1, 1) == Color(0x0000FF)); assert(Color::HSV(300, 1, 1) == Color(0xFF00FF)); assert(Color::HSV(30, 1, 1) == Color(0xFF7F00)); assert(Color::HSV(90, 1, 1) == Color(0x7FFF00)); assert(Color::HSV(150, 1, 1) == Color(0x00FF7F)); assert(Color::HSV(210, 1, 1) == Color(0x007FFF)); assert(Color::HSV(270, 1, 1) == Color(0x7F00FF)); assert(Color::HSV(330, 1, 1) == Color(0xFF007F)); { Color c = 0xE0FFE0; unsigned u = static_cast(c); printf("%06x %06x\n", u, static_cast(c)); assert(u == 0xE0FFE0); std::stringstream ss; printf("c=(%g,%g,%g)=(%A,%A,%A)\n", c.red, c.green, c.blue, c.red, c.green, c.blue); ss << c; puts(ss.str().c_str()); assert(ss.str() == "e0ffe0"); } return 0; } rsbackup-4.0/src/Defaults.h0000664000175000017500000000647513056231303012631 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 /** @brief Default warning mask */ #define DEFAULT_WARNING_MASK (WARNING_DEPRECATED|WARNING_PARTIAL|WARNING_ERRORLOGS|WARNING_DATABASE) /* Colors */ /** @brief "Good" color in HTML report */ #define COLOR_GOOD 0xE0FFE0 /** @brief "Bad" color in HTML report */ #define COLOR_BAD 0xFF4040 /** @brief Default color-picking strategy */ #define DEFAULT_COLOR_STRATEGY "equidistant-value" /* 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-4.0/src/MakeBackup.cc0000664000175000017500000003524013065536714013231 00000000000000// Copyright © 2011, 2012, 2014-2016 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 "Device.h" #include "Backup.h" #include "Volume.h" #include "Host.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); sp.reporting(warning_mask & WARNING_VERBOSE, false); 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(!(warning_mask & WARNING_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); sp.reporting(warning_mask & WARNING_VERBOSE, !command.act); 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) { warning(WARNING_PARTIAL, "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); sp.reporting(warning_mask & WARNING_VERBOSE, false); 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) { delete outcome; 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(warning_mask & (WARNING_VERBOSE|WARNING_ERRORLOGS)) { warning(WARNING_VERBOSE|WARNING_ERRORLOGS, "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(WARNING_DATABASE, "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(warning_mask & WARNING_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(); } // Backup VOLUME static void backupVolume(Volume *volume) { Host *host = volume->parent; char buffer[1024]; for(auto &d: config.devices) { Device *device = d.second; switch(volume->needsBackup(device)) { case BackupRequired: config.identifyDevices(Store::Enabled); if(device->store && device->store->state == Store::Enabled) backupVolume(volume, device); else if(warning_mask & WARNING_STORE) { config.identifyDevices(Store::Disabled); if(device->store) switch(device->store->state) { case Store::Disabled: warning(WARNING_STORE, "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(WARNING_STORE, "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(warning_mask & WARNING_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(warning_mask & WARNING_VERBOSE) IO::out.writef("INFO: %s:%s is not available\n", host->name.c_str(), volume->name.c_str()); break; case NotThisDevice: if(warning_mask & WARNING_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(WARNING_ALWAYS, "cannot backup always-up host %s - not reachable", host->name.c_str()); ++errors; // Try anyway, so that the failures are recorded. } else { warning(WARNING_UNREACHABLE, "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-4.0/src/rsbackup.cc0000664000175000017500000001355513060546702013036 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 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, !!(warning_mask & WARNING_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. warning(WARNING_VERBOSE, "cannot acquire lockfile %s", config.lock.c_str()); exit(0); } } // Select volumes if(command.backup || command.prune || command.pruneIncomplete) command.selections.select(config); // 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 << "td.bad { background-color: #" << config.colorBad << " }\n"; ss << "td.good { background-color: #" << config.colorGood << " }\n"; ss << "span.bad { color: #" << 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) warning(WARNING_VERBOSE, "%d errors detected", errors); IO::out.close(); } catch(Error &e) { error("%s", e.what()); if(debug) e.trace(stderr); } catch(std::runtime_error &e) { error("%s", e.what()); } exit(!!errors); } rsbackup-4.0/src/test-parseinteger.cc0000664000175000017500000000444712671570535014701 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-4.0/src/test-base64.cc0000664000175000017500000000225213040671504013252 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 #include "Utils.h" static std::string base64(const std::string &s) { std::stringstream ss; write_base64(ss, s); std::cerr << "[" << s << "] -> [" << ss.str() << "]\n"; return ss.str(); } int main() { assert(base64("") == ""); assert(base64("f") == "Zg=="); assert(base64("fo") == "Zm8="); assert(base64("foo") == "Zm9v"); assert(base64("foob") == "Zm9vYg=="); assert(base64("fooba") == "Zm9vYmE="); assert(base64("foobar") == "Zm9vYmFy"); } rsbackup-4.0/src/Store.h0000664000175000017500000000323613056231303012146 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-4.0/src/test-host.cc0000664000175000017500000000230113056231303013132 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 "Host.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-4.0/src/test-unicode.cc0000664000175000017500000000337712671570535013640 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-4.0/src/test-directory.cc0000664000175000017500000000316112671570535014205 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-4.0/src/Check.cc0000664000175000017500000000303012671570535012234 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-4.0/src/Utils.h0000664000175000017500000002412013060550036012147 00000000000000//-*-C++-*- // Copyright © 2011, 2012, 2014-2016 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 #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 Parse a float * @param s Representation of float * @param min Minimum acceptable value * @param max Maximum acceptable value * @return Floating point value * @throws SyntaxError if the @p s doesn't represent a number * @throws SyntaxError if the value is out of range */ double parseFloat(const std::string &s, double min = -std::numeric_limits::max(), double max = std::numeric_limits::max()); /** @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 an error message and terminate * @param fmt Format string, as printf() * @param ... Arguments to format string * * Writes an error message to standard error and terminates the program * by calling @c exit(). */ void fatal [[noreturn]](const char *fmt, ...); /** @brief Display a warning message * @param type Warning type * @param fmt Format string, as printf() * @param ... Arguments to format string * * Writes an warning message to standard error. */ void warning(unsigned type, const char *fmt, ...); /** @brief Always issue this warning */ #define WARNING_ALWAYS 0 /** @brief Display warnings for unknown devices, hosts and volumes */ #define WARNING_UNKNOWN 0x00000001 /** @brief Display warnings for unsuitable stores and unavailable devices */ #define WARNING_STORE 0x00000002 /** @brief Display warnings for deprecated configuration syntax */ #define WARNING_DEPRECATED 0x00000004 /** @brief Display rsync partial transfer warnings */ #define WARNING_PARTIAL 0x00000008 /** @brief Display verbose messages */ #define WARNING_VERBOSE 0x00000010 /** @brief Display error logs */ #define WARNING_ERRORLOGS 0x00000020 /** @brief Display warnings for database activity */ #define WARNING_DATABASE 0x00000040 /** @brief Display warnings for unreachable hosts */ #define WARNING_UNREACHABLE 0x00000080 /** @brief Current warning mask */ extern unsigned warning_mask; /** @brief Enable warning(s) * @param bits Warning bit(s) to enable */ inline void enable_warning(unsigned bits) { warning_mask |= bits; } /** @brief Disable warning(s) * @param bits Warning bit(s) to disable */ inline void disable_warning(unsigned bits) { warning_mask &= ~bits; } /** @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(); } /** @brief RFC4684 base64 alphabet for @ref write_base64() */ extern const char rfc4684_base64[]; /** @brief Convert a string to base64 * @param os Output stream * @param s String to convert * @param alphabet Digits and padding (must be 65 bytes long) * @return @p os */ std::ostream &write_base64(std::ostream &os, const std::string &s, const char *alphabet = rfc4684_base64); /** @brief Expand environment variable references * @param s Input string * @param pos Start position within @p s * @param n Number of characters to read within @p s * @return @p s with environment variables expanded * * Within @p s: * * 1. The @c \ character quotes the following character. The exception is that * if it is at the end of the string, it is not replaced. * * 2. The sequence @c ${NAME} is replaced (nonrecursively) with the value * of the environment variable @c NAME, if it is set. */ std::string substitute(const std::string &s, std::string::size_type pos = 0, std::string::size_type n = std::string::npos); /** @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. */ void getMonotonicTime(struct timespec &now); /** @brief Issue debug output * * Affects the @ref D macro and @ref write_debug(). * * The default is @c false. */ extern bool debug; /** @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). */ int write_debug(const char *path, long line, const char *msg, ...); /** @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)(debug && write_debug(__FILE__, __LINE__, __VA_ARGS__)) #endif /* UTILS_H */ rsbackup-4.0/src/Directory.cc0000664000175000017500000000365012671570535013173 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-4.0/src/ConfDirective.h0000664000175000017500000001375113060550036013603 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 CONFDIRECTIVE_H #define CONFDIRECTIVE_H /** @file ConfDirective.h * @brief Configuration file parser support * * This file contains classes used during configuration parsing, including the * classes that define directives (@ref ConfDirective). */ /** @brief Context for configuration file parsing * * This class captures the state for a configuration file that we are reading. * If it includes further configuration files, there will be further * ConfContext objects. */ 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; }; class ConfDirective; /** @brief Type of name-to-directive map */ typedef std::map directives_type; /** @brief Base class for configuration file directives * * Each configuration file directive has a corresponding subclass and a single * instance. */ class ConfDirective { public: /** @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. */ ConfDirective(const char *name_, int min_=0, int max_=INT_MAX); /** @brief Name of directive */ const std::string name; /** @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; /** @brief Get a boolean parameter * @param cc Context containing directive * @return @c true or @c false * * Use in ConfDirective::set implementations for boolean-sense directives. */ bool get_boolean(const ConfContext &cc) const; /** @brief Set or extend a vector directive * @param cc Context containing directive * @param conf Configuration value to update */ void extend(const ConfContext &cc, std::vector &conf) const; /** @brief Act on a directive * @param cc Context containing directive */ virtual void set(ConfContext &cc) const = 0; /** @brief Find a directive * @param name Name of directive * @return Pointer to implementation or null pointer if not found */ static const ConfDirective *find(const std::string &name); private: /** @brief Minimum number of arguments */ int min; /** @brief Maximum number of arguments */ int max; /** @brief Map names to directives */ static directives_type *directives; }; /** @brief Base class for directives that can only appear in a host context */ class HostOnlyDirective: public ConfDirective { public: /** @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): ConfDirective(name_, min_, max_), inheritable(inheritable_) {} void check(const ConfContext &cc) const override; /** @brief If @c true, also allowed in volume context */ bool inheritable; }; /** @brief Base class for directives that can only appear in a volume context */ class VolumeOnlyDirective: public ConfDirective { public: /** @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): ConfDirective(name_, min_, max_) {} void check(const ConfContext &cc) const override; }; /** @brief Base class for color-setting directives */ class ColorDirective: public ConfDirective { public: /** @brief Constructor * @param name Name of directive */ ColorDirective(const char *name): ConfDirective(name, 1, 4) {} void check(const ConfContext &cc) const override; void set(ConfContext &cc) const override; /** @brief Set a color * @param cc Configuration context * @param c Color to set */ virtual void set(ConfContext &cc, const Color &c) const = 0; private: /** @brief Parse and set an RGB color representation * @param cc Configuration context * @param n Index for first element */ void set_rgb(ConfContext &cc, size_t n) const; /** @brief Parse and set an HSV color representation * @param cc Configuration context * @param n Index for first element */ void set_hsv(ConfContext &cc, size_t n) const; /** @brief Parse and set a packed integer color representation * @param cc Configuration context * @param n Index for first element * @param radix Radix or 0 to pick as per strtol(3) */ void set_packed(ConfContext &cc, size_t n, int radix = 0) const; }; #endif /* CONFDIRECTIVE_H */ rsbackup-4.0/src/timestamp.cc0000664000175000017500000000216513040671504013217 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 "Errors.h" #include #include #include void getMonotonicTime(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-4.0/src/Progress.cc0000664000175000017500000000227512671570535013035 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-4.0/src/Report.h0000664000175000017500000000575513056231303012335 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 Compute counters */ void compute(); /** @brief Generate the list of warnings */ void warnings(); /** @brief Calculate how many warnings there are */ int warningCount() const; /** @brief Generate the summary table and set counters */ void summary(); /** @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 logs(const Volume *volume); /** @brief Generate the report of backup logs for everything */ void logs(); /** @brief Generate the report of pruning logfiles */ void pruneLogs(const std::string &days); /** @brief Generate backup history graphic */ void historyGraph(); /** @brief Generate a named report section */ void section(const std::string &name); /** @brief Current backup history */ std::string history_png; }; #endif /* REPORT_H */ rsbackup-4.0/src/HistoryGraph.cc0000664000175000017500000003055213057050705013642 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 "Conf.h" #include "Backup.h" #include "Volume.h" #include "Host.h" #include "HistoryGraph.h" #include "Errors.h" #include "Utils.h" #include #include #include HostLabels::HostLabels(Render::Context &ctx): Render::Grid(ctx) { unsigned row = 0; if(config.hosts.size() == 0) throw std::runtime_error("no hosts found in configuration"); for(auto host_iterator: config.hosts) { Host *host = host_iterator.second; if(!host->selected()) continue; if(host->volumes.size() == 0) printf("%s has no volumes!?!\n", host_iterator.first.c_str()); auto t = new Render::Text(ctx, host_iterator.first, config.colorGraphForeground, config.hostNameFont); cleanup(t); add(t, 0, row); for(auto volume_iterator: host->volumes) { Volume *volume = volume_iterator.second; if(!volume->selected()) continue; ++row; } } set_padding(config.horizontalPadding, config.verticalPadding); } VolumeLabels::VolumeLabels(Render::Context &ctx): Render::Grid(ctx) { unsigned row = 0; for(auto host_iterator: config.hosts) { Host *host = host_iterator.second; if(!host->selected()) continue; for(auto volume_iterator: host->volumes) { Volume *volume = volume_iterator.second; if(!volume->selected()) continue; auto t = new Render::Text(ctx, volume_iterator.first, config.colorGraphForeground, config.volumeNameFont); cleanup(t); add(t, 0, row); ++row; } } set_padding(config.horizontalPadding, config.verticalPadding); } DeviceKey::DeviceKey(Render::Context &ctx): Render::Grid(ctx) { unsigned row = 0; for(auto device_iterator: config.devices) { const auto &device = device_iterator.first; device_rows[device] = row; auto t = new Render::Text(ctx, device, config.colorGraphForeground, config.deviceNameFont); cleanup(t); add(t, 0, row); auto r = new Render::Rectangle(ctx, config.backupIndicatorKeyWidth, indicator_height, device_color(row)); rectangles.push_back(r); cleanup(r); add(r, 1, row, -1, 0); ++row; } set_padding(config.horizontalPadding, config.verticalPadding); } void DeviceKey::set_indicator_height(double h) { indicator_height = h; for(auto r: rectangles) r->set_size(-1, indicator_height); } const Color DeviceKey::device_color(unsigned row) const { /* TODO char di[64]; snprintf(di, sizeof di, "device%u", row); if(context.colors.find(di) != context.colors.end()) return context.colors[di]; */ return config.deviceColorStrategy->get(row, config.devices.size()); } HistoryGraphContent::HistoryGraphContent(Render::Context &ctx, const DeviceKey &device_key): Render::Widget(ctx), earliest(INT_MAX, 1, 0), latest(0), device_key(device_key), rows(0) { for(auto host_iterator: config.hosts) { Host *host = host_iterator.second; if(!host->selected()) continue; for(auto volume_iterator: host->volumes) { Volume *volume = volume_iterator.second; if(!volume->selected()) continue; for(auto backup: volume->backups) { if(backup->getStatus() == COMPLETE) { earliest = std::min(earliest, backup->date); latest = std::max(latest, backup->date); } } ++rows; } } if(rows == 0) throw CommandError("no volumes selected"); } void HistoryGraphContent::set_extent() { assert(row_height > 0); auto columns = latest.toNumber() - earliest.toNumber() + 1; height = rows ? row_height * rows + config.verticalPadding * (rows - 1) : 0; width = latest >= earliest ? config.backupIndicatorWidth * columns : 0; } void HistoryGraphContent::render_vertical_guides() { set_source_color(config.colorMonthGuide); Date d = earliest; while(d <= latest) { d.d = 1; d.addMonth(); Date next = d; next.addMonth(); double x = (d - earliest) * config.backupIndicatorWidth; double w = (next - d) * config.backupIndicatorWidth; w = std::min(w, width - x); context.cairo->rectangle(x, 0, w, height); d.addMonth(); } context.cairo->fill(); } void HistoryGraphContent::render_horizontal_guides() { unsigned row = 0; for(auto host_iterator: config.hosts) { Host *host = host_iterator.second; if(!host->selected()) continue; set_source_color(config.colorHostGuide); for(auto volume_iterator: host->volumes) { Volume *volume = volume_iterator.second; if(!volume->selected()) continue; context.cairo->rectangle(0, row * (row_height + config.verticalPadding), width, 1); context.cairo->fill(); set_source_color(config.colorVolumeGuide); ++row; } } set_source_color(config.colorVolumeGuide); context.cairo->rectangle(0, row * (row_height + config.verticalPadding) - config.verticalPadding, width, 1); context.cairo->fill(); } void HistoryGraphContent::render_data() { double y = 0; double base = floor((row_height + config.verticalPadding - 1 - (indicator_height * config.devices.size())) / 2) + 1; for(auto host_iterator: config.hosts) { Host *host = host_iterator.second; if(!host->selected()) continue; for(auto volume_iterator: host->volumes) { Volume *volume = volume_iterator.second; if(!volume->selected()) continue; for(auto backup: volume->backups) { if(backup->getStatus() == COMPLETE) { double x = (backup->date - earliest) * config.backupIndicatorWidth; auto device_row = device_key.device_row(backup); double offset = base + device_row * indicator_height; set_source_color(device_key.device_color(backup)); context.cairo->rectangle(x, y + offset, config.backupIndicatorWidth, indicator_height); context.cairo->fill(); } } y += row_height + config.verticalPadding; } } } void HistoryGraphContent::render() { render_vertical_guides(); render_horizontal_guides(); render_data(); } TimeLabels::TimeLabels(Render::Context &ctx, HistoryGraphContent &content): Render::Container(ctx), content(content) { } void TimeLabels::set_extent() { if(width < 0) { Date d = content.earliest; int year = -1; double limit = 0; while(d <= content.latest) { Date next = d; next.d = 1; next.addMonth(); double xnext = (next - content.earliest) * config.backupIndicatorWidth; auto t = new Render::Text(context, "", config.colorGraphForeground, config.timeLabelFont); cleanup(t); // Try increasingly compact formats until one fits static const char *const formats[] = { "%B %Y", "%b %Y", "%b %y", "%B", "%b", }; static const unsigned nformats = sizeof formats / sizeof *formats; unsigned format; double x; for(format = (d.y != year ? 0 : 3); format < nformats; ++format) { t->set_text(d.format(formats[format])); t->set_extent(); // At the right hand edge, push back so it fits x = std::min((d - content.earliest) * config.backupIndicatorWidth, content.width - t->width); // If it fits, use it if(x >= limit && x + t->width < xnext) break; } if(format < nformats) { add(t, x, 0); limit = x + t->width; year = d.y; } d = next; } Container::set_extent(); } } HistoryGraph::HistoryGraph(Render::Context &ctx): Render::Grid(ctx), host_labels(ctx), volume_labels(ctx), device_key(ctx), content(ctx, device_key), time_labels(ctx, content) { set_padding(config.horizontalPadding, config.verticalPadding); } void HistoryGraph::set_extent() { host_labels.set_extent(); volume_labels.set_extent(); device_key.set_extent(); //time_labels.set_extent(); double row_height = std::max({host_labels.get_maximum_height(), volume_labels.get_maximum_height(), (config.backupIndicatorHeight * config.devices.size())}); double indicator_height = floor(row_height / config.devices.size()); device_key.set_indicator_height(indicator_height); content.set_indicator_height(indicator_height); host_labels.set_minimum(0, row_height); volume_labels.set_minimum(0, row_height); content.set_row_height(row_height); content.set_extent(); Grid::set_extent(); } void HistoryGraph::addPart(const std::string &partspec) { static std::regex partspec_regex("^([^:]+):([0-9]+),([0-9]+)(?::([LCR])([TCB]))?$"); std::smatch mr; if(!std::regex_match(partspec, mr, partspec_regex)) throw SyntaxError("invalid graph component specification '" + partspec + "'"); std::string part = mr[1]; unsigned column = parseInteger(mr[2], 0, INT_MAX); unsigned row = parseInteger(mr[3], 0, INT_MAX); int hj, vj; switch(mr[4].length() ? *mr[4].first : 'L') { case 'L': hj = -1; break; case 'C': hj = 0; break; case 'R': hj = 1; break; default: throw std::logic_error("HistoryGraph::addPart hj"); } switch(mr[5].length() ? *mr[5].first : 'T') { case 'T': vj = -1; break; case 'C': vj = 0; break; case 'B': vj = 1; break; default: throw std::logic_error("HistoryGraph::addPart vj"); } Widget *w; if(part == "host-labels") w = &host_labels; else if(part == "volume-labels") w = &volume_labels; else if(part == "content") w = &content; else if(part == "time-labels") w = &time_labels; else if(part == "device-key") w = &device_key; else throw SyntaxError("unrecognized graph component '" + part + "'"); add(w, column, row, hj, vj); } void HistoryGraph::addParts(const std::vector &partspecs) { for(auto &partspec: partspecs) addPart(partspec); } void HistoryGraph::render() { set_source_color(config.colorGraphBackground); context.cairo->rectangle(0, 0, width, height); context.cairo->fill(); Grid::render(); } void HistoryGraph::adjustConfig() { if(content.width == 0) return; // Figure out how big a content panel we can get away with double maxContentWidth = config.graphTargetWidth - (width - content.width); maxContentWidth = floor(maxContentWidth); auto columns = content.latest.toNumber() - content.earliest.toNumber() + 1; // Work out how big an indicator we can get away with double maxIndicatorWidth = maxContentWidth / columns; // Constrain to integral widths. This is a bug, but currently nonintegral // widths render badly, so a necessary one. if(maxIndicatorWidth >= 1) maxIndicatorWidth = floor(maxIndicatorWidth); if(width < config.graphTargetWidth) { // We can make the indicators bigger // Pick the biggest config.backupIndicatorWidth = std::max(config.backupIndicatorWidth, maxIndicatorWidth); content.changed(); return; } if(config.graphTargetWidth > 0 && width > config.graphTargetWidth) { // We have exceeded the target width if(maxContentWidth <= 0) { // User has asked for the impossible warning(WARNING_ALWAYS, "graph-target-width is much too small"); return; // Oh well } config.backupIndicatorWidth = maxIndicatorWidth; content.changed(); return; } } rsbackup-4.0/src/RetireDevices.cc0000664000175000017500000000310712671570535013761 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-4.0/src/test-split.cc0000664000175000017500000000524412671570535013340 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-4.0/src/rsbackup-graph.cc0000664000175000017500000001076213056231303014123 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 #include "Conf.h" #include "Backup.h" #include "Command.h" #include "Selection.h" #include "IO.h" #include "HistoryGraph.h" #include "Errors.h" #include "Utils.h" #include static const struct option options[] = { { "help", no_argument, nullptr, 'h' }, { "version", no_argument, nullptr, 'V' }, { "config", required_argument, nullptr, 'c' }, { "debug", no_argument, nullptr, 'd' }, { "database", required_argument, nullptr, 'D' }, { "output", required_argument, nullptr, 'o' }, { nullptr, 0, nullptr, 0 } }; static const char *graphHelpString() { return "Usage:\n" " rsbackup-graph [OPTIONS] [--] [[-]HOST...] [[-]HOST:VOLUME...]\n" "\n" "Options:\n" " --config, -c PATH Set config file (default: /etc/rsbackup/config)\n" " --debug, -d Debug output\n" " --database, -D PATH Override database path\n" " --output, -o PATH Output filename\n" " --help, -h Display usage message\n" " --version, -V Display version number\n" "\n" ; } static void help() { IO::out.writef(graphHelpString()); IO::out.close(); exit(0); } static void version() { IO::out.writef("%s\n", VERSION); IO::out.close(); exit(0); } static Cairo::ErrorStatus stdout_write_func(const unsigned char *data, unsigned int length) { fwrite(data, 1, length, stdout); if(ferror(stdout)) throw SystemError("writing to stdout", errno); return CAIRO_STATUS_SUCCESS; } int main(int argc, char **argv) { try { int n; const char *output = "rsbackup.png"; VolumeSelections selections; // Override debug if(getenv("RSBACKUP_DEBUG")) debug = true; // Hack to avoid graph generation causing a database upgrade command.act = false; // Parse options optind = 1; while((n = getopt_long(argc, (char *const *)argv, "+hVdc:D:o:", options, nullptr)) >= 0) { switch(n) { case 'h': help(); case 'V': version(); case 'c': configPath = optarg; break; case 'd': debug = true; break; case 'D': database = optarg; break; case 'o': output = optarg; break; default: exit(1); } } if(optind < argc) for(n = optind; n < argc; ++n) selections.add(argv[n]); config.read(); config.validate(); config.readState(); selections.select(config); // Eliminates segfault with "Failed to wrap object of type // 'PangoLayout'. Hint: this error is commonly caused by failing to call a // library init() function.". // // How you're supposed to know about this I've not discovered. Pango::init(); // Rendering context Render::Context context; // Use a throwaway graph and surface to work out size Cairo::RefPtr surface = Cairo::ImageSurface::create(Cairo::FORMAT_ARGB32, 1, 1); context.cairo = Cairo::Context::create(surface); HistoryGraph graph0(context); graph0.addParts(config.graphLayout); graph0.set_extent(); graph0.adjustConfig(); // Create the real graph HistoryGraph graph(context); graph.addParts(config.graphLayout); graph.set_extent(); // Create the real surface surface = Cairo::ImageSurface::create(Cairo::FORMAT_ARGB32, ceil(graph.width), ceil(graph.height)); context.cairo = Cairo::Context::create(surface); graph.render(); if(std::string(output) == "-") surface->write_to_png_stream(&stdout_write_func); else surface->write_to_png(output); return 0; } catch(Error &e) { error("%s", e.what()); if(debug) e.trace(stderr); return 1; } catch(std::runtime_error &e) { error("%s", e.what()); return 1; } } rsbackup-4.0/src/Selection.h0000664000175000017500000000574413056231303013005 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 SELECTION_H #define SELECTION_H /** @file Selection.h * @brief %Selection of volumes to operate on */ #include #include class Conf; /** @brief Represents a single 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 Represents a list of selections */ class VolumeSelections { public: /** @brief Add a selection to the list * @param selection Selection string from caller */ void add(const std::string &selection); /** @brief Select volumes * * Invokes Conf::selectVolumes() according to the selected volumes. * If no voumes were selected, selects everyting. */ void select(Conf &config) const; /** @brief Return the number of selections */ size_t size() const { return selections.size(); } /** @brief Return the nth selection * @param n Index into selections array */ const Selection &operator[](size_t n) const { return selections.at(n); } /** @brief Return an iterator pointing to the first selection * @return Iterator */ std::vector::const_iterator begin() const { return selections.begin(); } /** @brief Return an iterator pointing after the last selection * @return Iterator */ std::vector::const_iterator end() const { return selections.end(); } private: /** @brief Selections */ std::vector selections; }; #endif /* SELECTION_H */ rsbackup-4.0/src/ConfBase.h0000664000175000017500000001224113056231303012526 00000000000000// -*-C++-*- // Copyright © 2011, 2012, 2014-2016 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 CONFBASE_H #define CONFBASE_H /** @file ConfBase.h * @brief Base class for program configuration and state */ #include #include #include #include "Defaults.h" /** @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 out the value of a vector directive * @param os Output stream * @param step Indent depth * @param directive Name of directive * @param value Value of directive */ void writeVector(std::ostream &os, int step, const std::string &directive, const std::vector &value) const; /** @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(); }; #endif /* CONFBASE_H */ rsbackup-4.0/src/Command.h0000664000175000017500000000711713056231303012432 00000000000000// -*-C++-*- // Copyright © 2011, 2012, 2014-2016 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" #include "Selection.h" struct option; /** @brief Represents the parsed command line */ class Command { public: Command() = default; Command(const Command &) = delete; Command &operator=(const Command &) = delete; ~Command(); /** @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 @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 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 Log summary verbosity */ LogVerbosity logVerbosity = Failed; /** @brief Devices selected for retirement */ std::vector devices; /** @brief Selections */ VolumeSelections selections; /** @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 Path to config file * * This defaults to @ref DEFAULT_CONFIG. */ extern std::string configPath; /** @brief Database path */ extern std::string database; #endif /* COMMANDLINE_H */ rsbackup-4.0/src/test-eventloop.cc0000664000175000017500000000404712671570535014220 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-4.0/src/Subprocess.cc0000664000175000017500000001615013065536714013355 00000000000000// Copyright © 2011, 2012, 2014-2016 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 "Defaults.h" #include "IO.h" #include "Utils.h" #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"); // Report if necessary if(reportNeeded) report(); // 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(WARNING_ALWAYS, "%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; getMonotonicTime(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(reported) return; 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()); reported = true; } void Subprocess::reporting(bool reportCommand, bool reportNow) { reportNeeded = reportCommand; if(reportNeeded && reportNow) report(); } std::string Subprocess::pathSearch(const std::string &name) { if(name.find('/') != std::string::npos) return name; const char *pathc = getenv("PATH"); char buffer[1024]; if(!pathc) { // Follow documented execvp behavior size_t rc = confstr(_CS_PATH, buffer, sizeof buffer); if(rc == 0) throw SystemError("confstr", errno); if(rc > sizeof buffer) throw SystemError("confstr: not enough space"); pathc = buffer; } std::string path = pathc; size_t pos = 0; while(pos < path.size()) { size_t colon = path.find(':', pos); std::string e(path, pos, colon - pos); std::string p(e + "/" + name); if(access(p.c_str(), X_OK) == 0) return p; if(!(pos = colon + 1)) break; } return ""; } rsbackup-4.0/src/Render.cc0000664000175000017500000001231313040671504012427 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 "Render.h" #include "Utils.h" #include // Widget Render::Widget::~Widget() { deleteAll(cleanup_list); } void Render::Widget::changed() { if(width >= 0) { width = height = -1; if(parent) parent->changed(); } } void Render::Widget::cleanup(Widget *w) { cleanup_list.push_back(w); } // Container void Render::Container::add(Widget *widget, double x, double y) { children.push_back(Child(widget, x, y)); widget->parent = this; changed(); } void Render::Container::set_extent() { width = 0; height = 0; for(const auto &child: children) { if(child.widget->width < 0) child.widget->set_extent(); width = std::max(child.x + child.widget->width, width); height = std::max(child.y + child.widget->height, height); } width = ceil(width); height = ceil(height); } void Render::Container::render() { Render::Guard g(this); for(const auto &child: children) { context.cairo->translate(child.x, child.y); child.widget->render(); context.cairo->translate(-child.x, -child.y); } } // Grid void Render::Grid::add(Widget *widget, unsigned column, unsigned row, int hj, int vj) { children.push_back(GridChild(widget, column, row, hj, vj)); widget->parent = this; changed(); } void Render::Grid::set_padding(double xp, double yp) { xpadding = xp; ypadding = yp; changed(); } void Render::Grid::set_minimum(double w, double h) { force_width = w; force_height = h; changed(); } void Render::Grid::set_extent() { column_widths.clear(); row_heights.clear(); for(const auto &child: children) { if(child.widget->width < 0) child.widget->set_extent(); if(child.column >= column_widths.size()) column_widths.resize(child.column + 1); column_widths[child.column] = std::max(child.widget->width, column_widths[child.column]); if(child.row >= row_heights.size()) row_heights.resize(child.row + 1); row_heights[child.row] = std::max(child.widget->height, row_heights[child.row]); } for(auto &column_width: column_widths) column_width=std::max(column_width, force_width); width = xpadding * (column_widths.size() - 1); for(auto column_width: column_widths) width += column_width; for(auto &row_height: row_heights) row_height=std::max(row_height, force_height); height = ypadding * (row_heights.size() - 1); for(auto row_height: row_heights) height += row_height; } void Render::Grid::render() { Render::Guard g(this); for(const auto &child: children) { double child_x = 0; for(unsigned column = 0; column < child.column; ++column) child_x += column_widths[column] + xpadding; double child_y = 0; for(unsigned row = 0; row < child.row; ++row) child_y += row_heights[row] + ypadding; child_x = justify(child_x, column_widths[child.column], child.widget->width, child.hj); child_y = justify(child_y, row_heights[child.row], child.widget->height, child.vj); context.cairo->translate(child_x, child_y); child.widget->render(); context.cairo->translate(-child_x, -child_y); } } double Render::Grid::justify(double x, double cell_width, double child_width, int justification) { return x + floor((cell_width - child_width) * (justification + 1) / 2.0); } // Colored void Render::Colored::render() { set_source_color(color); } // Text Render::Text::Text(Context &context, const std::string &t, const Color &c, const std::string &f): Colored(context, c), text(t), font(f) { } void Render::Text::set_text(const std::string &t) { text = t; changed(); } void Render::Text::set_font(const std::string &f) { font = Pango::FontDescription(f); changed(); } void Render::Text::set_extent() { if(!layout) layout = Pango::Layout::create(context.cairo); layout->set_text(text); layout->set_font_description(font); Pango::Rectangle ink, logical; layout->get_pixel_extents(ink, logical); width = ceil(logical.get_width()); height = ceil(logical.get_height()); } void Render::Text::render() { Colored::render(); context.cairo->move_to(0, 0); layout->show_in_cairo_context(context.cairo); } // Rectangle void Render::Rectangle::set_extent() { } void Render::Rectangle::render() { Colored::render(); context.cairo->rectangle(0, 0, width, height); context.cairo->fill(); } void Render::Rectangle::changed() { } rsbackup-4.0/src/Backup.h0000664000175000017500000001143613056231303012260 00000000000000// -*-C++-*- // Copyright © 2011, 2012, 2014-2016 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 BACKUP_H #define BACKUP_H /** @file Backup.h * @brief State of a backup */ #include "Date.h" #include class Database; class Volume; class Device; /** @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 * @return @c true if this sorts earlier than @p that * * 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 @c true if @p a sorts earlier than @p b * * Backups are ordered by date first and by device name for backups of the * same date. */ bool operator()(Backup *a, Backup *b) const { return *a < *b; } }; #endif /* BACKUP_H */ rsbackup-4.0/src/HistoryGraph.h0000664000175000017500000001214613056231303013475 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 HISTORYGRAPH_H #define HISTORYGRAPH_H /** @file HistoryGraph.h * @brief Visualization of backup history */ #include "Render.h" #include "Conf.h" /** @brief Host name labels */ class HostLabels: public Render::Grid { public: /** @brief Constructor * @param ctx Rendering context */ HostLabels(Render::Context &ctx); }; /** @brief Volume name labels */ class VolumeLabels: public Render::Grid { public: /** @brief Constructor * @param ctx Rendering context */ VolumeLabels(Render::Context &ctx); }; /** @brief Key showing mapping of device names to colors */ class DeviceKey: public Render::Grid { public: /** @brief Constructor * @param ctx Rendering context */ DeviceKey(Render::Context &ctx); /** @brief Return the device row number for a backup * @param backup Backup * @return Device row number */ unsigned device_row(const Backup *backup) const { return device_rows.find(backup->deviceName)->second; } /** @brief Return the color for a device by number * @param row Device row number * @return Color */ const Color device_color(unsigned row) const; /** @brief Return the color for a backup * @param backup Backup * @return Color */ const Color device_color(const Backup *backup) const { return device_color(device_row(backup)); } /** @brief Set the device indicator height * @param h Height */ void set_indicator_height(double h); private: /** @brief Mapping of device names to device rows */ std::map device_rows; /** @brief Child rectangles */ std::list rectangles; /** @brief Height of device indicator rectangle */ double indicator_height = 1; }; /** @brief Visualization of backup history */ class HistoryGraphContent: public Render:: Widget { public: /** @brief Constructor * @param ctx Rendering context * @param device_key Corresponding @ref DeviceKey structure */ HistoryGraphContent(Render::Context &ctx, const DeviceKey &device_key); /** @brief Set the rot height * @param h Row height */ void set_row_height(double h) { row_height = h; changed(); } /** @brief Render the vertical guides */ void render_vertical_guides(); /** @brief Render the horizontal guides */ void render_horizontal_guides(); /** @brief Render the data */ void render_data(); void set_extent() override; void render() override; /** @brief Earliest date of any backup */ Date earliest; /** @brief Latest date of any backup */ Date latest; /** @brief Set the device indicator height * @param h New height */ void set_indicator_height(double h) { indicator_height = h; } private: /** @brief Height of a single row * * Set by @ref set_extent. */ double row_height = 0; /** @brief Corresponding @ref DeviceKey object */ const DeviceKey &device_key; /** @brief Number of rows */ unsigned rows; /** @brief Height of device indicator rectangle */ double indicator_height = 1; }; /** @brief Time-axis labels */ class TimeLabels: public Render::Container { public: /** @brief Constructor * @param ctx Rendering context * @param content Corresponding @ref HistoryGraphContent object */ TimeLabels(Render::Context &ctx, HistoryGraphContent &content); void set_extent() override; private: /** @brief Corresponding @ref HistoryGraphContent object */ HistoryGraphContent &content; }; /** @brief Complete graph showing backup history */ class HistoryGraph: public Render::Grid { public: /** @brief Constructor * @param ctx Rendering context */ HistoryGraph(Render::Context &ctx); /** @brief Add a component of the graph * @param partspec Component name and position */ void addPart(const std::string &partspec); /** @brief Add graph components * @param partspecs List of component names and positions */ void addParts(const std::vector &partspecs); /** @brief Adjust configuration to match targets */ void adjustConfig(); /** @brief Host name labels */ HostLabels host_labels; /** @brief Volume name labels */ VolumeLabels volume_labels; /** @brief Key showing mapping of device names to colors */ DeviceKey device_key; /** @brief Visualization of backup history */ HistoryGraphContent content; /** @brief Time-axis labels */ TimeLabels time_labels; void set_extent() override; void render() override; }; #endif /* HISTORYGRAPH_H */ rsbackup-4.0/src/FileLock.cc0000664000175000017500000000340112671570535012711 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-4.0/src/Prune.h0000664000175000017500000000653312671570535012165 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-4.0/src/Database.h0000664000175000017500000001536412671570535012602 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-4.0/src/BulkRemove.h0000664000175000017500000000315213065536714013140 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 * * Bulk removal happens in @ref pruneBackups and @ref retireVolumes. */ #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-4.0/src/rsbackup.h0000664000175000017500000000234112671570535012677 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-4.0/src/stylesheet.cc0000664000175000017500000000410513056231303013375 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" "\n" "img.history {\n" " border: 1px solid black;\n" " padding: 2px\n" "}\n" ; rsbackup-4.0/src/BulkRemove.cc0000664000175000017500000000224213056231303013257 00000000000000// Copyright © 2011, 2012, 2015, 2016 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 #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); reporting(warning_mask & WARNING_VERBOSE, false); // BulkRemoves only get created when the caller has committed to removing // things, so no point checking command.act here. } rsbackup-4.0/src/parseInteger.cc0000664000175000017500000000255212671570535013657 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-4.0/src/Database.cc0000664000175000017500000001407313056231303012715 00000000000000// Copyright © 2014, 2015, 2016 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 "Utils.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) { sqlite3_close_v2(db); 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) fatal("sqlite3_close: error: %s", sqlite3_errstr(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-4.0/src/DeviceAccess.cc0000664000175000017500000000355613065536714013554 00000000000000// Copyright © 2012, 2015, 2016 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); sp.reporting(warning_mask & WARNING_VERBOSE, false); 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-4.0/src/Color.cc0000664000175000017500000000306213056231303012263 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 "Color.h" #include "Utils.h" #include #include #include Color Color::HSV(double h, double s, double v) { // https://en.wikipedia.org/wiki/HSL_and_HSV#Converting_to_RGB h = fmod(h, 360); double c = v * s; double hp = h / 60; double x = c * (1 - fabs(fmod(hp, 2) - 1)); double r1, g1, b1; if(hp < 1) { r1 = c; g1 = x; b1 = 0; } else if(hp < 2) { r1 = x; g1 = c; b1 = 0; } else if(hp < 3) { r1 = 0; g1 = c; b1 = x; } else if(hp < 4) { r1 = 0; g1 = x; b1 = c; } else if(hp < 5) { r1 = x; g1 = 0; b1 = c; } else { r1 = c; g1 = 0; b1 = x; } double m = v - c; return Color(r1+m, g1+m, b1+m); } std::ostream &operator<<(std::ostream &os, const Color &c) { boost::io::ios_all_saver save_state(os); os << std::hex << std::setw(6) << std::setfill('0') << static_cast(c); return os; } rsbackup-4.0/src/Action.cc0000664000175000017500000000362513065536714012445 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-4.0/src/parseFloat.cc0000664000175000017500000000231713040671504013313 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 double parseFloat(const std::string &s, double min, double max) { errno = 0; const char *sc = s.c_str(); char *e; double n = strtod(sc, &e); if(errno) throw SyntaxError("invalid number '" + s + "': " + strerror(errno)); if(*e || e == sc) throw SyntaxError("invalid number '" + s + "'"); if(n > max || n < min) throw SyntaxError("number '" + s + "' out of range"); return n; } rsbackup-4.0/src/test-command.cc0000664000175000017500000001602112671570535013616 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-4.0/src/IO.cc0000664000175000017500000000652713056231303011525 00000000000000// Copyright © 2011, 2012, 2014, 2016 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; } subprocess->reporting(verbose, false); 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-4.0/src/Color.h0000664000175000017500000001214413056231303012126 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 COLOR_H #define COLOR_H /** @file Color.h * @brief Representation and selection of colors * * The @ref Color class represents colors in RGB form. No attempt is made to * formalize it in terms of color space - you get whatever interpretation Cairo * and/or your HTML or image rendering clients use. It is used by the classes * of @ref Render.h and by the various color-setting configuration directives * (see @ref ColorDirective). * * The @ref ColorStrategy class and its subclasses provide a configurable means * of coloring a range of items different colors. It is used by @ref * Conf::deviceColorStrategy. */ #include #include #include /** @brief An RGB color * * Colors are accepted in three ways: * - as an RGB triple, with 0<=R,G,B<=1 (and this is the internal representation) * - as an HSV triple, with 0<=H<360 and 0<=S,V<=1 * - as a 24-bit packed RGB integer, with 0<=R,G,B<=255 */ struct Color { /** @brief Constructor * @param r Red component * @param g Green component * @param b Blue component * * All components have values in the closed interval [0,1]. * For example, (1,0,0) represents red. */ Color(double r, double g, double b): red(r), green(g), blue(b) { } /** @brief Constructor * @param rgb 24-bit red/green/blue color * * The top 8 bits are red, the middle green and the bottom blue. * For example, 0xFF0000 represents red. */ Color(unsigned rgb = 0): red(component(rgb, 16)), green(component(rgb, 8)), blue(component(rgb, 0)) { } /** @brief Convert to integer form * @return 24-bit red/green/blue color value * * The top 8 bits are red, the middle green and the bottom blue. * For example, 0xFF0000 represents red. */ operator unsigned() const { return pack(red, 16) + pack(green, 8) + pack(blue, 0); } /** @brief Red component * * 0 <= red <= 1 */ double red; /** @brief Green component * * 0 <= green <= 1 */ double green; /** @brief Blue component * * 0 <= blue <= 1 */ double blue; /** @brief Convert from HSV * @param h Hue, 0<=h<360 * @param s Saturation, 0<=s<=1 * @param v Value, 0<=v<=1 * @return Color value * * @p h may actually be any value - it is reduced modulo 360. */ static Color HSV(double h, double s, double v); private: /** @brief Compute a component from integer form * @param n Integer form, 0 <= @p n <= 255 * @param shift Right shift (0, 8 or 16) * @return Component value, 0 <= value <= 1 */ static double component(unsigned n, unsigned shift) { return (double)((n >> shift) & 255) / 255.0; } /** @brief Pack a component into integer form * @param c Component, 0 <= @p c <= 1 * @param shift Left shift (0, 8 or 16) * @return Partial integer form */ static unsigned pack(double c, unsigned shift) { return static_cast(255.0 * c + 0x0.ffffffffp-1) << shift; } }; /** @brief Output a color * @param os Output stream * @param c Color * * Output @p c as a 6-digit hex value. */ std::ostream &operator<<(std::ostream &os, const Color &c); /** @brief A strategy for picking a small set of distinct colors */ class ColorStrategy { public: /** @brief Constructor * @param name Name of this strategy */ ColorStrategy(const char *name); /* @brief Destructor */ virtual ~ColorStrategy() = default; /** @brief Get a color * @param n Item number, 0 <= @p n < @p items * @param items Total number of items * @return Selected color */ virtual Color get(unsigned n, unsigned items) const = 0; /** @brief Get the description of this strategy */ virtual std::string description() const; /** @brief Create a color-picking strategy from configuration * @param name Name of strategy to use * @param params Strategy parameters * @param pos Index of first parameter * * The supported strategies are @c "equidistant-hue" (see @ref * EquidistantHue) and @c "equidistant-value" (see @ref EquidistantValue). * * The parameters correspond to the constructor arguments for the strategy * (generally with a bit of user-facing range-checking). */ static ColorStrategy *create(const std::string &name, std::vector ¶ms, size_t pos = 0); protected: /** @brief Name of this strategy */ const char *name; }; #endif /* COLOR_H */ rsbackup-4.0/src/Errors.h0000664000175000017500000001305612671570535012346 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-4.0/src/Render.h0000664000175000017500000002201613040671504012272 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 RENDER_H #define RENDER_H /** @file Render.h * @brief Graphical rendering */ #include #include #include "Color.h" namespace Render { /** @brief Rendering context */ struct Context { /** @brief Cairo context */ Cairo::RefPtr cairo; }; /** @brief Base class for widgets */ class Widget { public: /** @brief Constructor * @param ctx Rendering context */ Widget(Context &ctx): context(ctx) {} /** @brief Destructor */ virtual ~Widget(); /** @brief Width * * Set by @ref Widget::set_extent */ double width = -1; /** @brief Height * * Set by @ref Widget::set_extent. */ double height = -1; /** @brief Parent widget */ Widget *parent = nullptr; /** @brief Set @ref width and @ref height * * If there are child widgets, the first step should be to recursively * calculate their extents. This may be skipped for children with * non-negative @ref width fields. */ virtual void set_extent() = 0; /** @brief Render this widget */ virtual void render() = 0; /** @brief Clean up some other widget when this one is destroyed */ void cleanup(Widget *w); /** @brief Called when the widget's extent potentially changes * * Invalidates @ref Widget::width and @ref Widget::height, and then * recurses into its parent (if there is one). */ virtual void changed(); protected: /** @brief Context for drawing */ Context &context; /** @brief Set the drawing color * @param color Color to draw in */ inline void set_source_color(const Color &color) { context.cairo->set_source_rgb(color.red, color.green, color.blue); } /** @brief List of widgets to clean up on destruction */ std::vector cleanup_list; friend class Guard; }; /** @brief Container that places widgets at arbitrary locations */ class Container: public Widget { public: /** @brief Constructor * @param ctx Rendering context */ Container(Context &ctx): Widget(ctx) {} /** @brief Add a child widget * @param widget Pointer to child widget * @param x X coordinate of top left of widget * @param y Y coordinate of top left of widget */ void add(Widget *widget, double x, double y); void set_extent() override; void render() override; private: /** @brief Annotated child of a grid */ struct Child { /** @brief Child widget */ Widget *widget; /** @brief X coordinate */ double x; /** @brief Y coordinate */ double y; /** @brief Constructor */ Child(Widget *w, double x, double y): widget(w), x(x), y(y) {} }; /** @brief Child widgets in order of addition */ std::vector children; }; /** @brief Container that arranges widgets in a grid */ class Grid: public Widget { public: /** @brief Constructor * @param ctx Rendering context */ Grid(Context &ctx): Widget(ctx) {} /** @brief Add a child widget * @param widget Pointer to child widget * @param column Column number from 0 * @param row Row number from 0 * @param hj Horizontal justification * @param vj Vertical justification * * Justification values are: * - -1 for left justified * - 0 for centered * - 1 for right justified */ void add(Widget *widget, unsigned column, unsigned row, int hj = -1, int vj = -1); /** @brief Set inter-child padding * @param xp Horizontal padding * @param yp Vertical padding */ void set_padding(double xp, double yp); /** @brief Set minimum child sizes * @param w Minimum width * @param h Minimum height */ void set_minimum(double w, double h); /** @brief Get the maximum width of any column * @return Maximum column width * * @ref Grid::set_extent must have been called. */ double get_maximum_width() const { return *std::max_element(column_widths.begin(), column_widths.end()); } /** @brief Get the maximum height of any row * @return Maximum row height * * @ref Grid::set_extent must have been called. */ double get_maximum_height() const { return *std::max_element(row_heights.begin(), row_heights.end()); } void set_extent() override; void render() override; private: /** @brief Annotated child of a grid */ struct GridChild { /** @brief Child widget */ Widget *widget; /** @brief Column number from 0 */ unsigned column; /** @brief row Row number from 0 */ unsigned row; /** @brief Horizontal justification */ int hj; /** @brief Vertical justification */ int vj; /** @brief Constructor */ GridChild(Widget *w, int c, int r, int h, int v): widget(w), column(c), row(r), hj(h), vj(v) {} }; /** @brief Horizontal padding */ double xpadding = 0; /** @brief Vertical padding */ double ypadding = 0; /** @brief Minimum column width */ double force_width = 0; /** @brief Minimum row height */ double force_height = 0; /** @brief Child widgets in order of addition */ std::vector children; /** @brief Column widths (only after Grid::set_extent) */ std::vector column_widths; /** @brief Column heights (only after Grid::set_extent) */ std::vector row_heights; /** @brief Justify coordinate * @param x Coordinate of container * @param cell_width Size of container * @param child_width Width of contained element * @param justification Justification mode * @return Justified coordinate */ static double justify(double x, double cell_width, double child_width, int justification); }; /** @brief Colored widget */ class Colored: public Widget { public: /** @brief Constructor * @param ctx Rendering context * @param c Color */ Colored(Context &ctx, const Color &c = {0,0,0}): Widget(ctx),color(c) { } /** @brief Set color * @param c Color */ void set_color(const Color &c) { color = c; } /** @brief Set the color in the rendering context */ void render() override; private: /** @brief Color */ Color color; }; /** @brief Text widget */ class Text: public Colored { public: /** @brief Constructor * @param ctx Rendering context * @param t Text to display * @param c Color for text * @param f Pango font description */ Text(Context &ctx, const std::string &t = "", const Color &c = {0,0,0}, const std::string &f = ""); /** @brief Set text * @param t Text to display */ void set_text(const std::string &t); /** @brief Set text * @param f Pango font description */ void set_font(const std::string &f); void set_extent() override; void render() override; private: /** @brief Text to render */ std::string text; /** @brief Font */ Pango::FontDescription font; /** @brief Pango layout for text */ Glib::RefPtr layout; }; /** @brief Filled rectangular widget */ class Rectangle: public Colored { public: /** @brief Constructor * @param ctx Rendering context * @param w Width * @param h Height * @param c Color */ Rectangle(Context &ctx, double w, double h, const Color &c = {0,0,0}): Colored(ctx, c) { width = w; height = h; } /** @brief Set the rectangle size * @param w New width or non-positive to not set * @param h New height or non-positive to not set */ void set_size(double w, double h) { if(w > 0) width = w; if(h > 0) height = h; } void set_extent() override; void render() override; protected: void changed() override; }; /** @brief Guard class for rendering contexts */ class Guard { public: /** @brief Constructor * @param w Any widget with the right rendering context */ Guard(Widget *w): context(w->context) { context.cairo->save(); } /** @brief Destructor */ ~Guard() { context.cairo->restore(); } private: /** @brief Rendering context */ Context &context; }; }; #endif /* RENDER_H */ rsbackup-4.0/src/PruneExec.cc0000664000175000017500000000652713056231303013114 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 "Backup.h" #include "Volume.h" #include "Host.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-4.0/src/Document.h0000664000175000017500000003124313040671504012633 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 An image */ struct Image: public Node { /** @brief Constructor * @param url URL to image */ Image(const std::string &url): url(url) {} /** @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 URL for this image */ std::string url; }; /** @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-4.0/src/Action.h0000664000175000017500000001106613065536714012305 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. * * These objects are (intended to be) used wherever concurrency can be * exploited. Currently, this means @ref pruneBackups and @ref retireVolumes. */ #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-4.0/src/RetireVolumes.cc0000664000175000017500000001612513065536714014034 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 "Device.h" #include "Store.h" #include "Command.h" #include "Utils.h" #include "Errors.h" #include "IO.h" #include "Database.h" #include "BulkRemove.h" #include #include static void removeDirectory(const std::string &path) { if(warning_mask & WARNING_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(warning_mask & WARNING_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(); } } }; // Schedule the 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-4.0/src/Makefile.in0000664000175000017500000017426113067504140012761 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) rsbackup-graph$(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) test-color$(EXEEXT) \ test-base64$(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) test-color$(EXEEXT) \ test-base64$(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) Selection.$(OBJEXT) Color.$(OBJEXT) \ parseFloat.$(OBJEXT) Render.$(OBJEXT) HistoryGraph.$(OBJEXT) \ ColorStrategy.$(OBJEXT) ConfDirective.$(OBJEXT) \ base64.$(OBJEXT) substitute.$(OBJEXT) timestamp.$(OBJEXT) \ debug.$(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_rsbackup_graph_OBJECTS = rsbackup-graph.$(OBJEXT) \ PruneAge.$(OBJEXT) PruneNever.$(OBJEXT) PruneExec.$(OBJEXT) \ PruneDecay.$(OBJEXT) rsbackup_graph_OBJECTS = $(am_rsbackup_graph_OBJECTS) rsbackup_graph_DEPENDENCIES = librsbackup.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_test_base64_OBJECTS = test-base64.$(OBJEXT) test_base64_OBJECTS = $(am_test_base64_OBJECTS) test_base64_DEPENDENCIES = librsbackup.a 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_color_OBJECTS = test-color.$(OBJEXT) test_color_OBJECTS = $(am_test_color_OBJECTS) test_color_DEPENDENCIES = librsbackup.a 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) \ timestamp.$(OBJEXT) debug.$(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_DEPENDENCIES = librsbackup.a 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) \ $(rsbackup_graph_SOURCES) $(test_base64_SOURCES) \ $(test_check_SOURCES) $(test_color_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) \ $(rsbackup_graph_SOURCES) $(test_base64_SOURCES) \ $(test_check_SOURCES) $(test_color_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@ CAIROMM_CFLAGS = @CAIROMM_CFLAGS@ CAIROMM_LIBS = @CAIROMM_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@ PANGOMM_CFLAGS = @PANGOMM_CFLAGS@ PANGOMM_LIBS = @PANGOMM_LIBS@ 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-2016 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_CXXFLAGS = $(SQLITE3_CFLAGS) $(CAIROMM_CFLAGS) $(PANGOMM_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 Selection.h Selection.cc Color.h \ Color.cc parseFloat.cc Render.h Render.cc HistoryGraph.h \ HistoryGraph.cc ColorStrategy.cc ConfDirective.h ConfDirective.cc \ base64.cc substitute.cc timestamp.cc debug.cc ConfBase.h Volume.h \ Host.h Backup.h Device.h rsbackup_SOURCES = rsbackup.cc PruneAge.cc PruneNever.cc PruneExec.cc \ PruneDecay.cc rsbackup_LDADD = librsbackup.a $(SQLITE3_LIBS) $(BOOST_LIBS) rsbackup_graph_SOURCES = rsbackup-graph.cc PruneAge.cc PruneNever.cc \ PruneExec.cc PruneDecay.cc rsbackup_graph_LDADD = librsbackup.a $(SQLITE3_LIBS) $(BOOST_LIBS) $(CAIROMM_LIBS) $(PANGOMM_LIBS) test_date_SOURCES = test-date.cc test_date_LDADD = librsbackup.a test_color_SOURCES = test-color.cc test_color_LDADD = librsbackup.a test_subprocess_SOURCES = test-subprocess.cc Subprocess.cc Errors.cc IO.cc \ EventLoop.cc nonblock.cc Action.cc timestamp.cc debug.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_timespec_LDADD = librsbackup.a 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 test_base64_SOURCES = test-base64.cc test_base64_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) rsbackup-graph$(EXEEXT): $(rsbackup_graph_OBJECTS) $(rsbackup_graph_DEPENDENCIES) $(EXTRA_rsbackup_graph_DEPENDENCIES) @rm -f rsbackup-graph$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(rsbackup_graph_OBJECTS) $(rsbackup_graph_LDADD) $(LIBS) test-base64$(EXEEXT): $(test_base64_OBJECTS) $(test_base64_DEPENDENCIES) $(EXTRA_test_base64_DEPENDENCIES) @rm -f test-base64$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_base64_OBJECTS) $(test_base64_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-color$(EXEEXT): $(test_color_OBJECTS) $(test_color_DEPENDENCIES) $(EXTRA_test_color_DEPENDENCIES) @rm -f test-color$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_color_OBJECTS) $(test_color_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)/Color.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ColorStrategy.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)/ConfDirective.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)/HistoryGraph.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)/Render.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)/Selection.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)/base64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.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)/parseFloat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parseInteger.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsbackup-graph.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)/substitute.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-base64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-check.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-color.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)/timestamp.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) test-color.log: test-color$(EXEEXT) @p='test-color$(EXEEXT)'; \ b='test-color'; \ $(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-base64.log: test-base64$(EXEEXT) @p='test-base64$(EXEEXT)'; \ b='test-base64'; \ $(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-4.0/src/Report.cc0000664000175000017500000003504113056231303012462 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 "Device.h" #include "Backup.h" #include "Volume.h" #include "Host.h" #include "Command.h" #include "IO.h" #include "Database.h" #include "Report.h" #include "Utils.h" #include "Subprocess.h" #include "Errors.h" #include #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); } void Report::compute() { backups_missing = 0; backups_partial = 0; backups_out_of_date = 0; backups_failed = 0; devices_unknown = config.unknownDevices.size(); hosts_unknown = config.unknownHosts.size(); volumes_unknown = 0; for(auto &h: config.hosts) { const Host *host = h.second; volumes_unknown += host->unknownVolumes.size(); for(auto &v: host->volumes) { const Volume *volume = v.second; bool out_of_date = true; size_t devices_used = 0; for(auto &d: config.devices) { const Device *device = d.second; auto perDevice = volume->findDevice(device->name); if(perDevice && perDevice->count) { // At least one successful backup exists... int newestAge = Date::today() - perDevice->newest; if(newestAge <= volume->maxAge) out_of_date = false; // ...and it's recent enough ++devices_used; } // 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; // most recent backup failed } if(devices_used < config.devices.size()) { // some device lacks a backup if(devices_used == 0) ++backups_missing; // no device has a backup else ++backups_partial; // only some devices have a backup } else if(out_of_date) ++backups_out_of_date; // no device has a recent enough backup } } } // Generate the list of warnings void Report::warnings() { char buffer[1024]; Document::List *l = new Document::List(); for(auto &d: config.unknownDevices) l->entry("Unknown device " + d); for(auto &h: config.unknownHosts) l->entry("Unknown host " + h); 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); } 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); } d.append(l); } int Report::warningCount() const { int warnings = config.unknownDevices.size() + config.unknownHosts.size(); for(auto &h: config.hosts) warnings += h.second->unknownVolumes.size(); if(backups_missing) ++warnings; if(backups_partial) ++warnings; if(backups_out_of_date) ++warnings; if(backups_failed) ++warnings; return warnings; } // Generate the summary table void Report::summary() { 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) { const Host *host = h.second; t->addCell(new Document::Cell(host->name, 1, host->volumes.size())) ->style = "host"; for(auto &v: host->volumes) { const Volume *volume = v.second; // See if every device has a backup bool missingDevice = false; for(const auto &d: config.devices) { const 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"; for(const auto &d: config.devices) { const Device *device = d.second; auto perDevice = volume->findDevice(device->name); int perDeviceCount = perDevice ? perDevice->count : 0; if(perDeviceCount) { // 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); } else { c->style = "bad"; } } else { // No succesful backups! t->addCell(new Document::Cell("none")) ->style = "bad"; } t->addCell(new Document::Cell(new Document::String(perDeviceCount))) ->style = perDeviceCount ? "good" : "bad"; } t->newRow(); } } d.append(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::logs(const Volume *volume) { Document::LinearContainer *lc = nullptr; const 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::logs() { // Sort by host/volume first, then date, device *last* for(auto &h: config.hosts) { const Host *host = h.second; for(auto &v: host->volumes) { const Volume *volume = v.second; logs(volume); } } } // Generate the report of pruning logfiles void Report::pruneLogs(const std::string &days) { int ndays = DEFAULT_PRUNE_REPORT_AGE; if(days.size()) ndays = parseInteger(days, 0, INT_MAX); if(config.reportPruneLogs) ndays = config.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 * ndays; 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(); } d.append(t); } void Report::historyGraph() { std::string history_png; std::string rg = Subprocess::pathSearch("rsbackup-graph"); if(rg.size() == 0) return; std::vector cmd = { "rsbackup-graph", "-c", configPath, "-D", database, "-o-", }; if(debug) cmd.push_back("-d"); Subprocess sp(cmd); sp.capture(1, &history_png); sp.runAndWait(); if(history_png.size()) { std::stringstream ss; ss << "data:image/png;base64,"; write_base64(ss, history_png); Document::Image *image = new Document::Image(ss.str()); image->style = "history"; d.append(image); } } void Report::section(const std::string &n) { std::string name = n, value, condition; size_t colon = name.find("?"); if(colon != std::string::npos) { condition.assign(name, colon + 1, std::string::npos); name.erase(colon); if(condition == "warnings") { if(!warningCount()) return; } else throw SyntaxError("unrecognized report condition '" + condition + "'"); // Update Conf.cc and rsbackup.5 if any new conditionss } colon = name.find(":"); if(colon != std::string::npos) { value = substitute(name, colon + 1, std::string::npos); name.erase(colon); } if(name == "warnings") warnings(); else if(name == "summary") summary(); else if(name == "logs") logs(); else if(name == "prune-logs") pruneLogs(value); else if(name == "history-graph") historyGraph(); else if(name == "h1") d.heading(value, 1); else if(name == "h2") d.heading(value, 2); else if(name == "h3") d.heading(value, 3); else if(name == "p") d.para(value); else if(name == "title") d.title = value; else throw SyntaxError("unrecognized report name '" + name + "'"); // Update Conf.cc and rsbackup.5 if any new names added } // Generate the full report void Report::generate() { if(::setenv("RSBACKUP_DATE", Date::today().toString().c_str(), 1/*overwrite*/)) throw SystemError("setenv", errno); if(getenv("RSBACKUP_TODAY")) { if(::setenv("RSBACKUP_CTIME", "", 1/*overwrite*/)) throw SystemError("setenv", errno); } else { time_t now; time(&now); if(::setenv("RSBACKUP_CTIME", ctime(&now), 1/*overwrite*/)) throw SystemError("setenv", errno); } compute(); for(const auto &s: config.report) section(s); } rsbackup-4.0/src/Errors.cc0000664000175000017500000000356412671570535012507 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-4.0/src/ConfBase.cc0000664000175000017500000001135313056231303012667 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 "ConfBase.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); d(os, "# For parameters, see documentation for individual pruning policies", 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) { } void ConfBase::writeVector(std::ostream &os, int step, const std::string &directive, const std::vector &value) const { if(value.size()) { os << indent(step) << directive; int y = step + directive.size(); for(const auto &s: value) { if(y + s.size() >= 80) { os << '\n' << indent(step) << directive << " +"; y = step + directive.size() + 2; } const std::string q = quote(s); os << ' ' << q; y += q.size() + 1; } if(y) os << '\n'; } else os << indent(step) << directive << "\n"; } rsbackup-4.0/src/Backup.cc0000664000175000017500000000667713056231303012431 00000000000000// Copyright © 2011, 2014-2016 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 "Device.h" #include "Backup.h" #include "Volume.h" #include "Host.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(); } } Device *Backup::getDevice() const { return volume->parent->parent->findDevice(deviceName); } const char *const backup_status_names[] = { "unknown", "underway", "complete", "failed", "pruning", "pruned" }; rsbackup-4.0/src/debug.cc0000664000175000017500000000177313056231303012302 00000000000000// Copyright © 2016 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 bool debug; int write_debug(const char *path, long line, const char *msg, ...) { if(debug) { va_list ap; va_start(ap, msg); fprintf(stderr, "%s:%ld: ", path, line); vfprintf(stderr, msg, ap); fputc('\n', stderr); va_end(ap); } return 0; } rsbackup-4.0/src/substitute.cc0000664000175000017500000000313113040671504013421 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 std::string substitute(const std::string &s, std::string::size_type pos, std::string::size_type n) { std::string r; pos = std::min(s.size(), pos); n = std::min(n, s.size() - pos); std::string::size_type l = pos + n; while(pos < l) { char c = s.at(pos++); switch(c) { default: r += c; break; case '\\': if(pos >= l) r += c; else r += s.at(pos++); break; case '$': if(pos < l && s.at(pos) == '{') { std::string::size_type e = s.find('}', pos); if(e < l) { std::string name(s, pos + 1, e - (pos + 1)); const char *value = getenv(name.c_str()); if(value) { r += value; pos = e + 1; break; } } } r += c; break; } } return r; } rsbackup-4.0/src/EventLoop.cc0000664000175000017500000001250513065536714013140 00000000000000// Copyright © 2015, 2016 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) fatal("sigprocmask: error: %s", strerror(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; getMonotonicTime(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); } } } rsbackup-4.0/src/test-globfiles.cc0000664000175000017500000000400313056231303014124 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 free(dir); return 0; } rsbackup-4.0/src/nonblock.cc0000664000175000017500000000175612671570535013041 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-4.0/src/Device.cc0000664000175000017500000000163513056231303012410 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 "Device.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-4.0/src/Document.cc0000664000175000017500000000420012671570535012775 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-4.0/src/test-volume.cc0000664000175000017500000000221613056231303013471 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 "Backup.h" #include "Volume.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")); return 0; } rsbackup-4.0/src/Email.cc0000664000175000017500000000353513056231303012241 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 "Utils.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, !!(warning_mask & WARNING_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-4.0/src/test-device.cc0000664000175000017500000000212013056231303013413 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 "Device.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-4.0/src/FileLock.h0000664000175000017500000000352012671570535012555 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-4.0/src/PruneAge.cc0000664000175000017500000000413613056231303012716 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 "Backup.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-4.0/src/globFiles.cc0000664000175000017500000000350212671570535013131 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-4.0/src/test-timespec.cc0000664000175000017500000000257412671570535014021 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-4.0/src/test-prunedecay.cc0000664000175000017500000000253512671570535014344 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-4.0/src/error.cc0000664000175000017500000000272513056231303012343 00000000000000// Copyright © 2014, 2016 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 "Defaults.h" #include "IO.h" #include int errors; unsigned warning_mask = DEFAULT_WARNING_MASK; 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 fatal(const char *fmt, ...) { va_list ap; va_start(ap, fmt); error_generic("ERROR", fmt, ap); va_end(ap); exit(1); } void error(const char *fmt, ...) { va_list ap; va_start(ap, fmt); error_generic("ERROR", fmt, ap); va_end(ap); ++errors; } void warning(unsigned warning_type, const char *fmt, ...) { if(!warning_type || (warning_type & warning_mask)) { va_list ap; va_start(ap, fmt); error_generic("WARNING", fmt, ap); va_end(ap); } } rsbackup-4.0/src/Host.cc0000664000175000017500000001002213065536714012132 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 "Backup.h" #include "Volume.h" #include "Host.h" #include "Subprocess.h" #include #include #include Host::~Host() { for(auto &v: volumes) delete v.second; } 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-4.0/src/Conf.h0000664000175000017500000002516313056231303011742 00000000000000// -*-C++-*- // Copyright © 2011, 2012, 2014-2016 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 and state * * Configuration and state, which are not well-separated, are organized into a * tree structure. * * Nodes that take part in configuration inheritance derive from @ref ConfBase. * This class captures inheritable configuration and, in its constructor, * implements that inheritance from parent nodes. * * The root node has type @ref Conf. As well as the inheritable configuration * this contains the global configuration. * * The children of the @ref Conf node are of type @ref Host (a host that may be * backed up), @ref Device (a physical backup device) and @ref Store (a mount * point at which a backup device may be found). @ref Host participates in * configuration inheritance; the others do not. * * The children of the @ref Host nodes are all of type @ref Volume (a volume * within a host), which participates in configuration inheritance. Finally * the children of the @ref Volume nodes are of type @ref Backup (a single * backup of some value on some device at a particular time). */ #include #include #include #include #include "Defaults.h" #include "Color.h" #include "ConfBase.h" class Store; class Device; class Host; class Volume; class Database; class Backup; /** @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 Root node of the entire configuration and state of rsbackup. */ class Conf: public ConfBase { public: /** @brief Constructor */ Conf(); /** @brief Destructor */ virtual ~Conf(); /** @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 = 0; /** @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 'good' color code */ Color colorGood = COLOR_GOOD; /** @brief 'bad' color code */ Color colorBad = COLOR_BAD; /** @brief Foregroud color of graph */ Color colorGraphForeground = { 0, 0, 0 }; /** @brief Background color of graph */ Color colorGraphBackground = { 1, 1, 1 }; /** @brief Color of vertical bars repsenting months in graph */ Color colorMonthGuide = { 0.96875, 0.96875, 0.96875 }; /** @brief Color of horizontal lines between hosts in graph */ Color colorHostGuide = { 0.875, 0.875, 0.875 }; /** @brief Color of horizontal lines between volumes in graph */ Color colorVolumeGuide = { 0.9375, 0.9375, 0.9375 }; /** @brief Horizontal padding in graph */ double horizontalPadding = 8; /** @brief Vertical padding in graph */ double verticalPadding = 2; /** @brief Backup indicator width for one day */ double backupIndicatorWidth = 4; /** @brief Minimum backup indicator height */ double backupIndicatorHeight = 2; /** @brief Target graph width */ double graphTargetWidth = 0; /** @brief Backup indicator width in the device key */ double backupIndicatorKeyWidth = 16; /** @brief Strategy for picking device colors */ const ColorStrategy *deviceColorStrategy = nullptr; /** @brief Pango font description for host names */ std::string hostNameFont = "Normal"; /** @brief Pango font description for volume names */ std::string volumeNameFont = "Normal"; /** @brief Pango font description for device names */ std::string deviceNameFont = "Normal"; /** @brief Pango font description for time labels */ std::string timeLabelFont = "Normal"; /** @brief List of report sections */ std::vector report = { "title:Backup report (${RSBACKUP_DATE})", "h1:Backup report (${RSBACKUP_DATE})", "h2:Warnings?warnings", "warnings", "h2:Summary", "summary", "history-graph", "h2:Logfiles", "logs", "h3:Pruning logs", "prune-logs", "p:Generated ${RSBACKUP_CTIME}" }; /** @brief Layout of graph */ std::vector graphLayout = { "host-labels:0,0", "volume-labels:1,0", "content:2,0", "time-labels:2,1", "device-key:2,3:RC", }; /** @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 Global configuration */ extern Conf config; #endif /* CONF_H */ rsbackup-4.0/src/split.cc0000664000175000017500000000404613060550036012345 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-4.0/src/toLines.cc0000664000175000017500000000223012671570535012635 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-4.0/src/Text.cc0000664000175000017500000001531613040671504012142 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::Image::renderText(std::ostream &) const { } void Document::RootContainer::renderText(std::ostream &os) const { renderTextContents(os); } void Document::renderText(std::ostream &os) const { content.renderText(os); } rsbackup-4.0/configure0000775000175000017500000064145613067504137012047 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for rsbackup 4.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='4.0' PACKAGE_STRING='rsbackup 4.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 PANGOMM_LIBS PANGOMM_CFLAGS CAIROMM_LIBS CAIROMM_CFLAGS 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 4.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 4.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 4.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 4.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='4.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 "$as_me:${as_lineno-$LINENO}: checking for Cairomm CFLAGS" >&5 $as_echo_n "checking for Cairomm CFLAGS... " >&6; } if ${rjk_cv_cairomm_cflags+:} false; then : $as_echo_n "(cached) " >&6 else rjk_cv_cairomm_cflags=`pkg-config --silence-errors --cflags cairomm-1.0` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $rjk_cv_cairomm_cflags" >&5 $as_echo "$rjk_cv_cairomm_cflags" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Cairomm LIBS" >&5 $as_echo_n "checking for Cairomm LIBS... " >&6; } if ${rjk_cv_cairomm_libs+:} false; then : $as_echo_n "(cached) " >&6 else rjk_cv_cairomm_libs=`pkg-config --silence-errors --libs cairomm-1.0` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $rjk_cv_cairomm_libs" >&5 $as_echo "$rjk_cv_cairomm_libs" >&6; } CAIROMM_CFLAGS=$rjk_cv_cairomm_cflags CAIROMM_LIBS=$rjk_cv_cairomm_libs { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Pangomm CFLAGS" >&5 $as_echo_n "checking for Pangomm CFLAGS... " >&6; } if ${rjk_cv_pangomm_cflags+:} false; then : $as_echo_n "(cached) " >&6 else rjk_cv_pangomm_cflags=`pkg-config --silence-errors --cflags pangomm-1.4` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $rjk_cv_pangomm_cflags" >&5 $as_echo "$rjk_cv_pangomm_cflags" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Pangomm LIBS" >&5 $as_echo_n "checking for Pangomm LIBS... " >&6; } if ${rjk_cv_pangomm_libs+:} false; then : $as_echo_n "(cached) " >&6 else rjk_cv_pangomm_libs=`pkg-config --silence-errors --libs pangomm-1.4` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $rjk_cv_pangomm_libs" >&5 $as_echo "$rjk_cv_pangomm_libs" >&6; } PANGOMM_CFLAGS=$rjk_cv_pangomm_cflags PANGOMM_LIBS=$rjk_cv_pangomm_libs $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="-std=gnu++11 -Wall -W -Werror -Wpointer-arith -Wwrite-strings $CXXFLAGS" 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 4.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 4.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-4.0/Makefile.am0000664000175000017500000000214113056231303012140 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 . SUBDIRS=src tests doc tools EXTRA_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 dist_noinst_SCRIPTS=scripts/txt2src scripts/htmlman scripts/dist echo-distdir: @echo $(distdir) echo-version: @echo $(VERSION) clean-local: rm -f */*.gcno rm -f */*.gcda rm -f */*.gcov rsbackup-4.0/COPYING0000664000175000017500000010451312671570535011164 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-4.0/configure.ac0000775000175000017500000001021513067504124012404 00000000000000# Copyright © 2011-17 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], [4.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_CACHE_CHECK([for Cairomm CFLAGS],[rjk_cv_cairomm_cflags],[ rjk_cv_cairomm_cflags=`pkg-config --silence-errors --cflags cairomm-1.0` ]) AC_CACHE_CHECK([for Cairomm LIBS],[rjk_cv_cairomm_libs],[ rjk_cv_cairomm_libs=`pkg-config --silence-errors --libs cairomm-1.0` ]) AC_SUBST([CAIROMM_CFLAGS],[$rjk_cv_cairomm_cflags]) AC_SUBST([CAIROMM_LIBS],[$rjk_cv_cairomm_libs]) AC_CACHE_CHECK([for Pangomm CFLAGS],[rjk_cv_pangomm_cflags],[ rjk_cv_pangomm_cflags=`pkg-config --silence-errors --cflags pangomm-1.4` ]) AC_CACHE_CHECK([for Pangomm LIBS],[rjk_cv_pangomm_libs],[ rjk_cv_pangomm_libs=`pkg-config --silence-errors --libs pangomm-1.4` ]) AC_SUBST([PANGOMM_CFLAGS],[$rjk_cv_pangomm_cflags]) AC_SUBST([PANGOMM_LIBS],[$rjk_cv_pangomm_libs]) 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="-std=gnu++11 -Wall -W -Werror -Wpointer-arith -Wwrite-strings $CXXFLAGS" 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-4.0/README.md0000664000175000017500000000306413067504124011376 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-2017 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-4.0/acinclude.m40000664000175000017500000000207312671570535012320 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-4.0/doc/0000775000175000017500000000000013067504144010743 500000000000000rsbackup-4.0/doc/decay.lyx0000664000175000017500000001747712671570535012535 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-4.0/doc/rsbackup.10000664000175000017500000003532113040671504012557 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 \fBrsbackup\fR 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. .PP See \fBrsbackup\fR(5) for details of the configuration file. .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 \fBrsbackup\fR(5) for details how how pruning is controlled. .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 "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. See \fBrsbackup\fR(5) .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\-graph\fR(1), \fBrsbackup.cron\fR(1), \fBrsbackup\-mount\fR(1), \fBrsbackup\-snapshot\-hook\fR(1), \fBrsync\fR(1), \fBrsbackup\fR(5) .SH AUTHOR Richard Kettlewell rsbackup-4.0/doc/decay.pdf0000664000175000017500000032173512671572007012461 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:20160314172527Z) /ModDate (D:20160314172527Z) /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 [<0C88DFCB8C898CC9AFEEBDA1EFC2C815> <0C88DFCB8C898CC9AFEEBDA1EFC2C815>] /Length 696 /Filter /FlateDecode >> stream x%{LQs-^oR !&+&J$%\ %Դb̆%3fcc6|>{ss{Ba)Bh#_I܈8bA4$Đ(2&$JFm:)^gd2L;`V;=` X=?}!8NgĘ &dP~.8p37g7"m~ SbF̥D <bB@X) ҄|Q~ l] N&L 敀Ll @RH)Z , =O }GAX Vj.hIXdkW`kg/7eA Wa-#RB- 6[F:GDjD3KFvv-e=`Qm>v*TGQ#$r,J~SW2KCHGBXJ ?}#$@b,P#* OQQjFRf4(Lʲ8)\dN ! endstream endobj startxref 106533 %%EOF rsbackup-4.0/doc/Makefile.am0000664000175000017500000000314613040671504012717 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 . man_MANS=rsbackup.1 rsbackup.cron.1 rsbackup-mount.1 rsbackup-snapshot-hook.1 \ rsbackup.5 rsbackup-graph.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 rsbackup.5.html rsbackup-graph.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 $@ %.html: % $(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-4.0/doc/rsbackup-manual.in.html0000664000175000017500000007311013040671504015241 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 pages for the command and the configuration file 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_
./configure
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-4.0/doc/rsbackup.css0000664000175000017500000000323713056231303013204 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 } img.history { border: 1px solid black; padding: 2px } rsbackup-4.0/doc/disk-encryption.html0000664000175000017500000001720712671570535014711 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-4.0/doc/testing.md0000664000175000017500000000330512671570535012672 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-4.0/doc/rsbackup-snapshot-hook.10000664000175000017500000000414212671570535015362 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-4.0/doc/rsbackup-docs.html0000664000175000017500000000417012671570535014322 00000000000000 rsbackup

rsbackup

Getting Started

Reference Information

Miscellaneous

  • Change history
  • rsbackup home page
  • rsbackup on Github
    • rsbackup-4.0/doc/rsbackup-debian.html0000664000175000017500000001113712671570535014615 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-4.0/doc/Makefile.in0000664000175000017500000004321413067504140012730 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)" "$(DESTDIR)$(man5dir)" man5dir = $(mandir)/man5 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@ CAIROMM_CFLAGS = @CAIROMM_CFLAGS@ CAIROMM_LIBS = @CAIROMM_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@ PANGOMM_CFLAGS = @PANGOMM_CFLAGS@ PANGOMM_LIBS = @PANGOMM_LIBS@ 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 \ rsbackup.5 rsbackup-graph.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 rsbackup.5.html rsbackup-graph.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) install-man5: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man5dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man5dir)" || 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 '/\.5[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,^[^5][0-9a-z]*$$,5,;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)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$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)$(man5dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ done; } uninstall-man5: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.5[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man5dir)'; $(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)" "$(DESTDIR)$(man5dir)"; 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-man5 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 uninstall-man5 .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-man5 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 uninstall-man5 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 $@ %.html: % $(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-4.0/doc/rsbackup-graph.10000664000175000017500000000437013040671504013656 00000000000000.TH rsbackup-graph 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-graph \- graphical representation of rsbackup state .SH SYNOPSIS \fBrsbackup\-graph\fR [\fIOPTIONS\fR] [\fB\-\-\fR] [\fISELECTOR\fR...] .SH DESCRIPTION \fBrsbackup\-graph\fR generates a graphical representation of the current set of backups known to \fBrsbackup\fR. .PP For configuration options which affect this program, see the section \fBGraph Directives\fR in \fBrsbackup\fR(5). .SH OPTIONS .TP .B \-\-config \fIPATH\fR, \fB\-c \fIPATH The path to the configuration file. The default is .IR /etc/rsbackup/config . .TP .B \-\-database\fR, \fB\-D \fIPATH Override the path to the backup database. .TP .B \-\-output\fR, \fB\-o \fIPATH Set the output path. To write to standard output, use \fB\-o -\fR. The default is \fIrsbackup.png\fR. .TP .B \-\-help\fR, \fB\-h Display a usage message. .TP .B \-\-version\fR, \fB\-V Display the version number. .SS "Volume Selection" The list of selectors on the command line determines what subset of the known volumes are displayed. 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 display. .SH "SEE ALSO" \fBrsbackup\fR(1), \fBrsbackup.cron\fR(1), \fBrsbackup\-mount\fR(1), \fBrsbackup\-snapshot\-hook\fR(1), \fBrsync\fR(1), \fBrsbackup\fR(5) .SH AUTHOR Richard Kettlewell rsbackup-4.0/doc/rsbackup.cron.10000664000175000017500000000563512671570535013537 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-4.0/doc/rsbackup-mount.10000664000175000017500000000465512671570535013740 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-4.0/doc/rsbackup.50000664000175000017500000006103013040671504012557 00000000000000.TH rsbackup 5 .\" 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 /etc/rsbackup/config \- configuration for rsync-based backup utility .SH DESCRIPTION This describes the configuration file syntax for for \fBrsbackup\fR(1). .SH "CONFIGURATION FILE" The configuration 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. .SH "GLOBAL DIRECTIVES" Global directives control some general aspect of the program. .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 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. .SS "Report Directives" These are global directives that affect only the HTML report. .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. .IP This directive is deprecated. Use \fBcolor\-bad\fR and \fBcolor\-good\fR instead. .TP .B color\-bad \fICOLOR The color used to represent bad states (no sufficiently recent backup) in the report. See below for the interpretation of \fICOLOR\fR. .TP .B color\-good \fICOLOR The color used to represent good states (a recent backup) in the report. .TP .B report \fR[\fB+\fR] \fR[\fIKEY\fR][\fB:\fIVALUE\fR][\fB?\fICONDITION\fR] ... Defines the report contents. The arguments to this directive are a sequence of keys, optionally parameterized by a value and/or a condition. .IP If the first argument is a \fB+\fR then the arguments are added to the current configuration; otherwise they replace it. .IP The possible keys, with values where appropriate, are: .RS .TP .B generated A timestamp stating when the report was generated. .TP .B history\-graph A graphic showing the backups available for each volume. This only works if \fBrsbackup\-graph\fR(1) is installed. .TP .B h1:\fIHEADING .TP .B h2:\fIHEADING .TP .B h3:\fIHEADING Headings at levels 1, 2 and 3. .TP .B logs A list of logs of failed backups. .TP .B p:\fIPARAGRAPH A paragraph of text. .TP .B prune\-logs\fR[\fB:\fIDAYS\fR] A list of logs of pruned backups. .IP \fIDAYS\fR is the number of days of pruning logs to put in the report. The default is 3. .TP .B summary A table summarizing the backups available for each volume. .TP .B title:\fITITLE The document title. .TP .B warnings A list of warning messages. .PP If a condition is specified then the key is only used if the condition is true. The possible conditions are: .TP .B warnings True if there are any warnings to display (i.e. if the \fBwarnings\fR key is nonempty). .PP Within a \fIVALUE\fR the following sequences undergo substitution: .TP .B \e\fICHAR Replaced with the single character \fICHAR\fR. .TP .B ${\fIVARIABLE\fB} Replaced with the value of the environment variable \fIVARIABLE\fR, if it is set. .PP The following environment variables are set: .TP .B RSBACKUP_CTIME The local date and time in \fBctime\fR(3) format. .TP .B RSBACKUP_DATE The local date in YYYY\-MM\-DD format. .PP The default is equivalent to: .PP .RS .nf report "title:Backup report (${RSBACKUP_DATE})" report "h1:Backup report (${RSBACKUP_DATE})" report + h2:Warnings?warnings warnings report + "h2:Summary" summary report + history\-graph report + h2:Logfiles logs report + "h3:Pruning logs" prune\-logs report + "p:Generated ${RSBACKUP_CTIME}" .fi .RE .RE .TP .B report\-prune\-logs \fIDAYS\fR Overrides the number of days of pruning logs to put in the report. .IP This directive is deprecated. Use \fBreport\fR instead. .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 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 "Graph Directives" These are global directives that affect the output of \fBrsbackup\-graph\fR(1). .TP .B color\-graph\-background \fICOLOR The background color. See below for the interpretation of \fICOLOR\fR. .TP .B color\-graph\-foreground \fICOLOR The foreground color, i.e. for text. .TP .B color\-month\-guide \fICOLOR The color for the vertical month guides. .TP .B color\-host\-guide \fICOLOR The color for the horizontal guides between hosts. .TP .B color\-volume\-guide \fICOLOR The color for the horizontal guides between volumes. .TP .B device\-color\-strategy \fISTRATEGY The strategy to use for picking device colors. .IP A strategy is a name and a sequence of parameters, all of which are optional. .IP The possible strategies are: .RS .TP .B equidistant\-value \fIHUE SATURATION MINVALUE MAXVALUE Colors are picked with chosen hue and saturation, with values equally spaced within a range. .IP The default hue is 0 and the default saturation is 1. The default value range is from 0 to 1. .TP .B equidistant\-hue \fIHUE SATURATION VALUE Colors are picked with chosen saturation and value and equally spaced hues, starting from \fIHUE\fR. .IP The default starting hue is 0 and the default saturation and value are 1. .PP The default strategy is equivalent to: .RS .nf device\-color\-strategy equidistant\-value 120 0.75 .fi .RE .RE .TP .B horizontal\-padding \fIPIXELS The number pixels to place between horizontally adjacent elements. The default is 8. .TP .B vertical\-padding \fIPIXELS The number pixels to place between vertically adjacent elements. The default is 2. .TP .B host\-name\-font \fIFONT The font description used for host names. See below for the interpretation of \fIFONT\fR. .TP .B volume\-name\-font \fIFONT The font description used for volume names. .TP .B device\-name\-font \fIFONT The font description used for device names. .TP .B time\-label\-font \fIFONT The font description used for time labels. .TP .B graph\-layout \fR[\fB+\fR] \fR\fIPART\fR\fB:\fICOLUMN\fB,\fIROW\fR[\fB:\fIHV\fR] ... .RS Defines the graph layout. .PP The arguments to this directive are a sequence of graph component specifications of the form \fIPART\fR\fB:\fICOLUMN\fB,\fIROW\fR[\fB:\fIHV\fR], where: .TP .I PART The name of this component. The following parts are recognized: .RS .TP .B host\-labels The host name labels for the graph. This is expected to be in the same row as \fBcontent\fR. .TP .B volume\-labels The volume name labels for the graph. This is expected to be in the same row as \fBcontent\fR. .TP .B content The graph content. .TP .B time\-labels The time labels for the graph. This is expected to be in the same column as \fBcontent\fR. .TP .B device\-key The key mapping device names to colors. .RE .TP .I COLUMN The column number for this component. 0 is the leftmost column. .TP .I ROW The row number for this component. 0 is the top row. .TP .I HV The (optional) justification specification for this component. .I H may be one of the following: .RS .TP .B L Left justification. .TP .B C Centre justification. .TP .B R Right justification. .PP .I V may be one of the following: .TP .B T Top justification. .TP .B C Centre justification. .TP .B B Bottom justification. .RE .PP Parts may be repeated or omitted. .PP The default layout is equivalent to: .PP .RS .nf graph\-layout host\-labels:0,0 graph\-layout + volume\-labels:1,0 graph\-layout + content:2,0 graph\-layout + time\-labels:2,1 graph\-layout + device\-key:2,3:RC .fi .RE .RE .SS Colors \fICOLOR\fR may be one of the following: .TP .I DECIMAL\fR or \fB0x\fIRRGGBB An integer value representing an RGB triple. It is most convenient to use hexadecimal. For example, black is \fB0x000000\fR, red is \fB0xFF0000\fR, and so on. .TP .B rgb \fIRED GREEN BLUE Three numbers in the range 0 to 1 representing red, green and blue components. .TP .B hsv \fIHUE SATURATION VALUE \fIHUE\fR chooses between different primary colors and mixtures of them. 0 represents red, 120 represents green and 240 represents blue; intermediate values represent mixed hues. .IP Normally it would be in the range 0 <= \fIHUE\fR < 360, but values outside this range are mapped into it. .IP \fISATURATION\fR is a number in the range 0 to 1 and (roughly) represents how colorful the color is. 0 is a shade of grey and 1 is maximally colorful. .IP \fIVALUE\fR is a number in the range 0 to 1 and represents the brightness of the color. .IP See https://en.wikipedia.org/wiki/HSL_and_HSV for a fuller discussion of these terms. .SS Fonts \fIFONT\fR is a Pango font description. The syntax is "[\fIFAMILY-LIST\fR] [\fISTYLE-OPTIONS\fR] [\fISIZE\fR]" where: .TP .I FAMILY-LIST A comma-separate list of font families. These necessarily depend on the fonts installed locally but Pango recognizes \fBmonospace\fR, \fBsans\fR and and \fBserif\fR as generic family names. .IP If you have \fBtexttopng\fR(1) then \fBtexttopng \-l\fR will generate a list of fonts recognized by your Pango install. See http://www.greenend.org.uk/rjk/sw/texttools/ for download. .TP .I STYLE-OPTIONS A whitespace-separated list of style, variant, weight, stretch and gravity options. .IP The possible style options are \fBroman\fR (the default), \fBoblique\fR and \fBitalic\fB. .IP The possible variant options are \fBsmall\-caps\fR. .IP The possible weight options are \fBthin\fB, \fBultra\-light\fR, \fBlight\fR, \fBsemi\-light\fB, \fBbook\fR, \fBregular\fR (the default), \fBmedium\fR, \fBsemi\-bold\fR, \fBbold\fR, \fBultra\-bold\fR, \fBheavy\fR and \fBultra\-heavy\fR. .IP The possible stretch options are \fBultra\-condensed\fR, \fBcondensed\fR, \fBsemi\-condensed\fR, \fBsemi\-expanded\fR, \fBexpanded\fR and \fBultra\-expanded\fR. .IP The possible gravity options are \fBsouth\fR (the default), \fBnorth\fR, \fBeast\fR and \fBwest\fR. .TP .I SIZE The font size in points, or \fIPIXELS\fR\fBpx\fR for a font size in pixels. .PP The details of the syntax are entirely under the control of the Pango library; for full details you must consult its documentation or source code. .SH "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 directive is deprecated. Use \fBprune\-parameter min\-backups\fR instead. .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 directive is deprecated. Use \fBprune\-parameter prune\-age\fR instead. .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. .SH "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). .SH "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 "SEE ALSO" \fBrsbackup\fR(1), \fBrsbackup\-graph\fR(1), \fBrsbackup.cron\fR(1), \fBrsbackup\-mount\fR(1), \fBrsbackup\-snapshot\-hook\fR(1), \fBrsync\fR(1), \fBrsbackup\fR(5) .SH AUTHOR Richard Kettlewell rsbackup-4.0/doc/CHANGES.html0000664000175000017500000003647213065536742012644 00000000000000 Changes To rsbackup

      Changes To rsbackup

      Please see rsbackup in git for detailed change history.

      Changes In rsbackup 4.0

      • A new tool, rsbackup-graph, has been introduced. This generates a graphical representation of available backups.
      • The colors directive is now split into colors-good and colors-bad which can take either RGB or HSV parameters.
        Advance warning: the old colors directive is now deprecated and will produce a warning. In some future version it will be removed.
      • Report contents can now be parameterized using the new report directive.
        Advance warning: the old report-prune-logs directive is now deprecated and will produce a warning. In some future version it will be removed.
      • Configuration file documentation has been moved to a new man page, rsbackup(5).
      • Various minor bugs have been fixed.

      Changes In rsbackup 3.1

      • Don’t throw exceptions from destructors. Addresses Debian bug #811705.
      • Fix error handling in character encoding translation.
      • Patch from Maria Valentina Marin to use consistent mtimes during .deb build. Fixes Debian bug #793716.
      • Stop cron scripts exiting nonzero if .deb is removed. Fixes Debian bug #810335.
      • Patch from Jonathon Wiltshire to use install rather than cp during .deb builds.
      • Correct distribution of scripts.
      • Add missing .deb build dependencies.

      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-4.0/tests/0000775000175000017500000000000013067504144011340 500000000000000rsbackup-4.0/tests/setup.sh0000775000175000017500000001111513060550045012750 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_OPT}" 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 # Exclude graph from report echo 'report "title:Backup report (${RSBACKUP_DATE})"' >> ${WORKSPACE}/config echo 'report + "h1:Backup report (${RSBACKUP_DATE})"' >> ${WORKSPACE}/config echo 'report + h2:Warnings?warnings warnings' >> ${WORKSPACE}/config echo 'report + h2:Summary summary' >> ${WORKSPACE}/config echo 'report + h2:Logfiles logs' >> ${WORKSPACE}/config echo 'report + "h3:Pruning logs" prune-logs' >> ${WORKSPACE}/config echo 'report + "p:Generated ${RSBACKUP_CTIME}"' >> ${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-4.0/tests/retire-device0000775000175000017500000000543112671570535013747 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-4.0/tests/pruneexec0000775000175000017500000000423012671570535013212 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-4.0/tests/configs/0000775000175000017500000000000013067504144012770 500000000000000rsbackup-4.0/tests/configs/pruneparam/0000775000175000017500000000000013067504144015142 500000000000000rsbackup-4.0/tests/configs/pruneparam/config0000664000175000017500000000017712671570535016266 00000000000000prune-parameter a b prune-parameter c d prune-parameter e f host spong prune-parameter a bb prune-parameter --remove c rsbackup-4.0/tests/configs/empty/0000775000175000017500000000000013067504144014126 500000000000000rsbackup-4.0/tests/configs/empty/config0000664000175000017500000000000012671570535015233 00000000000000rsbackup-4.0/tests/configs/include/0000775000175000017500000000000013067504144014413 500000000000000rsbackup-4.0/tests/configs/include/config.d/0000775000175000017500000000000013067504144016102 500000000000000rsbackup-4.0/tests/configs/include/config.d/z0000664000175000017500000000000712671570535016222 00000000000000host z rsbackup-4.0/tests/configs/include/config.d/backup~0000664000175000017500000000001412671570535017412 00000000000000host backup rsbackup-4.0/tests/configs/include/config.d/empty0000664000175000017500000000000012671570535017100 00000000000000rsbackup-4.0/tests/configs/include/config.d/#recovery#0000664000175000017500000000001612671570535017715 00000000000000host recovery rsbackup-4.0/tests/configs/include/config.d/.dotfile0000664000175000017500000000001512671570535017454 00000000000000Host dotfile rsbackup-4.0/tests/configs/include/config.d/a0000664000175000017500000000000712671570535016171 00000000000000host a rsbackup-4.0/tests/configs/include/config0000664000175000017500000000002112671570535015523 00000000000000include config.d rsbackup-4.0/tests/check-configs0000775000175000017500000000421613060550045013706 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 # Initial consistency check for root in ${srcdir:-.}/configs/*; do exec 3>${WORKSPACE}/got.txt s ${RSBACKUP} --config ${srcdir:-.}/expect/${root##*configs/}.txt ${VERBOSE_OPT} \ --dump-config >&3 compare ${srcdir:-.}/expect/${root##*configs/}.txt ${WORKSPACE}/got.txt rm -f ${WORKSPACE}/got.txt done # Verbose output must be parsable for root in ${srcdir:-.}/configs/*; do exec 3>${WORKSPACE}/got-verbose.txt s ${RSBACKUP} --config ${srcdir:-.}/expect/${root##*configs/}.txt ${VERBOSE_OPT} \ --dump-config --verbose >&3 exec 4>${WORKSPACE}/got-concise.txt s ${RSBACKUP} --config ${WORKSPACE}/got-verbose.txt ${VERBOSE_OPT} \ --dump-config >&4 compare ${srcdir:-.}/expect/${root##*configs/}.txt ${WORKSPACE}/got-concise.txt rm -f ${WORKSPACE}/got.txt done # Check against configs for root in ${srcdir:-.}/configs/*; do exec 3>${WORKSPACE}/got.txt s cd ${root} s ${RSBACKUP} --config config ${VERBOSE_OPT} \ --dump-config >&3 s cd - compare ${srcdir:-.}/expect/${root##*configs/}.txt ${WORKSPACE}/got.txt rm -f ${WORKSPACE}/got.txt done rm -rf ${WORKSPACE} rsbackup-4.0/tests/pruneage0000775000175000017500000000155112671570535013025 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-4.0/tests/Makefile.am0000664000175000017500000000606312671570535013330 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-4.0/tests/retire-volume0000775000175000017500000001161312671570535014016 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-4.0/tests/bashisms0000775000175000017500000000167612671570535013040 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-4.0/tests/expect/0000775000175000017500000000000013067504144012630 500000000000000rsbackup-4.0/tests/expect/retire-device/0000775000175000017500000000000013067504144015357 500000000000000rsbackup-4.0/tests/expect/retire-device/create.txt0000664000175000017500000000133212671570535017311 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-4.0/tests/expect/retire-device/device2-db.txt0000664000175000017500000000011412671570535017747 00000000000000host1|volume1|device1|1980-01-01|0|2| host1|volume2|device1|1980-01-01|0|2| rsbackup-4.0/tests/expect/retire-device/created-db.txt0000664000175000017500000000027612671570535020046 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-4.0/tests/expect/retire-device/device2.txt0000664000175000017500000000112412671570535017366 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-4.0/tests/expect/retire-device/dryrun.txt0000664000175000017500000000115612671570535017375 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-4.0/tests/expect/pruneexec/0000775000175000017500000000000013067504144014626 500000000000000rsbackup-4.0/tests/expect/pruneexec/pruneexec-db.txt0000664000175000017500000000144512671570535017703 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-4.0/tests/expect/include.txt0000664000175000017500000000224213040671504014730 00000000000000max-age 3 prune-policy age ssh-timeout 60 public false logs /var/log/backup color-good 0xe0ffe0 color-bad 0xff4040 sendmail /usr/sbin/sendmail report "title:Backup report (${RSBACKUP_DATE})" report + "h1:Backup report (${RSBACKUP_DATE})" h2:Warnings?warnings warnings report + h2:Summary summary history-graph h2:Logfiles logs "h3:Pruning logs" report + prune-logs "p:Generated ${RSBACKUP_CTIME}" color-graph-background 0xffffff color-graph-foreground 0x000000 color-month-guide 0xf7f7f7 color-host-guide 0xdfdfdf color-volume-guide 0xefefef device-color-strategy equidistant-value 120 0.75 horizontal-padding 8 vertical-padding 2 backup-indicator-width 4 backup-indicator-height 2 graph-target-width 0 backup-indicator-key-width 16 host-name-font Normal volume-name-font Normal device-name-font Normal time-label-font Normal graph-layout host-labels:0,0 volume-labels:1,0 content:2,0 time-labels:2,1 graph-layout + device-key:2,3:RC 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-4.0/tests/expect/retire-volume/0000775000175000017500000000000013067504144015427 500000000000000rsbackup-4.0/tests/expect/retire-volume/volume2.html0000664000175000017500000000563713056231303017631 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-4.0/tests/expect/retire-volume/dryrun.html0000664000175000017500000000571513056231303017560 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-4.0/tests/expect/retire-volume/create.txt0000664000175000017500000000133212671570535017361 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-4.0/tests/expect/retire-volume/volume2.txt0000664000175000017500000000121012671570535017502 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-4.0/tests/expect/retire-volume/created-db.txt0000664000175000017500000000027612671570535020116 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-4.0/tests/expect/retire-volume/dryrun.txt0000664000175000017500000000126012671570535017441 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-4.0/tests/expect/retire-volume/all.txt0000664000175000017500000000110412671570535016663 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-4.0/tests/expect/retire-volume/all.html0000664000175000017500000000553513056231303017005 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-4.0/tests/expect/retire-volume/all-db.txt0000664000175000017500000000000012671570535017240 00000000000000rsbackup-4.0/tests/expect/retire-volume/volume2-db.txt0000664000175000017500000000016212671570535020072 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-4.0/tests/expect/retire-volume/create.html0000664000175000017500000000615113056231303017473 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-4.0/tests/expect/prunenever/0000775000175000017500000000000013067504144015021 500000000000000rsbackup-4.0/tests/expect/prunenever/neverprune-db.txt0000664000175000017500000000135612671570535020272 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-4.0/tests/expect/pruneparam.txt0000664000175000017500000000227013040671504015460 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 color-good 0xe0ffe0 color-bad 0xff4040 sendmail /usr/sbin/sendmail report "title:Backup report (${RSBACKUP_DATE})" report + "h1:Backup report (${RSBACKUP_DATE})" h2:Warnings?warnings warnings report + h2:Summary summary history-graph h2:Logfiles logs "h3:Pruning logs" report + prune-logs "p:Generated ${RSBACKUP_CTIME}" color-graph-background 0xffffff color-graph-foreground 0x000000 color-month-guide 0xf7f7f7 color-host-guide 0xdfdfdf color-volume-guide 0xefefef device-color-strategy equidistant-value 120 0.75 horizontal-padding 8 vertical-padding 2 backup-indicator-width 4 backup-indicator-height 2 graph-target-width 0 backup-indicator-key-width 16 host-name-font Normal volume-name-font Normal device-name-font Normal time-label-font Normal graph-layout host-labels:0,0 volume-labels:1,0 content:2,0 time-labels:2,1 graph-layout + device-key:2,3:RC 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-4.0/tests/expect/prunedecay/0000775000175000017500000000000013067504144014767 500000000000000rsbackup-4.0/tests/expect/prunedecay/prunedecay-db.txt0000664000175000017500000000257212671570535020207 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-4.0/tests/expect/store/0000775000175000017500000000000013067504144013764 500000000000000rsbackup-4.0/tests/expect/store/duplicate-stderr.txt0000664000175000017500000000144713056231303017716 00000000000000WARNING: /config:21: the 'prune-age' directive is deprecated, use 'prune-parameter prune-age' instead WARNING: /config:23: the 'min-backups' directive is deprecated, use 'prune-parameter min-backups' instead WARNING: /config:28: the 'min-backups' directive is deprecated, use 'prune-parameter min-backups' instead WARNING: /config:30: 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-4.0/tests/expect/store/duplicate.html0000664000175000017500000000614113056231303016536 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-4.0/tests/expect/store/overridden.txt0000664000175000017500000000135112671570535016615 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-4.0/tests/expect/store/overridden.html0000664000175000017500000000614113056231303016725 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-4.0/tests/expect/store/duplicate.txt0000664000175000017500000000135112671570535016426 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-4.0/tests/expect/store/overridden-stderr.txt0000664000175000017500000000127513056231303020104 00000000000000WARNING: /config:21: the 'prune-age' directive is deprecated, use 'prune-parameter prune-age' instead WARNING: /config:23: the 'min-backups' directive is deprecated, use 'prune-parameter min-backups' instead WARNING: /config:28: the 'min-backups' directive is deprecated, use 'prune-parameter min-backups' instead WARNING: /config:30: 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-4.0/tests/expect/upgrade/0000775000175000017500000000000013067504144014257 500000000000000rsbackup-4.0/tests/expect/upgrade/interrupted-db.txt0000664000175000017500000000152212671570535017677 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-4.0/tests/expect/upgrade/simple-db.txt0000664000175000017500000000125412671570535016625 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-4.0/tests/expect/prune/0000775000175000017500000000000013067504144013761 500000000000000rsbackup-4.0/tests/expect/prune/createsecond.txt0000664000175000017500000000133212671570535017107 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-4.0/tests/expect/prune/null.txt0000664000175000017500000000140112671570535015417 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-4.0/tests/expect/prune/dryrun-db.txt0000664000175000017500000000076412671570535016366 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-4.0/tests/expect/prune/volume2.txt0000664000175000017500000000213412671570535016042 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-4.0/tests/expect/prune/volume1.txt0000664000175000017500000000172312671570535016044 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-4.0/tests/expect/prune/third.txt0000664000175000017500000000165412671570535015571 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-4.0/tests/expect/prune/dryrun.txt0000664000175000017500000000140112671570535015770 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-4.0/tests/expect/prune/null-db.txt0000664000175000017500000000037212671570535016010 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-4.0/tests/expect/prune/unselected-db.txt0000664000175000017500000000147212671570535017173 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-4.0/tests/expect/prune/created.txt0000664000175000017500000000133212671570535016057 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-4.0/tests/expect/prune/volume2-db.txt0000664000175000017500000000160412671570535016426 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-4.0/tests/expect/prune/volume1-db.txt0000664000175000017500000000110012671570535016414 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-4.0/tests/expect/prune/everything-db.txt0000664000175000017500000000177112671570535017226 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-4.0/tests/expect/prune/unselected.txt0000664000175000017500000000165412671570535016612 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-4.0/tests/expect/check-file/0000775000175000017500000000000013067504144014622 500000000000000rsbackup-4.0/tests/expect/check-file/missing.html0000664000175000017500000000616113056231303017075 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-4.0/tests/expect/check-file/missing.txt0000664000175000017500000000140112671570535016757 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-4.0/tests/expect/style/0000775000175000017500000000000013067504144013770 500000000000000rsbackup-4.0/tests/expect/style/styled.txt0000664000175000017500000000133212671570535015763 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-4.0/tests/expect/style/styled.html0000664000175000017500000000275312671570535016120 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-4.0/tests/expect/empty.txt0000664000175000017500000000164613040671504014452 00000000000000max-age 3 prune-policy age ssh-timeout 60 public false logs /var/log/backup color-good 0xe0ffe0 color-bad 0xff4040 sendmail /usr/sbin/sendmail report "title:Backup report (${RSBACKUP_DATE})" report + "h1:Backup report (${RSBACKUP_DATE})" h2:Warnings?warnings warnings report + h2:Summary summary history-graph h2:Logfiles logs "h3:Pruning logs" report + prune-logs "p:Generated ${RSBACKUP_CTIME}" color-graph-background 0xffffff color-graph-foreground 0x000000 color-month-guide 0xf7f7f7 color-host-guide 0xdfdfdf color-volume-guide 0xefefef device-color-strategy equidistant-value 120 0.75 horizontal-padding 8 vertical-padding 2 backup-indicator-width 4 backup-indicator-height 2 graph-target-width 0 backup-indicator-key-width 16 host-name-font Normal volume-name-font Normal device-name-font Normal time-label-font Normal graph-layout host-labels:0,0 volume-labels:1,0 content:2,0 time-labels:2,1 graph-layout + device-key:2,3:RC rsbackup-4.0/tests/expect/glob-store/0000775000175000017500000000000013067504144014705 500000000000000rsbackup-4.0/tests/expect/glob-store/everything.txt0000664000175000017500000000133212671570535017560 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-4.0/tests/expect/glob-store/everything.html0000664000175000017500000000615113056231303017672 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-4.0/tests/expect/backup/0000775000175000017500000000000013067504144014075 500000000000000rsbackup-4.0/tests/expect/backup/onehost.html0000664000175000017500000000615113056231303016355 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-4.0/tests/expect/backup/dryrun.html0000664000175000017500000000600213056231303016214 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-4.0/tests/expect/backup/everything.txt0000664000175000017500000000133212671570535016750 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-4.0/tests/expect/backup/onevolume.html0000664000175000017500000000604713056231303016713 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-4.0/tests/expect/backup/onevolume.txt0000664000175000017500000000132212671570535016574 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-4.0/tests/expect/backup/dryrun.txt0000664000175000017500000000121212671570535016104 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-4.0/tests/expect/backup/everything.html0000664000175000017500000000615113056231303017062 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-4.0/tests/expect/backup/onehost.txt0000664000175000017500000000133212671570535016243 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-4.0/tests/prunenever0000775000175000017500000000343512671570535013413 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-4.0/tests/prunedecay0000775000175000017500000001702412671570535013360 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-4.0/tests/pruner.sh0000775000175000017500000000247012671570535013144 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-4.0/tests/store0000775000175000017500000000555412671570535012362 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-4.0/tests/upgrade0000775000175000017500000001113412671570535012644 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-4.0/tests/prune0000775000175000017500000002004513056231303012330 00000000000000#! /bin/sh # Copyright © 2011, 2012, 2014-2016 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} --verbose --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-4.0/tests/Makefile.in0000664000175000017500000007761713067504140013343 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@ CAIROMM_CFLAGS = @CAIROMM_CFLAGS@ CAIROMM_LIBS = @CAIROMM_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@ PANGOMM_CFLAGS = @PANGOMM_CFLAGS@ PANGOMM_LIBS = @PANGOMM_LIBS@ 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-4.0/tests/check-mounted0000775000175000017500000000420312671570535013742 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-4.0/tests/check-file0000775000175000017500000000251112671570535013206 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-4.0/tests/hook0000775000175000017500000000352712671570535012164 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-4.0/tests/style0000775000175000017500000000314712671570535012362 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-4.0/tests/glob-store0000775000175000017500000000321512671570535013273 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-4.0/tests/backup0000775000175000017500000000732712671570535012473 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-4.0/INSTALL0000644000175000017500000003660012421052313011137 00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX `make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as `configure' are involved. Use GNU `make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. rsbackup-4.0/Makefile.in0000664000175000017500000006333013067504140012164 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 $(dist_noinst_SCRIPTS) COPYING INSTALL \ 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 config.aux/ltmain.sh \ $(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 = 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 = 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@ CAIROMM_CFLAGS = @CAIROMM_CFLAGS@ CAIROMM_LIBS = @CAIROMM_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@ PANGOMM_CFLAGS = @PANGOMM_CFLAGS@ PANGOMM_LIBS = @PANGOMM_LIBS@ 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, 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 . SUBDIRS = src tests doc tools EXTRA_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 dist_noinst_SCRIPTS = scripts/txt2src scripts/htmlman scripts/dist 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 $(SCRIPTS) 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-4.0/aclocal.m40000664000175000017500000014677313067504136012001 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-4.0/config.h.in0000664000175000017500000000464113067504143012145 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-4.0/config.aux/0000775000175000017500000000000013067504143012236 500000000000000rsbackup-4.0/config.aux/config.sub0000755000175000017500000010577512404676534014166 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-4.0/config.aux/compile0000755000175000017500000001624512753041535013544 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-4.0/config.aux/config.guess0000755000175000017500000012355012404676534014512 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-4.0/config.aux/ar-lib0000755000175000017500000001330212753041535013251 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-4.0/config.aux/missing0000755000175000017500000001533012753041535013557 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-4.0/config.aux/ltmain.sh0000644000175000017500000105203012417260023013767 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 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. # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.11 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1.11" TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs 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 BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs 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 BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 rsbackup-4.0/config.aux/install-sh0000755000175000017500000003413712753041535014172 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. ;; *) # $RANDOM is not portable (e.g. dash); use it when possible to # lower collision chance tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # As "mkdir -p" follows symlinks and we work in /tmp possibly; so # create the $tmpdir first (and fail if unsuccessful) to make sure # that nobody tries to guess the $tmpdir name. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/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. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 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-4.0/config.aux/test-driver0000755000175000017500000001027712753041535014363 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-4.0/debian/0000775000175000017500000000000013067504143011417 500000000000000rsbackup-4.0/debian/rsbackup.conffiles0000664000175000017500000000025212671570535015052 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-4.0/debian/control0000664000175000017500000000305213056231303012733 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-system-dev,libboost-filesystem-dev,libboost-dev,pkg-config,libpangomm-1.4-dev,libcairomm-1.0-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. Package: rsbackup-graph Architecture: any Section: admin Depends: ${shlibs:Depends},rsbackup Recommends: openssh-server,openssh-client Description: Graphics for 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. . This package generates graphical representations of currently available backups. rsbackup-4.0/debian/rsbackup.postrm0000775000175000017500000000147213056231303014417 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-4.0/debian/doc.rsbackup0000664000175000017500000000036512671570535013654 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-4.0/debian/copyright0000664000175000017500000000153712671570535013310 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-4.0/debian/changelog0000664000175000017500000001450413067504124013214 00000000000000rsbackup (4.0) stable; urgency=medium * Release 4.0 -- Richard Kettlewell Sun, 26 Mar 2017 17:16:52 +0100 rsbackup (3.1) unstable; urgency=medium * Release 3.1 -- Richard Kettlewell Sun, 24 Jan 2016 10:59:06 +0000 rsbackup (3.0-2) unstable; urgency=low * Upload again with orig this time (dgit needs a new version number to do this) -- Matthew Vernon Fri, 01 Jan 2016 12:58:18 +0000 rsbackup (3.0-1) unstable; urgency=low * New upstream version (Closes: #777394) * patch from Maria Valentina Marin to fix mtimes before building binary packages (reproducible-builds effort) (Closes: #793716) -- Matthew Vernon Tue, 29 Dec 2015 14:57:43 +0000 rsbackup (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-4) unstable; urgency=low * Patch from Jonathan Wiltshire to use install rather than cp for post{inst,rm}, making build less sensitive to source file permissions (Closes: #774013) -- Matthew Vernon Sun, 28 Dec 2014 19:10:11 +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-4.0/debian/rules0000775000175000017500000001321413067504124012417 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 VERSION=4.0 export DEB_BUILD_MAINT_OPTIONS = hardening=+all DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk export SOURCE_DATE_EPOCH = $(shell date -d "$$(dpkg-parsechangelog --count 1 -SDate)" +%s) # Debian apparently wants reproducible builds but won't execute them # in a consistent environment, so every project has to clean up after # it. export LC_ALL=C.UTF-8 build-arch: build build-indep: build build: [ -e configure ] || ./autogen.sh ./configure --prefix=/usr --mandir=/usr/share/man --without-lyx ${CONFIGURE_EXTRA} $(MAKE) clean-rsbackup: rm -rf debian/rsbackup binary-rsbackup: build rm -rf debian/rsbackup mkdir -p debian/rsbackup/DEBIAN mkdir -p debian/rsbackup/etc/rsbackup/hosts.d mkdir -p debian/rsbackup/etc/cron.hourly mkdir -p debian/rsbackup/etc/cron.daily mkdir -p debian/rsbackup/etc/cron.weekly mkdir -p debian/rsbackup/etc/cron.monthly mkdir -p debian/rsbackup/usr/share/doc/rsbackup mkdir -p debian/rsbackup/var/log/backup mkdir -p debian/rsbackup/usr/share/doc-base mkdir -p debian/rsbackup/usr/bin mkdir -p debian/rsbackup/usr/share/man/man1 mkdir -p debian/rsbackup/usr/share/man/man5 cp debian/rsbackup.conffiles debian/rsbackup/DEBIAN/conffiles install debian/rsbackup.postinst debian/rsbackup/DEBIAN/postinst install debian/rsbackup.postrm debian/rsbackup/DEBIAN/postrm install -m 755 tools/rsbackup.hourly debian/rsbackup/etc/cron.hourly/rsbackup install -m 755 tools/rsbackup.daily debian/rsbackup/etc/cron.daily/rsbackup install -m 755 tools/rsbackup.weekly debian/rsbackup/etc/cron.weekly/rsbackup install -m 755 tools/rsbackup.monthly debian/rsbackup/etc/cron.monthly/rsbackup cp tools/rsbackup.config debian/rsbackup/etc/rsbackup/config cp tools/rsbackup.defaults debian/rsbackup/etc/rsbackup/defaults cp tools/rsbackup.devices debian/rsbackup/etc/rsbackup/devices cp debian/changelog debian/rsbackup/usr/share/doc/rsbackup/changelog.Debian cp debian/doc.rsbackup debian/rsbackup/usr/share/doc-base/rsbackup cp README.md debian/rsbackup/usr/share/doc/rsbackup/. lynx -dump -nolist doc/CHANGES.html > debian/rsbackup/usr/share/doc/rsbackup/changelog gzip -9nv debian/rsbackup/usr/share/doc/rsbackup/* cp doc/*.html doc/*.css debian/rsbackup/usr/share/doc/rsbackup/. cp debian/copyright debian/rsbackup/usr/share/doc/rsbackup/. $(INSTALL) -m 755 src/rsbackup debian/rsbackup/usr/bin/rsbackup $(MAKE) -C tools install DESTDIR=$(shell pwd)/debian/rsbackup $(INSTALL) -m 644 doc/rsbackup.1 \ doc/rsbackup.cron.1 \ doc/rsbackup-mount.1 \ doc/rsbackup-snapshot-hook.1 \ debian/rsbackup/usr/share/man/man1/ $(INSTALL) -m 644 doc/rsbackup.5 debian/rsbackup/usr/share/man/man5/ strip --remove-section=.comment debian/rsbackup/usr/bin/rsbackup gzip -9nv debian/rsbackup/usr/share/man/man*/* dpkg-shlibdeps -Tdebian/substvars.rsbackup \ debian/rsbackup/usr/bin/* cd debian/rsbackup && \ find -name DEBIAN -prune -o -type f -print \ | sed 's/^\.\///' \ | xargs md5sum > DEBIAN/md5sums dpkg-gencontrol -isp -prsbackup -Pdebian/rsbackup \ -Tdebian/substvars.rsbackup chown -R root:root debian/rsbackup chmod -R g-ws debian/rsbackup find debian/rsbackup -newermt "@$$SOURCE_DATE_EPOCH" -print0 | \ xargs -0r touch --no-dereference --date="@$$SOURCE_DATE_EPOCH" dpkg --build debian/rsbackup .. clean-rsbackup-graph: rm -rf debian/rsbackup-graph binary-rsbackup-graph: build rm -rf debian/rsbackup-graph mkdir -p debian/rsbackup-graph/DEBIAN mkdir -p debian/rsbackup-graph/usr/bin mkdir -p debian/rsbackup-graph/usr/share/man/man1 mkdir -p debian/rsbackup-graph/usr/share/doc ln -s rsbackup \ debian/rsbackup-graph/usr/share/doc/rsbackup-graph $(INSTALL) -m 755 src/rsbackup-graph \ debian/rsbackup-graph/usr/bin/rsbackup-graph $(INSTALL) -m 644 doc/rsbackup-graph.1 \ debian/rsbackup-graph/usr/share/man/man1/ strip --remove-section=.comment \ debian/rsbackup-graph/usr/bin/rsbackup-graph gzip -9nv debian/rsbackup-graph/usr/share/man/man*/* dpkg-shlibdeps -Tdebian/substvars.rsbackup-graph \ debian/rsbackup-graph/usr/bin/* cd debian/rsbackup-graph && \ find -name DEBIAN -prune -o -type f -print \ | sed 's/^\.\///' \ | xargs md5sum > DEBIAN/md5sums dpkg-gencontrol -isp -prsbackup-graph -Pdebian/rsbackup-graph \ -Tdebian/substvars.rsbackup-graph chown -R root:root debian/rsbackup-graph chmod -R g-ws debian/rsbackup-graph find debian/rsbackup-graph -newermt "@$$SOURCE_DATE_EPOCH" -print0 | \ xargs -0r touch --no-dereference --date="@$$SOURCE_DATE_EPOCH" dpkg --build debian/rsbackup-graph .. binary: binary-arch binary-indep binary-arch: binary-rsbackup binary-rsbackup-graph binary-indep: clean: clean-rsbackup clean-rsbackup-graph 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-4.0/debian/rsbackup.postinst0000775000175000017500000000144413056231303014755 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-4.0/tools/0000775000175000017500000000000013067504144011336 500000000000000rsbackup-4.0/tools/rsbackup.config0000664000175000017500000000021412671570535014263 00000000000000# Location of lockfile lock /var/run/rsbackup.lock # User configuration include /etc/rsbackup/local # Hosts include /etc/rsbackup/hosts.d rsbackup-4.0/tools/Makefile.am0000664000175000017500000000403013056231303013277 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 || exit 0' >> $@.new echo '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-4.0/tools/rsbackup.cron.in0000775000175000017500000000720712671570535014400 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-4.0/tools/t-hook-fsck-ok0000775000175000017500000000352412671570535013753 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-4.0/tools/rsbackup.devices0000664000175000017500000000034112671570535014441 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-4.0/tools/t-hook-dryrun0000775000175000017500000000253312671570535013740 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-4.0/tools/rsbackup-snapshot-hook.in0000775000175000017500000000731012671570535016226 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-4.0/tools/t-hook-post0000775000175000017500000000333112671570535013377 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-4.0/tools/Makefile.in0000664000175000017500000007436213067504140013333 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@ CAIROMM_CFLAGS = @CAIROMM_CFLAGS@ CAIROMM_LIBS = @CAIROMM_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@ PANGOMM_CFLAGS = @PANGOMM_CFLAGS@ PANGOMM_LIBS = @PANGOMM_LIBS@ 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 || exit 0' >> $@.new echo '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-4.0/tools/t-hook-fsck-fail0000775000175000017500000000343412671570535014255 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-4.0/tools/t-bashisms0000775000175000017500000000153512671570535013271 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-4.0/tools/t-hook-nosnap0000775000175000017500000000246612671570535013720 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-4.0/tools/rsbackup.defaults0000664000175000017500000000153712671570535014636 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-4.0/tools/rsbackup-mount.in0000775000175000017500000000754612671570535014606 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-4.0/tools/t-hook-ok0000775000175000017500000000352112671570535013024 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-4.0/tools/srccheck0000775000175000017500000000371012671570535013001 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;