Skip to content

Commit

Permalink
Rename #includes with regex
Browse files Browse the repository at this point in the history
I used:
fd --type f '.*\.(?:(?:cpp)|(?:hpp)|(?:c)|(?:h))' --exec sed -i -E 's/#include <libdnf\/(.+)>/#include <libdnf5\/\1>/g' {}
fd --type f '.*\.(?:(?:cpp)|(?:hpp)|(?:c)|(?:h))' --exec sed -i -E 's/#include "libdnf\/(.+)"/#include "libdnf5\/\1"/g' {}
fd --type f '.*\.(?:(?:cpp)|(?:hpp)|(?:c)|(?:h))' --exec sed -i -E 's/#include "libdnf-cli\/(.+)"/#include "libdnf5-cli\/\1"/g' {}
fd --type f '.*\.(?:(?:cpp)|(?:hpp)|(?:c)|(?:h))' --exec sed -i -E 's/#include <libdnf-cli\/(.+)>/#include <libdnf5-cli\/\1>/g' {}

The pre-commit hook then rearranged many of the #includes.
  • Loading branch information
evan-goode authored and m-blaha committed Jun 21, 2023
1 parent 04c073f commit 7e82e0d
Show file tree
Hide file tree
Showing 469 changed files with 1,050 additions and 1,237 deletions.
5 changes: 2 additions & 3 deletions dnf5-plugins/builddep_plugin/builddep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.

#include "builddep.hpp"

#include "libdnf5-cli/exception.hpp"
#include "utils/bgettext/bgettext-mark-domain.h"
#include "utils/string.hpp"

#include "libdnf-cli/exception.hpp"

#include <dnf5/shared_options.hpp>
#include <libdnf/rpm/package_query.hpp>
#include <libdnf5/rpm/package_query.hpp>
#include <rpm/rpmbuild.h>

#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion dnf5-plugins/builddep_plugin/builddep.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.

#include <dnf5/context.hpp>
#include <dnf5/shared_options.hpp>
#include <libdnf/conf/option_bool.hpp>
#include <libdnf5/conf/option_bool.hpp>

#include <vector>

Expand Down
10 changes: 5 additions & 5 deletions dnf5-plugins/changelog_plugin/changelog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.

#include "changelog.hpp"

#include <libdnf-cli/output/changelogs.hpp>
#include <libdnf/conf/const.hpp>
#include <libdnf/conf/option_string.hpp>
#include <libdnf/rpm/package.hpp>
#include <libdnf/rpm/package_query.hpp>
#include <libdnf5-cli/output/changelogs.hpp>
#include <libdnf5/conf/const.hpp>
#include <libdnf5/conf/option_string.hpp>
#include <libdnf5/rpm/package.hpp>
#include <libdnf5/rpm/package_query.hpp>

#include <ctime>
#include <iomanip>
Expand Down
4 changes: 2 additions & 2 deletions dnf5-plugins/changelog_plugin/changelog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
#define DNF5_COMMANDS_CHANGELOG_HPP

#include <dnf5/context.hpp>
#include <libdnf/conf/option_bool.hpp>
#include <libdnf/conf/option_number.hpp>
#include <libdnf5/conf/option_bool.hpp>
#include <libdnf5/conf/option_number.hpp>

#include <memory>
#include <vector>
Expand Down
4 changes: 2 additions & 2 deletions dnf5-plugins/copr_plugin/copr_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
#include "os_release.hpp"

#include <glob.h>
#include <libdnf/base/base.hpp>
#include <libdnf/conf/config_parser.hpp>
#include <libdnf5/base/base.hpp>
#include <libdnf5/conf/config_parser.hpp>

namespace dnf5 {

Expand Down
2 changes: 1 addition & 1 deletion dnf5-plugins/copr_plugin/copr_disable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
#include "copr.hpp"
#include "copr_repo.hpp"

#include <libdnf/conf/const.hpp>
#include <libdnf5/conf/const.hpp>

using namespace libdnf5::cli;

Expand Down
2 changes: 1 addition & 1 deletion dnf5-plugins/copr_plugin/copr_enable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
#include "copr.hpp"
#include "copr_repo.hpp"

#include <libdnf/conf/const.hpp>
#include <libdnf5/conf/const.hpp>

using namespace libdnf5::cli;

Expand Down
2 changes: 1 addition & 1 deletion dnf5-plugins/copr_plugin/copr_remove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
#include "copr.hpp"
#include "copr_repo.hpp"

#include <libdnf/conf/const.hpp>
#include <libdnf5/conf/const.hpp>

using namespace libdnf5::cli;

Expand Down
4 changes: 2 additions & 2 deletions dnf5-plugins/copr_plugin/copr_repo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
#include "json.hpp"

#include <fnmatch.h>
#include <libdnf-cli/utils/userconfirm.hpp>
#include <libdnf/conf/const.hpp>
#include <libdnf5-cli/utils/userconfirm.hpp>
#include <libdnf5/conf/const.hpp>

#include <filesystem>
#include <fstream>
Expand Down
2 changes: 1 addition & 1 deletion dnf5-plugins/copr_plugin/copr_repo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
#include "helpers.hpp"
#include "json.hpp"

#include <libdnf/base/base.hpp>
#include <libdnf5/base/base.hpp>

#include <filesystem>

Expand Down
2 changes: 1 addition & 1 deletion dnf5-plugins/copr_plugin/download_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.

#include "download_file.hpp"

#include "libdnf/repo/file_downloader.hpp"
#include "libdnf5/repo/file_downloader.hpp"

#include <filesystem>

Expand Down
2 changes: 1 addition & 1 deletion dnf5-plugins/copr_plugin/download_file.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
#ifndef DNF5_COMMANDS_COPR_DOWNLOAD_FILE_HPP
#define DNF5_COMMANDS_COPR_DOWNLOAD_FILE_HPP

#include <libdnf/base/base.hpp>
#include <libdnf5/base/base.hpp>

#include <filesystem>

Expand Down
2 changes: 1 addition & 1 deletion dnf5-plugins/copr_plugin/helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
#ifndef DNF5_COMMANDS_COPR_HELPERS_HPP
#define DNF5_COMMANDS_COPR_HELPERS_HPP

#include <libdnf/utils/format.hpp>
#include <libdnf5/utils/format.hpp>

#include <iostream>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion dnf5-plugins/copr_plugin/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
#ifndef DNF5_COMMANDS_COPR_JSON_HPP
#define DNF5_COMMANDS_COPR_JSON_HPP

#include "libdnf/base/base.hpp"
#include "libdnf5/base/base.hpp"

#include <json.h>

Expand Down
12 changes: 5 additions & 7 deletions dnf5-plugins/repoclosure_plugin/repoclosure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.

#include "repoclosure.hpp"

#include "libdnf5-cli/argument_parser.hpp"
#include "libdnf5/conf/const.hpp"
#include "libdnf5/rpm/package.hpp"
#include "libdnf5/rpm/package_query.hpp"
#include "libdnf5/utils/format.hpp"
#include "utils/bgettext/bgettext-mark-domain.h"

#include "libdnf-cli/argument_parser.hpp"

#include "libdnf/conf/const.hpp"
#include "libdnf/rpm/package.hpp"
#include "libdnf/rpm/package_query.hpp"
#include "libdnf/utils/format.hpp"

#include <iostream>


Expand Down
4 changes: 2 additions & 2 deletions dnf5-plugins/repoclosure_plugin/repoclosure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.

#include <dnf5/context.hpp>
#include <dnf5/shared_options.hpp>
#include <libdnf-cli/session.hpp>
#include <libdnf/conf/option_string_list.hpp>
#include <libdnf5-cli/session.hpp>
#include <libdnf5/conf/option_string_list.hpp>

#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion dnf5/cmdline_aliases.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.

#include "cmdline_aliases.hpp"

#include <libdnf/common/preserve_order_map.hpp>
#include <libdnf5/common/preserve_order_map.hpp>
#include <toml.hpp>

#include <iostream>
Expand Down
4 changes: 2 additions & 2 deletions dnf5/commands/advisory/advisory_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.

#include "advisory_info.hpp"

#include <libdnf-cli/output/advisoryinfo.hpp>
#include <libdnf/rpm/package_query.hpp>
#include <libdnf5-cli/output/advisoryinfo.hpp>
#include <libdnf5/rpm/package_query.hpp>

#include <iostream>

Expand Down
6 changes: 3 additions & 3 deletions dnf5/commands/advisory/advisory_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.

#include "advisory_list.hpp"

#include "libdnf-cli/output/advisorylist.hpp"
#include "libdnf5-cli/output/advisorylist.hpp"

#include <libdnf/advisory/advisory_package.hpp>
#include <libdnf/rpm/package_query.hpp>
#include <libdnf5/advisory/advisory_package.hpp>
#include <libdnf5/rpm/package_query.hpp>

namespace dnf5 {

Expand Down
6 changes: 3 additions & 3 deletions dnf5/commands/advisory/advisory_subcommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.

#include "dnf5/context.hpp"

#include <libdnf-cli/output/advisorysummary.hpp>
#include <libdnf/conf/const.hpp>
#include <libdnf/rpm/package_query.hpp>
#include <libdnf5-cli/output/advisorysummary.hpp>
#include <libdnf5/conf/const.hpp>
#include <libdnf5/rpm/package_query.hpp>

namespace dnf5 {

Expand Down
2 changes: 1 addition & 1 deletion dnf5/commands/advisory/advisory_subcommand.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
#include "arguments.hpp"

#include <dnf5/context.hpp>
#include <libdnf/advisory/advisory_query.hpp>
#include <libdnf5/advisory/advisory_query.hpp>

#include <memory>

Expand Down
4 changes: 2 additions & 2 deletions dnf5/commands/advisory/advisory_summary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.

#include "advisory_summary.hpp"

#include <libdnf-cli/output/advisorysummary.hpp>
#include <libdnf/rpm/package_query.hpp>
#include <libdnf5-cli/output/advisorysummary.hpp>
#include <libdnf5/rpm/package_query.hpp>

namespace dnf5 {

Expand Down
2 changes: 1 addition & 1 deletion dnf5/commands/advisory/arguments.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.

#include "utils/bgettext/bgettext-lib.h"

#include <libdnf-cli/session.hpp>
#include <libdnf5-cli/session.hpp>

namespace dnf5 {

Expand Down
7 changes: 3 additions & 4 deletions dnf5/commands/advisory_shared.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
#define DNF5_COMMANDS_ARGUMENTS_HPP


#include "libdnf5/base/base_weak.hpp"
#include "utils/bgettext/bgettext-lib.h"
#include "utils/string.hpp"

#include "libdnf/base/base_weak.hpp"

#include <libdnf-cli/session.hpp>
#include <libdnf/advisory/advisory_query.hpp>
#include <libdnf5-cli/session.hpp>
#include <libdnf5/advisory/advisory_query.hpp>

#include <optional>

Expand Down
2 changes: 1 addition & 1 deletion dnf5/commands/autoremove/autoremove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.

#include "autoremove.hpp"

#include <libdnf/rpm/package_query.hpp>
#include <libdnf5/rpm/package_query.hpp>

namespace dnf5 {

Expand Down
2 changes: 1 addition & 1 deletion dnf5/commands/autoremove/autoremove.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
#define DNF5_COMMANDS_AUTOREMOVE_AUTOREMOVE_HPP

#include <dnf5/context.hpp>
#include <libdnf/conf/option_bool.hpp>
#include <libdnf5/conf/option_bool.hpp>

#include <memory>
#include <vector>
Expand Down
8 changes: 4 additions & 4 deletions dnf5/commands/check-upgrade/check-upgrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
#include "utils/bgettext/bgettext-mark-domain.h"

#include <dnf5/shared_options.hpp>
#include <libdnf-cli/output/changelogs.hpp>
#include <libdnf-cli/output/package_list_sections.hpp>
#include <libdnf/conf/const.hpp>
#include <libdnf/rpm/package_query.hpp>
#include <libdnf5-cli/output/changelogs.hpp>
#include <libdnf5-cli/output/package_list_sections.hpp>
#include <libdnf5/conf/const.hpp>
#include <libdnf5/rpm/package_query.hpp>

#include <iostream>

Expand Down
6 changes: 3 additions & 3 deletions dnf5/commands/check-upgrade/check-upgrade.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.

#include <dnf5/context.hpp>
#include <dnf5/shared_options.hpp>
#include <libdnf-cli/output/package_list_sections.hpp>
#include <libdnf/conf/option_bool.hpp>
#include <libdnf/rpm/package_set.hpp>
#include <libdnf5-cli/output/package_list_sections.hpp>
#include <libdnf5/conf/option_bool.hpp>
#include <libdnf5/rpm/package_set.hpp>

#include <memory>
#include <vector>
Expand Down
4 changes: 2 additions & 2 deletions dnf5/commands/clean/clean.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.

#include "utils/bgettext/bgettext-mark-domain.h"

#include <libdnf-cli/argument_parser.hpp>
#include <libdnf/repo/repo_cache.hpp>
#include <libdnf5-cli/argument_parser.hpp>
#include <libdnf5/repo/repo_cache.hpp>

#include <filesystem>
#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion dnf5/commands/distro-sync/distro-sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
#include "distro-sync.hpp"

#include <dnf5/shared_options.hpp>
#include <libdnf/conf/option_string.hpp>
#include <libdnf5/conf/option_string.hpp>

namespace dnf5 {

Expand Down
2 changes: 1 addition & 1 deletion dnf5/commands/distro-sync/distro-sync.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.

#include <dnf5/context.hpp>
#include <dnf5/shared_options.hpp>
#include <libdnf/conf/option_bool.hpp>
#include <libdnf5/conf/option_bool.hpp>

#include <memory>
#include <vector>
Expand Down
10 changes: 5 additions & 5 deletions dnf5/commands/download/download.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
#include "dnf5/shared_options.hpp"
#include "utils/bgettext/bgettext-mark-domain.h"

#include <libdnf/conf/option_string.hpp>
#include <libdnf/repo/package_downloader.hpp>
#include <libdnf/rpm/package.hpp>
#include <libdnf/rpm/package_query.hpp>
#include <libdnf/rpm/package_set.hpp>
#include <libdnf5/conf/option_string.hpp>
#include <libdnf5/repo/package_downloader.hpp>
#include <libdnf5/rpm/package.hpp>
#include <libdnf5/rpm/package_query.hpp>
#include <libdnf5/rpm/package_set.hpp>

#include <iostream>
#include <map>
Expand Down
2 changes: 1 addition & 1 deletion dnf5/commands/download/download.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
#define DNF5_COMMANDS_DOWNLOAD_DOWNLOAD_HPP

#include <dnf5/context.hpp>
#include <libdnf/conf/option.hpp>
#include <libdnf5/conf/option.hpp>

#include <memory>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion dnf5/commands/environment/arguments.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.

#include "utils/bgettext/bgettext-lib.h"

#include <libdnf-cli/session.hpp>
#include <libdnf5-cli/session.hpp>

namespace dnf5 {

Expand Down
10 changes: 5 additions & 5 deletions dnf5/commands/environment/environment_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.

#include "environment_info.hpp"

#include <libdnf-cli/output/environmentinfo.hpp>
#include <libdnf/comps/comps.hpp>
#include <libdnf/comps/environment/environment.hpp>
#include <libdnf/comps/environment/query.hpp>
#include <libdnf/conf/const.hpp>
#include <libdnf5-cli/output/environmentinfo.hpp>
#include <libdnf5/comps/comps.hpp>
#include <libdnf5/comps/environment/environment.hpp>
#include <libdnf5/comps/environment/query.hpp>
#include <libdnf5/conf/const.hpp>

namespace dnf5 {

Expand Down
Loading

0 comments on commit 7e82e0d

Please sign in to comment.