Skip to content

Commit

Permalink
sim: fix "backup restore" removing bin/ and lib/ subdirectories
Browse files Browse the repository at this point in the history
  • Loading branch information
varqox committed Oct 13, 2024
1 parent c04458f commit 0a58f47
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion subprojects/sim/src/backup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <simlib/syscalls.hh>
#include <simlib/throw_assert.hh>
#include <simlib/to_arg_seq.hh>
#include <simlib/utilities.hh>
#include <simlib/working_directory.hh>
#include <string>
#include <string_view>
Expand Down Expand Up @@ -359,7 +360,7 @@ void restore(ArgSeq::Iter begin, ArgSeq::Iter end) {
for_each_dir_component(dir_path, [&](dirent* entry) {
auto filename = string_view{entry->d_name};
path += filename;
if (path != DEFAULT_BACKUP_REPOSITORY_PATH) {
if (!is_one_of(path, DEFAULT_BACKUP_REPOSITORY_PATH, "bin", "lib")) {
bool absent = paths_present_in_backup.find(path) == paths_present_in_backup.end();
if (entry->d_type == DT_DIR) {
path += '/';
Expand Down

0 comments on commit 0a58f47

Please sign in to comment.