From 974026cb71ec91dd0203bca71c0b835483986cab Mon Sep 17 00:00:00 2001 From: Paul Dreik Date: Sat, 14 Aug 2021 10:01:32 +0200 Subject: [PATCH 1/4] drop autoconf C++11 workaround for lgtm --- lgtm.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/lgtm.yml b/lgtm.yml index 6b1ff87..a159312 100644 --- a/lgtm.yml +++ b/lgtm.yml @@ -6,6 +6,5 @@ extraction: - nettle-dev configure: command: - - grep -v AX_CXX_COMPILE_STDCXX tmp && mv tmp configure.ac - ./bootstrap.sh - ./configure From c71ac53eb047858d600380f766ad235f8787819a Mon Sep 17 00:00:00 2001 From: Paul Dreik Date: Sun, 15 Aug 2021 20:26:50 +0200 Subject: [PATCH 2/4] add github action compiling with gcc11 --- .github/workflows/gcc11.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/gcc11.yml diff --git a/.github/workflows/gcc11.yml b/.github/workflows/gcc11.yml new file mode 100644 index 0000000..e82094f --- /dev/null +++ b/.github/workflows/gcc11.yml @@ -0,0 +1,29 @@ +name: gcc 11 + +on: [push, pull_request] + + +jobs: + build: + name: Compiles with gcc 11 + runs-on: ubuntu-20.04 + + steps: + - name: checkout + uses: actions/checkout@v2 + - name: install packages + run: sudo apt install build-essential nettle-dev time gcc-11 g++-11 + - name: bootstrap + run: ./bootstrap.sh + - name: configure + run: ./configure CXX=g++-11 + - name: build + run: make + - name: check + run: make check + - name: store the logs as an artifact + if: ${{ always() }} + uses: actions/upload-artifact@v2.2.4 + with: + path: '**/*.log' + From 61877de88d782b63b17458a61fcc078391499b29 Mon Sep 17 00:00:00 2001 From: Paul Dreik Date: Sun, 15 Aug 2021 20:31:31 +0200 Subject: [PATCH 3/4] include (thanks to tastytea) --- rdfind.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/rdfind.cc b/rdfind.cc index fbd6cb8..64dd8f6 100644 --- a/rdfind.cc +++ b/rdfind.cc @@ -9,6 +9,7 @@ // std #include #include +#include #include #include From d3c6a523bf531fe4bf46c8b13397b111b3fb6634 Mon Sep 17 00:00:00 2001 From: Gabor Szabo Date: Thu, 15 Sep 2022 14:37:50 +0300 Subject: [PATCH 4/4] allow for '-checksum none' to disable checksum filtering. #118 --- rdfind.cc | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/rdfind.cc b/rdfind.cc index 64dd8f6..cd35314 100644 --- a/rdfind.cc +++ b/rdfind.cc @@ -61,7 +61,7 @@ usage() << " -followsymlinks true |(false) follow symlinks\n" << " -removeidentinode (true)| false ignore files with nonunique " "device and inode\n" - << " -checksum md5 |(sha1)| sha256\n" + << " -checksum md5 |(sha1)| sha256 | none\n" << " checksum type\n" << " -deterministic (true)| false makes results independent of order\n" << " from listing the filesystem\n" @@ -103,6 +103,7 @@ struct Options bool followsymlinks = false; // follow symlinks bool dryrun = false; // only dryrun, don't destroy anything bool remove_identical_inode = true; // remove files with identical inodes + bool checksum = true; // use some checksum bool usemd5 = false; // use md5 checksum to check for similarity bool usesha1 = false; // use sha1 checksum to check for similarity bool usesha256 = false; // use sha256 checksum to check for similarity @@ -174,8 +175,10 @@ parseOptions(Parser& parser) o.usesha1 = true; } else if (parser.parsed_string_is("sha256")) { o.usesha256 = true; + } else if (parser.parsed_string_is("none")) { + o.checksum = false; } else { - std::cerr << "expected md5/sha1/sha256, not \"" + std::cerr << "expected md5/sha1/sha256/none, not \"" << parser.get_parsed_string() << "\"\n"; std::exit(EXIT_FAILURE); } @@ -237,8 +240,10 @@ parseOptions(Parser& parser) // done with parsing of options. remaining arguments are files and dirs. // decide what checksum to use - if no checksum is set, force sha1! - if (!o.usemd5 && !o.usesha1 && !o.usesha256) { - o.usesha1 = true; + if (o.checksum) { + if (!o.usemd5 && !o.usesha1 && !o.usesha256) { + o.usesha1 = true; + } } return o; } @@ -356,17 +361,19 @@ main(int narg, const char* argv[]) { Fileinfo::readtobuffermode::READ_FIRST_BYTES, "first bytes" }, { Fileinfo::readtobuffermode::READ_LAST_BYTES, "last bytes" }, }; - if (o.usemd5) { - modes.emplace_back(Fileinfo::readtobuffermode::CREATE_MD5_CHECKSUM, - "md5 checksum"); - } - if (o.usesha1) { - modes.emplace_back(Fileinfo::readtobuffermode::CREATE_SHA1_CHECKSUM, - "sha1 checksum"); - } - if (o.usesha256) { - modes.emplace_back(Fileinfo::readtobuffermode::CREATE_SHA256_CHECKSUM, - "sha256 checksum"); + if (o.checksum) { + if (o.usemd5) { + modes.emplace_back(Fileinfo::readtobuffermode::CREATE_MD5_CHECKSUM, + "md5 checksum"); + } + if (o.usesha1) { + modes.emplace_back(Fileinfo::readtobuffermode::CREATE_SHA1_CHECKSUM, + "sha1 checksum"); + } + if (o.usesha256) { + modes.emplace_back(Fileinfo::readtobuffermode::CREATE_SHA256_CHECKSUM, + "sha256 checksum"); + } } for (auto it = modes.begin() + 1; it != modes.end(); ++it) {