Page MenuHomePhabricator

[backport#15880] utils and libraries: Replace deprecated Boost Filesystem functions
ClosedPublic

Authored by majcosta on Sep 4 2020, 15:31.

Details

Summary

Replace deprecated Boost Filesystem function (Hennadii Stepanov)
Remove dead code for walletFile check (Hennadii Stepanov)

Pull request description:

Boost Filesystem `basename()` and `extension()` functions are [deprecated since v1.36.0](https://www.boost.org/doc/libs/1_36_0/libs/filesystem/doc/reference.html#Convenience-functions).

See more: https://lists.boost.org/Archives/boost/2010/01/160905.php

Also this PR prevents further use of deprecated Boost Filesystem functions.
Ref: https://www.boost.org/doc/libs/1_64_0/libs/filesystem/doc/index.htm#Coding-guidelines

Note: On my Linux system Boost 1.65.1 header `/usr/include/boost/filesystem/convenience.hpp` contains:
```c++
# ifndef BOOST_FILESYSTEM_NO_DEPRECATED

    inline std::string extension(const path & p)
    {
      return p.extension().string();
    }

    inline std::string basename(const path & p)
    {
      return p.stem().string();
    }

    inline path change_extension( const path & p, const path & new_extension )
    {
      path new_p( p );
      new_p.replace_extension( new_extension );
      return new_p;
    }

# endif
```

UPDATE:
Also removed unused code as [noted](https://github.com/bitcoin/bitcoin/pull/15880#discussion_r279386614) by **ryanofsky**.

Backport of Core PR15880 and PR17654 (to unbreak PR15880)

Test Plan
ninja check check-functional

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

majcosta requested review of this revision.Sep 4 2020, 15:31

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

this breaks building on Boost 1.59 which is currently our minimum. Going to squash PR17654 onto this.

This revision is now accepted and ready to land.Sep 4 2020, 19:35