Skip to content

Commit

Permalink
Merge branch 'branch_2.7.x' into no_last_slice
Browse files Browse the repository at this point in the history
  • Loading branch information
Edrusb committed Jun 23, 2024
2 parents 062d0fe + 26348e7 commit 26aea8b
Show file tree
Hide file tree
Showing 31 changed files with 140 additions and 50 deletions.
6 changes: 6 additions & 0 deletions THANKS
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
version 2.7.15
--------------
Thanks to James Pedersen for feedback, thanks to Rolf Gebhardt for
investigations and help. Thanks to Dennis Alexis Valin Dittrich
for Feedback and bug report.

version 2.7.13
--------------
Thanks to Thomas, Andrea Vai, John Goerzen and Rolf Gebhardt for having
Expand Down
21 changes: 21 additions & 0 deletions doc/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
#######################################################################
# dar - disk archive - a backup/restoration program
# Copyright (C) 2002-2024 Denis Corbin
#
# This program is free software; you can 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# to contact the author, see the AUTHOR file
#######################################################################

SUBDIRS = samples mini-howto man
dist_noinst_DATA = COMMAND_LINE Doxyfile portable_cp Benchmark_tools/README Benchmark_tools/always_change Benchmark_tools/bitflip Benchmark_tools/build_test_tree.bash Benchmark_tools/hide_change Benchmark_tools/historization_feature restoration_dependencies.txt
dist_pkgdata_DATA = README Features.html Limitations.html Notes.html Tutorial.html Good_Backup_Practice.html FAQ.html api_tutorial.html dar_doc.jpg dar_s_doc.jpg index.html dar-catalog.dtd authentification.html dar_key.txt old_dar_key1.txt old_dar_key2.txt from_sources.html presentation.html usage_notes.html python/libdar_test.py style.css restoration-with-dar.html benchmark.html benchmark_logs.html index_dar.html index_internal.html index_libdar.html
Expand Down
12 changes: 7 additions & 5 deletions man/dar.1
Original file line number Diff line number Diff line change
Expand Up @@ -352,17 +352,19 @@ The mask is a string with wildcards (like * and ? see glob(7) for details) which
The mask is applied to filenames which are not directories (see glob(7) for details on wildcard characters). If a given file matches the mask and does not match any mask given with -X, the file is selected for the operation. By default (no -I and no -X on the command line), all files are included for the operation. -I may be present several times on the command line, in that case all files that match one of the -I mask will be considered for the given operation, if they do not also match one of the -X mask. See also -ar and -am options.
.TP 20
-P, --prune <path>
Do not consider file or directory sub-tree given by the path. -P may be present several time on the command line. The difference with -X is that the mask is not applied only to the filename, but also include the path. Moreover it applies also to directories (-X does not). By default (no -P on the command-line), no sub-tree or file is excluded from the operation, and the whole directory tree (as indicated by -R option) is considered. Note that <path> may contains wildcards like * or ? see
Do not consider file or directory sub-tree given by the path. -P may be present several time on the command line. The difference with -X is that the mask is not applied only to the filename, but also includes the path. Moreover it applies also to directories (-X does not). By default (no -P on the command-line), no sub-tree or file is excluded from the operation, and the whole directory tree (as indicated by -R option) is considered. Note that <path> may contains wildcards like * or ? see
.B glob(7)
man page for more information.
or
.B regex(7)
man page for more information as well as -ar option to use regex instread of glob expressions.
.TP 20
-g, --go-into <path>
Files or directory to only take in account, as opposed to -P. -g may be present several time on command-line. Same thing here, the difference with -I is that the mask is applied to the path+filename and also concerns directories. By default all files under the -R directory are considered. Else, if one or more -g option is given, just those are selected (if they do not match any -P option). All paths given this way must be relative to the -R directory, which defaults to current directory.
Files or directory to only take in account, as opposed to -P. -g may be used several time on command-line. Same thing here, the difference with -I is that the mask is applied to the path+filename and also concerns directories. By default all files under the -R directory are considered. Else, if one or more -g option is given, just those are selected (if they do not match any -P option). All paths given this way must be relative to the -R directory, which defaults to current directory.
.B Warning,
-g option cannot receive wildcards, these would not be interpreted.
.TP 20
-[, --include-from-file <listing_file>
Files listed in the listing file are included for the operation. No wildcard expression is interpreted in the listing file, the null character is not allowed and the carriage return is used to separate file names (one file name per line) each line must not exceed 20479 bytes. Note that this option applies to any files and directory exactly as -g does, with an important difference however: -g option only uses relative paths to the root directory (the directory given with the -R option), while -[ can use absolute path as well. Another difference is when the argument is a directory -g will include all the subdirectories under that directory, while when the same entry is found in a listing file given to -[ only that directory will be included, no subdirectory or subfile would be enrolled in the backup, with -[ you need to list the exact set of file you want to backup. You can thus generate a listing file with the 'find / -print > somefile' command and give 'somefile' as argument to -[ option. Note that however, dar will never save files out of the -R given root directory tree, even if some are listed in the 'somefile' file.
Files listed in the listing file are included for the operation. No wildcard expression is interpreted in the listing file, the null character is not allowed and the carriage return is used to separate file names (one file name per line) each line must not exceed 20479 bytes. Note that this option applies to any files and directory exactly as -g does, with an important difference however: -g option only uses relative paths to the root directory (the directory given with the -R option), while -[ can use absolute path as well but only for operations that have a fs_root argument (archive creation, comparison, extraction, and so on, but not for archive listing, testing and merging). Another difference is when the argument is a directory -g will include all the subdirectories under that directory, while when the same entry is found in a listing file given to -[ option, only that directory will be included, no subdirectory or subfile would be enrolled in the backup. With -[ you need to list the exact set of file you want to backup. You can thus generate a listing file with the 'find / -print > somefile' command and give 'somefile' as argument to -[ option. Note that however, dar will never save files out of the -R given root directory tree, even if some are listed in the 'somefile' file.
.TP 20
-], --exclude-from-file <listing_file>
Files listed in the listing file are excluded from the operation. If a directory is listed in the file, all its contents is excluded. This option is the opposite of -[ and acts the same was as -P option does (in particular it is compared to the whole path+filename and applies to files and directories). As for -[ option, -] listing file can contain absolute paths, but wildcards are not expanded, neither.
Expand All @@ -375,7 +377,7 @@ since version 2.2.0 two modes of interpretation of these options exist. The norm
.RS
.TP 5
the normal method is the default and is the one that has been presented above:
A directory is elected for operation if no -P or -] option excludes it. If at least one -g or -[ option is given one command line, one -g or -[ option must cover it, else it is not elected for operation. If a directory is not selected, no recursion is done in it (the directory is pruned). For non directories files, the same is true (P, -g, -[ and -] do apply) and a second test must also be satisfied: no -X option must exclude the filename, and if at least one -I option is given, one must match the given filename (using or not wildcards).
A directory is elected for operation if no -P or -] option excludes it. If at least one -g or -[ option is given on command line, one -g or -[ option must cover it, else it is not elected for operation. If a directory is not selected, no recursion is done in it (the directory is pruned). For non directories files, the same is true (P, -g, -[ and -] do apply) and a second test must also be satisfied: no -X option must exclude the filename, and if at least one -I option is given, one must match the given filename (using or not wildcards).
.TP 5
the ordered method (when -am option is given on command-line):
The ordered method takes care of the order of presence between -X and -I in one hand and of -P, -g, -[ and -] in the other hand (note that it has also the same action concerning EA selection when using -u and -U options, but that's no more file selection). In the ordered method the last argument take precedence over all the previous ones, let's take an example:
Expand Down
10 changes: 10 additions & 0 deletions src/build/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ from 2.7.x to 2.8.0
than the last slice to fetch archive format when reading an archive with
the help of an external catalog in direct access mode.

from 2.7.14 to 2.7.15
- updating libdar about CURLINFO_CONTENT_LENGTH_DOWNLOAD symbol which is
reported as deprecated by recent libcurl libraries.
- fixed compilation problem under MacOS Mojave
- fixed bug that lead the warning about a backup operation about to save
the backup itslef, to not show
- removing obsolete call to gcry_control(GCRYCTL_ENABLE_M_GUARD) while
initializing libgcrypt. This lead to libgcrypt initialization to fail
with libgcrypt 1.11 and more recent versions.

from 2.7.13 to 2.7.14
- adding safe guard in fichier_libcurl destructor to verify all data have
been passed to libcurl *and* libcurl has completed the writing operation
Expand Down
2 changes: 1 addition & 1 deletion src/build/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.69)
AC_INIT([DAR], [2.7.14_no_last_slice], [[https://github.com/Edrusb/DAR/issues]])
AC_INIT([DAR], [2.7.15.RC3_no_last_slice], [[https://github.com/Edrusb/DAR/issues]])
AC_CONFIG_HEADERS([config.h])
AC_LANG([C++])
AC_CONFIG_SRCDIR([src/libdar/catalogue.cpp])
Expand Down
72 changes: 64 additions & 8 deletions src/libdar/archive_options.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,15 @@ namespace libdar
/// defines the filenames to only save (except directory) as those that match the given mask
void set_selection(const mask & selection);

/// defines the directory and files to consider (this mask will be applied to the absolute path of files being proceeded)
/// defines the directories and files to consider

/// \note WARNING: this mask will be applied to the absolute path of files being proceeded.
/// We speak here about the root of the filesystem under which the fs_root directory contains
/// the files to backup. This is independent from the fs_root argument of class archive
/// constructor which objective is to reduce the perimeter of the backup. The subtree filters
/// do not compare only to the path inside the fs_root directory but to the full path,
/// including the fs_root directory. In other words, if the subtree mask do not accept
/// anything under fs_root path, the resulting backup will be empty.
void set_subtree(const mask & subtree);

/// defines whether overwritting is allowed or not
Expand Down Expand Up @@ -1000,7 +1008,17 @@ namespace libdar
/// defines the filenames to only save (except directory) as those that match the given mask
void set_selection(const mask & selection);

/// defines the directory and files to consider (this mask will be applied to the absolute path of files being proceeded)
/// defines the directories and files to consider

/// \note WARNING: The filter mechanism used here is common to all operations and works
/// by comparing full paths, while in the other hand, paths stored in the libdar archive are
/// all relative to what was provided as fs_root at backup time. To have this filter mecanism
/// working in the context of merging, where no fs_root can be provided to transform relative
/// paths to absolute paths, libdar will emulate an fs_root with the pseudo root value of the
/// path::FAKE_ROOT field. This is invisible form the libdar API user except when relying on
/// mask_list objects, which cannot thus receive full path as those would not be prepended
/// by path::FAKE_ROOT as fs_root value, because fs_root prefixing is only performed for relative
/// paths.
void set_subtree(const mask & subtree);

/// defines whether overwritting is allowed or not
Expand Down Expand Up @@ -1312,7 +1330,17 @@ namespace libdar
/// defines the filenames to only save (except directory) as those that match the given mask
void set_selection(const mask & selection);

/// defines the directory and files to consider (this mask will be applied to the absolute path of files being proceeded)
/// defines the directories and files to consider

/// \note WARNING: The filter mechanism used here is common to all operations and works
/// by comparing full paths, while in the other hand, paths stored in the libdar archive are
/// all relative paths to what was provided as fs_root at backup time. To have this filter mecanism
/// working in the context of restoration, libdar prepends the relative path found in the libdar
/// archive with the fs_root argument given to archive::op_extract.
/// In consequence the provided filter here, for extraction operation should be build taking into
/// account that files to restore will be seen as subdirectories of this provided "fs_root" where
/// the data will be restored. In other words, if the subtree mask do not accept anything under
/// fs_root path, the resulting backup will be empty.
void set_subtree(const mask & subtree);

/// defines whether a warning shall be issued before overwriting
Expand Down Expand Up @@ -1469,9 +1497,17 @@ namespace libdar
/// \note this mask does not reject directory (it does not apply to it)
void set_selection(const mask & selection);

/// mask applied to the full path, only those matching it will be listed

/// \note a directory excluded by it implies all its content to be excluded (pruned)
/// defines the directories and files to consider

/// \note WARNING: The filter mechanism used here is common to all operations and works
/// by comparing full paths, while in the other hand, paths stored in the libdar archive are
/// all relative to what was provided as fs_root at backup time. To have this filter mecanism
/// working in the context of listing, where no fs_root can be provided to transform relative
/// paths to absolute paths, libdar will emulate an fs_root with the pseudo root value of the
/// path::FAKE_ROOT field. This is invisible form the libdar API user except when relying on
/// mask_list objects, which cannot thus receive full path as those would not be prepended
/// by path::FAKE_ROOT as fs_root value, because fs_root prefixing is only performed for relative
/// paths.
void set_subtree(const mask & subtree);

/// whether to only show entries that have their data fully saved
Expand Down Expand Up @@ -1543,7 +1579,17 @@ namespace libdar
/// list of filenames to consider (directory not concerned by this fiter)
void set_selection(const mask & selection);

/// defines the directory and files to consider (this mask will be applied to the absolute path of files being proceeded)
/// defines the directories and files to consider

/// \note WARNING: The filter mechanism used here is common to all operations and works
/// by comparing full paths, while in the other hand, paths stored in the libdar archive are
/// all relative paths to what was provided as fs_root at backup time. To have this filter mecanism
/// working in the context of restoration, libdar prepends the relative path found in the libdar
/// archive with the fs_root argument given to archive::op_diff method.
/// In consequence the provided filter here, for comparison operation should be build taking into
/// account that files to compare will be seen as subdirectories of this provided "fs_root" the
/// the archive will be compared to. In other words, if the subtree mask do not accept anything under
/// the provided fs_root path, no file will be compared to what is on the filesystem.
void set_subtree(const mask & subtree);

/// whether the user needs detailed output of the operation
Expand Down Expand Up @@ -1663,7 +1709,17 @@ namespace libdar
/// list of filenames to consider (directory not concerned by this fiter)
void set_selection(const mask & selection);

/// defines the directory and files to consider (this mask will be applied to the absolute path of files being proceeded)
/// defines the directories and files to consider

/// \note WARNING: The filter mechanism used here is common to all operations and works
/// by comparing full paths, while in the other hand, paths stored in the libdar archive are
/// all relative to what was provided as fs_root at backup time. To have this filter mecanism
/// working in the context of testing, where no fs_root can be provided to transform relative
/// paths to absolute paths, libdar will emulate an fs_root with the pseudo root value of the
/// path::FAKE_ROOT field. This is invisible form the libdar API user except when relying on
/// mask_list objects, which cannot thus receive full path as those would not be prepended
/// by path::FAKE_ROOT as fs_root value, because fs_root prefixing is only performed for relative
/// paths.
void set_subtree(const mask & subtree);

/// whether the user needs detailed output of the operation
Expand Down
2 changes: 1 addition & 1 deletion src/libdar/cat_blockdev.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace libdar
cat_blockdev(const cat_blockdev & ref) = default;
cat_blockdev(cat_blockdev && ref) noexcept = default;
cat_blockdev & operator = (const cat_blockdev & ref) = default;
cat_blockdev & operator = (cat_blockdev && ref) noexcept = default;
cat_blockdev & operator = (cat_blockdev && ref) = default;
~cat_blockdev() = default;

virtual bool operator == (const cat_entree & ref) const override;
Expand Down
2 changes: 1 addition & 1 deletion src/libdar/cat_chardev.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ namespace libdar
cat_chardev(const cat_chardev & ref) = default;
cat_chardev(cat_chardev && ref) noexcept = default;
cat_chardev & operator = (const cat_chardev & ref) = default;
cat_chardev & operator = (cat_chardev && ref) noexcept = default;
cat_chardev & operator = (cat_chardev && ref) = default;
~cat_chardev() = default;


Expand Down
2 changes: 1 addition & 1 deletion src/libdar/cat_detruit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace libdar
cat_detruit(const cat_detruit & ref) = default;
cat_detruit(cat_detruit && ref) noexcept = default;
cat_detruit & operator = (const cat_detruit & ref) = default;
cat_detruit & operator = (cat_detruit && ref) noexcept = default;
cat_detruit & operator = (cat_detruit && ref) = default;
~cat_detruit() = default;

virtual bool operator == (const cat_entree & ref) const override;
Expand Down
2 changes: 1 addition & 1 deletion src/libdar/cat_device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace libdar
cat_device(const cat_device & ref) = default;
cat_device(cat_device && ref) noexcept = default;
cat_device & operator = (const cat_device & ref) = default;
cat_device & operator = (cat_device && ref) noexcept = default;
cat_device & operator = (cat_device && ref) = default;
~cat_device() = default;

virtual bool operator == (const cat_entree & ref) const override;
Expand Down
Loading

0 comments on commit 26aea8b

Please sign in to comment.