diff -Nru rsbackup-5.0/configure rsbackup-5.1/configure
--- rsbackup-5.0/configure 2018-02-13 18:03:16.000000000 +0000
+++ rsbackup-5.1/configure 2018-07-27 17:34:38.000000000 +0000
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for rsbackup 5.0.
+# Generated by GNU Autoconf 2.69 for rsbackup 5.1.
#
# Report bugs to .
#
@@ -580,8 +580,8 @@
# Identity of this package.
PACKAGE_NAME='rsbackup'
PACKAGE_TARNAME='rsbackup'
-PACKAGE_VERSION='5.0'
-PACKAGE_STRING='rsbackup 5.0'
+PACKAGE_VERSION='5.1'
+PACKAGE_STRING='rsbackup 5.1'
PACKAGE_BUGREPORT='rjk@greenend.org.uk'
PACKAGE_URL=''
@@ -1315,7 +1315,7 @@
# 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 5.0 to adapt to many kinds of systems.
+\`configure' configures rsbackup 5.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1386,7 +1386,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of rsbackup 5.0:";;
+ short | recursive ) echo "Configuration of rsbackup 5.1:";;
esac
cat <<\_ACEOF
@@ -1493,7 +1493,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-rsbackup configure 5.0
+rsbackup configure 5.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1833,7 +1833,7 @@
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 5.0, which was
+It was created by rsbackup $as_me 5.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2696,7 +2696,7 @@
# Define the identity of the package.
PACKAGE='rsbackup'
- VERSION='5.0'
+ VERSION='5.1'
cat >>confdefs.h <<_ACEOF
@@ -5852,6 +5852,31 @@
CXXFLAGS="${CXXFLAGS} -Wno-c++14-extensions"
fi
+# sigc++ is broken, but the compiler can be persuaded to ignore it.
+# https://bugzilla.redhat.com/show_bug.cgi?id=1576299
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sigc++ is broken" >&5
+$as_echo_n "checking whether sigc++ is broken... " >&6; }
+if ${rjk_cv_sigcpp_broken+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ rjk_cv_sigcpp_broken=no
+else
+ rjk_cv_sigcpp_broken=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $rjk_cv_sigcpp_broken" >&5
+$as_echo "$rjk_cv_sigcpp_broken" >&6; }
+if test $rjk_cv_sigcpp_broken = yes; then
+ CXXFLAGS="${CXXFLAGS} -Wno-cast-function-type"
+fi
+
ac_config_files="$ac_config_files Makefile src/Makefile tests/Makefile doc/Makefile tools/Makefile"
@@ -6390,7 +6415,7 @@
# 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 5.0, which was
+This file was extended by rsbackup $as_me 5.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -6456,7 +6481,7 @@
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 5.0
+rsbackup config.status 5.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff -Nru rsbackup-5.0/configure.ac rsbackup-5.1/configure.ac
--- rsbackup-5.0/configure.ac 2018-11-09 22:26:20.000000000 +0000
+++ rsbackup-5.1/configure.ac 2018-07-27 17:33:59.000000000 +0000
@@ -13,7 +13,7 @@
# 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], [5.0], [rjk@greenend.org.uk])
+AC_INIT([rsbackup], [5.1], [rjk@greenend.org.uk])
AC_CONFIG_AUX_DIR([config.aux])
AM_INIT_AUTOMAKE([foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
diff -Nru rsbackup-5.0/debian/changelog rsbackup-5.1/debian/changelog
--- rsbackup-5.0/debian/changelog 2018-11-09 22:26:20.000000000 +0000
+++ rsbackup-5.1/debian/changelog 2018-11-09 22:26:20.000000000 +0000
@@ -1,3 +1,15 @@
+rsbackup (5.1-1) unstable; urgency=medium
+
+ * New upstream version (Closes: #908644)
+
+ -- Matthew Vernon Mon, 08 Oct 2018 20:26:07 +0100
+
+rsbackup (5.1) stable; urgency=medium
+
+ * Release 5.1
+
+ -- Richard Kettlewell Fri, 27 Jul 2018 18:34:15 +0100
+
rsbackup (5.0-2) unstable; urgency=medium
* Upstream patch to workaround sigc++ build failure on GCC 8 (Closes:
diff -Nru rsbackup-5.0/debian/control rsbackup-5.1/debian/control
--- rsbackup-5.0/debian/control 2018-11-09 22:26:20.000000000 +0000
+++ rsbackup-5.1/debian/control 2018-02-13 13:57:32.000000000 +0000
@@ -5,7 +5,7 @@
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,xattr,acl,bash,automake
+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,xattr,acl,bash
Package: rsbackup
Architecture: any
diff -Nru rsbackup-5.0/debian/rules rsbackup-5.1/debian/rules
--- rsbackup-5.0/debian/rules 2018-11-09 22:26:20.000000000 +0000
+++ rsbackup-5.1/debian/rules 2018-11-09 22:26:20.000000000 +0000
@@ -15,7 +15,7 @@
# along with this program. If not, see .
INSTALL=install
-VERSION=5.0
+VERSION=5.1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
@@ -32,7 +32,7 @@
build-indep: build
build:
[ -e configure ] || ./autogen.sh
- ./configure --prefix=/usr --mandir=/usr/share/man --without-lyx ${CONFIGURE_EXTRA}
+ ./configure --prefix=/usr --mandir=/usr/share/man ${CONFIGURE_EXTRA}
$(MAKE)
clean-rsbackup:
diff -Nru rsbackup-5.0/doc/CHANGES.html rsbackup-5.1/doc/CHANGES.html
--- rsbackup-5.0/doc/CHANGES.html 2018-02-13 13:57:32.000000000 +0000
+++ rsbackup-5.1/doc/CHANGES.html 2018-07-27 17:33:22.000000000 +0000
@@ -15,6 +15,24 @@
href="https://github.com/ewxrjk/rsbackup">rsbackup
in git for detailed change history.
+ Changes In rsbackup 5.1
+
+
+
+ - Store directories are now normally required to be mount
+ points. See the description of
store
+ and store-pattern
+ in rsbackup(5)
+ and --unmounted-store
in rsbackup(1) for options to
+ restore the previous behavior.
+ Fixes issue
+ #42.
+
+ - Minor build fixes.
+
+
+
Changes In rsbackup 5.0
diff -Nru rsbackup-5.0/doc/rsbackup.1 rsbackup-5.1/doc/rsbackup.1
--- rsbackup-5.0/doc/rsbackup.1 2018-01-27 16:40:36.000000000 +0000
+++ rsbackup-5.1/doc/rsbackup.1 2018-07-27 17:33:22.000000000 +0000
@@ -1,5 +1,5 @@
.TH rsbackup 1
-.\" Copyright (c) 2011, 2012, 2014-15, 2017 Richard Kettlewell
+.\" Copyright (c) 2011, 2012, 2014-15, 2017-18 Richard Kettlewell
.\"
.\" This program is free software: you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
@@ -113,6 +113,10 @@
.IP
This option implicitly enables the \fB\-\-warn\-store\fR option.
.TP
+.B \-\-unmounted\-store \fIPATH\fR
+Equivalent to \fB\-\-store\fR except that the store does not have to
+be a mount point.
+.TP
.B \-\-verbose\fR, \fB\-v
Enable verbose mode.
Various messages will be displayed to report progress and the rsync
diff -Nru rsbackup-5.0/doc/rsbackup.5 rsbackup-5.1/doc/rsbackup.5
--- rsbackup-5.0/doc/rsbackup.5 2018-02-13 13:57:32.000000000 +0000
+++ rsbackup-5.1/doc/rsbackup.5 2018-07-27 17:33:22.000000000 +0000
@@ -101,14 +101,20 @@
Normally backups must only be accessible by the calling user.
This option suppresses the check.
.TP
-.B store \fIPATH\fR
+.B store \fR[\fB--mounted|--no-mounted\fR] \fIPATH\fR
A path at which a backup device may be mounted.
This can be used multiple times.
+.IP
+With the \fB--mounted\fR option (which is the default),
+\fIPATH\fR must be a mount point.
+With \fB--no-mounted\fR it need not be a mount point.
.TP
-.B store\-pattern \fIPATTERN\fR
+.B store\-pattern \fR[\fB-mounted|-nomounted\fR] \fIPATTERN\fR
A \fBglob\fR(7) pattern matching paths at which a backup device may be
mounted.
This can be used multiple times.
+.IP
+See the description of \fBstore\fR above for the meanings of the options.
.SS "Report Directives"
These are global directives that affect only the HTML report.
.TP
@@ -714,9 +720,7 @@
.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).
+This list excludes any that have already been scheduled for pruning.
.TP
.B PRUNE_TOTAL
The total number of backups of this volume on any device.
diff -Nru rsbackup-5.0/doc/rsbackup-manual.in.html rsbackup-5.1/doc/rsbackup-manual.in.html
--- rsbackup-5.0/doc/rsbackup-manual.in.html 2018-02-13 13:57:32.000000000 +0000
+++ rsbackup-5.1/doc/rsbackup-manual.in.html 2018-07-27 17:33:22.000000000 +0000
@@ -253,7 +253,7 @@
(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
+ although you can use the public
directive to change
this behaviour.
chmod 700 /backup1 /backup2
@@ -472,7 +472,7 @@
a host with a modern
rsync
, or vice versa, extended attributes and ACLs
cannot be backed up at all.
- The option must then be set as follows:
+ The directive must then be set as follows:
rsync-extra-options
diff -Nru rsbackup-5.0/scripts/dist rsbackup-5.1/scripts/dist
--- rsbackup-5.0/scripts/dist 2018-11-09 22:26:20.000000000 +0000
+++ rsbackup-5.1/scripts/dist 2018-07-27 17:33:22.000000000 +0000
@@ -96,11 +96,12 @@
s ./configure
# Build the source archive
+s make -C doc
s make -C doc html
s make distcheck
srcpkg=rsbackup # source package name
-binpkgs="rsbackup" # binary packages
+binpkgs="rsbackup rsbackup-graph" # binary packages
version=$(make echo-version) # get version number
debversion=$(dpkg-parsechangelog -ldebian/changelog -SVersion)
source=${srcpkg}-${version} # source directory
diff -Nru rsbackup-5.0/src/Command.cc rsbackup-5.1/src/Command.cc
--- rsbackup-5.0/src/Command.cc 2018-01-27 16:40:36.000000000 +0000
+++ rsbackup-5.1/src/Command.cc 2018-07-27 17:33:22.000000000 +0000
@@ -1,4 +1,4 @@
-// Copyright © 2011-16 Richard Kettlewell.
+// Copyright © 2011-18 Richard Kettlewell.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -36,6 +36,7 @@
LOG_VERBOSITY = 266,
DUMP_CONFIG = 267,
FORGET_ONLY = 268,
+ UNMOUNTED_STORE = 269,
};
const struct option Command::options[] = {
@@ -48,6 +49,7 @@
{ "prune", no_argument, nullptr, 'p' },
{ "prune-incomplete", no_argument, nullptr, 'P' },
{ "store", required_argument, nullptr, 's' },
+ { "unmounted-store", required_argument, nullptr, UNMOUNTED_STORE },
{ "retire-device", no_argument, nullptr, RETIRE_DEVICE },
{ "retire", no_argument, nullptr, RETIRE },
{ "config", required_argument, nullptr, 'c' },
@@ -99,6 +101,7 @@
"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"
+" --unmounted-store 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"
@@ -148,6 +151,7 @@
case 'p': prune = true; break;
case 'P': pruneIncomplete = true; break;
case 's': stores.push_back(optarg); enable_warning(WARNING_STORE); break;
+ case UNMOUNTED_STORE: unmountedStores.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;
diff -Nru rsbackup-5.0/src/Command.h rsbackup-5.1/src/Command.h
--- rsbackup-5.0/src/Command.h 2018-01-27 16:40:36.000000000 +0000
+++ rsbackup-5.1/src/Command.h 2018-07-27 17:33:22.000000000 +0000
@@ -1,5 +1,5 @@
// -*-C++-*-
-// Copyright © 2011, 2012, 2014-2016 Richard Kettlewell.
+// Copyright © 2011, 2012, 2014-18 Richard Kettlewell.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -95,6 +95,12 @@
/** @brief Explicitly specified stores */
std::vector stores;
+ /** @brief Explicitly specified stores
+ *
+ * These ones don't have to be mount points.
+ */
+ std::vector unmountedStores;
+
/** @brief Wait if lock cannot be held
*
* The default is @c false.
diff -Nru rsbackup-5.0/src/ConfDirective.cc rsbackup-5.1/src/ConfDirective.cc
--- rsbackup-5.0/src/ConfDirective.cc 2018-02-13 13:57:32.000000000 +0000
+++ rsbackup-5.1/src/ConfDirective.cc 2018-07-27 17:33:22.000000000 +0000
@@ -139,22 +139,43 @@
// Global directives ----------------------------------------------------------
+size_t parseStoreArguments(const ConfContext &cc, bool &mounted) {
+ mounted = true;
+ size_t i = 1;
+ while(i < cc.bits.size() && cc.bits[i][0] == '-') {
+ if(cc.bits[i] == "--mounted")
+ mounted = true;
+ else if(cc.bits[i] == "--no-mounted")
+ mounted = false;
+ else
+ throw SyntaxError("unrecognized store option");
+ ++i;
+ }
+ if(i >= cc.bits.size())
+ throw SyntaxError("missing store path");
+ return i;
+}
+
/** @brief The @c store directive */
static const struct StoreDirective: public ConfDirective {
- StoreDirective(): ConfDirective("store", 1, 1) {}
+ StoreDirective(): ConfDirective("store", 1, INT_MAX) {}
void set(ConfContext &cc) const override {
- cc.conf->stores[cc.bits[1]] = new Store(cc.bits[1]);
+ bool mounted;
+ size_t i = parseStoreArguments(cc, mounted);
+ cc.conf->stores[cc.bits[i]] = new Store(cc.bits[i], mounted);
}
} store_directive;
/** @brief The @c store-pattern directive */
static const struct StorePatternDirective: public ConfDirective {
- StorePatternDirective(): ConfDirective("store-pattern", 1, 1) {}
+ StorePatternDirective(): ConfDirective("store-pattern", 1, INT_MAX) {}
void set(ConfContext &cc) const override {
std::vector files;
- globFiles(files, cc.bits[1], GLOB_NOCHECK);
+ bool mounted;
+ size_t i = parseStoreArguments(cc, mounted);
+ globFiles(files, cc.bits[i], GLOB_NOCHECK);
for(auto &file: files)
- cc.conf->stores[file] = new Store(file);
+ cc.conf->stores[file] = new Store(file, mounted);
}
} store_pattern_directive;
diff -Nru rsbackup-5.0/src/rsbackup.cc rsbackup-5.1/src/rsbackup.cc
--- rsbackup-5.0/src/rsbackup.cc 2018-01-27 16:40:36.000000000 +0000
+++ rsbackup-5.1/src/rsbackup.cc 2018-07-27 17:33:22.000000000 +0000
@@ -1,4 +1,4 @@
-// Copyright © 2011-15 Richard Kettlewell.
+// Copyright © 2011-18 Richard Kettlewell.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -31,6 +31,8 @@
#include
#include
+static void commandLineStores(const std::vector & stores, bool mounted);
+
int main(int argc, char **argv) {
try {
if(setlocale(LC_CTYPE, "") == nullptr)
@@ -52,16 +54,11 @@
}
// Override stores
- if(command.stores.size() != 0) {
+ if(command.stores.size() != 0 || command.unmountedStores.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;
- }
+ commandLineStores(command.stores, true);
+ commandLineStores(command.unmountedStores, false);
}
// Take the lock, if one is defined.
@@ -194,3 +191,15 @@
}
exit(!!errors);
}
+
+static void commandLineStores(const std::vector &stores,
+ bool mounted) {
+ for(auto &s: stores) {
+ auto it = config.stores.find(s);
+ if(it == config.stores.end())
+ config.stores[s] = new Store(s, mounted);
+ else
+ it->second->state = Store::Enabled;
+ }
+
+}
diff -Nru rsbackup-5.0/src/Store.cc rsbackup-5.1/src/Store.cc
--- rsbackup-5.0/src/Store.cc 2017-10-15 12:05:35.000000000 +0000
+++ rsbackup-5.1/src/Store.cc 2018-07-27 17:33:22.000000000 +0000
@@ -1,4 +1,4 @@
-// Copyright © 2011, 2012 Richard Kettlewell.
+// Copyright © 2011-13, 2015-18 Richard Kettlewell.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -34,6 +34,14 @@
return; // already identified
if(stat(path.c_str(), &sb) < 0)
throw BadStore("store '" + path + "' does not exist");
+ if(mounted) {
+ const std::string parent_path = path + "/..";
+ struct stat parent_sb;
+ if(stat(parent_path.c_str(), &parent_sb) < 0)
+ throw FatalStoreError("cannot stat '" + parent_path);
+ if(sb.st_dev == parent_sb.st_dev)
+ throw UnavailableStore("store '" + path + "' is not mounted");
+ }
// Make sure backup devices are mounted
preDeviceAccess();
// Read the device name
diff -Nru rsbackup-5.0/src/Store.h rsbackup-5.1/src/Store.h
--- rsbackup-5.0/src/Store.h 2017-10-05 21:14:40.000000000 +0000
+++ rsbackup-5.1/src/Store.h 2018-07-27 17:33:22.000000000 +0000
@@ -1,5 +1,5 @@
// -*-C++-*-
-// Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell.
+// Copyright © 2011, 2012, 2014, 2015, 2018 Richard Kettlewell.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -32,7 +32,8 @@
/** @brief Constructor
* @param path_ Location of store
*/
- Store(const std::string &path_): path(path_) {}
+ Store(const std::string &path_, bool mounted_):
+ path(path_), mounted(mounted_) {}
/** @brief Possible states */
enum State {
@@ -43,9 +44,12 @@
Enabled = 2,
};
- /** @param Location of store */
+ /** @brief Location of store */
std::string path;
+ /** @brief True if path must be a mount point */
+ bool mounted;
+
/** @param Device mounted at this store
*
* Set to null pointer before checking, or if no device is mounted here
diff -Nru rsbackup-5.0/tests/expect/store/notmounted.txt rsbackup-5.1/tests/expect/store/notmounted.txt
--- rsbackup-5.0/tests/expect/store/notmounted.txt 1970-01-01 00:00:00.000000000 +0000
+++ rsbackup-5.1/tests/expect/store/notmounted.txt 2018-07-27 17:33:22.000000000 +0000
@@ -0,0 +1,7 @@
+WARNING: store '/store3' is not mounted
+ERROR: no backup devices found
+WARNING: cannot backup host1:volume1 to device1 - device not available
+WARNING: cannot backup host1:volume1 to device2 - device suppressed due to --store
+WARNING: cannot backup host1:volume2 to device1 - device not available
+WARNING: cannot backup host1:volume2 to device2 - device suppressed due to --store
+WARNING: cannot backup host1:volume3 to device2 - device suppressed due to --store
diff -Nru rsbackup-5.0/tests/glob-store rsbackup-5.1/tests/glob-store
--- rsbackup-5.0/tests/glob-store 2016-03-14 17:14:05.000000000 +0000
+++ rsbackup-5.1/tests/glob-store 2018-07-27 17:33:22.000000000 +0000
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell.
+# Copyright © 2011, 2012, 2014, 2015, 2018 Richard Kettlewell.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@
sed < ${WORKSPACE}/config > ${WORKSPACE}/config.new \
'/^store /d';
-echo "store-pattern ${WORKSPACE}/store*" >>${WORKSPACE}/config.new
+echo "store-pattern --no-mounted ${WORKSPACE}/store*" >>${WORKSPACE}/config.new
mv -f ${WORKSPACE}/config.new ${WORKSPACE}/config
echo "| Create backup for everything using glob-pattern directive"
diff -Nru rsbackup-5.0/tests/Makefile.am rsbackup-5.1/tests/Makefile.am
--- rsbackup-5.0/tests/Makefile.am 2018-02-13 13:57:32.000000000 +0000
+++ rsbackup-5.1/tests/Makefile.am 2018-07-27 17:33:22.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright © 2011-2015,17 Richard Kettlewell.
+# Copyright © 2011-2015,17-18 Richard Kettlewell.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -40,6 +40,7 @@
expect/store/overridden.html \
expect/store/duplicate.txt \
expect/store/overridden-stderr.txt \
+ expect/store/notmounted.txt \
expect/upgrade/interrupted-db.txt \
expect/upgrade/simple-db.txt \
expect/prune/createsecond.txt \
diff -Nru rsbackup-5.0/tests/Makefile.in rsbackup-5.1/tests/Makefile.in
--- rsbackup-5.0/tests/Makefile.in 2018-02-13 18:03:17.000000000 +0000
+++ rsbackup-5.1/tests/Makefile.in 2018-07-27 17:34:39.000000000 +0000
@@ -441,7 +441,7 @@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-# Copyright © 2011-2015,17 Richard Kettlewell.
+# Copyright © 2011-2015,17-18 Richard Kettlewell.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -484,6 +484,7 @@
expect/store/overridden.html \
expect/store/duplicate.txt \
expect/store/overridden-stderr.txt \
+ expect/store/notmounted.txt \
expect/upgrade/interrupted-db.txt \
expect/upgrade/simple-db.txt \
expect/prune/createsecond.txt \
diff -Nru rsbackup-5.0/tests/setup.sh rsbackup-5.1/tests/setup.sh
--- rsbackup-5.0/tests/setup.sh 2018-01-27 16:40:36.000000000 +0000
+++ rsbackup-5.1/tests/setup.sh 2018-07-27 17:33:22.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright © 2011, 2012, 2014-17 Richard Kettlewell.
+# Copyright © 2011, 2012, 2014-18 Richard Kettlewell.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -41,12 +41,12 @@
mkdir ${WORKSPACE}/store1
echo device1 > ${WORKSPACE}/store1/device-id
- echo "store ${WORKSPACE}/store1" >> ${WORKSPACE}/config
+ echo "store --no-mounted ${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 "store --no-mounted ${WORKSPACE}/store2" >>${WORKSPACE}/config
echo "device device2" >> ${WORKSPACE}/config
echo "public true" >> ${WORKSPACE}/config
diff -Nru rsbackup-5.0/tests/store rsbackup-5.1/tests/store
--- rsbackup-5.0/tests/store 2016-03-14 17:14:05.000000000 +0000
+++ rsbackup-5.1/tests/store 2018-07-27 17:33:22.000000000 +0000
@@ -1,5 +1,5 @@
#! /usr/bin/env bash
-# Copyright © 2011, 2012, 2014, 2015 Richard Kettlewell.
+# Copyright © 2011, 2012, 2014-15, 2018 Richard Kettlewell.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -20,8 +20,20 @@
mv ${WORKSPACE}/store1 ${WORKSPACE}/store3
+echo "| Stores must be mount points normally"
+set +e
+STDERR=${WORKSPACE}/got/notmounted.txt RUN=store RSBACKUP_TODAY=1980-01-01 s ${RSBACKUP} --backup --store ${WORKSPACE}/store3
+status=$?
+set -e
+if [ $status != 1 ]; then
+ echo >&2 "FAILED: store mount check failed"
+ exit 1
+fi
+sed < ${WORKSPACE}/got/notmounted.txt > ${WORKSPACE}/got/notmounted-sed.txt "s,${WORKSPACE},,g"
+compare ${srcdir:-.}/expect/store/notmounted.txt ${WORKSPACE}/got/notmounted-sed.txt
+
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
+STDERR=${WORKSPACE}/got/overridden-stderr.txt RUN=store RSBACKUP_TODAY=1980-01-01 s ${RSBACKUP} --backup --unmounted-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
@@ -38,7 +50,7 @@
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
+STDERR=${WORKSPACE}/got/duplicate-stderr.txt RUN=store RSBACKUP_TODAY=1980-01-01 s ${RSBACKUP} --backup --unmounted-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