aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-24 13:28:45 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-24 15:47:41 +0100
commit49750cc61904ba17060521bd345c6ae526fb1bf8 (patch)
tree8aa8c06a7d6ec58c62dd0741011e8357a19c8b8d
parent75f48bbb1ae368febe984c10c2db2d0b5cbd7cec (diff)
downloadpaludis-49750cc61904ba17060521bd345c6ae526fb1bf8.tar.gz
paludis-49750cc61904ba17060521bd345c6ae526fb1bf8.tar.xz
FSEntry -> FSPath, FSStat
Fixes: ticket:967
-rw-r--r--.gitignore3
-rw-r--r--doc/api/cplusplus/examples/example_contents.cc2
-rw-r--r--doc/api/cplusplus/examples/example_dep_label.cc2
-rw-r--r--doc/api/cplusplus/examples/example_dep_spec_flattener.cc2
-rw-r--r--doc/api/cplusplus/examples/example_match_package.cc2
-rw-r--r--doc/api/cplusplus/examples/example_metadata_key.cc8
-rw-r--r--doc/api/cplusplus/examples/example_selection.cc2
-rw-r--r--paludis/action.hh9
-rw-r--r--paludis/broken_linkage_configuration.cc111
-rw-r--r--paludis/broken_linkage_configuration.hh10
-rw-r--r--paludis/broken_linkage_configuration_TEST.cc16
-rw-r--r--paludis/broken_linkage_finder.cc87
-rw-r--r--paludis/broken_linkage_finder.hh22
-rw-r--r--paludis/comma_separated_dep_printer.cc1
-rw-r--r--paludis/contents.cc18
-rw-r--r--paludis/contents.hh14
-rw-r--r--paludis/dep_spec.cc3
-rw-r--r--paludis/dep_spec.hh6
-rw-r--r--paludis/dep_spec_data.hh4
-rw-r--r--paludis/dep_tag.cc4
-rw-r--r--paludis/dep_tag.hh8
-rw-r--r--paludis/distribution.cc6
-rw-r--r--paludis/distribution.hh4
-rw-r--r--paludis/elf_linkage_checker.cc49
-rw-r--r--paludis/elf_linkage_checker.hh12
-rw-r--r--paludis/environment.hh15
-rw-r--r--paludis/environment_factory.cc2
-rw-r--r--paludis/environment_factory.hh1
-rw-r--r--paludis/environment_implementation.cc22
-rw-r--r--paludis/environment_implementation.hh8
-rw-r--r--paludis/environments/no_config/no_config_environment.cc56
-rw-r--r--paludis/environments/no_config/no_config_environment.hh17
-rw-r--r--paludis/environments/no_config/no_config_environment_TEST.cc7
-rw-r--r--paludis/environments/no_config/registration.cc14
-rw-r--r--paludis/environments/paludis/bashable_conf.cc7
-rw-r--r--paludis/environments/paludis/bashable_conf.hh8
-rw-r--r--paludis/environments/paludis/keywords_conf.cc2
-rw-r--r--paludis/environments/paludis/keywords_conf.hh4
-rw-r--r--paludis/environments/paludis/licenses_conf.cc2
-rw-r--r--paludis/environments/paludis/licenses_conf.hh4
-rw-r--r--paludis/environments/paludis/mirrors_conf.cc2
-rw-r--r--paludis/environments/paludis/mirrors_conf.hh2
-rw-r--r--paludis/environments/paludis/output_conf.cc2
-rw-r--r--paludis/environments/paludis/output_conf.hh4
-rw-r--r--paludis/environments/paludis/package_mask_conf.cc2
-rw-r--r--paludis/environments/paludis/package_mask_conf.hh4
-rw-r--r--paludis/environments/paludis/paludis_config.cc179
-rw-r--r--paludis/environments/paludis/paludis_config.hh5
-rw-r--r--paludis/environments/paludis/paludis_environment.cc83
-rw-r--r--paludis/environments/paludis/paludis_environment.hh14
-rw-r--r--paludis/environments/paludis/paludis_environment_TEST.cc11
-rw-r--r--paludis/environments/paludis/use_conf.cc3
-rw-r--r--paludis/environments/paludis/use_conf.hh4
-rw-r--r--paludis/environments/paludis/world.cc16
-rw-r--r--paludis/environments/paludis/world.hh6
-rw-r--r--paludis/environments/paludis/world_TEST.cc3
-rw-r--r--paludis/environments/portage/portage_environment.cc106
-rw-r--r--paludis/environments/portage/portage_environment.hh22
-rw-r--r--paludis/environments/portage/portage_environment_TEST.cc6
-rw-r--r--paludis/environments/test/test_environment.cc24
-rw-r--r--paludis/environments/test/test_environment.hh10
-rw-r--r--paludis/file_output_manager.cc16
-rw-r--r--paludis/file_output_manager.hh5
-rw-r--r--paludis/filter.cc11
-rw-r--r--paludis/filter.hh4
-rw-r--r--paludis/filter_TEST.cc4
-rw-r--r--paludis/forward_at_finish_output_manager.cc1
-rw-r--r--paludis/fs_merger-fwd.hh1
-rw-r--r--paludis/fs_merger.cc158
-rw-r--r--paludis/fs_merger.hh103
-rw-r--r--paludis/fs_merger_TEST.cc198
-rw-r--r--paludis/hooker.cc50
-rw-r--r--paludis/hooker.hh6
-rw-r--r--paludis/hooker_TEST.cc33
-rw-r--r--paludis/ipc_output_manager.cc1
-rw-r--r--paludis/legacy/dep_list_TEST.hh1
-rw-r--r--paludis/legacy/range_rewriter.cc2
-rw-r--r--paludis/legacy/uninstall_task.cc2
-rw-r--r--paludis/libtool_linkage_checker.cc24
-rw-r--r--paludis/libtool_linkage_checker.hh12
-rw-r--r--paludis/linkage_checker.hh10
-rw-r--r--paludis/literal_metadata_key.cc33
-rw-r--r--paludis/literal_metadata_key.hh23
-rw-r--r--paludis/mask.cc3
-rw-r--r--paludis/mask.hh4
-rw-r--r--paludis/match_package.cc1
-rw-r--r--paludis/merger-fwd.hh1
-rw-r--r--paludis/merger.cc65
-rw-r--r--paludis/merger.hh44
-rw-r--r--paludis/metadata_key.cc6
-rw-r--r--paludis/metadata_key.hh6
-rw-r--r--paludis/ndbam.cc82
-rw-r--r--paludis/ndbam.hh10
-rw-r--r--paludis/ndbam_merger.cc41
-rw-r--r--paludis/ndbam_merger.hh26
-rw-r--r--paludis/ndbam_unmerger.cc48
-rw-r--r--paludis/ndbam_unmerger.hh11
-rw-r--r--paludis/notifier_callback.cc4
-rw-r--r--paludis/notifier_callback.hh8
-rw-r--r--paludis/output_manager_factory.cc2
-rw-r--r--paludis/package_id.hh4
-rw-r--r--paludis/paludislike_options_conf.cc4
-rw-r--r--paludis/paludislike_options_conf.hh8
-rw-r--r--paludis/partially_made_package_dep_spec.cc8
-rw-r--r--paludis/partially_made_package_dep_spec.hh3
-rw-r--r--paludis/python_hooks.cc13
-rw-r--r--paludis/repositories/accounts/accounts_id.cc16
-rw-r--r--paludis/repositories/accounts/accounts_id.hh4
-rw-r--r--paludis/repositories/accounts/accounts_repository.cc10
-rw-r--r--paludis/repositories/accounts/accounts_repository.hh6
-rw-r--r--paludis/repositories/accounts/accounts_repository_store.cc35
-rw-r--r--paludis/repositories/accounts/accounts_repository_store.hh12
-rw-r--r--paludis/repositories/accounts/installed_accounts_id.cc2
-rw-r--r--paludis/repositories/accounts/installed_accounts_id.hh2
-rw-r--r--paludis/repositories/accounts/passwd_accounts_handler.cc1
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc24
-rw-r--r--paludis/repositories/cran/cran_installed_repository.hh9
-rw-r--r--paludis/repositories/cran/cran_package_id.cc13
-rw-r--r--paludis/repositories/cran/cran_package_id.hh5
-rw-r--r--paludis/repositories/cran/cran_repository.cc35
-rw-r--r--paludis/repositories/cran/cran_repository.hh13
-rw-r--r--paludis/repositories/cran/dep_spec_pretty_printer.cc1
-rw-r--r--paludis/repositories/cran/keys.hh1
-rw-r--r--paludis/repositories/cran/package_dep_spec.cc2
-rw-r--r--paludis/repositories/e/check_fetched_files_visitor.cc25
-rw-r--r--paludis/repositories/e/check_fetched_files_visitor.hh9
-rw-r--r--paludis/repositories/e/dep_spec_pretty_printer.cc1
-rw-r--r--paludis/repositories/e/depend_rdepend_TEST.cc12
-rw-r--r--paludis/repositories/e/e_installed_repository.cc37
-rw-r--r--paludis/repositories/e/e_installed_repository.hh4
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc112
-rw-r--r--paludis/repositories/e/e_installed_repository_id.hh5
-rw-r--r--paludis/repositories/e/e_key.cc29
-rw-r--r--paludis/repositories/e/e_key.hh7
-rw-r--r--paludis/repositories/e/e_repository.cc313
-rw-r--r--paludis/repositories/e/e_repository.hh17
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc151
-rw-r--r--paludis/repositories/e/e_repository_TEST_0.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_1.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_2.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_3.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_4.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc6
-rw-r--r--paludis/repositories/e/e_repository_TEST_ever.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_exheres_0.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_exlibs.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_pbin.cc27
-rw-r--r--paludis/repositories/e/e_repository_TEST_phases.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_replacing.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc18
-rw-r--r--paludis/repositories/e/e_repository_mask_file.cc2
-rw-r--r--paludis/repositories/e/e_repository_mask_file.hh3
-rw-r--r--paludis/repositories/e/e_repository_news.cc32
-rw-r--r--paludis/repositories/e/e_repository_news.hh5
-rw-r--r--paludis/repositories/e/e_repository_params.hh27
-rw-r--r--paludis/repositories/e/e_repository_sets.cc32
-rw-r--r--paludis/repositories/e/e_repository_sets_TEST.cc8
-rw-r--r--paludis/repositories/e/e_stripper.cc11
-rw-r--r--paludis/repositories/e/e_stripper.hh15
-rw-r--r--paludis/repositories/e/eapi.cc4
-rw-r--r--paludis/repositories/e/ebuild.cc24
-rw-r--r--paludis/repositories/e/ebuild.hh71
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache.cc107
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache.hh3
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc278
-rw-r--r--paludis/repositories/e/ebuild_id.cc28
-rw-r--r--paludis/repositories/e/ebuild_id.hh5
-rw-r--r--paludis/repositories/e/eclass_mtimes.cc28
-rw-r--r--paludis/repositories/e/eclass_mtimes.hh12
-rw-r--r--paludis/repositories/e/exheres_layout.cc164
-rw-r--r--paludis/repositories/e/exheres_layout.hh44
-rw-r--r--paludis/repositories/e/exheres_profile.cc30
-rw-r--r--paludis/repositories/e/exheres_profile.hh8
-rw-r--r--paludis/repositories/e/exndbam_id.cc2
-rw-r--r--paludis/repositories/e/exndbam_id.hh4
-rw-r--r--paludis/repositories/e/exndbam_repository.cc69
-rw-r--r--paludis/repositories/e/exndbam_repository.hh10
-rw-r--r--paludis/repositories/e/exndbam_repository_TEST.cc23
-rw-r--r--paludis/repositories/e/extra_distribution_data.cc2
-rw-r--r--paludis/repositories/e/extra_distribution_data.hh4
-rw-r--r--paludis/repositories/e/fetch_visitor.cc32
-rw-r--r--paludis/repositories/e/fetch_visitor.hh5
-rw-r--r--paludis/repositories/e/fetch_visitor_TEST.cc13
-rw-r--r--paludis/repositories/e/fix_locked_dependencies.cc3
-rw-r--r--paludis/repositories/e/info_metadata_key.cc25
-rw-r--r--paludis/repositories/e/info_metadata_key.hh5
-rw-r--r--paludis/repositories/e/layout.cc22
-rw-r--r--paludis/repositories/e/layout.hh52
-rw-r--r--paludis/repositories/e/manifest2_reader.cc11
-rw-r--r--paludis/repositories/e/manifest2_reader.hh3
-rw-r--r--paludis/repositories/e/memoised_hashes.cc15
-rw-r--r--paludis/repositories/e/memoised_hashes.hh4
-rw-r--r--paludis/repositories/e/metadata_xml.cc11
-rw-r--r--paludis/repositories/e/metadata_xml.hh4
-rw-r--r--paludis/repositories/e/pbin_merger.cc21
-rw-r--r--paludis/repositories/e/pbin_merger.hh18
-rw-r--r--paludis/repositories/e/pipe_command_handler.cc6
-rw-r--r--paludis/repositories/e/pretend_fetch_visitor.cc15
-rw-r--r--paludis/repositories/e/pretend_fetch_visitor.hh5
-rw-r--r--paludis/repositories/e/profile.cc4
-rw-r--r--paludis/repositories/e/profile.hh5
-rw-r--r--paludis/repositories/e/profile_file.cc5
-rw-r--r--paludis/repositories/e/profile_file.hh6
-rw-r--r--paludis/repositories/e/traditional_layout.cc171
-rw-r--r--paludis/repositories/e/traditional_layout.hh46
-rw-r--r--paludis/repositories/e/traditional_profile.cc56
-rw-r--r--paludis/repositories/e/traditional_profile.hh6
-rw-r--r--paludis/repositories/e/use_desc.cc9
-rw-r--r--paludis/repositories/e/use_desc.hh4
-rw-r--r--paludis/repositories/e/vdb_id.cc3
-rw-r--r--paludis/repositories/e/vdb_id.hh4
-rw-r--r--paludis/repositories/e/vdb_merger.cc51
-rw-r--r--paludis/repositories/e/vdb_merger.hh28
-rw-r--r--paludis/repositories/e/vdb_merger_TEST.cc55
-rw-r--r--paludis/repositories/e/vdb_repository.cc151
-rw-r--r--paludis/repositories/e/vdb_repository.hh17
-rw-r--r--paludis/repositories/e/vdb_repository_TEST.cc211
-rw-r--r--paludis/repositories/e/vdb_unmerger.cc47
-rw-r--r--paludis/repositories/e/vdb_unmerger.hh9
-rw-r--r--paludis/repositories/e/vdb_unmerger_TEST.cc131
-rw-r--r--paludis/repositories/e/xml_things.cc2
-rw-r--r--paludis/repositories/e/xml_things.hh5
-rw-r--r--paludis/repositories/e/xml_things_handle.hh3
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc13
-rw-r--r--paludis/repositories/fake/fake_installed_repository.hh4
-rw-r--r--paludis/repositories/fake/fake_package_id.cc4
-rw-r--r--paludis/repositories/fake/fake_package_id.hh2
-rw-r--r--paludis/repositories/fake/fake_repository.cc8
-rw-r--r--paludis/repositories/fake/fake_repository.hh4
-rw-r--r--paludis/repositories/gems/gem_specification.cc12
-rw-r--r--paludis/repositories/gems/gem_specification.hh5
-rw-r--r--paludis/repositories/gems/gems_repository.cc18
-rw-r--r--paludis/repositories/gems/gems_repository.hh4
-rw-r--r--paludis/repositories/gems/gems_repository_TEST.cc6
-rw-r--r--paludis/repositories/gems/installed_gems_repository.cc20
-rw-r--r--paludis/repositories/gems/installed_gems_repository.hh4
-rw-r--r--paludis/repositories/gems/params.hh14
-rw-r--r--paludis/repositories/repository/repository_id.cc4
-rw-r--r--paludis/repositories/repository/repository_id.hh2
-rw-r--r--paludis/repositories/repository/repository_repository.cc17
-rw-r--r--paludis/repositories/repository/repository_repository.hh6
-rw-r--r--paludis/repositories/repository/repository_repository_store.cc1
-rw-r--r--paludis/repositories/repository/repository_repository_store.hh1
-rw-r--r--paludis/repositories/unavailable/unavailable_package_id.cc4
-rw-r--r--paludis/repositories/unavailable/unavailable_package_id.hh2
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.cc12
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.hh6
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_TEST.cc4
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_dependencies_key.cc1
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_file.cc4
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_file.hh6
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_id.cc12
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_id.hh2
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_store.cc11
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_store.hh8
-rw-r--r--paludis/repositories/unpackaged/installed_id.cc87
-rw-r--r--paludis/repositories/unpackaged/installed_id.hh5
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc51
-rw-r--r--paludis/repositories/unpackaged/installed_repository.hh8
-rw-r--r--paludis/repositories/unpackaged/installed_repository_TEST.cc131
-rw-r--r--paludis/repositories/unpackaged/unpackaged_id.cc24
-rw-r--r--paludis/repositories/unpackaged/unpackaged_id.hh5
-rw-r--r--paludis/repositories/unpackaged/unpackaged_key.cc1
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.cc14
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.hh8
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository_TEST.cc43
-rw-r--r--paludis/repositories/unpackaged/unpackaged_stripper.cc11
-rw-r--r--paludis/repositories/unpackaged/unpackaged_stripper.hh14
-rw-r--r--paludis/repositories/unwritten/unwritten_id.cc4
-rw-r--r--paludis/repositories/unwritten/unwritten_id.hh2
-rw-r--r--paludis/repositories/unwritten/unwritten_repository.cc12
-rw-r--r--paludis/repositories/unwritten/unwritten_repository.hh6
-rw-r--r--paludis/repositories/unwritten/unwritten_repository_TEST.cc4
-rw-r--r--paludis/repositories/unwritten/unwritten_repository_file.cc4
-rw-r--r--paludis/repositories/unwritten/unwritten_repository_file.hh6
-rw-r--r--paludis/repositories/unwritten/unwritten_repository_store.cc11
-rw-r--r--paludis/repositories/unwritten/unwritten_repository_store.hh8
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc25
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.hh6
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository_TEST.cc2
-rw-r--r--paludis/repositories/virtuals/package_id.cc4
-rw-r--r--paludis/repositories/virtuals/package_id.hh2
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc8
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.hh4
-rw-r--r--paludis/repository.hh12
-rw-r--r--paludis/repository_factory.cc2
-rw-r--r--paludis/repository_factory.hh1
-rw-r--r--paludis/repository_name_cache.cc46
-rw-r--r--paludis/repository_name_cache.hh6
-rw-r--r--paludis/repository_name_cache_TEST.cc15
-rw-r--r--paludis/resolver/collect_installed.cc2
-rw-r--r--paludis/resolver/decider.cc10
-rw-r--r--paludis/resolver/find_repository_for_helper.cc4
-rw-r--r--paludis/resolver/interest_in_spec_helper.cc4
-rw-r--r--paludis/resolver/resolver_test.cc13
-rw-r--r--paludis/selection.hh1
-rw-r--r--paludis/selinux/security_context.cc2
-rw-r--r--paludis/selinux/security_context.hh6
-rw-r--r--paludis/set_file.cc3
-rw-r--r--paludis/set_file.hh6
-rw-r--r--paludis/set_file_TEST.cc17
-rw-r--r--paludis/sohooks_TEST.cc2
-rw-r--r--paludis/stringify_formatter-impl.hh8
-rw-r--r--paludis/stringify_formatter.cc8
-rw-r--r--paludis/stringify_formatter.hh8
-rw-r--r--paludis/stripper.cc44
-rw-r--r--paludis/stripper.hh24
-rw-r--r--paludis/stripper_TEST.cc18
-rw-r--r--paludis/syncer.cc19
-rw-r--r--paludis/syncer.hh2
-rw-r--r--paludis/tar_merger.cc14
-rw-r--r--paludis/tar_merger.hh26
-rw-r--r--paludis/tar_merger_TEST.cc59
-rw-r--r--paludis/unmerger.cc32
-rw-r--r--paludis/unmerger.hh14
-rw-r--r--paludis/user_dep_spec.cc10
-rw-r--r--paludis/util/config_file.cc8
-rw-r--r--paludis/util/config_file.hh6
-rw-r--r--paludis/util/config_file_TEST.cc15
-rw-r--r--paludis/util/dir_iterator.hh136
-rw-r--r--paludis/util/dir_iterator.se21
-rw-r--r--paludis/util/dir_iterator_TEST.cc105
-rw-r--r--paludis/util/files.m48
-rw-r--r--paludis/util/fs_entry-fwd.hh87
-rw-r--r--paludis/util/fs_entry.cc748
-rw-r--r--paludis/util/fs_entry.hh404
-rw-r--r--paludis/util/fs_entry_TEST.cc442
-rw-r--r--paludis/util/fs_error.cc30
-rw-r--r--paludis/util/fs_error.hh48
-rw-r--r--paludis/util/fs_iterator-fwd.hh (renamed from paludis/util/dir_iterator-fwd.hh)28
-rw-r--r--paludis/util/fs_iterator.cc (renamed from paludis/util/dir_iterator.cc)108
-rw-r--r--paludis/util/fs_iterator.hh63
-rw-r--r--paludis/util/fs_iterator.se21
-rw-r--r--paludis/util/fs_iterator_TEST.cc93
-rwxr-xr-xpaludis/util/fs_iterator_TEST_cleanup.sh (renamed from paludis/util/dir_iterator_TEST_cleanup.sh)4
-rwxr-xr-xpaludis/util/fs_iterator_TEST_setup.sh (renamed from paludis/util/dir_iterator_TEST_setup.sh)4
-rw-r--r--paludis/util/fs_path-fwd.hh53
-rw-r--r--paludis/util/fs_path.cc439
-rw-r--r--paludis/util/fs_path.hh194
-rw-r--r--paludis/util/fs_path.se19
-rw-r--r--paludis/util/fs_path_TEST.cc152
-rwxr-xr-xpaludis/util/fs_path_TEST_cleanup.sh (renamed from paludis/util/fs_entry_TEST_cleanup.sh)4
-rwxr-xr-xpaludis/util/fs_path_TEST_setup.sh (renamed from paludis/util/fs_entry_TEST_setup.sh)4
-rw-r--r--paludis/util/fs_stat-fwd.hh28
-rw-r--r--paludis/util/fs_stat.cc197
-rw-r--r--paludis/util/fs_stat.hh106
-rw-r--r--paludis/util/fs_stat_TEST.cc299
-rwxr-xr-xpaludis/util/fs_stat_TEST_cleanup.sh9
-rwxr-xr-xpaludis/util/fs_stat_TEST_setup.sh23
-rw-r--r--paludis/util/hashes.cc5
-rw-r--r--paludis/util/hashes.hh6
-rw-r--r--paludis/util/is_file_with_extension.cc12
-rw-r--r--paludis/util/is_file_with_extension.hh16
-rw-r--r--paludis/util/is_file_with_extension_TEST.cc15
-rw-r--r--paludis/util/process.cc4
-rw-r--r--paludis/util/process.hh4
-rw-r--r--paludis/util/process_TEST.cc4
-rw-r--r--paludis/util/realpath.cc32
-rw-r--r--paludis/util/realpath.hh8
-rw-r--r--paludis/util/realpath_TEST.cc47
-rw-r--r--paludis/util/safe_ifstream.cc21
-rw-r--r--paludis/util/safe_ifstream.hh4
-rw-r--r--paludis/util/safe_ifstream_TEST.cc14
-rw-r--r--paludis/util/safe_ofstream.cc20
-rw-r--r--paludis/util/safe_ofstream.hh4
-rw-r--r--paludis/util/safe_ofstream_TEST.cc16
-rw-r--r--paludis/util/system_TEST.cc1
-rw-r--r--paludis/util/wildcard_expander.cc21
-rw-r--r--paludis/util/wildcard_expander.hh11
-rw-r--r--paludis/util/wildcard_expander_TEST.cc8
-rw-r--r--python/Makefile.am2
-rw-r--r--python/action.cc2
-rw-r--r--python/contents.cc10
-rw-r--r--python/dep_tag.cc2
-rw-r--r--python/environment.cc28
-rw-r--r--python/filter.cc6
-rw-r--r--python/filtered_generator.cc1
-rw-r--r--python/fs_path.cc (renamed from python/fs_entry.cc)20
-rw-r--r--python/iterable.hh7
-rw-r--r--python/mask.cc6
-rw-r--r--python/metadata_key.cc43
-rwxr-xr-xpython/package_id_TEST.py4
-rw-r--r--python/paludis_python.hh2
-rw-r--r--python/paludis_python_so.cc2
-rw-r--r--ruby/action.cc2
-rw-r--r--ruby/contents.cc4
-rw-r--r--ruby/dep_tag.cc8
-rw-r--r--ruby/environment.cc10
-rw-r--r--ruby/environment_TEST.rb2
-rw-r--r--ruby/filter.cc4
-rw-r--r--ruby/metadata_key.cc20
-rw-r--r--ruby/package_id.cc2
-rw-r--r--ruby/paludis_ruby.hh1
-rw-r--r--ruby/repository.cc4
-rw-r--r--ruby/repository_TEST.rb2
-rw-r--r--src/clients/accerso/accerso.cc9
-rw-r--r--src/clients/adjutrix/adjutrix.cc28
-rw-r--r--src/clients/adjutrix/display_default_system_resolution.cc1
-rw-r--r--src/clients/adjutrix/downgrade_check.cc15
-rw-r--r--src/clients/appareo/appareo.cc30
-rw-r--r--src/clients/cave/cmd_contents.cc1
-rw-r--r--src/clients/cave/cmd_display_resolution.cc8
-rw-r--r--src/clients/cave/cmd_executables.cc3
-rw-r--r--src/clients/cave/cmd_execute_resolution.cc2
-rw-r--r--src/clients/cave/cmd_fix_linkage.cc5
-rw-r--r--src/clients/cave/cmd_import.cc8
-rw-r--r--src/clients/cave/cmd_info.cc4
-rw-r--r--src/clients/cave/cmd_manage_search_index.cc2
-rw-r--r--src/clients/cave/cmd_match.cc6
-rw-r--r--src/clients/cave/cmd_perform.cc6
-rw-r--r--src/clients/cave/cmd_print_id_contents.cc1
-rw-r--r--src/clients/cave/cmd_print_id_executables.cc3
-rw-r--r--src/clients/cave/cmd_print_sync_protocols.cc16
-rw-r--r--src/clients/cave/cmd_resolve_display_callback.cc3
-rw-r--r--src/clients/cave/cmd_resume.cc5
-rw-r--r--src/clients/cave/cmd_show.cc4
-rw-r--r--src/clients/cave/cmd_update_world.cc1
-rw-r--r--src/clients/cave/cmd_verify.cc34
-rw-r--r--src/clients/cave/colour_formatter.cc2
-rw-r--r--src/clients/cave/colour_formatter.hh6
-rw-r--r--src/clients/cave/command_factory.cc18
-rw-r--r--src/clients/cave/executables_common.cc25
-rw-r--r--src/clients/cave/executables_common.hh4
-rw-r--r--src/clients/cave/format_plain_contents_entry.cc8
-rw-r--r--src/clients/cave/format_plain_metadata_key.cc4
-rw-r--r--src/clients/cave/format_user_config.cc7
-rw-r--r--src/clients/cave/resolve_common.cc2
-rw-r--r--src/clients/cave/script_command.cc8
-rw-r--r--src/clients/cave/script_command.hh4
-rw-r--r--src/clients/cave/select_format_for_spec.cc3
-rw-r--r--src/clients/importare/importare.cc8
-rw-r--r--src/clients/inquisitio/key_extractor.cc7
-rw-r--r--src/clients/instruo/instruo.cc19
-rw-r--r--src/clients/paludis/applets.cc19
-rw-r--r--src/clients/paludis/do_executables.cc16
-rw-r--r--src/clients/paludis/info.cc4
-rw-r--r--src/clients/reconcilio/fix_linkage.cc1
-rw-r--r--src/output/colour_formatter.cc4
-rw-r--r--src/output/colour_formatter.hh8
-rw-r--r--src/output/console_install_task.cc8
-rw-r--r--src/output/console_install_task.hh2
-rw-r--r--src/output/console_query_task.cc4
-rw-r--r--src/output/mask_displayer.cc4
443 files changed, 5693 insertions, 5819 deletions
diff --git a/.gitignore b/.gitignore
index 2beb533..58cb2ed 100644
--- a/.gitignore
+++ b/.gitignore
@@ -444,6 +444,9 @@ paludis-*.*.*.tar.bz2
/paludis/util/fast_unique_copy_TEST
/paludis/util/forward_parallel_for_each_TEST
/paludis/util/fs_entry_TEST
+/paludis/util/fs_iterator_TEST
+/paludis/util/fs_path_TEST
+/paludis/util/fs_stat_TEST
/paludis/util/graph_TEST
/paludis/util/indirect_iterator_TEST
/paludis/util/is_file_with_extension_TEST
diff --git a/doc/api/cplusplus/examples/example_contents.cc b/doc/api/cplusplus/examples/example_contents.cc
index 7c52266..8be11c1 100644
--- a/doc/api/cplusplus/examples/example_contents.cc
+++ b/doc/api/cplusplus/examples/example_contents.cc
@@ -73,7 +73,7 @@ int main(int argc, char * argv[])
/* Fetch package IDs for installed 'sys-apps/paludis'. */
std::shared_ptr<const PackageIDSequence> ids((*env)[selection::AllVersionsSorted(
generator::Package(QualifiedPackageName("sys-apps/paludis")) |
- filter::InstalledAtRoot(FSEntry("/")))]);
+ filter::InstalledAtSlash())]);
/* For each ID: */
for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
diff --git a/doc/api/cplusplus/examples/example_dep_label.cc b/doc/api/cplusplus/examples/example_dep_label.cc
index 3dcbfc0..5514423 100644
--- a/doc/api/cplusplus/examples/example_dep_label.cc
+++ b/doc/api/cplusplus/examples/example_dep_label.cc
@@ -154,7 +154,7 @@ int main(int argc, char * argv[])
/* Fetch package IDs for all installed packages. */
std::shared_ptr<const PackageIDSequence> ids((*env)[selection::AllVersionsUnsorted(
generator::All() |
- filter::InstalledAtRoot(FSEntry("/")))]);
+ filter::InstalledAtSlash())]);
/* Store a map from distfile name to whether it is fetch restricted. */
ResultsMap results;
diff --git a/doc/api/cplusplus/examples/example_dep_spec_flattener.cc b/doc/api/cplusplus/examples/example_dep_spec_flattener.cc
index a1a2720..5040216 100644
--- a/doc/api/cplusplus/examples/example_dep_spec_flattener.cc
+++ b/doc/api/cplusplus/examples/example_dep_spec_flattener.cc
@@ -44,7 +44,7 @@ int main(int argc, char * argv[])
/* Fetch package IDs for all installed packages. */
std::shared_ptr<const PackageIDSequence> ids((*env)[selection::AllVersionsSorted(
generator::All() |
- filter::InstalledAtRoot(FSEntry("/")))]);
+ filter::InstalledAtSlash())]);
/* For each ID: */
for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
diff --git a/doc/api/cplusplus/examples/example_match_package.cc b/doc/api/cplusplus/examples/example_match_package.cc
index 9bad07c..741fa9e 100644
--- a/doc/api/cplusplus/examples/example_match_package.cc
+++ b/doc/api/cplusplus/examples/example_match_package.cc
@@ -42,7 +42,7 @@ int main(int argc, char * argv[])
/* Fetch all installed packages. */
std::shared_ptr<const PackageIDSequence> ids((*env)[selection::AllVersionsSorted(
generator::All() |
- filter::InstalledAtRoot(FSEntry("/")))]);
+ filter::InstalledAtSlash())]);
/* Fetch the 'system' and 'world' sets. Ordinarily we should check for
* zero pointers here, but these two sets will always exist. */
diff --git a/doc/api/cplusplus/examples/example_metadata_key.cc b/doc/api/cplusplus/examples/example_metadata_key.cc
index 21cd85f..a75944a 100644
--- a/doc/api/cplusplus/examples/example_metadata_key.cc
+++ b/doc/api/cplusplus/examples/example_metadata_key.cc
@@ -75,9 +75,9 @@ namespace
cout << indent << left << setw(30) << " Value:" << " " << key.value() << endl;
}
- void visit(const MetadataValueKey<FSEntry> & key)
+ void visit(const MetadataValueKey<FSPath> & key)
{
- cout << indent << left << setw(30) << " Class:" << " " << "MetadataValueKey<FSEntry>" << endl;
+ cout << indent << left << setw(30) << " Class:" << " " << "MetadataValueKey<FSPath>" << endl;
cout << indent << left << setw(30) << " Value:" << " " << key.value() << endl;
}
@@ -193,9 +193,9 @@ namespace
cout << indent << left << setw(30) << " Value:" << " " << join(key.value()->begin(), key.value()->end(), " ") << endl;
}
- void visit(const MetadataCollectionKey<FSEntrySequence> & key)
+ void visit(const MetadataCollectionKey<FSPathSequence> & key)
{
- cout << indent << left << setw(30) << " Class:" << " " << "MetadataCollectionKey<FSEntrySequence>" << endl;
+ cout << indent << left << setw(30) << " Class:" << " " << "MetadataCollectionKey<FSPathSequence>" << endl;
cout << indent << left << setw(30) << " Value:" << " " << join(key.value()->begin(), key.value()->end(), " ") << endl;
}
diff --git a/doc/api/cplusplus/examples/example_selection.cc b/doc/api/cplusplus/examples/example_selection.cc
index a086b0c..a1669af 100644
--- a/doc/api/cplusplus/examples/example_selection.cc
+++ b/doc/api/cplusplus/examples/example_selection.cc
@@ -70,7 +70,7 @@ int main(int argc, char * argv[])
show_selection(env, selection::AllVersionsSorted(
generator::Matches(make_package_dep_spec({ }).package(
QualifiedPackageName("sys-apps/paludis")), { }) |
- filter::InstalledAtRoot(FSEntry("/"))));
+ filter::InstalledAtSlash()));
/* Filters can be combined. Usually filter::NotMasked should be combined
* with filter::SupportsAction<InstallAction>, since installed packages
diff --git a/paludis/action.hh b/paludis/action.hh
index 716fcbf..15b97b6 100644
--- a/paludis/action.hh
+++ b/paludis/action.hh
@@ -29,7 +29,7 @@
#include <paludis/util/pimp.hh>
#include <paludis/util/sequence-fwd.hh>
#include <paludis/util/named_value.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/util/options.hh>
#include <paludis/output_manager-fwd.hh>
#include <paludis/util/type_list.hh>
@@ -198,9 +198,10 @@ namespace paludis
/**
* Sometimes we never want to unmerge certain files.
*
- * \since 0,38
+ * \since 0.38
+ * \since 0.55 uses FSPath
*/
- NamedValue<n::ignore_for_unmerge, std::function<bool (const FSEntry &)> > ignore_for_unmerge;
+ NamedValue<n::ignore_for_unmerge, std::function<bool (const FSPath &)> > ignore_for_unmerge;
/**
* Some repositories need to do special handlings for direct overwrites
@@ -442,7 +443,7 @@ namespace paludis
const FetchActionOptions & options;
/// Signal that we will fetch a particular file.
- virtual void will_fetch(const FSEntry & destination, const unsigned long size_in_bytes) = 0;
+ virtual void will_fetch(const FSPath & destination, const unsigned long size_in_bytes) = 0;
virtual const std::string simple_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/broken_linkage_configuration.cc b/paludis/broken_linkage_configuration.cc
index 0796b94..630a869 100644
--- a/paludis/broken_linkage_configuration.cc
+++ b/paludis/broken_linkage_configuration.cc
@@ -21,7 +21,6 @@
#include <paludis/util/realpath.hh>
#include <paludis/util/wildcard_expander.hh>
#include <paludis/util/config_file.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
#include <paludis/util/options.hh>
@@ -30,6 +29,10 @@
#include <paludis/util/system.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/create_iterator-impl.hh>
+#include <paludis/util/fs_iterator.hh>
+#include <paludis/util/fs_path.hh>
+#include <paludis/util/fs_stat.hh>
#include <algorithm>
#include <functional>
#include <iterator>
@@ -44,29 +47,29 @@ namespace paludis
struct Imp<BrokenLinkageConfiguration>
{
std::vector<std::string> ld_library_mask;
- std::vector<FSEntry> search_dirs;
- std::vector<FSEntry> search_dirs_mask;
- std::vector<FSEntry> ld_so_conf;
+ std::vector<FSPath> search_dirs;
+ std::vector<FSPath> search_dirs_mask;
+ std::vector<FSPath> ld_so_conf;
void load_from_environment();
- void load_from_etc_revdep_rebuild(const FSEntry &);
- void load_from_etc_profile_env(const FSEntry &);
- void load_from_etc_ld_so_conf(const FSEntry &);
+ void load_from_etc_revdep_rebuild(const FSPath &);
+ void load_from_etc_profile_env(const FSPath &);
+ void load_from_etc_ld_so_conf(const FSPath &);
void add_defaults();
};
template <>
struct WrappedForwardIteratorTraits<BrokenLinkageConfiguration::DirsIteratorTag>
{
- typedef std::vector<FSEntry>::const_iterator UnderlyingIterator;
+ typedef std::vector<FSPath>::const_iterator UnderlyingIterator;
};
}
namespace
{
- struct IsGarbageFile : std::unary_function<const FSEntry &, bool>
+ struct IsGarbageFile : std::unary_function<const FSPath &, bool>
{
- bool operator() (const FSEntry & file)
+ bool operator() (const FSPath & file)
{
std::string basename(file.basename());
return '#' == basename[0] || '~' == basename[basename.length() - 1];
@@ -83,7 +86,7 @@ namespace
{
Log::get_instance()->message("reconcilio.broken_linkage_finder.config", ll_debug, lc_context)
<< "Got " << varname << "=\"" + str << "\"";
- tokenise<delim_kind::AnyOfTag, delim_mode::DelimiterTag>(str, ":", "", std::back_inserter(vec));
+ tokenise<delim_kind::AnyOfTag, delim_mode::DelimiterTag>(str, ":", "", create_inserter<T_>(std::back_inserter(vec)));
}
}
@@ -97,21 +100,21 @@ namespace
{
Log::get_instance()->message("reconcilio.broken_linkage_finder.config", ll_debug, lc_context)
<< "Got " << varname << "=\"" << str << "\"";
- tokenise_whitespace(str, std::back_inserter(vec));
+ tokenise_whitespace(str, create_inserter<T_>(std::back_inserter(vec)));
}
}
inline void
- do_wildcards(std::vector<std::string> &, const FSEntry &)
+ do_wildcards(std::vector<std::string> &, const FSPath &)
{
}
inline void
- do_wildcards(std::vector<FSEntry> & vec, const FSEntry & root)
+ do_wildcards(std::vector<FSPath> & vec, const FSPath & root)
{
- std::vector<FSEntry> scratch;
+ std::vector<FSPath> scratch;
- for (std::vector<FSEntry>::const_iterator it(vec.begin()), it_end(vec.end()); it_end != it; ++it)
+ for (std::vector<FSPath>::const_iterator it(vec.begin()), it_end(vec.end()); it_end != it; ++it)
std::copy(WildcardExpander(stringify(*it), root), WildcardExpander(),
std::back_inserter(scratch));
@@ -119,15 +122,15 @@ namespace
swap(vec, scratch);
}
- template <typename T_>
+ template <typename T_, typename C_>
void
- cleanup(const std::string & varname, std::vector<T_> & vec, const FSEntry & root)
+ cleanup(const std::string & varname, std::vector<T_> & vec, const FSPath & root, const C_ & comparator)
{
vec.erase(std::find(vec.begin(), vec.end(), T_("-*")), vec.end());
do_wildcards(vec, root);
- std::sort(vec.begin(), vec.end());
+ std::sort(vec.begin(), vec.end(), comparator);
vec.erase(std::unique(vec.begin(), vec.end()), vec.end());
Log::get_instance()->message("reconcilio.broken_linkage_finder.config",
@@ -148,9 +151,11 @@ namespace
}
void
- parse_ld_so_conf(const FSEntry & root, const FSEntry & file, const LineConfigFileOptions & opts, std::vector<std::string> & res)
+ parse_ld_so_conf(const FSPath & root, const FSPath & file, const LineConfigFileOptions & opts, std::vector<std::string> & res)
{
- if (file.is_regular_file_or_symlink_to_regular_file())
+ FSStat file_stat(file);
+
+ if (file_stat.is_regular_file_or_symlink_to_regular_file())
{
LineConfigFile lines(file, opts);
for (auto it(lines.begin()), it_end(lines.end()); it_end != it; ++it)
@@ -162,7 +167,7 @@ namespace
{
for (auto it2(next(tokens.begin())), it2_end(tokens.end()); it2_end != it2; ++it2)
{
- FSEntry rel('/' == it2->at(0) ? root : file.dirname());
+ FSPath rel('/' == it2->at(0) ? root : file.dirname());
for (WildcardExpander it3(*it2, rel), it3_end; it3_end != it3; ++it3)
{
Context ctx("When reading included file '" + stringify(rel / *it3) + "':");
@@ -183,13 +188,13 @@ namespace
}
}
- else if (file.exists())
+ else if (file_stat.exists())
Log::get_instance()->message("reconcilio.broken_linkage_finder.etc_ld_so_conf.not_a_file", ll_warning, lc_context)
<< "'" << file << "' exists but is not a regular file";
}
}
-BrokenLinkageConfiguration::BrokenLinkageConfiguration(const FSEntry & root) :
+BrokenLinkageConfiguration::BrokenLinkageConfiguration(const FSPath & root) :
Pimp<BrokenLinkageConfiguration>()
{
Context ctx("When loading broken linkage checker configuration for '" + stringify(root) + "':");
@@ -200,12 +205,12 @@ BrokenLinkageConfiguration::BrokenLinkageConfiguration(const FSEntry & root) :
_imp->load_from_etc_ld_so_conf(root);
_imp->add_defaults();
- cleanup("LD_LIBRARY_MASK", _imp->ld_library_mask, root);
- cleanup("SEARCH_DIRS", _imp->search_dirs, root);
- cleanup("SEARCH_DIRS_MASK", _imp->search_dirs_mask, root);
+ cleanup("LD_LIBRARY_MASK", _imp->ld_library_mask, root, std::less<std::string>());
+ cleanup("SEARCH_DIRS", _imp->search_dirs, root, FSPathComparator());
+ cleanup("SEARCH_DIRS_MASK", _imp->search_dirs_mask, root, FSPathComparator());
// don't need the extra cleanup here
- std::sort(_imp->ld_so_conf.begin(), _imp->ld_so_conf.end());
+ std::sort(_imp->ld_so_conf.begin(), _imp->ld_so_conf.end(), FSPathComparator());
_imp->ld_so_conf.erase(std::unique(_imp->ld_so_conf.begin(), _imp->ld_so_conf.end()),
_imp->ld_so_conf.end());
Log::get_instance()->message("reconcilio.broken_linkage_finder.config",
@@ -233,32 +238,31 @@ Imp<BrokenLinkageConfiguration>::load_from_environment()
}
void
-Imp<BrokenLinkageConfiguration>::load_from_etc_revdep_rebuild(const FSEntry & root)
+Imp<BrokenLinkageConfiguration>::load_from_etc_revdep_rebuild(const FSPath & root)
{
using namespace std::placeholders;
- FSEntry etc_revdep_rebuild(root / "etc" / "revdep-rebuild");
+ FSPath etc_revdep_rebuild(root / "etc" / "revdep-rebuild");
+ FSStat etc_revdep_rebuild_stat(etc_revdep_rebuild);
Context ctx("When reading '" + stringify(etc_revdep_rebuild) + "':");
- if (etc_revdep_rebuild.is_directory_or_symlink_to_directory())
+ if (etc_revdep_rebuild_stat.is_directory_or_symlink_to_directory())
{
- std::vector<FSEntry> conf_files = std::vector<FSEntry>(
- DirIterator(etc_revdep_rebuild), DirIterator());
- conf_files.erase(std::remove_if(conf_files.begin(), conf_files.end(),
- IsGarbageFile()),
+ std::vector<FSPath> conf_files = std::vector<FSPath>(FSIterator(etc_revdep_rebuild, { }), FSIterator());
+ conf_files.erase(std::remove_if(conf_files.begin(), conf_files.end(), IsGarbageFile()),
conf_files.end());
- std::sort(conf_files.begin(), conf_files.end());
+ std::sort(conf_files.begin(), conf_files.end(), FSPathComparator());
KeyValueConfigFileOptions opts;
opts += kvcfo_disallow_space_around_equals;
opts += kvcfo_disallow_space_inside_unquoted_values;
- for (std::vector<FSEntry>::iterator it(conf_files.begin()),
+ for (std::vector<FSPath>::iterator it(conf_files.begin()),
it_end(conf_files.end()); it_end != it; ++it)
{
Context ctx_file("When reading '" + stringify(*it) + "':");
- if (it->is_regular_file_or_symlink_to_regular_file())
+ if (it->stat().is_regular_file_or_symlink_to_regular_file())
{
KeyValueConfigFile kvs(*it, opts,
&KeyValueConfigFile::no_defaults, &KeyValueConfigFile::no_transformation);
@@ -275,20 +279,21 @@ Imp<BrokenLinkageConfiguration>::load_from_etc_revdep_rebuild(const FSEntry & ro
<< "'" << *it << "' is not a regular file";
}
}
- else if (etc_revdep_rebuild.exists())
+ else if (etc_revdep_rebuild_stat.exists())
Log::get_instance()->message("reconcilio.broken_linkage_finder.etc_revdep_rebuild.not_a_directory", ll_warning, lc_context)
<< "'" << etc_revdep_rebuild << "' exists but is not a directory";
}
void
-Imp<BrokenLinkageConfiguration>::load_from_etc_profile_env(const FSEntry & root)
+Imp<BrokenLinkageConfiguration>::load_from_etc_profile_env(const FSPath & root)
{
using namespace std::placeholders;
- FSEntry etc_profile_env(root / "etc" / "profile.env");
+ FSPath etc_profile_env(root / "etc" / "profile.env");
+ FSStat etc_profile_env_stat(etc_profile_env);
Context ctx("When reading '" + stringify(etc_profile_env) + "':");
- if (etc_profile_env.is_regular_file_or_symlink_to_regular_file())
+ if (etc_profile_env_stat.is_regular_file_or_symlink_to_regular_file())
{
KeyValueConfigFileOptions opts;
opts += kvcfo_disallow_space_around_equals;
@@ -304,15 +309,15 @@ Imp<BrokenLinkageConfiguration>::load_from_etc_profile_env(const FSEntry & root)
from_colon_string(fromfile, "PATH", search_dirs);
from_colon_string(fromfile, "ROOTPATH", search_dirs);
}
- else if (etc_profile_env.exists())
+ else if (etc_profile_env_stat.exists())
Log::get_instance()->message("reconcilio.broken_linkage_finder.etc_profile_env.not_a_file", ll_warning, lc_context)
<< "'" << etc_profile_env << "' exists but is not a regular file";
}
void
-Imp<BrokenLinkageConfiguration>::load_from_etc_ld_so_conf(const FSEntry & root)
+Imp<BrokenLinkageConfiguration>::load_from_etc_ld_so_conf(const FSPath & root)
{
- FSEntry etc_ld_so_conf(root / "etc" / "ld.so.conf");
+ FSPath etc_ld_so_conf(root / "etc" / "ld.so.conf");
Context ctx("When reading '" + stringify(etc_ld_so_conf) + "':");
LineConfigFileOptions opts;
@@ -326,8 +331,8 @@ Imp<BrokenLinkageConfiguration>::load_from_etc_ld_so_conf(const FSEntry & root)
{
Log::get_instance()->message("reconcilio.broken_linkage_finder.got", ll_debug, lc_context)
<< "Got " << join(res.begin(), res.end(), " ");
- std::copy(res.begin(), res.end(), std::back_inserter(search_dirs));
- std::copy(res.begin(), res.end(), std::back_inserter(ld_so_conf));
+ std::copy(res.begin(), res.end(), create_inserter<FSPath>(std::back_inserter(search_dirs)));
+ std::copy(res.begin(), res.end(), create_inserter<FSPath>(std::back_inserter(ld_so_conf)));
}
}
@@ -352,17 +357,17 @@ Imp<BrokenLinkageConfiguration>::add_defaults()
Log::get_instance()->message("reconcilio.broken_linkage_finder.config", ll_debug, lc_context)
<< "Got SEARCH_DIRS=\"" << default_search_dirs << "\"";
tokenise_whitespace(
- default_search_dirs, std::back_inserter(search_dirs));
+ default_search_dirs, create_inserter<FSPath>(std::back_inserter(search_dirs)));
Log::get_instance()->message("reconcilio.broken_linkage_finder.config", ll_debug, lc_context)
<< "Got SEARCH_DIRS_MASK=\"" << default_search_dirs_mask << "\"";
tokenise_whitespace(
- default_search_dirs_mask, std::back_inserter(search_dirs_mask));
+ default_search_dirs_mask, create_inserter<FSPath>(std::back_inserter(search_dirs_mask)));
Log::get_instance()->message("reconcilio.broken_linkage_finder.config", ll_debug, lc_context)
<< "Default ld.so.conf contents is \"" << default_ld_so_conf << "\"";
tokenise_whitespace(
- default_ld_so_conf, std::back_inserter(ld_so_conf));
+ default_ld_so_conf, create_inserter<FSPath>(std::back_inserter(ld_so_conf)));
}
BrokenLinkageConfiguration::DirsIterator
@@ -390,9 +395,9 @@ BrokenLinkageConfiguration::end_ld_so_conf() const
}
bool
-BrokenLinkageConfiguration::dir_is_masked(const FSEntry & dir) const
+BrokenLinkageConfiguration::dir_is_masked(const FSPath & dir) const
{
- return std::binary_search(_imp->search_dirs_mask.begin(), _imp->search_dirs_mask.end(), dir);
+ return std::binary_search(_imp->search_dirs_mask.begin(), _imp->search_dirs_mask.end(), dir, FSPathComparator());
}
bool
@@ -401,5 +406,5 @@ BrokenLinkageConfiguration::lib_is_masked(const std::string & lib) const
return std::binary_search(_imp->ld_library_mask.begin(), _imp->ld_library_mask.end(), lib);
}
-template class WrappedForwardIterator<BrokenLinkageConfiguration::DirsIteratorTag, const paludis::FSEntry>;
+template class WrappedForwardIterator<BrokenLinkageConfiguration::DirsIteratorTag, const FSPath>;
diff --git a/paludis/broken_linkage_configuration.hh b/paludis/broken_linkage_configuration.hh
index 36c1299..13948ea 100644
--- a/paludis/broken_linkage_configuration.hh
+++ b/paludis/broken_linkage_configuration.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_BROKEN_LINKAGE_CONFIGURATION_HH 1
#include <paludis/util/attributes.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/util/pimp.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
@@ -33,24 +33,24 @@ namespace paludis
private Pimp<BrokenLinkageConfiguration>
{
public:
- BrokenLinkageConfiguration(const FSEntry &);
+ BrokenLinkageConfiguration(const FSPath &);
~BrokenLinkageConfiguration();
BrokenLinkageConfiguration(const BrokenLinkageConfiguration &) = delete;
BrokenLinkageConfiguration & operator= (const BrokenLinkageConfiguration &) = delete;
struct DirsIteratorTag;
- typedef WrappedForwardIterator<DirsIteratorTag, const FSEntry> DirsIterator;
+ typedef WrappedForwardIterator<DirsIteratorTag, const FSPath> DirsIterator;
DirsIterator begin_search_dirs() const PALUDIS_ATTRIBUTE((warn_unused_result));
DirsIterator end_search_dirs() const PALUDIS_ATTRIBUTE((warn_unused_result));
DirsIterator begin_ld_so_conf() const PALUDIS_ATTRIBUTE((warn_unused_result));
DirsIterator end_ld_so_conf() const PALUDIS_ATTRIBUTE((warn_unused_result));
- bool dir_is_masked(const FSEntry &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+ bool dir_is_masked(const FSPath &) const PALUDIS_ATTRIBUTE((warn_unused_result));
bool lib_is_masked(const std::string &) const PALUDIS_ATTRIBUTE((warn_unused_result));
};
- extern template class WrappedForwardIterator<BrokenLinkageConfiguration::DirsIteratorTag, const FSEntry>;
+ extern template class WrappedForwardIterator<BrokenLinkageConfiguration::DirsIteratorTag, const FSPath>;
}
#endif
diff --git a/paludis/broken_linkage_configuration_TEST.cc b/paludis/broken_linkage_configuration_TEST.cc
index d050772..a356821 100644
--- a/paludis/broken_linkage_configuration_TEST.cc
+++ b/paludis/broken_linkage_configuration_TEST.cc
@@ -18,7 +18,7 @@
*/
#include <paludis/broken_linkage_configuration.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_path.hh>
#include <paludis/util/join.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
@@ -43,19 +43,19 @@ namespace test_cases
setenv("SEARCH_DIRS_MASK", "/quuxlib/quux", 1);
setenv("LD_LIBRARY_MASK", "libquux.so", 1);
- BrokenLinkageConfiguration config(FSEntry::cwd() / "broken_linkage_configuration_TEST_dir");
+ BrokenLinkageConfiguration config(FSPath::cwd() / "broken_linkage_configuration_TEST_dir");
TEST_CHECK_EQUAL(join(config.begin_search_dirs(), config.end_search_dirs(), " "),
"/42 /alib /barbin /barlib/foo /bazbin /bin /blib /fhqwhgads1 /fhqwhgads2 /foobin /foolib/bar /hwdp foobar /lib32 /lib64 /quuxlib /qwerty1 /qwerty2 /sbin /uiop1 /uiop2 /usr/bin /usr/lib* /usr/sbin");
TEST_CHECK_EQUAL(join(config.begin_ld_so_conf(), config.end_ld_so_conf(), " "),
"/42 /barlib/foo /fhqwhgads1 /fhqwhgads2 /foolib/bar /lib /qwerty1 /qwerty2 /uiop1 /uiop2 /usr/lib hwdp foobar");
- TEST_CHECK(config.dir_is_masked(FSEntry("/meh")));
- TEST_CHECK(config.dir_is_masked(FSEntry("/quuxlib/quux")));
- TEST_CHECK(! config.dir_is_masked(FSEntry("/feh")));
- TEST_CHECK(! config.dir_is_masked(FSEntry("/opt/OpenOffice")));
- TEST_CHECK(! config.dir_is_masked(FSEntry("/usr/lib/openoffice")));
- TEST_CHECK(! config.dir_is_masked(FSEntry("/foo")));
+ TEST_CHECK(config.dir_is_masked(FSPath("/meh")));
+ TEST_CHECK(config.dir_is_masked(FSPath("/quuxlib/quux")));
+ TEST_CHECK(! config.dir_is_masked(FSPath("/feh")));
+ TEST_CHECK(! config.dir_is_masked(FSPath("/opt/OpenOffice")));
+ TEST_CHECK(! config.dir_is_masked(FSPath("/usr/lib/openoffice")));
+ TEST_CHECK(! config.dir_is_masked(FSPath("/foo")));
TEST_CHECK(config.lib_is_masked("libquux.so"));
TEST_CHECK(config.lib_is_masked("libxyzzy.so"));
diff --git a/paludis/broken_linkage_finder.cc b/paludis/broken_linkage_finder.cc
index 9d39c5e..b81fbdc 100644
--- a/paludis/broken_linkage_finder.cc
+++ b/paludis/broken_linkage_finder.cc
@@ -24,8 +24,6 @@
#include <paludis/linkage_checker.hh>
#include <paludis/util/realpath.hh>
-#include <paludis/util/fs_entry.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/log.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/pimp-impl.hh>
@@ -35,6 +33,9 @@
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/member_iterator-impl.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_iterator.hh>
+#include <paludis/util/fs_error.hh>
#include <paludis/contents.hh>
#include <paludis/environment.hh>
@@ -56,8 +57,8 @@
using namespace paludis;
-typedef std::multimap<FSEntry, std::shared_ptr<const PackageID> > Files;
-typedef std::map<FSEntry, std::set<std::string> > PackageBreakage;
+typedef std::multimap<FSPath, std::shared_ptr<const PackageID>, FSPathComparator> Files;
+typedef std::map<FSPath, std::set<std::string>, FSPathComparator> PackageBreakage;
typedef std::map<std::shared_ptr<const PackageID>, PackageBreakage, PackageIDSetComparator> Breakage;
namespace paludis
@@ -70,7 +71,7 @@ namespace paludis
std::shared_ptr<const Sequence<std::string>> libraries;
std::vector<std::shared_ptr<LinkageChecker> > checkers;
- std::set<FSEntry> extra_lib_dirs;
+ std::set<FSPath, FSPathComparator> extra_lib_dirs;
Mutex mutex;
@@ -80,12 +81,12 @@ namespace paludis
Breakage breakage;
PackageBreakage orphan_breakage;
- void search_directory(const FSEntry &);
+ void search_directory(const FSPath &);
- void walk_directory(const FSEntry &);
- void check_file(const FSEntry &);
+ void walk_directory(const FSPath &);
+ void check_file(const FSPath &);
- void add_breakage(const FSEntry &, const std::string &);
+ void add_breakage(const FSPath &, const std::string &);
void gather_package(const std::shared_ptr<const PackageID> &);
Imp(const Environment * the_env, const std::shared_ptr<const Sequence<std::string>> & the_libraries) :
@@ -118,19 +119,19 @@ namespace paludis
namespace
{
- const std::map<FSEntry, std::set<std::string> > no_files;
+ const std::map<FSPath, std::set<std::string>, FSPathComparator> no_files;
const std::set<std::string> no_reqs;
- struct ParentOf : std::unary_function<FSEntry, bool>
+ struct ParentOf : std::unary_function<FSPath, bool>
{
- const FSEntry & _child;
+ const FSPath & _child;
- ParentOf(const FSEntry & child) :
+ ParentOf(const FSPath & child) :
_child(child)
{
}
- bool operator() (const FSEntry & parent)
+ bool operator() (const FSPath & parent)
{
std::string child_str(stringify(_child)), parent_str(stringify(parent));
return 0 == child_str.compare(0, parent_str.length(), parent_str) &&
@@ -150,13 +151,13 @@ BrokenLinkageFinder::BrokenLinkageFinder(const Environment * env, const std::sha
if (libraries->empty())
_imp->checkers.push_back(std::shared_ptr<LinkageChecker>(std::make_shared<LibtoolLinkageChecker>(env->preferred_root_key()->value())));
- std::vector<FSEntry> search_dirs_nosyms, search_dirs_pruned;
+ std::vector<FSPath> search_dirs_nosyms, search_dirs_pruned;
std::transform(_imp->config.begin_search_dirs(), _imp->config.end_search_dirs(),
std::back_inserter(search_dirs_nosyms),
- std::bind(realpath_with_current_and_root, _1, FSEntry("/"), env->preferred_root_key()->value()));
- std::sort(search_dirs_nosyms.begin(), search_dirs_nosyms.end());
+ std::bind(realpath_with_current_and_root, _1, FSPath("/"), env->preferred_root_key()->value()));
+ std::sort(search_dirs_nosyms.begin(), search_dirs_nosyms.end(), FSPathComparator());
- for (std::vector<FSEntry>::const_iterator it(search_dirs_nosyms.begin()),
+ for (std::vector<FSPath>::const_iterator it(search_dirs_nosyms.begin()),
it_end(search_dirs_nosyms.end()); it_end != it; ++it)
if (search_dirs_pruned.end() ==
std::find_if(search_dirs_pruned.begin(), search_dirs_pruned.end(),
@@ -168,12 +169,12 @@ BrokenLinkageFinder::BrokenLinkageFinder(const Environment * env, const std::sha
std::transform(_imp->config.begin_ld_so_conf(), _imp->config.end_ld_so_conf(),
std::inserter(_imp->extra_lib_dirs, _imp->extra_lib_dirs.begin()),
- std::bind(realpath_with_current_and_root, _1, FSEntry("/"), env->preferred_root_key()->value()));
+ std::bind(realpath_with_current_and_root, _1, FSPath("/"), env->preferred_root_key()->value()));
std::for_each(search_dirs_pruned.begin(), search_dirs_pruned.end(),
std::bind(&Imp<BrokenLinkageFinder>::search_directory, _imp.get(), _1));
- for (std::set<FSEntry>::const_iterator it(_imp->extra_lib_dirs.begin()),
+ for (std::set<FSPath>::const_iterator it(_imp->extra_lib_dirs.begin()),
it_end(_imp->extra_lib_dirs.end()); it_end != it; ++it)
{
Log::get_instance()->message("reconcilio.broken_linkage_finder.config", ll_debug, lc_context)
@@ -182,7 +183,7 @@ BrokenLinkageFinder::BrokenLinkageFinder(const Environment * env, const std::sha
std::bind(&LinkageChecker::add_extra_lib_dir, _1, env->preferred_root_key()->value() / *it));
}
- std::function<void (const FSEntry &, const std::string &)> callback(
+ std::function<void (const FSPath &, const std::string &)> callback(
std::bind(&Imp<BrokenLinkageFinder>::add_breakage, _imp.get(), _1, _2));
std::for_each(indirect_iterator(_imp->checkers.begin()), indirect_iterator(_imp->checkers.end()),
std::bind(&LinkageChecker::need_breakage_added, _1, callback));
@@ -195,9 +196,9 @@ BrokenLinkageFinder::~BrokenLinkageFinder()
}
void
-Imp<BrokenLinkageFinder>::search_directory(const FSEntry & directory)
+Imp<BrokenLinkageFinder>::search_directory(const FSPath & directory)
{
- FSEntry dir(directory);
+ FSPath dir(directory);
env->trigger_notifier_callback(NotifierCallbackLinkageStepEvent(dir));
do
@@ -210,10 +211,10 @@ Imp<BrokenLinkageFinder>::search_directory(const FSEntry & directory)
return;
}
}
- while (FSEntry("/") != dir);
+ while (FSPath("/") != dir);
- FSEntry with_root(env->preferred_root_key()->value() / directory);
- if (with_root.is_directory())
+ FSPath with_root(env->preferred_root_key()->value() / directory);
+ if (with_root.stat().is_directory())
walk_directory(with_root);
else
Log::get_instance()->message("reconcilio.broken_linkage_finder.missing", ll_debug, lc_context)
@@ -221,11 +222,11 @@ Imp<BrokenLinkageFinder>::search_directory(const FSEntry & directory)
}
void
-Imp<BrokenLinkageFinder>::walk_directory(const FSEntry & directory)
+Imp<BrokenLinkageFinder>::walk_directory(const FSPath & directory)
{
using namespace std::placeholders;
- FSEntry without_root(directory.strip_leading(env->preferred_root_key()->value()));
+ FSPath without_root(directory.strip_leading(env->preferred_root_key()->value()));
if (config.dir_is_masked(without_root))
{
Log::get_instance()->message("reconcilio.broken_linkage_finder.masked", ll_debug, lc_context)
@@ -242,8 +243,8 @@ Imp<BrokenLinkageFinder>::walk_directory(const FSEntry & directory)
try
{
- std::for_each(DirIterator(directory, { dio_include_dotfiles, dio_inode_sort }), DirIterator(),
- std::bind(&Imp<BrokenLinkageFinder>::check_file, this, _1));
+ std::for_each(FSIterator(directory, { fsio_include_dotfiles, fsio_inode_sort }), FSIterator(),
+ std::bind(&Imp<BrokenLinkageFinder>::check_file, this, _1));
}
catch (const FSError & ex)
{
@@ -252,26 +253,28 @@ Imp<BrokenLinkageFinder>::walk_directory(const FSEntry & directory)
}
void
-Imp<BrokenLinkageFinder>::check_file(const FSEntry & file)
+Imp<BrokenLinkageFinder>::check_file(const FSPath & file)
{
using namespace std::placeholders;
try
{
- if (file.is_symbolic_link())
+ FSStat file_stat(file);
+
+ if (file_stat.is_symlink())
{
- FSEntry target(dereference_with_root(file, env->preferred_root_key()->value()));
- if (target.is_regular_file())
+ FSPath target(dereference_with_root(file, env->preferred_root_key()->value()));
+ if (target.stat().is_regular_file())
{
std::for_each(indirect_iterator(checkers.begin()), indirect_iterator(checkers.end()),
std::bind(&LinkageChecker::note_symlink, _1, file, target));
}
}
- else if (file.is_directory())
+ else if (file_stat.is_directory())
walk_directory(file);
- else if (file.is_regular_file())
+ else if (file_stat.is_regular_file())
{
env->trigger_notifier_callback(NotifierCallbackLinkageStepEvent(file));
@@ -289,7 +292,7 @@ Imp<BrokenLinkageFinder>::check_file(const FSEntry & file)
}
void
-Imp<BrokenLinkageFinder>::add_breakage(const FSEntry & file, const std::string & req)
+Imp<BrokenLinkageFinder>::add_breakage(const FSPath & file, const std::string & req)
{
using namespace std::placeholders;
@@ -309,7 +312,7 @@ Imp<BrokenLinkageFinder>::add_breakage(const FSEntry & file, const std::string &
std::bind(&Imp<BrokenLinkageFinder>::gather_package, this, _1));
}
- FSEntry without_root(file.strip_leading(env->preferred_root_key()->value()));
+ FSPath without_root(file.strip_leading(env->preferred_root_key()->value()));
std::pair<Files::const_iterator, Files::const_iterator> range(files.equal_range(without_root));
if (range.first == range.second)
orphan_breakage[without_root].insert(req);
@@ -393,7 +396,7 @@ BrokenLinkageFinder::end_broken_files(const std::shared_ptr<const PackageID> & p
BrokenLinkageFinder::MissingRequirementConstIterator
BrokenLinkageFinder::begin_missing_requirements(
- const std::shared_ptr<const PackageID> & pkg, const FSEntry & file) const
+ const std::shared_ptr<const PackageID> & pkg, const FSPath & file) const
{
if (pkg)
{
@@ -419,7 +422,7 @@ BrokenLinkageFinder::begin_missing_requirements(
BrokenLinkageFinder::MissingRequirementConstIterator
BrokenLinkageFinder::end_missing_requirements(
- const std::shared_ptr<const PackageID> & pkg, const FSEntry & file) const
+ const std::shared_ptr<const PackageID> & pkg, const FSPath & file) const
{
if (pkg)
{
@@ -444,8 +447,8 @@ BrokenLinkageFinder::end_missing_requirements(
}
template class WrappedForwardIterator<BrokenLinkageFinder::BrokenPackageConstIteratorTag,
- const std::shared_ptr<const paludis::PackageID> >;
+ const std::shared_ptr<const PackageID> >;
template class WrappedForwardIterator<BrokenLinkageFinder::BrokenFileConstIteratorTag,
- const paludis::FSEntry>;
+ const FSPath>;
template class WrappedForwardIterator<BrokenLinkageFinder::MissingRequirementConstIteratorTag, const std::string>;
diff --git a/paludis/broken_linkage_finder.hh b/paludis/broken_linkage_finder.hh
index d944b0f..6227d28 100644
--- a/paludis/broken_linkage_finder.hh
+++ b/paludis/broken_linkage_finder.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_BROKEN_LINKAGE_FINDER_HH
#include <paludis/util/attributes.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/util/pimp.hh>
#include <paludis/util/sequence-fwd.hh>
#include <paludis/util/wrapped_forward_iterator-fwd.hh>
@@ -34,36 +34,36 @@
namespace paludis
{
class PALUDIS_VISIBLE BrokenLinkageFinder :
- private paludis::Pimp<BrokenLinkageFinder>
+ private Pimp<BrokenLinkageFinder>
{
public:
- BrokenLinkageFinder(const paludis::Environment *, const std::shared_ptr<const Sequence<std::string>> &);
+ BrokenLinkageFinder(const Environment *, const std::shared_ptr<const Sequence<std::string>> &);
~BrokenLinkageFinder();
BrokenLinkageFinder(const BrokenLinkageFinder &) = delete;
BrokenLinkageFinder & operator= (const BrokenLinkageFinder &) = delete;
struct BrokenPackageConstIteratorTag;
- typedef paludis::WrappedForwardIterator<BrokenPackageConstIteratorTag,
- const std::shared_ptr<const paludis::PackageID>
+ typedef WrappedForwardIterator<BrokenPackageConstIteratorTag,
+ const std::shared_ptr<const PackageID>
> BrokenPackageConstIterator;
BrokenPackageConstIterator begin_broken_packages() const PALUDIS_ATTRIBUTE((warn_unused_result));
BrokenPackageConstIterator end_broken_packages() const PALUDIS_ATTRIBUTE((warn_unused_result));
struct BrokenFileConstIteratorTag;
- typedef paludis::WrappedForwardIterator<BrokenFileConstIteratorTag, const paludis::FSEntry> BrokenFileConstIterator;
- BrokenFileConstIterator begin_broken_files(const std::shared_ptr<const paludis::PackageID> &)
+ typedef WrappedForwardIterator<BrokenFileConstIteratorTag, const FSPath> BrokenFileConstIterator;
+ BrokenFileConstIterator begin_broken_files(const std::shared_ptr<const PackageID> &)
const PALUDIS_ATTRIBUTE((warn_unused_result));
- BrokenFileConstIterator end_broken_files(const std::shared_ptr<const paludis::PackageID> &)
+ BrokenFileConstIterator end_broken_files(const std::shared_ptr<const PackageID> &)
const PALUDIS_ATTRIBUTE((warn_unused_result));
struct MissingRequirementConstIteratorTag;
- typedef paludis::WrappedForwardIterator<MissingRequirementConstIteratorTag, const std::string> MissingRequirementConstIterator;
+ typedef WrappedForwardIterator<MissingRequirementConstIteratorTag, const std::string> MissingRequirementConstIterator;
MissingRequirementConstIterator begin_missing_requirements(
- const std::shared_ptr<const paludis::PackageID> &, const paludis::FSEntry &)
+ const std::shared_ptr<const PackageID> &, const FSPath &)
const PALUDIS_ATTRIBUTE((warn_unused_result));
MissingRequirementConstIterator end_missing_requirements(
- const std::shared_ptr<const paludis::PackageID> &, const paludis::FSEntry &)
+ const std::shared_ptr<const PackageID> &, const FSPath &)
const PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
diff --git a/paludis/comma_separated_dep_printer.cc b/paludis/comma_separated_dep_printer.cc
index b66d562..33db0b8 100644
--- a/paludis/comma_separated_dep_printer.cc
+++ b/paludis/comma_separated_dep_printer.cc
@@ -19,7 +19,6 @@
#include <paludis/comma_separated_dep_printer.hh>
#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/options.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/accept_visitor.hh>
diff --git a/paludis/contents.cc b/paludis/contents.cc
index 5fb1841..fb12bae 100644
--- a/paludis/contents.cc
+++ b/paludis/contents.cc
@@ -32,16 +32,16 @@ namespace paludis
template <>
struct Imp<ContentsEntry>
{
- const std::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
+ const std::shared_ptr<const MetadataValueKey<FSPath> > location_key;
- Imp(const FSEntry & n) :
- location_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("location", "location", mkt_significant, n))
+ Imp(const FSPath & n) :
+ location_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("location", "location", mkt_significant, n))
{
}
};
}
-ContentsEntry::ContentsEntry(const FSEntry & n) :
+ContentsEntry::ContentsEntry(const FSPath & n) :
Pimp<ContentsEntry>(n),
_imp(Pimp<ContentsEntry>::_imp)
{
@@ -57,23 +57,23 @@ ContentsEntry::need_keys_added() const
{
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
ContentsEntry::location_key() const
{
return _imp->location_key;
}
-ContentsFileEntry::ContentsFileEntry(const FSEntry & our_name) :
+ContentsFileEntry::ContentsFileEntry(const FSPath & our_name) :
ContentsEntry(our_name)
{
}
-ContentsDirEntry::ContentsDirEntry(const FSEntry & our_name) :
+ContentsDirEntry::ContentsDirEntry(const FSPath & our_name) :
ContentsEntry(our_name)
{
}
-ContentsOtherEntry::ContentsOtherEntry(const FSEntry & our_name) :
+ContentsOtherEntry::ContentsOtherEntry(const FSPath & our_name) :
ContentsEntry(our_name)
{
}
@@ -92,7 +92,7 @@ namespace paludis
};
}
-ContentsSymEntry::ContentsSymEntry(const FSEntry & our_name, const std::string & our_target) :
+ContentsSymEntry::ContentsSymEntry(const FSPath & our_name, const std::string & our_target) :
Pimp<ContentsSymEntry>(our_target),
ContentsEntry(our_name),
_imp(Pimp<ContentsSymEntry>::_imp)
diff --git a/paludis/contents.hh b/paludis/contents.hh
index 595aa2e..9b8d8e6 100644
--- a/paludis/contents.hh
+++ b/paludis/contents.hh
@@ -25,7 +25,7 @@
#include <paludis/util/pimp.hh>
#include <paludis/util/type_list.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/metadata_key_holder.hh>
#include <memory>
#include <string>
@@ -66,7 +66,7 @@ namespace paludis
///\name Basic operations
///\{
- ContentsEntry(const FSEntry & path);
+ ContentsEntry(const FSPath & path);
virtual ~ContentsEntry() = 0;
///\}
@@ -91,7 +91,7 @@ namespace paludis
*
* \since 0.36
*/
- const std::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
+ const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
///\}
@@ -112,7 +112,7 @@ namespace paludis
///\name Basic operations
///\{
- ContentsFileEntry(const FSEntry &);
+ ContentsFileEntry(const FSPath &);
///\}
};
@@ -131,7 +131,7 @@ namespace paludis
///\name Basic operations
///\{
- ContentsDirEntry(const FSEntry &);
+ ContentsDirEntry(const FSPath &);
///\}
};
@@ -151,7 +151,7 @@ namespace paludis
///\name Basic operations
///\{
- ContentsOtherEntry(const FSEntry &);
+ ContentsOtherEntry(const FSPath &);
///\}
};
@@ -174,7 +174,7 @@ namespace paludis
///\name Basic operations
///\{
- ContentsSymEntry(const FSEntry &, const std::string & target);
+ ContentsSymEntry(const FSPath &, const std::string & target);
~ContentsSymEntry();
///\}
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index 12616b7..4221d46 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -34,7 +34,6 @@
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/options.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/metadata_key.hh>
#include <paludis/additional_package_dep_spec_requirement.hh>
#include <paludis/dep_spec_data.hh>
@@ -688,7 +687,7 @@ PackageDepSpec::from_repository_ptr() const
return _imp->data->from_repository_ptr();
}
-std::shared_ptr<const FSEntry>
+std::shared_ptr<const FSPath>
PackageDepSpec::installed_at_path_ptr() const
{
return _imp->data->installed_at_path_ptr();
diff --git a/paludis/dep_spec.hh b/paludis/dep_spec.hh
index f62c4cd..98b485f 100644
--- a/paludis/dep_spec.hh
+++ b/paludis/dep_spec.hh
@@ -24,7 +24,7 @@
#include <paludis/util/clone.hh>
#include <paludis/util/pimp.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_path.hh>
#include <paludis/util/named_value.hh>
#include <paludis/changed_choices-fwd.hh>
@@ -275,7 +275,7 @@ namespace paludis
struct InstallableToPath
{
NamedValue<n::include_masked, bool> include_masked;
- NamedValue<n::path, FSEntry> path;
+ NamedValue<n::path, FSPath> path;
};
/**
@@ -385,7 +385,7 @@ namespace paludis
*
* \since 0.32
*/
- std::shared_ptr<const FSEntry> installed_at_path_ptr() const;
+ std::shared_ptr<const FSPath> installed_at_path_ptr() const;
/**
* Fetch the installable-to-path requirement (may be a zero pointer).
diff --git a/paludis/dep_spec_data.hh b/paludis/dep_spec_data.hh
index a4a81fd..aff05ad 100644
--- a/paludis/dep_spec_data.hh
+++ b/paludis/dep_spec_data.hh
@@ -22,7 +22,7 @@
#include <paludis/dep_spec_data-fwd.hh>
#include <paludis/util/attributes.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/changed_choices-fwd.hh>
#include <paludis/name-fwd.hh>
#include <paludis/version_operator-fwd.hh>
@@ -148,7 +148,7 @@ namespace paludis
*
* \since 0.32
*/
- virtual std::shared_ptr<const FSEntry> installed_at_path_ptr() const = 0;
+ virtual std::shared_ptr<const FSPath> installed_at_path_ptr() const = 0;
/**
* Fetch the installable-to-path requirement (may be a zero pointer).
diff --git a/paludis/dep_tag.cc b/paludis/dep_tag.cc
index 7c68bae..f56cb1f 100644
--- a/paludis/dep_tag.cc
+++ b/paludis/dep_tag.cc
@@ -185,7 +185,7 @@ DepTag::operator< (const DepTag & other) const
return c1.value < c2.value;
}
-GLSADepTag::GLSADepTag(const std::string & id, const std::string & our_glsa_title, const FSEntry& our_glsa_file) :
+GLSADepTag::GLSADepTag(const std::string & id, const std::string & our_glsa_title, const FSPath & our_glsa_file) :
_id(id),
_glsa_title(our_glsa_title),
_glsa_file(our_glsa_file)
@@ -208,7 +208,7 @@ GLSADepTag::category() const
return "glsa";
}
-const FSEntry
+const FSPath
GLSADepTag::glsa_file() const
{
return _glsa_file;
diff --git a/paludis/dep_tag.hh b/paludis/dep_tag.hh
index 07a422e..bf64e43 100644
--- a/paludis/dep_tag.hh
+++ b/paludis/dep_tag.hh
@@ -40,7 +40,7 @@
#include <paludis/util/simple_visitor.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/named_value.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_path.hh>
#include <paludis/util/operators.hh>
#include <paludis/util/type_list.hh>
#include <paludis/util/singleton.hh>
@@ -201,13 +201,13 @@ namespace paludis
private:
const std::string _id;
const std::string _glsa_title;
- const FSEntry _glsa_file;
+ const FSPath _glsa_file;
public:
///\name Basic operations
///\{
- GLSADepTag(const std::string & id, const std::string & glsa_title, const FSEntry&);
+ GLSADepTag(const std::string & id, const std::string & glsa_title, const FSPath &);
~GLSADepTag();
///\}
@@ -222,7 +222,7 @@ namespace paludis
/**
* The full path to the glsa announcement file.
*/
- const FSEntry glsa_file() const;
+ const FSPath glsa_file() const;
/**
* Fetch our GLSA title (for example, 'Yet another PHP remote access
diff --git a/paludis/distribution.cc b/paludis/distribution.cc
index 9505f2f..f3139b9 100644
--- a/paludis/distribution.cc
+++ b/paludis/distribution.cc
@@ -20,7 +20,6 @@
#include <paludis/distribution-impl.hh>
#include <paludis/util/config_file.hh>
#include <paludis/util/destringify.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/make_named_values.hh>
@@ -29,6 +28,7 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/system.hh>
+#include <paludis/util/fs_iterator.hh>
#include <unordered_map>
using namespace paludis;
@@ -53,7 +53,7 @@ namespace paludis
{
Context c("When loading distribution data:");
- for (DirIterator d(getenv_with_default("PALUDIS_DISTRIBUTIONS_DIR", DATADIR "/paludis/distributions")), d_end ;
+ for (FSIterator d(FSPath(getenv_with_default("PALUDIS_DISTRIBUTIONS_DIR", DATADIR "/paludis/distributions")), { }), d_end ;
d != d_end ; ++d)
{
if (! is_file_with_extension(*d, ".conf", { }))
@@ -69,7 +69,7 @@ namespace paludis
n::concept_license() = k.get("concept_license"),
n::concept_use() = k.get("concept_use"),
n::default_environment() = k.get("default_environment"),
- n::extra_data_dir() = FSEntry(strip_trailing_string(stringify(d->realpath()), ".conf")),
+ n::extra_data_dir() = FSPath(strip_trailing_string(stringify(d->realpath()), ".conf")),
n::fallback_environment() = k.get("fallback_environment"),
n::name() = strip_trailing_string(d->basename(), ".conf"),
n::paludis_package() = k.get("paludis_package"),
diff --git a/paludis/distribution.hh b/paludis/distribution.hh
index 295b962..84b4e4d 100644
--- a/paludis/distribution.hh
+++ b/paludis/distribution.hh
@@ -25,7 +25,7 @@
#include <paludis/util/exception.hh>
#include <paludis/util/pimp.hh>
#include <paludis/util/named_value.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_path.hh>
#include <paludis/util/singleton.hh>
#include <memory>
@@ -72,7 +72,7 @@ namespace paludis
NamedValue<n::concept_license, std::string> concept_license;
NamedValue<n::concept_use, std::string> concept_use;
NamedValue<n::default_environment, std::string> default_environment;
- NamedValue<n::extra_data_dir, FSEntry> extra_data_dir;
+ NamedValue<n::extra_data_dir, FSPath> extra_data_dir;
NamedValue<n::fallback_environment, std::string> fallback_environment;
NamedValue<n::name, std::string> name;
NamedValue<n::paludis_package, std::string> paludis_package;
diff --git a/paludis/elf_linkage_checker.cc b/paludis/elf_linkage_checker.cc
index fc3576d..79e7b70 100644
--- a/paludis/elf_linkage_checker.cc
+++ b/paludis/elf_linkage_checker.cc
@@ -26,7 +26,6 @@
#include <paludis/util/elf_symbol_section.hh>
#include <paludis/util/realpath.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
#include <paludis/util/mutex.hh>
@@ -37,6 +36,8 @@
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/safe_ifstream.hh>
+#include <paludis/util/fs_path.hh>
+#include <paludis/util/fs_stat.hh>
#include <algorithm>
#include <cerrno>
@@ -97,32 +98,32 @@ namespace
}
}
-typedef std::multimap<FSEntry, FSEntry> Symlinks;
-typedef std::map<ElfArchitecture, std::map<std::string, std::vector<FSEntry> > > Needed;
+typedef std::multimap<FSPath, FSPath, FSPathComparator> Symlinks;
+typedef std::map<ElfArchitecture, std::map<std::string, std::vector<FSPath> > > Needed;
namespace paludis
{
template <>
struct Imp<ElfLinkageChecker>
{
- FSEntry root;
+ FSPath root;
std::set<std::string> check_libraries;
Mutex mutex;
- std::map<FSEntry, ElfArchitecture> seen;
+ std::map<FSPath, ElfArchitecture, FSPathComparator> seen;
Symlinks symlinks;
std::map<ElfArchitecture, std::vector<std::string> > libraries;
Needed needed;
- std::vector<FSEntry> extra_lib_dirs;
+ std::vector<FSPath> extra_lib_dirs;
- template <typename> bool check_elf(const FSEntry &, std::istream &);
- void handle_library(const FSEntry &, const ElfArchitecture &);
- template <typename> bool check_extra_elf(const FSEntry &, std::istream &, std::set<ElfArchitecture> &);
+ template <typename> bool check_elf(const FSPath &, std::istream &);
+ void handle_library(const FSPath &, const ElfArchitecture &);
+ template <typename> bool check_extra_elf(const FSPath &, std::istream &, std::set<ElfArchitecture> &);
- Imp(const FSEntry & the_root, const std::shared_ptr<const Sequence<std::string>> & the_libraries) :
+ Imp(const FSPath & the_root, const std::shared_ptr<const Sequence<std::string>> & the_libraries) :
root(the_root)
{
for (auto it(the_libraries->begin()), it_end(the_libraries->end()); it_end != it; ++it)
@@ -131,7 +132,7 @@ namespace paludis
};
}
-ElfLinkageChecker::ElfLinkageChecker(const FSEntry & root, const std::shared_ptr<const Sequence<std::string>> & libraries) :
+ElfLinkageChecker::ElfLinkageChecker(const FSPath & root, const std::shared_ptr<const Sequence<std::string>> & libraries) :
Pimp<ElfLinkageChecker>(root, libraries)
{
}
@@ -141,12 +142,12 @@ ElfLinkageChecker::~ElfLinkageChecker()
}
bool
-ElfLinkageChecker::check_file(const FSEntry & file)
+ElfLinkageChecker::check_file(const FSPath & file)
{
std::string basename(file.basename());
if (! (std::string::npos != basename.find(".so.") ||
(3 <= basename.length() && ".so" == basename.substr(basename.length() - 3)) ||
- file.has_permission(fs_ug_owner, fs_perm_execute)))
+ (0 != (file.stat().permissions() & S_IXUSR))))
return false;
SafeIFStream stream(file);
@@ -155,7 +156,7 @@ ElfLinkageChecker::check_file(const FSEntry & file)
template <typename ElfType_>
bool
-Imp<ElfLinkageChecker>::check_elf(const FSEntry & file, std::istream & stream)
+Imp<ElfLinkageChecker>::check_elf(const FSPath & file, std::istream & stream)
{
if (! ElfObject<ElfType_>::is_valid_elf(stream))
return false;
@@ -214,7 +215,7 @@ Imp<ElfLinkageChecker>::check_elf(const FSEntry & file, std::istream & stream)
}
void
-Imp<ElfLinkageChecker>::handle_library(const FSEntry & file, const ElfArchitecture & arch)
+Imp<ElfLinkageChecker>::handle_library(const FSPath & file, const ElfArchitecture & arch)
{
seen.insert(std::make_pair(file, arch));
std::pair<Symlinks::const_iterator, Symlinks::const_iterator> range(symlinks.equal_range(file));
@@ -226,18 +227,18 @@ Imp<ElfLinkageChecker>::handle_library(const FSEntry & file, const ElfArchitectu
ll_debug, lc_context) << "Known symlinks are " <<
join(second_iterator(range.first), second_iterator(range.second), " ");
std::transform(second_iterator(range.first), second_iterator(range.second),
- std::back_inserter(libraries[arch]), std::mem_fn(&FSEntry::basename));
+ std::back_inserter(libraries[arch]), std::mem_fn(&FSPath::basename));
}
}
void
-ElfLinkageChecker::note_symlink(const FSEntry & link, const FSEntry & target)
+ElfLinkageChecker::note_symlink(const FSPath & link, const FSPath & target)
{
if (_imp->check_libraries.empty())
{
Lock l(_imp->mutex);
- std::map<FSEntry, ElfArchitecture>::const_iterator it(_imp->seen.find(target));
+ std::map<FSPath, ElfArchitecture, FSPathComparator>::const_iterator it(_imp->seen.find(target));
if (_imp->seen.end() != it)
{
Log::get_instance()->message("reconcilio.broken_linkage_finder.note_symlink", ll_debug, lc_context)
@@ -250,14 +251,14 @@ ElfLinkageChecker::note_symlink(const FSEntry & link, const FSEntry & target)
}
void
-ElfLinkageChecker::add_extra_lib_dir(const FSEntry & dir)
+ElfLinkageChecker::add_extra_lib_dir(const FSPath & dir)
{
_imp->extra_lib_dirs.push_back(dir);
}
void
ElfLinkageChecker::need_breakage_added(
- const std::function<void (const FSEntry &, const std::string &)> & callback)
+ const std::function<void (const FSPath &, const std::string &)> & callback)
{
using namespace std::placeholders;
@@ -284,7 +285,7 @@ ElfLinkageChecker::need_breakage_added(
all_missing[*it].insert(arch_it->first);
}
- for (std::vector<FSEntry>::const_iterator dir_it(_imp->extra_lib_dirs.begin()),
+ for (std::vector<FSPath>::const_iterator dir_it(_imp->extra_lib_dirs.begin()),
dir_it_end(_imp->extra_lib_dirs.end()); dir_it_end != dir_it; ++dir_it)
{
Context ctx("When searching for missing libraries in '" + stringify(*dir_it) + "':");
@@ -295,8 +296,8 @@ ElfLinkageChecker::need_breakage_added(
if (missing_it->second.empty())
continue;
- FSEntry file(dereference_with_root(*dir_it / missing_it->first, _imp->root));
- if (! file.is_regular_file())
+ FSPath file(dereference_with_root(*dir_it / missing_it->first, _imp->root));
+ if (! file.stat().is_regular_file())
{
Log::get_instance()->message("reconcilio.broken_linkage_finder.missing", ll_debug, lc_context)
<< "'" << file << "' is missing or not a regular file";
@@ -333,7 +334,7 @@ ElfLinkageChecker::need_breakage_added(
template <typename ElfType_>
bool
-Imp<ElfLinkageChecker>::check_extra_elf(const FSEntry & file, std::istream & stream, std::set<ElfArchitecture> & arches)
+Imp<ElfLinkageChecker>::check_extra_elf(const FSPath & file, std::istream & stream, std::set<ElfArchitecture> & arches)
{
if (! ElfObject<ElfType_>::is_valid_elf(stream))
return false;
diff --git a/paludis/elf_linkage_checker.hh b/paludis/elf_linkage_checker.hh
index 13c502c..8af79d0 100644
--- a/paludis/elf_linkage_checker.hh
+++ b/paludis/elf_linkage_checker.hh
@@ -29,18 +29,18 @@ namespace paludis
{
class ElfLinkageChecker :
public LinkageChecker,
- private paludis::Pimp<ElfLinkageChecker>
+ private Pimp<ElfLinkageChecker>
{
public:
- ElfLinkageChecker(const paludis::FSEntry &, const std::shared_ptr<const Sequence<std::string>> &);
+ ElfLinkageChecker(const FSPath &, const std::shared_ptr<const Sequence<std::string>> &);
virtual ~ElfLinkageChecker();
- virtual bool check_file(const paludis::FSEntry &) PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual void note_symlink(const paludis::FSEntry &, const paludis::FSEntry &);
+ virtual bool check_file(const FSPath &) PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual void note_symlink(const FSPath &, const FSPath &);
- virtual void add_extra_lib_dir(const paludis::FSEntry &);
+ virtual void add_extra_lib_dir(const FSPath &);
virtual void need_breakage_added(
- const std::function<void (const paludis::FSEntry &, const std::string &)> &);
+ const std::function<void (const FSPath &, const std::string &)> &);
};
}
diff --git a/paludis/environment.hh b/paludis/environment.hh
index 9eea424..e31f457 100644
--- a/paludis/environment.hh
+++ b/paludis/environment.hh
@@ -22,7 +22,6 @@
#include <paludis/environment-fwd.hh>
#include <paludis/util/options-fwd.hh>
-#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/tribool-fwd.hh>
#include <paludis/util/simple_visitor.hh>
#include <paludis/output_manager-fwd.hh>
@@ -258,7 +257,7 @@ namespace paludis
* \since 0.48
*/
virtual const std::shared_ptr<Repository> repository_from_new_config_file(
- const FSEntry &) PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ const FSPath &) PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
///\}
@@ -269,25 +268,25 @@ namespace paludis
* Return a collection of bashrc files to be used by the various components
* that are implemented in bash.
*/
- virtual std::shared_ptr<const FSEntrySequence> bashrc_files() const
+ virtual std::shared_ptr<const FSPathSequence> bashrc_files() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
/**
* Return directories to search for syncer scripts.
*/
- virtual std::shared_ptr<const FSEntrySequence> syncers_dirs() const
+ virtual std::shared_ptr<const FSPathSequence> syncers_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
/**
* Return directories to search for fetcher scripts.
*/
- virtual std::shared_ptr<const FSEntrySequence> fetchers_dirs() const
+ virtual std::shared_ptr<const FSPathSequence> fetchers_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
/**
* Return directories to search for hooks.
*/
- virtual std::shared_ptr<const FSEntrySequence> hook_dirs() const
+ virtual std::shared_ptr<const FSPathSequence> hook_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
/**
@@ -462,7 +461,7 @@ namespace paludis
*
* \since 0.54
*/
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > preferred_root_key() const = 0;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > preferred_root_key() const = 0;
/**
* The format_key, if non-zero, holds our environment's format. Environment
@@ -475,7 +474,7 @@ namespace paludis
* The config_location_key, if non-zero, specifies the location of the configuration file or directory,
* the contents of which depends on the format returned by format_key.
*/
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > config_location_key() const = 0;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > config_location_key() const = 0;
///\}
diff --git a/paludis/environment_factory.cc b/paludis/environment_factory.cc
index 0e4c4c2..8907248 100644
--- a/paludis/environment_factory.cc
+++ b/paludis/environment_factory.cc
@@ -23,8 +23,6 @@
#include <paludis/util/system.hh>
#include <paludis/util/member_iterator-impl.hh>
#include <paludis/util/join.hh>
-#include <paludis/util/fs_entry.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
diff --git a/paludis/environment_factory.hh b/paludis/environment_factory.hh
index 72e6574..8abd245 100644
--- a/paludis/environment_factory.hh
+++ b/paludis/environment_factory.hh
@@ -24,7 +24,6 @@
#include <paludis/util/attributes.hh>
#include <paludis/util/pimp.hh>
#include <paludis/util/set-fwd.hh>
-#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/no_type.hh>
#include <paludis/util/singleton.hh>
#include <paludis/environment-fwd.hh>
diff --git a/paludis/environment_implementation.cc b/paludis/environment_implementation.cc
index 1fda482..a136c08 100644
--- a/paludis/environment_implementation.cc
+++ b/paludis/environment_implementation.cc
@@ -134,33 +134,33 @@ EnvironmentImplementation::~EnvironmentImplementation()
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
EnvironmentImplementation::bashrc_files() const
{
- return std::make_shared<FSEntrySequence>();
+ return std::make_shared<FSPathSequence>();
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
EnvironmentImplementation::syncers_dirs() const
{
- std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
- result->push_back(FSEntry(DATADIR "/paludis/syncers"));
- result->push_back(FSEntry(LIBEXECDIR "/paludis/syncers"));
+ std::shared_ptr<FSPathSequence> result(std::make_shared<FSPathSequence>());
+ result->push_back(FSPath(DATADIR "/paludis/syncers"));
+ result->push_back(FSPath(LIBEXECDIR "/paludis/syncers"));
return result;
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
EnvironmentImplementation::fetchers_dirs() const
{
- std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> result(std::make_shared<FSPathSequence>());
std::string fetchers_dir(getenv_with_default("PALUDIS_FETCHERS_DIR", ""));
if (fetchers_dir.empty())
{
- result->push_back(FSEntry(DATADIR "/paludis/fetchers"));
- result->push_back(FSEntry(LIBEXECDIR "/paludis/fetchers"));
+ result->push_back(FSPath(DATADIR "/paludis/fetchers"));
+ result->push_back(FSPath(LIBEXECDIR "/paludis/fetchers"));
}
else
- result->push_back(FSEntry(fetchers_dir));
+ result->push_back(FSPath(fetchers_dir));
return result;
}
diff --git a/paludis/environment_implementation.hh b/paludis/environment_implementation.hh
index e2d9c80..8e42825 100644
--- a/paludis/environment_implementation.hh
+++ b/paludis/environment_implementation.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -70,13 +70,13 @@ namespace paludis
///\}
- virtual std::shared_ptr<const FSEntrySequence> bashrc_files() const
+ virtual std::shared_ptr<const FSPathSequence> bashrc_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> syncers_dirs() const
+ virtual std::shared_ptr<const FSPathSequence> syncers_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> fetchers_dirs() const
+ virtual std::shared_ptr<const FSPathSequence> fetchers_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual std::shared_ptr<const DestinationsSet> default_destinations() const
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index 8e3aaf5..7762b28 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -20,7 +20,6 @@
#include <paludis/environments/no_config/no_config_environment.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/map-impl.hh>
#include <paludis/util/set.hh>
@@ -35,6 +34,9 @@
#include <paludis/util/hashes.hh>
#include <paludis/util/member_iterator-impl.hh>
#include <paludis/util/sequence-impl.hh>
+#include <paludis/util/fs_path.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_iterator.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/distribution.hh>
#include <paludis/package_database.hh>
@@ -62,8 +64,8 @@ namespace paludis
{
const no_config_environment::Params params;
- const FSEntry top_level_dir;
- const FSEntry write_cache;
+ const FSPath top_level_dir;
+ const FSPath write_cache;
bool accept_unstable;
bool is_vdb;
@@ -76,8 +78,8 @@ namespace paludis
std::shared_ptr<PackageDatabase> package_database;
std::shared_ptr<LiteralMetadataValueKey<std::string> > format_key;
- std::shared_ptr<LiteralMetadataValueKey<FSEntry> > repository_dir_key;
- std::shared_ptr<LiteralMetadataValueKey<FSEntry> > preferred_root_key;
+ std::shared_ptr<LiteralMetadataValueKey<FSPath> > repository_dir_key;
+ std::shared_ptr<LiteralMetadataValueKey<FSPath> > preferred_root_key;
Imp(NoConfigEnvironment * const env, const no_config_environment::Params & params);
void initialise(NoConfigEnvironment * const env);
@@ -88,7 +90,7 @@ namespace paludis
namespace
{
- bool is_vdb_repository(const FSEntry & location, no_config_environment::RepositoryType type)
+ bool is_vdb_repository(const FSPath & location, no_config_environment::RepositoryType type)
{
switch (type)
{
@@ -103,10 +105,10 @@ namespace
Context context("When determining repository type at '" + stringify(location) + "':");
- if (! location.is_directory())
+ if (! location.stat().is_directory())
throw ConfigurationError("Location is not a directory");
- if ((location / "profiles").is_directory())
+ if ((location / "profiles").stat().is_directory())
{
Log::get_instance()->message("no_config_environment.ebuild_detected", ll_debug, lc_context)
<< "Found profiles/, looks like Ebuild format";
@@ -114,18 +116,18 @@ namespace
}
int outer_count(0);
- for (DirIterator d(location), d_end ; d != d_end ; ++d)
+ for (FSIterator d(location, { }), d_end ; d != d_end ; ++d)
{
- if (! d->is_directory())
+ if (! d->stat().is_directory())
continue;
int inner_count(0);
- for (DirIterator e(*d), e_end ; e != e_end ; ++e)
+ for (FSIterator e(*d, { }), e_end ; e != e_end ; ++e)
{
- if (! e->is_directory())
+ if (! e->stat().is_directory())
continue;
- if ((*e / "CONTENTS").exists())
+ if ((*e / "CONTENTS").stat().exists())
{
Log::get_instance()->message("no_config_environment.vdb_detected", ll_debug, lc_context)
<< "Found '" << stringify(*e) << "/CONTENTS', looks like VDB format";
@@ -164,10 +166,10 @@ Imp<NoConfigEnvironment>::Imp(
paludis_command("false"),
package_database(std::make_shared<PackageDatabase>(env)),
format_key(std::make_shared<LiteralMetadataValueKey<std::string>>("format", "Format", mkt_significant, "no_config")),
- repository_dir_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("repository_dir", "Repository dir",
+ repository_dir_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("repository_dir", "Repository dir",
mkt_normal, p.repository_dir())),
- preferred_root_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("root", "Root",
- mkt_normal, FSEntry("/")))
+ preferred_root_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("root", "Root",
+ mkt_normal, FSPath("/")))
{
}
@@ -179,12 +181,12 @@ Imp<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
if (! is_vdb)
{
/* don't assume these're in initialisable order. */
- std::map<FSEntry, bool> repository_dirs;
+ std::map<FSPath, bool, FSPathComparator> repository_dirs;
RepositoryName main_repository_name("x");
bool ignored_one(false);
repository_dirs.insert(std::make_pair(params.repository_dir(), true));
- for (FSEntrySequence::ConstIterator d(params.extra_repository_dirs()->begin()), d_end(params.extra_repository_dirs()->end()) ;
+ for (FSPathSequence::ConstIterator d(params.extra_repository_dirs()->begin()), d_end(params.extra_repository_dirs()->end()) ;
d != d_end ; ++d)
{
if (params.repository_dir().realpath() == d->realpath())
@@ -201,7 +203,7 @@ Imp<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
std::unordered_map<RepositoryName, std::function<std::string (const std::string &)>,
Hash<RepositoryName> > repo_configs;
- for (std::map<FSEntry, bool>::const_iterator r(repository_dirs.begin()), r_end(repository_dirs.end()) ;
+ for (auto r(repository_dirs.begin()), r_end(repository_dirs.end()) ;
r != r_end ; ++r)
{
Context local_context("When reading repository at location '" + stringify(r->first) + "':");
@@ -225,7 +227,7 @@ Imp<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
if (r->second && ! params.master_repository_name().empty())
keys->insert("master_repository", params.master_repository_name());
- if ((r->first / "metadata" / "profiles_desc.conf").exists())
+ if ((r->first / "metadata" / "profiles_desc.conf").stat().exists())
keys->insert("layout", "exheres");
std::function<std::string (const std::string &)> repo_func(
@@ -377,7 +379,7 @@ NoConfigEnvironment::~NoConfigEnvironment()
{
}
-FSEntry
+FSPath
NoConfigEnvironment::main_repository_dir() const
{
return _imp->top_level_dir;
@@ -548,10 +550,10 @@ NoConfigEnvironment::perform_hook(
return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
NoConfigEnvironment::hook_dirs() const
{
- return std::make_shared<FSEntrySequence>();
+ return std::make_shared<FSPathSequence>();
}
void
@@ -565,13 +567,13 @@ NoConfigEnvironment::format_key() const
return _imp->format_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
NoConfigEnvironment::config_location_key() const
{
- return std::shared_ptr<const MetadataValueKey<FSEntry> >();
+ return std::shared_ptr<const MetadataValueKey<FSPath> >();
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
NoConfigEnvironment::preferred_root_key() const
{
return _imp->preferred_root_key;
@@ -618,7 +620,7 @@ NoConfigEnvironment::populate_sets() const
}
const std::shared_ptr<Repository>
-NoConfigEnvironment::repository_from_new_config_file(const FSEntry &)
+NoConfigEnvironment::repository_from_new_config_file(const FSPath &)
{
throw InternalError(PALUDIS_HERE, "can't create repositories on the fly for NoConfigEnvironment");
}
diff --git a/paludis/environments/no_config/no_config_environment.hh b/paludis/environments/no_config/no_config_environment.hh
index a2b1a31..c240a34 100644
--- a/paludis/environments/no_config/no_config_environment.hh
+++ b/paludis/environments/no_config/no_config_environment.hh
@@ -21,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_ENVIRONMENT_NO_CONFIG_NO_CONFIG_ENVIRONMENT_HH 1
#include <paludis/environment_implementation.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/pimp.hh>
#include <paludis/util/map-fwd.hh>
@@ -58,7 +57,7 @@ namespace paludis
NamedValue<n::disable_metadata_cache, bool> disable_metadata_cache;
NamedValue<n::extra_accept_keywords, std::string> extra_accept_keywords;
NamedValue<n::extra_params, std::shared_ptr<Map<std::string, std::string> > > extra_params;
- NamedValue<n::extra_repository_dirs, std::shared_ptr<const FSEntrySequence> > extra_repository_dirs;
+ NamedValue<n::extra_repository_dirs, std::shared_ptr<const FSPathSequence> > extra_repository_dirs;
NamedValue<n::master_repository_name, std::string> master_repository_name;
/**
@@ -70,9 +69,9 @@ namespace paludis
*/
NamedValue<n::profiles_if_not_auto, std::string> profiles_if_not_auto;
- NamedValue<n::repository_dir, FSEntry> repository_dir;
+ NamedValue<n::repository_dir, FSPath> repository_dir;
NamedValue<n::repository_type, no_config_environment::RepositoryType> repository_type;
- NamedValue<n::write_cache, FSEntry> write_cache;
+ NamedValue<n::write_cache, FSPath> write_cache;
};
}
@@ -110,7 +109,7 @@ namespace paludis
/**
* What is our top level directory for our main repository?
*/
- FSEntry main_repository_dir() const;
+ FSPath main_repository_dir() const;
/**
* Should we accept unstable keywords?
@@ -190,7 +189,7 @@ namespace paludis
virtual bool unmasked_by_user(const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> hook_dirs() const
+ virtual std::shared_ptr<const FSPathSequence> hook_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual uid_t reduced_uid() const;
@@ -214,14 +213,14 @@ namespace paludis
virtual bool remove_from_world(const SetName &) const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > config_location_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > preferred_root_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > config_location_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > preferred_root_key() const;
virtual const std::shared_ptr<OutputManager> create_output_manager(
const CreateOutputManagerInfo &) const;
virtual const std::shared_ptr<Repository> repository_from_new_config_file(
- const FSEntry &) PALUDIS_ATTRIBUTE((noreturn));
+ const FSPath &) PALUDIS_ATTRIBUTE((noreturn));
virtual void update_config_files_for_package_move(
const PackageDepSpec &, const QualifiedPackageName &) const;
diff --git a/paludis/environments/no_config/no_config_environment_TEST.cc b/paludis/environments/no_config/no_config_environment_TEST.cc
index 1a987bf..b0a09db 100644
--- a/paludis/environments/no_config/no_config_environment_TEST.cc
+++ b/paludis/environments/no_config/no_config_environment_TEST.cc
@@ -21,7 +21,6 @@
#include <test/test_runner.hh>
#include <test/test_framework.hh>
#include <paludis/util/sequence.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/make_named_values.hh>
using namespace test;
@@ -40,12 +39,12 @@ namespace test_cases
n::disable_metadata_cache() = false,
n::extra_accept_keywords() = "",
n::extra_params() = std::shared_ptr<Map<std::string, std::string> >(),
- n::extra_repository_dirs() = std::make_shared<FSEntrySequence>(),
+ n::extra_repository_dirs() = std::make_shared<FSPathSequence>(),
n::master_repository_name() = "",
n::profiles_if_not_auto() = "",
- n::repository_dir() = FSEntry("no_config_environment_TEST_dir/repo"),
+ n::repository_dir() = FSPath("no_config_environment_TEST_dir/repo"),
n::repository_type() = no_config_environment::ncer_auto,
- n::write_cache() = FSEntry("/var/empty")
+ n::write_cache() = FSPath("/var/empty")
));
TEST_CHECK(bool(e.package_database()));
diff --git a/paludis/environments/no_config/registration.cc b/paludis/environments/no_config/registration.cc
index d23873f..0f6f74b 100644
--- a/paludis/environments/no_config/registration.cc
+++ b/paludis/environments/no_config/registration.cc
@@ -39,9 +39,9 @@ namespace
std::shared_ptr<Map<std::string, std::string> > extra_params(
std::make_shared<Map<std::string, std::string>>());
- FSEntry repository_dir(FSEntry::cwd());
- std::shared_ptr<FSEntrySequence> extra_repository_dirs(std::make_shared<FSEntrySequence>());
- FSEntry write_cache("/var/empty");
+ FSPath repository_dir(FSPath::cwd());
+ std::shared_ptr<FSPathSequence> extra_repository_dirs(std::make_shared<FSPathSequence>());
+ FSPath write_cache("/var/empty");
std::string profile;
std::string master_repository_name;
bool disable_metadata_cache(false);
@@ -56,24 +56,24 @@ namespace
{
std::string::size_type p(t->find('='));
if (std::string::npos == p)
- repository_dir = *t;
+ repository_dir = FSPath(*t);
else
{
std::string key(t->substr(0, p)), value(t->substr(p + 1));
if (key == "write-cache")
- write_cache = value;
+ write_cache = FSPath(value);
else if (key == "master-repository-name")
master_repository_name = value;
else if (key == "master-repository-dir")
throw ConfigurationError("NoConfigEnvironment key master-repository-dir is no longer "
"supported, use master-repository-name and extra-repository-dir");
else if (key == "extra-repository-dir")
- extra_repository_dirs->push_back(value);
+ extra_repository_dirs->push_back(FSPath(value));
else if (key == "profile")
profile = value;
else if (key == "repository-dir")
- repository_dir = value;
+ repository_dir = FSPath(value);
else if (key == "disable-metadata-cache")
disable_metadata_cache = destringify<bool>(value);
else if (key == "accept-unstable")
diff --git a/paludis/environments/paludis/bashable_conf.cc b/paludis/environments/paludis/bashable_conf.cc
index 5c6bf24..4095e9f 100644
--- a/paludis/environments/paludis/bashable_conf.cc
+++ b/paludis/environments/paludis/bashable_conf.cc
@@ -19,7 +19,6 @@
#include "bashable_conf.hh"
#include <paludis/util/config_file.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/log.hh>
@@ -27,6 +26,8 @@
#include <paludis/util/process.hh>
#include <paludis/util/map.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/options.hh>
+#include <paludis/util/fs_path.hh>
#include <functional>
using namespace paludis;
@@ -44,7 +45,7 @@ std::string defined_vars_to_kv_func(
}
std::shared_ptr<LineConfigFile>
-paludis::paludis_environment::make_bashable_conf(const FSEntry & f, const LineConfigFileOptions & o)
+paludis::paludis_environment::make_bashable_conf(const FSPath & f, const LineConfigFileOptions & o)
{
Context context("When making a config file out of '" + stringify(f) + "':");
@@ -77,7 +78,7 @@ paludis::paludis_environment::make_bashable_conf(const FSEntry & f, const LineCo
}
std::shared_ptr<KeyValueConfigFile>
-paludis::paludis_environment::make_bashable_kv_conf(const FSEntry & f,
+paludis::paludis_environment::make_bashable_kv_conf(const FSPath & f,
const std::shared_ptr<const Map<std::string, std::string> > & predefined_variables,
const KeyValueConfigFileOptions & o)
{
diff --git a/paludis/environments/paludis/bashable_conf.hh b/paludis/environments/paludis/bashable_conf.hh
index 372753d..650cdd9 100644
--- a/paludis/environments/paludis/bashable_conf.hh
+++ b/paludis/environments/paludis/bashable_conf.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -20,7 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_ENVIRONMENTS_PALUDIS_BASHABLE_CONF_HH
#define PALUDIS_GUARD_PALUDIS_ENVIRONMENTS_PALUDIS_BASHABLE_CONF_HH 1
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/util/config_file-fwd.hh>
#include <paludis/util/map-fwd.hh>
#include <memory>
@@ -31,11 +31,11 @@ namespace paludis
namespace paludis_environment
{
std::shared_ptr<LineConfigFile> make_bashable_conf(
- const FSEntry &,
+ const FSPath &,
const LineConfigFileOptions &);
std::shared_ptr<KeyValueConfigFile> make_bashable_kv_conf(
- const FSEntry &,
+ const FSPath &,
const std::shared_ptr<const Map<std::string, std::string> > &,
const KeyValueConfigFileOptions &);
}
diff --git a/paludis/environments/paludis/keywords_conf.cc b/paludis/environments/paludis/keywords_conf.cc
index ea26d40..d40bc4e 100644
--- a/paludis/environments/paludis/keywords_conf.cc
+++ b/paludis/environments/paludis/keywords_conf.cc
@@ -83,7 +83,7 @@ KeywordsConf::~KeywordsConf()
}
void
-KeywordsConf::add(const FSEntry & filename)
+KeywordsConf::add(const FSPath & filename)
{
Context context("When adding source '" + stringify(filename) + "' as a keywords file:");
diff --git a/paludis/environments/paludis/keywords_conf.hh b/paludis/environments/paludis/keywords_conf.hh
index 4ac8e96..4e63286 100644
--- a/paludis/environments/paludis/keywords_conf.hh
+++ b/paludis/environments/paludis/keywords_conf.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_ENVIRONMENTS_PALUDIS_KEYWORDS_CONF_HH 1
#include <paludis/util/pimp.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/name-fwd.hh>
#include <paludis/package_id-fwd.hh>
@@ -55,7 +55,7 @@ namespace paludis
/**
* Add another file.
*/
- void add(const FSEntry &);
+ void add(const FSPath &);
/**
* Query a collection of keywords.
diff --git a/paludis/environments/paludis/licenses_conf.cc b/paludis/environments/paludis/licenses_conf.cc
index d40322e..2ebaeac 100644
--- a/paludis/environments/paludis/licenses_conf.cc
+++ b/paludis/environments/paludis/licenses_conf.cc
@@ -82,7 +82,7 @@ LicensesConf::~LicensesConf()
}
void
-LicensesConf::add(const FSEntry & filename)
+LicensesConf::add(const FSPath & filename)
{
Context context("When adding source '" + stringify(filename) + "' as a licenses file:");
diff --git a/paludis/environments/paludis/licenses_conf.hh b/paludis/environments/paludis/licenses_conf.hh
index 7935cc7..2071ad1 100644
--- a/paludis/environments/paludis/licenses_conf.hh
+++ b/paludis/environments/paludis/licenses_conf.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_PALUDIS_ENVIRONMENTS_PALUDIS_LICENSES_CONF_HH 1
#include <paludis/util/pimp.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/name-fwd.hh>
#include <paludis/package_id-fwd.hh>
@@ -55,7 +55,7 @@ namespace paludis
/**
* Add another file.
*/
- void add(const FSEntry &);
+ void add(const FSPath &);
/**
* Query a particular license.
diff --git a/paludis/environments/paludis/mirrors_conf.cc b/paludis/environments/paludis/mirrors_conf.cc
index 56394ea..7d20df1 100644
--- a/paludis/environments/paludis/mirrors_conf.cc
+++ b/paludis/environments/paludis/mirrors_conf.cc
@@ -65,7 +65,7 @@ MirrorsConf::~MirrorsConf()
}
void
-MirrorsConf::add(const FSEntry & filename)
+MirrorsConf::add(const FSPath & filename)
{
Context context("When adding source '" + stringify(filename) + "' as a mirrors file:");
diff --git a/paludis/environments/paludis/mirrors_conf.hh b/paludis/environments/paludis/mirrors_conf.hh
index ae9f5a6..89fc86b 100644
--- a/paludis/environments/paludis/mirrors_conf.hh
+++ b/paludis/environments/paludis/mirrors_conf.hh
@@ -55,7 +55,7 @@ namespace paludis
/**
* Add another file.
*/
- void add(const FSEntry &);
+ void add(const FSPath &);
/**
* Query a mirror.
diff --git a/paludis/environments/paludis/output_conf.cc b/paludis/environments/paludis/output_conf.cc
index ac68155..dc5834e 100644
--- a/paludis/environments/paludis/output_conf.cc
+++ b/paludis/environments/paludis/output_conf.cc
@@ -328,7 +328,7 @@ namespace
}
void
-OutputConf::add(const FSEntry & filename)
+OutputConf::add(const FSPath & filename)
{
Context context("When adding source '" + stringify(filename) + "' as an output file:");
diff --git a/paludis/environments/paludis/output_conf.hh b/paludis/environments/paludis/output_conf.hh
index 9abd315..684b7a4 100644
--- a/paludis/environments/paludis/output_conf.hh
+++ b/paludis/environments/paludis/output_conf.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_ENVIRONMENTS_PALUDIS_OUTPUT_CONF_HH 1
#include <paludis/util/pimp.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/output_manager-fwd.hh>
#include <paludis/create_output_manager_info-fwd.hh>
#include <memory>
@@ -50,7 +50,7 @@ namespace paludis
/**
* Add another file.
*/
- void add(const FSEntry &);
+ void add(const FSPath &);
const std::shared_ptr<OutputManager> create_output_manager(
const CreateOutputManagerInfo &) const;
diff --git a/paludis/environments/paludis/package_mask_conf.cc b/paludis/environments/paludis/package_mask_conf.cc
index 49df819..2206405 100644
--- a/paludis/environments/paludis/package_mask_conf.cc
+++ b/paludis/environments/paludis/package_mask_conf.cc
@@ -73,7 +73,7 @@ PackageMaskConf::~PackageMaskConf()
}
void
-PackageMaskConf::add(const FSEntry & filename)
+PackageMaskConf::add(const FSPath & filename)
{
Context context("When adding source '" + stringify(filename) + "' as a package mask or unmask file:");
diff --git a/paludis/environments/paludis/package_mask_conf.hh b/paludis/environments/paludis/package_mask_conf.hh
index 01409ef..feaa51e 100644
--- a/paludis/environments/paludis/package_mask_conf.hh
+++ b/paludis/environments/paludis/package_mask_conf.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_ENVIRONMENTS_PALUDIS_PACKAGE_MASK_CONF_HH 1
#include <paludis/util/pimp.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/name-fwd.hh>
#include <paludis/package_id-fwd.hh>
@@ -56,7 +56,7 @@ namespace paludis
/**
* Add another file.
*/
- void add(const FSEntry &);
+ void add(const FSPath &);
/**
* Query a mask.
diff --git a/paludis/environments/paludis/paludis_config.cc b/paludis/environments/paludis/paludis_config.cc
index a670173..8d50b18 100644
--- a/paludis/environments/paludis/paludis_config.cc
+++ b/paludis/environments/paludis/paludis_config.cc
@@ -30,8 +30,6 @@
#include <paludis/util/config_file.hh>
#include <paludis/util/destringify.hh>
-#include <paludis/util/dir_iterator.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/log.hh>
#include <paludis/util/stringify.hh>
@@ -49,6 +47,9 @@
#include <paludis/util/graph-impl.hh>
#include <paludis/util/member_iterator-impl.hh>
#include <paludis/util/process.hh>
+#include <paludis/util/fs_iterator.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_error.hh>
#include <paludis/distribution.hh>
#include <paludis/repository_factory.hh>
@@ -171,7 +172,7 @@ namespace paludis
std::string config_dir;
mutable Mutex distribution_mutex;
mutable std::string distribution;
- std::shared_ptr<FSEntrySequence> bashrc_files;
+ std::shared_ptr<FSPathSequence> bashrc_files;
Repos repos;
std::function<std::string (const std::string &)> predefined_conf_vars_func;
@@ -207,7 +208,7 @@ namespace paludis
env(e),
paludis_command("paludis"),
config_dir("(unset)"),
- bashrc_files(std::make_shared<FSEntrySequence>()),
+ bashrc_files(std::make_shared<FSPathSequence>()),
keywords_conf(std::make_shared<KeywordsConf>(e)),
use_conf(std::make_shared<UseConf>(e)),
licenses_conf(std::make_shared<LicensesConf>(e)),
@@ -233,7 +234,7 @@ namespace paludis
Context context("When loading general.conf:");
std::shared_ptr<KeyValueConfigFile> kv;
- std::shared_ptr<FSEntry> world_file;
+ std::shared_ptr<FSPath> world_file;
commandline_environment->insert("root", root);
commandline_environment->insert("ROOT", root);
@@ -246,18 +247,18 @@ namespace paludis
std::placeholders::_1,
std::placeholders::_2);
- if ((FSEntry(config_dir) / "general.conf").exists())
+ if ((FSPath(config_dir) / "general.conf").stat().exists())
{
kv = std::make_shared<KeyValueConfigFile>(
- FSEntry(config_dir) / "general.conf",
+ FSPath(config_dir) / "general.conf",
KeyValueConfigFileOptions(),
def_predefined,
&KeyValueConfigFile::no_transformation);
}
- else if ((FSEntry(config_dir) / "general.bash").exists())
+ else if ((FSPath(config_dir) / "general.bash").stat().exists())
{
std::stringstream s;
- Process process(ProcessCommand({ "bash", stringify(FSEntry(config_dir) / "general.bash") }));
+ Process process(ProcessCommand({ "bash", stringify(FSPath(config_dir) / "general.bash") }));
process
.setenv("PALUDIS_LOG_LEVEL", stringify(Log::get_instance()->log_level()))
.setenv("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis"))
@@ -273,31 +274,31 @@ namespace paludis
if (exit_status != 0)
{
Log::get_instance()->message("paludis_environment.general.bash.failure", ll_warning, lc_context)
- << "Script '" << (FSEntry(config_dir) / "general.bash") <<
+ << "Script '" << (FSPath(config_dir) / "general.bash") <<
"' returned non-zero exit status '" << exit_status << "'";
kv.reset();
}
}
- else if ((FSEntry(config_dir) / "environment.conf").exists())
+ else if ((FSPath(config_dir) / "environment.conf").stat().exists())
{
Log::get_instance()->message("paludis_environment.general.rename", ll_warning, lc_context)
- << "The file '" << (FSEntry(config_dir) / "environment.conf") << "' should be renamed to '"
- << (FSEntry(config_dir) / "general.conf") << "'.";
+ << "The file '" << (FSPath(config_dir) / "environment.conf") << "' should be renamed to '"
+ << (FSPath(config_dir) / "general.conf") << "'.";
kv = std::make_shared<KeyValueConfigFile>(
- FSEntry(config_dir) / "environment.conf",
+ FSPath(config_dir) / "environment.conf",
KeyValueConfigFileOptions(),
def_predefined,
&KeyValueConfigFile::no_transformation);
}
- else if ((FSEntry(config_dir) / "environment.bash").exists())
+ else if ((FSPath(config_dir) / "environment.bash").stat().exists())
{
Log::get_instance()->message("paludis_environment.general.rename", ll_warning, lc_context)
- << "The file '" << (FSEntry(config_dir) / "environment.bash") << "' should be renamed to '"
- << (FSEntry(config_dir) / "general.bash") << "'.";
+ << "The file '" << (FSPath(config_dir) / "environment.bash") << "' should be renamed to '"
+ << (FSPath(config_dir) / "general.bash") << "'.";
std::stringstream s;
- Process process(ProcessCommand({ "bash", stringify(FSEntry(config_dir) / "environment.bash") }));
+ Process process(ProcessCommand({ "bash", stringify(FSPath(config_dir) / "environment.bash") }));
process
.setenv("PALUDIS_LOG_LEVEL", stringify(Log::get_instance()->log_level()))
.setenv("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis"))
@@ -313,7 +314,7 @@ namespace paludis
if (exit_status != 0)
{
Log::get_instance()->message("paludis_environment.general.bash.failure", ll_warning, lc_context)
- << "Script '" << (FSEntry(config_dir) / "general.bash") <<
+ << "Script '" << (FSPath(config_dir) / "general.bash") <<
"' returned non-zero exit status '" << exit_status << "'";
kv.reset();
}
@@ -356,12 +357,12 @@ namespace paludis
distribution = kv->get("distribution");
if (! kv->get("world").empty())
- world_file = std::make_shared<FSEntry>(kv->get("world"));
+ world_file = std::make_shared<FSPath>(kv->get("world"));
if (! world_file)
Log::get_instance()->message("paludis_environment.world.no_world", ll_warning, lc_context)
<< "No world file specified. You should specify 'world = /path/to/world/file' in "
- << (FSEntry(config_dir) / "general.conf")
+ << (FSPath(config_dir) / "general.conf")
<< ". Any attempted updates to world will not be saved.";
world = std::make_shared<World>(env, world_file);
@@ -410,22 +411,22 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
}
}
- FSEntry local_config_dir(FSEntry(getenv_with_default("PALUDIS_HOME", getenv_or_error("HOME"))) /
+ FSPath local_config_dir(FSPath(getenv_with_default("PALUDIS_HOME", getenv_or_error("HOME"))) /
(".paludis" + local_config_suffix)), old_config_dir(local_config_dir);
try
{
- if (! local_config_dir.exists())
- local_config_dir = (FSEntry(SYSCONFDIR) / ("paludis" + local_config_suffix));
+ if (! local_config_dir.stat().exists())
+ local_config_dir = (FSPath(SYSCONFDIR) / ("paludis" + local_config_suffix));
}
catch (const FSError &)
{
- local_config_dir = (FSEntry(SYSCONFDIR) / ("paludis" + local_config_suffix));
+ local_config_dir = (FSPath(SYSCONFDIR) / ("paludis" + local_config_suffix));
}
if (_imp->commandline_environment->end() == _imp->commandline_environment->find("root"))
{
- if (! local_config_dir.exists())
+ if (! local_config_dir.stat().exists())
throw PaludisConfigNoDirectoryError("Can't find configuration directory (tried '"
+ stringify(old_config_dir) + "', '" + stringify(local_config_dir) + "')");
@@ -441,7 +442,7 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
std::placeholders::_1,
std::placeholders::_2);
- if ((local_config_dir / "specpath.conf").exists())
+ if ((local_config_dir / "specpath.conf").stat().exists())
{
specpath = std::make_shared<KeyValueConfigFile>(
local_config_dir / "specpath.conf",
@@ -468,10 +469,10 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
local_config_suffix.insert(0, "-");
}
- if (! _imp->root_prefix.empty() && stringify(FSEntry(_imp->root_prefix).realpath()) != "/")
+ if (! _imp->root_prefix.empty() && stringify(FSPath(_imp->root_prefix).realpath()) != "/")
{
- local_config_dir = FSEntry(_imp->root_prefix) / SYSCONFDIR / ("paludis" + local_config_suffix);
- if (! local_config_dir.exists())
+ local_config_dir = FSPath(_imp->root_prefix) / SYSCONFDIR / ("paludis" + local_config_suffix);
+ if (! local_config_dir.stat().exists())
throw PaludisConfigError("Can't find configuration directory under root ("
"tried '" + stringify(local_config_dir) + "' and couldn't find any "
"specpath variables on the commandline");
@@ -525,7 +526,7 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
{
/* add normal repositories. start by getting defaults for config files... */
- if ((local_config_dir / (dist->repository_defaults_filename_part() + ".conf")).exists())
+ if ((local_config_dir / (dist->repository_defaults_filename_part() + ".conf")).stat().exists())
{
_imp->predefined_conf_vars_func = std::bind(&from_kv, std::make_shared<KeyValueConfigFile>(
local_config_dir / (dist->repository_defaults_filename_part() + ".conf"), KeyValueConfigFileOptions(),
@@ -533,7 +534,7 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
&KeyValueConfigFile::no_transformation),
std::placeholders::_1);
}
- else if ((local_config_dir / (dist->repository_defaults_filename_part() + ".bash")).exists())
+ else if ((local_config_dir / (dist->repository_defaults_filename_part() + ".bash")).stat().exists())
{
std::stringstream s;
Process process(ProcessCommand({ "bash", stringify(local_config_dir / (dist->repository_defaults_filename_part() + ".bash")) + "'" }));
@@ -555,26 +556,26 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
}
/* find candidate config directories */
- std::list<FSEntry> dirs;
+ std::list<FSPath> dirs;
dirs.push_back(local_config_dir / dist->repositories_directory());
/* find repo config files */
- std::list<FSEntry> repo_files;
- for (std::list<FSEntry>::const_iterator dir(dirs.begin()), dir_end(dirs.end()) ;
+ std::list<FSPath> repo_files;
+ for (std::list<FSPath>::const_iterator dir(dirs.begin()), dir_end(dirs.end()) ;
dir != dir_end ; ++dir)
{
- if (! dir->exists())
+ if (! dir->stat().exists())
continue;
- std::remove_copy_if(DirIterator(*dir), DirIterator(), std::back_inserter(repo_files),
+ std::remove_copy_if(FSIterator(*dir, { }), FSIterator(), std::back_inserter(repo_files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
- std::remove_copy_if(DirIterator(*dir), DirIterator(), std::back_inserter(repo_files),
+ std::remove_copy_if(FSIterator(*dir, { }), FSIterator(), std::back_inserter(repo_files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
/* get a mapping from repository name to key function, so we can work out the order */
std::unordered_map<RepositoryName, std::function<std::string (const std::string &)>, Hash<RepositoryName> > repo_configs;
- for (std::list<FSEntry>::const_iterator repo_file(repo_files.begin()), repo_file_end(repo_files.end()) ;
+ for (std::list<FSPath>::const_iterator repo_file(repo_files.begin()), repo_file_end(repo_files.end()) ;
repo_file != repo_file_end ; ++repo_file)
{
Context local_context("When reading repository file '" + stringify(*repo_file) + "':");
@@ -661,23 +662,23 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
/* keywords */
{
- std::list<FSEntry> files;
+ std::list<FSPath> files;
files.push_back(local_config_dir / (dist->keywords_filename_part() + ".conf"));
files.push_back(local_config_dir / (dist->keywords_filename_part() + ".bash"));
- if ((local_config_dir / (dist->keywords_filename_part() + ".conf.d")).exists())
+ if ((local_config_dir / (dist->keywords_filename_part() + ".conf.d")).stat().exists())
{
- std::remove_copy_if(DirIterator(local_config_dir / (dist->keywords_filename_part() + ".conf.d")), DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->keywords_filename_part() + ".conf.d"), { }), FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
- std::remove_copy_if(DirIterator(local_config_dir / (dist->keywords_filename_part() + ".conf.d")), DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->keywords_filename_part() + ".conf.d"), { }), FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
- for (std::list<FSEntry>::const_iterator file(files.begin()), file_end(files.end()) ;
+ for (std::list<FSPath>::const_iterator file(files.begin()), file_end(files.end()) ;
file != file_end ; ++file)
{
Context local_context("When reading keywords file '" + stringify(*file) + "':");
- if (! file->exists())
+ if (! file->stat().exists())
continue;
_imp->keywords_conf->add(*file);
@@ -686,26 +687,26 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
/* output */
{
- std::list<FSEntry> files;
+ std::list<FSPath> files;
files.push_back(local_config_dir / (dist->output_filename_part() + ".conf"));
files.push_back(local_config_dir / (dist->output_filename_part() + ".bash"));
- files.push_back(getenv_with_default("PALUDIS_DEFAULT_OUTPUT_CONF",
- SHAREDIR "/paludis/environments/paludis/default_output.conf"));
- if ((local_config_dir / (dist->output_filename_part() + ".conf.d")).exists())
+ files.push_back(FSPath(getenv_with_default("PALUDIS_DEFAULT_OUTPUT_CONF",
+ SHAREDIR "/paludis/environments/paludis/default_output.conf")));
+ if ((local_config_dir / (dist->output_filename_part() + ".conf.d")).stat().exists())
{
- std::remove_copy_if(DirIterator(local_config_dir / (dist->output_filename_part() + ".conf.d")), DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->output_filename_part() + ".conf.d"), { }), FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
- std::remove_copy_if(DirIterator(local_config_dir / (dist->output_filename_part() + ".conf.d")), DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->output_filename_part() + ".conf.d"), { }), FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
bool any(false);
- for (std::list<FSEntry>::const_iterator file(files.begin()), file_end(files.end()) ;
+ for (std::list<FSPath>::const_iterator file(files.begin()), file_end(files.end()) ;
file != file_end ; ++file)
{
Context local_context("When reading output file '" + stringify(*file) + "':");
- if (! file->exists())
+ if (! file->stat().exists())
continue;
_imp->output_conf->add(*file);
@@ -718,23 +719,23 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
/* use */
{
- std::list<FSEntry> files;
+ std::list<FSPath> files;
files.push_back(local_config_dir / (dist->use_filename_part() + ".conf"));
files.push_back(local_config_dir / (dist->use_filename_part() + ".bash"));
- if ((local_config_dir / (dist->use_filename_part() + ".conf.d")).exists())
+ if ((local_config_dir / (dist->use_filename_part() + ".conf.d")).stat().exists())
{
- std::remove_copy_if(DirIterator(local_config_dir / (dist->use_filename_part() + ".conf.d")), DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->use_filename_part() + ".conf.d"), { }), FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
- std::remove_copy_if(DirIterator(local_config_dir / (dist->use_filename_part() + ".conf.d")), DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->use_filename_part() + ".conf.d"), { }), FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
- for (std::list<FSEntry>::const_iterator file(files.begin()), file_end(files.end()) ;
+ for (std::list<FSPath>::const_iterator file(files.begin()), file_end(files.end()) ;
file != file_end ; ++file)
{
Context local_context("When reading use file '" + stringify(*file) + "':");
- if (! file->exists())
+ if (! file->stat().exists())
continue;
_imp->use_conf->add(*file);
@@ -743,23 +744,23 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
/* licenses */
{
- std::list<FSEntry> files;
+ std::list<FSPath> files;
files.push_back(local_config_dir / (dist->licenses_filename_part() + ".conf"));
files.push_back(local_config_dir / (dist->licenses_filename_part() + ".bash"));
- if ((local_config_dir / (dist->licenses_filename_part() + ".conf.d")).exists())
+ if ((local_config_dir / (dist->licenses_filename_part() + ".conf.d")).stat().exists())
{
- std::remove_copy_if(DirIterator(local_config_dir / (dist->licenses_filename_part() + ".conf.d")), DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->licenses_filename_part() + ".conf.d"), { }), FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
- std::remove_copy_if(DirIterator(local_config_dir / (dist->licenses_filename_part() + ".conf.d")), DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->licenses_filename_part() + ".conf.d"), { }), FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
- for (std::list<FSEntry>::const_iterator file(files.begin()), file_end(files.end()) ;
+ for (std::list<FSPath>::const_iterator file(files.begin()), file_end(files.end()) ;
file != file_end ; ++file)
{
Context local_context("When reading licenses file '" + stringify(*file) + "':");
- if (! file->exists())
+ if (! file->stat().exists())
continue;
_imp->licenses_conf->add(*file);
@@ -768,25 +769,25 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
/* user mask */
{
- std::list<FSEntry> files;
+ std::list<FSPath> files;
files.push_back(local_config_dir / (dist->package_mask_filename_part() + ".conf"));
files.push_back(local_config_dir / (dist->package_mask_filename_part() + ".bash"));
- if ((local_config_dir / (dist->package_mask_filename_part() + ".conf.d")).exists())
+ if ((local_config_dir / (dist->package_mask_filename_part() + ".conf.d")).stat().exists())
{
- std::remove_copy_if(DirIterator(local_config_dir / (dist->package_mask_filename_part() + ".conf.d")),
- DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->package_mask_filename_part() + ".conf.d"), { }),
+ FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
- std::remove_copy_if(DirIterator(local_config_dir / (dist->package_mask_filename_part() + ".conf.d")),
- DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->package_mask_filename_part() + ".conf.d"), { }),
+ FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
- for (std::list<FSEntry>::const_iterator file(files.begin()), file_end(files.end()) ;
+ for (std::list<FSPath>::const_iterator file(files.begin()), file_end(files.end()) ;
file != file_end ; ++file)
{
Context local_context("When reading package_mask file '" + stringify(*file) + "':");
- if (! file->exists())
+ if (! file->stat().exists())
continue;
_imp->package_mask_conf->add(*file);
@@ -795,25 +796,25 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
/* user unmask */
{
- std::list<FSEntry> files;
+ std::list<FSPath> files;
files.push_back(local_config_dir / (dist->package_unmask_filename_part() + ".conf"));
files.push_back(local_config_dir / (dist->package_unmask_filename_part() + ".bash"));
- if ((local_config_dir / (dist->package_unmask_filename_part() + ".conf.d")).exists())
+ if ((local_config_dir / (dist->package_unmask_filename_part() + ".conf.d")).stat().exists())
{
- std::remove_copy_if(DirIterator(local_config_dir / (dist->package_unmask_filename_part() + ".conf.d")),
- DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->package_unmask_filename_part() + ".conf.d"), { }),
+ FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
- std::remove_copy_if(DirIterator(local_config_dir / (dist->package_unmask_filename_part() + ".conf.d")),
- DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->package_unmask_filename_part() + ".conf.d"), { }),
+ FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
- for (std::list<FSEntry>::const_iterator file(files.begin()), file_end(files.end()) ;
+ for (std::list<FSPath>::const_iterator file(files.begin()), file_end(files.end()) ;
file != file_end ; ++file)
{
Context local_context("When reading package_unmask file '" + stringify(*file) + "':");
- if (! file->exists())
+ if (! file->stat().exists())
continue;
_imp->package_unmask_conf->add(*file);
@@ -822,23 +823,23 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
/* mirrors */
{
- std::list<FSEntry> files;
+ std::list<FSPath> files;
files.push_back(local_config_dir / (dist->mirrors_filename_part() + ".conf"));
files.push_back(local_config_dir / (dist->mirrors_filename_part() + ".bash"));
- if ((local_config_dir / (dist->mirrors_filename_part() + ".conf.d")).exists())
+ if ((local_config_dir / (dist->mirrors_filename_part() + ".conf.d")).stat().exists())
{
- std::remove_copy_if(DirIterator(local_config_dir / (dist->mirrors_filename_part() + ".conf.d")), DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->mirrors_filename_part() + ".conf.d"), { }), FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
- std::remove_copy_if(DirIterator(local_config_dir / (dist->mirrors_filename_part() + ".conf.d")), DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->mirrors_filename_part() + ".conf.d"), { }), FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
- for (std::list<FSEntry>::const_iterator file(files.begin()), file_end(files.end()) ;
+ for (std::list<FSPath>::const_iterator file(files.begin()), file_end(files.end()) ;
file != file_end ; ++file)
{
Context local_context("When reading mirrors file '" + stringify(*file) + "':");
- if (! file->exists())
+ if (! file->stat().exists())
continue;
_imp->mirrors_conf->add(*file);
@@ -853,7 +854,7 @@ PaludisConfig::~PaludisConfig()
}
const std::function<std::string (const std::string &)>
-PaludisConfig::repo_func_from_file(const FSEntry & repo_file)
+PaludisConfig::repo_func_from_file(const FSPath & repo_file)
{
std::shared_ptr<KeyValueConfigFile> kv;
if (is_file_with_extension(repo_file, ".bash", { }))
@@ -890,7 +891,7 @@ PaludisConfig::repo_func_from_file(const FSEntry & repo_file)
return repo_func;
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
PaludisConfig::bashrc_files() const
{
return _imp->bashrc_files;
diff --git a/paludis/environments/paludis/paludis_config.hh b/paludis/environments/paludis/paludis_config.hh
index 468948c..d319f45 100644
--- a/paludis/environments/paludis/paludis_config.hh
+++ b/paludis/environments/paludis/paludis_config.hh
@@ -28,7 +28,6 @@
#include <paludis/util/map-fwd.hh>
#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/util/named_value.hh>
-#include <paludis/util/fs_entry-fwd.hh>
#include <string>
@@ -134,14 +133,14 @@ namespace paludis
RepositoryConstIterator end_repositories() const;
- const std::function<std::string (const std::string &)> repo_func_from_file(const FSEntry &);
+ const std::function<std::string (const std::string &)> repo_func_from_file(const FSPath &);
///\}
/**
* Our bashrc files.
*/
- std::shared_ptr<const FSEntrySequence> bashrc_files() const;
+ std::shared_ptr<const FSPathSequence> bashrc_files() const;
/**
* The ROOT.
diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index cde353f..c7ed4e7 100644
--- a/paludis/environments/paludis/paludis_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -38,11 +38,11 @@
#include <paludis/user_dep_spec.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/repository_factory.hh>
+#include <paludis/standard_output_manager.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/log.hh>
#include <paludis/util/system.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/save.hh>
@@ -55,7 +55,9 @@
#include <paludis/util/options.hh>
#include <paludis/util/tribool.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/standard_output_manager.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_iterator.hh>
+#include <paludis/util/fs_error.hh>
#include <functional>
#include <algorithm>
@@ -73,7 +75,7 @@ namespace paludis
mutable Mutex hook_mutex;
mutable bool done_hooks;
mutable std::shared_ptr<Hooker> hooker;
- mutable std::list<std::pair<FSEntry, bool> > hook_dirs;
+ mutable std::list<std::pair<FSPath, bool> > hook_dirs;
std::shared_ptr<PaludisConfig> config;
std::string paludis_command;
@@ -84,9 +86,9 @@ namespace paludis
mutable std::map<SetName, std::shared_ptr<const SetSpecTree> > sets;
std::shared_ptr<LiteralMetadataValueKey<std::string> > format_key;
- std::shared_ptr<LiteralMetadataValueKey<FSEntry> > config_location_key;
- std::shared_ptr<LiteralMetadataValueKey<FSEntry> > world_file_key;
- std::shared_ptr<LiteralMetadataValueKey<FSEntry> > preferred_root_key;
+ std::shared_ptr<LiteralMetadataValueKey<FSPath> > config_location_key;
+ std::shared_ptr<LiteralMetadataValueKey<FSPath> > world_file_key;
+ std::shared_ptr<LiteralMetadataValueKey<FSPath> > preferred_root_key;
Imp(PaludisEnvironment * const e, std::shared_ptr<PaludisConfig> c) :
done_hooks(false),
@@ -94,21 +96,21 @@ namespace paludis
paludis_command("paludis"),
package_database(std::make_shared<PackageDatabase>(e)),
format_key(std::make_shared<LiteralMetadataValueKey<std::string>>("format", "Format", mkt_significant, "paludis")),
- config_location_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("conf_dir", "Config dir", mkt_normal,
- config->config_dir())),
- world_file_key(config->world()->location_if_set() ? std::make_shared<LiteralMetadataValueKey<FSEntry>>("world_file", "World file", mkt_normal,
+ config_location_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("conf_dir", "Config dir", mkt_normal,
+ FSPath(config->config_dir()))),
+ world_file_key(config->world()->location_if_set() ? std::make_shared<LiteralMetadataValueKey<FSPath>>("world_file", "World file", mkt_normal,
*config->world()->location_if_set())
- : std::shared_ptr<LiteralMetadataValueKey<FSEntry> >()),
- preferred_root_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("root", "Root", mkt_normal,
- config->root()))
+ : std::shared_ptr<LiteralMetadataValueKey<FSPath> >()),
+ preferred_root_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("root", "Root", mkt_normal,
+ FSPath(config->root())))
{
}
- void add_one_hook(const FSEntry & r, const bool v) const
+ void add_one_hook(const FSPath & r, const bool v) const
{
try
{
- if (r.is_directory())
+ if (r.stat().is_directory())
{
Log::get_instance()->message("paludis_environment.hooks.add_dir", ll_debug, lc_no_context)
<< "Adding hook directory '" << r << "'";
@@ -126,16 +128,16 @@ namespace paludis
}
}
- void need_hook_dirs(const FSEntry & c) const
+ void need_hook_dirs(const FSPath & c) const
{
if (! done_hooks)
{
add_one_hook(c / "hooks", true);
if (getenv_with_default("PALUDIS_NO_GLOBAL_HOOKS", "").empty())
{
- add_one_hook(FSEntry(LIBEXECDIR) / "paludis" / "hooks", false);
- add_one_hook(FSEntry(DATADIR) / "paludis" / "hooks", true);
- add_one_hook(FSEntry(LIBDIR) / "paludis" / "hooks", true);
+ add_one_hook(FSPath(LIBEXECDIR) / "paludis" / "hooks", false);
+ add_one_hook(FSPath(DATADIR) / "paludis" / "hooks", true);
+ add_one_hook(FSPath(LIBDIR) / "paludis" / "hooks", true);
}
done_hooks = true;
}
@@ -192,7 +194,7 @@ PaludisEnvironment::unmasked_by_user(const PackageID & d) const
return _imp->config->package_unmask_conf()->query(d);
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
PaludisEnvironment::bashrc_files() const
{
return _imp->config->bashrc_files();
@@ -219,9 +221,9 @@ PaludisEnvironment::perform_hook(
if (! _imp->hooker)
{
- _imp->need_hook_dirs(_imp->config->config_dir());
+ _imp->need_hook_dirs(FSPath(_imp->config->config_dir()));
_imp->hooker = std::make_shared<Hooker>(this);
- for (std::list<std::pair<FSEntry, bool> >::const_iterator h(_imp->hook_dirs.begin()),
+ for (std::list<std::pair<FSPath, bool> >::const_iterator h(_imp->hook_dirs.begin()),
h_end(_imp->hook_dirs.end()) ; h != h_end ; ++h)
_imp->hooker->add_dir(h->first, h->second);
}
@@ -229,46 +231,46 @@ PaludisEnvironment::perform_hook(
return _imp->hooker->perform_hook(hook, optional_output_manager);
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
PaludisEnvironment::hook_dirs() const
{
Lock lock(_imp->hook_mutex);
- _imp->need_hook_dirs(_imp->config->config_dir());
+ _imp->need_hook_dirs(FSPath(_imp->config->config_dir()));
- std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> result(std::make_shared<FSPathSequence>());
std::transform(_imp->hook_dirs.begin(), _imp->hook_dirs.end(), result->back_inserter(),
- std::mem_fn(&std::pair<FSEntry, bool>::first));
+ std::mem_fn(&std::pair<FSPath, bool>::first));
return result;
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
PaludisEnvironment::fetchers_dirs() const
{
- std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> result(std::make_shared<FSPathSequence>());
- result->push_back(FSEntry(_imp->config->config_dir()) / "fetchers");
+ result->push_back(FSPath(_imp->config->config_dir()) / "fetchers");
if (getenv_with_default("PALUDIS_NO_GLOBAL_FETCHERS", "").empty())
{
- std::shared_ptr<const FSEntrySequence> r(EnvironmentImplementation::fetchers_dirs());
+ std::shared_ptr<const FSPathSequence> r(EnvironmentImplementation::fetchers_dirs());
std::copy(r->begin(), r->end(), result->back_inserter());
}
return result;
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
PaludisEnvironment::syncers_dirs() const
{
- std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> result(std::make_shared<FSPathSequence>());
- result->push_back(FSEntry(_imp->config->config_dir()) / "syncers");
+ result->push_back(FSPath(_imp->config->config_dir()) / "syncers");
if (getenv_with_default("PALUDIS_NO_GLOBAL_SYNCERS", "").empty())
{
- std::shared_ptr<const FSEntrySequence> r(EnvironmentImplementation::syncers_dirs());
+ std::shared_ptr<const FSPathSequence> r(EnvironmentImplementation::syncers_dirs());
std::copy(r->begin(), r->end(), result->back_inserter());
}
@@ -443,13 +445,13 @@ PaludisEnvironment::format_key() const
return _imp->format_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
PaludisEnvironment::config_location_key() const
{
return _imp->config_location_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
PaludisEnvironment::preferred_root_key() const
{
return _imp->preferred_root_key;
@@ -499,7 +501,7 @@ namespace
std::shared_ptr<const SetSpecTree> make_set(
const Environment * const env,
- const FSEntry & f,
+ const FSPath & f,
const SetName & n,
SetFileSetOperatorMode mode,
SetFileType type)
@@ -527,14 +529,13 @@ PaludisEnvironment::populate_sets() const
Lock lock(_imp->sets_mutex);
add_set(SetName("world"), SetName("world::environment"), std::bind(&make_world_set, _imp->config->world()), true);
- FSEntry sets_dir(FSEntry(_imp->config->config_dir()) / "sets");
+ FSPath sets_dir(FSPath(_imp->config->config_dir()) / "sets");
Context context("When looking in sets directory '" + stringify(sets_dir) + "':");
- if (! sets_dir.exists())
+ if (! sets_dir.stat().exists())
return;
- for (DirIterator d(sets_dir, { dio_inode_sort }), d_end ;
- d != d_end ; ++d)
+ for (FSIterator d(sets_dir, { fsio_inode_sort }), d_end ; d != d_end ; ++d)
{
if (is_file_with_extension(*d, ".bash", { }))
{
@@ -556,7 +557,7 @@ PaludisEnvironment::populate_sets() const
}
const std::shared_ptr<Repository>
-PaludisEnvironment::repository_from_new_config_file(const FSEntry & f)
+PaludisEnvironment::repository_from_new_config_file(const FSPath & f)
{
const std::function<std::string (const std::string &)> repo_func(_imp->config->repo_func_from_file(f));
if (! repo_func)
diff --git a/paludis/environments/paludis/paludis_environment.hh b/paludis/environments/paludis/paludis_environment.hh
index c582923..04eb5c6 100644
--- a/paludis/environments/paludis/paludis_environment.hh
+++ b/paludis/environments/paludis/paludis_environment.hh
@@ -76,16 +76,16 @@ namespace paludis
///\}
- virtual std::shared_ptr<const FSEntrySequence> bashrc_files() const
+ virtual std::shared_ptr<const FSPathSequence> bashrc_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> syncers_dirs() const
+ virtual std::shared_ptr<const FSPathSequence> syncers_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> fetchers_dirs() const
+ virtual std::shared_ptr<const FSPathSequence> fetchers_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> hook_dirs() const
+ virtual std::shared_ptr<const FSPathSequence> hook_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual uid_t reduced_uid() const
@@ -140,8 +140,8 @@ namespace paludis
virtual bool remove_from_world(const SetName &) const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > config_location_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > preferred_root_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > config_location_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > preferred_root_key() const;
virtual const Tribool want_choice_enabled(
const std::shared_ptr<const PackageID> &,
@@ -167,7 +167,7 @@ namespace paludis
const CreateOutputManagerInfo &) const;
virtual const std::shared_ptr<Repository> repository_from_new_config_file(
- const FSEntry &) PALUDIS_ATTRIBUTE((warn_unused_result));
+ const FSPath &) PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void update_config_files_for_package_move(
const PackageDepSpec &, const QualifiedPackageName &) const;
diff --git a/paludis/environments/paludis/paludis_environment_TEST.cc b/paludis/environments/paludis/paludis_environment_TEST.cc
index f045eeb..787e471 100644
--- a/paludis/environments/paludis/paludis_environment_TEST.cc
+++ b/paludis/environments/paludis/paludis_environment_TEST.cc
@@ -19,7 +19,6 @@
#include "paludis_environment.hh"
#include "paludis_config.hh"
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
@@ -58,7 +57,7 @@ namespace test_cases
void run()
{
- setenv("PALUDIS_HOME", stringify(FSEntry::cwd() / "paludis_environment_TEST_dir" / "home1").c_str(), 1);
+ setenv("PALUDIS_HOME", stringify(FSPath::cwd() / "paludis_environment_TEST_dir" / "home1").c_str(), 1);
unsetenv("PALUDIS_SKIP_CONFIG");
std::shared_ptr<Environment> env(std::make_shared<PaludisEnvironment>(""));
@@ -91,7 +90,7 @@ namespace test_cases
void run()
{
- setenv("PALUDIS_HOME", stringify(FSEntry::cwd() / "paludis_environment_TEST_dir" / "home5").c_str(), 1);
+ setenv("PALUDIS_HOME", stringify(FSPath::cwd() / "paludis_environment_TEST_dir" / "home5").c_str(), 1);
unsetenv("PALUDIS_SKIP_CONFIG");
std::shared_ptr<Environment> env(std::make_shared<PaludisEnvironment>(""));
@@ -117,7 +116,7 @@ namespace test_cases
void run()
{
- setenv("PALUDIS_HOME", stringify(FSEntry::cwd() / "paludis_environment_TEST_dir" / "home2").c_str(), 1);
+ setenv("PALUDIS_HOME", stringify(FSPath::cwd() / "paludis_environment_TEST_dir" / "home2").c_str(), 1);
unsetenv("PALUDIS_SKIP_CONFIG");
std::shared_ptr<Environment> env(std::make_shared<PaludisEnvironment>(""));
@@ -150,7 +149,7 @@ namespace test_cases
void run()
{
- setenv("PALUDIS_HOME", stringify(FSEntry::cwd() / "paludis_environment_TEST_dir" / "home3").c_str(), 1);
+ setenv("PALUDIS_HOME", stringify(FSPath::cwd() / "paludis_environment_TEST_dir" / "home3").c_str(), 1);
unsetenv("PALUDIS_SKIP_CONFIG");
std::shared_ptr<Environment> env(std::make_shared<PaludisEnvironment>(""));
@@ -183,7 +182,7 @@ namespace test_cases
void run()
{
- setenv("PALUDIS_HOME", stringify(FSEntry::cwd() / "paludis_environment_TEST_dir" / "home4").c_str(), 1);
+ setenv("PALUDIS_HOME", stringify(FSPath::cwd() / "paludis_environment_TEST_dir" / "home4").c_str(), 1);
unsetenv("PALUDIS_SKIP_CONFIG");
std::shared_ptr<Environment> env(std::make_shared<PaludisEnvironment>(""));
diff --git a/paludis/environments/paludis/use_conf.cc b/paludis/environments/paludis/use_conf.cc
index e671272..8cf21b7 100644
--- a/paludis/environments/paludis/use_conf.cc
+++ b/paludis/environments/paludis/use_conf.cc
@@ -21,7 +21,6 @@
#include <paludis/environments/paludis/paludis_environment.hh>
#include <paludis/environments/paludis/bashable_conf.hh>
#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/tribool.hh>
#include <paludis/paludislike_options_conf.hh>
@@ -60,7 +59,7 @@ UseConf::~UseConf()
}
void
-UseConf::add(const FSEntry & filename)
+UseConf::add(const FSPath & filename)
{
Context context("When adding source '" + stringify(filename) + "' as a use file:");
diff --git a/paludis/environments/paludis/use_conf.hh b/paludis/environments/paludis/use_conf.hh
index 6ce0a63..f945e4f 100644
--- a/paludis/environments/paludis/use_conf.hh
+++ b/paludis/environments/paludis/use_conf.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_PALUDIS_ENVIRONMENTS_PALUDIS_USE_CONF_HH 1
#include <paludis/util/pimp.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/util/tribool-fwd.hh>
#include <paludis/choice-fwd.hh>
#include <paludis/name-fwd.hh>
@@ -57,7 +57,7 @@ namespace paludis
/**
* Add another file.
*/
- void add(const FSEntry &);
+ void add(const FSPath &);
const Tribool want_choice_enabled(
const std::shared_ptr<const PackageID> &,
diff --git a/paludis/environments/paludis/world.cc b/paludis/environments/paludis/world.cc
index 714f185..79e865d 100644
--- a/paludis/environments/paludis/world.cc
+++ b/paludis/environments/paludis/world.cc
@@ -19,12 +19,12 @@
#include <paludis/environments/paludis/world.hh>
#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/log.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/safe_ofstream.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/set_file.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/dep_tag.hh>
@@ -40,10 +40,10 @@ namespace paludis
struct Imp<World>
{
const Environment * const env;
- const std::shared_ptr<const FSEntry> maybe_world_file;
+ const std::shared_ptr<const FSPath> maybe_world_file;
mutable Mutex mutex;
- Imp(const Environment * const e, const std::shared_ptr<const FSEntry> & m) :
+ Imp(const Environment * const e, const std::shared_ptr<const FSPath> & m) :
env(e),
maybe_world_file(m)
{
@@ -51,7 +51,7 @@ namespace paludis
};
}
-World::World(const Environment * const e, const std::shared_ptr<const FSEntry> & f) :
+World::World(const Environment * const e, const std::shared_ptr<const FSPath> & f) :
Pimp<World>(e, f)
{
}
@@ -102,7 +102,7 @@ World::_add_string_to_world(const std::string & n) const
Context context("When adding '" + n + "' to world file '" + stringify(*_imp->maybe_world_file) + "':");
- if (! _imp->maybe_world_file->exists())
+ if (! _imp->maybe_world_file->stat().exists())
{
try
{
@@ -147,7 +147,7 @@ World::_remove_string_from_world(const std::string & n) const
Context context("When removing '" + n + "' from world file '" + stringify(*_imp->maybe_world_file) + "':");
- if (_imp->maybe_world_file->exists())
+ if (_imp->maybe_world_file->stat().exists())
{
SetFile world(make_named_values<SetFileParams>(
n::environment() = _imp->env,
@@ -181,7 +181,7 @@ World::world_set() const
if (_imp->maybe_world_file)
{
- if (_imp->maybe_world_file->exists())
+ if (_imp->maybe_world_file->stat().exists())
{
SetFile world(make_named_values<SetFileParams>(
n::environment() = _imp->env,
@@ -201,7 +201,7 @@ World::world_set() const
return std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>());
}
-std::shared_ptr<const FSEntry>
+std::shared_ptr<const FSPath>
World::location_if_set() const
{
return _imp->maybe_world_file;
diff --git a/paludis/environments/paludis/world.hh b/paludis/environments/paludis/world.hh
index 1915e59..9a0a27b 100644
--- a/paludis/environments/paludis/world.hh
+++ b/paludis/environments/paludis/world.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_ENVIRONMENTS_PALUDIS_WORLD_HH 1
#include <paludis/util/pimp.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/name-fwd.hh>
#include <paludis/spec_tree.hh>
#include <paludis/environment-fwd.hh>
@@ -40,7 +40,7 @@ namespace paludis
bool _remove_string_from_world(const std::string &) const;
public:
- World(const Environment * const, const std::shared_ptr<const FSEntry> &);
+ World(const Environment * const, const std::shared_ptr<const FSPath> &);
~World();
const std::shared_ptr<const SetSpecTree> world_set() const PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -51,7 +51,7 @@ namespace paludis
bool remove_from_world(const SetName &) const;
bool remove_from_world(const QualifiedPackageName &) const;
- std::shared_ptr<const FSEntry> location_if_set() const;
+ std::shared_ptr<const FSPath> location_if_set() const;
void update_config_files_for_package_move(
const PackageDepSpec &, const QualifiedPackageName &) const;
diff --git a/paludis/environments/paludis/world_TEST.cc b/paludis/environments/paludis/world_TEST.cc
index 181f3bb..56bef9d 100644
--- a/paludis/environments/paludis/world_TEST.cc
+++ b/paludis/environments/paludis/world_TEST.cc
@@ -19,7 +19,6 @@
#include <paludis/environments/paludis/world.hh>
#include <paludis/environments/test/test_environment.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/options.hh>
#include <paludis/partially_made_package_dep_spec.hh>
@@ -39,7 +38,7 @@ namespace test_cases
void run()
{
- std::shared_ptr<FSEntry> w(std::make_shared<FSEntry>(FSEntry::cwd() / "world_TEST_dir" / "world"));
+ std::shared_ptr<FSPath> w(std::make_shared<FSPath>(FSPath::cwd() / "world_TEST_dir" / "world"));
{
TestEnvironment env;
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index e11281d..04e74a8 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.cc
@@ -18,6 +18,7 @@
*/
#include "portage_environment.hh"
+
#include <paludis/util/log.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/system.hh>
@@ -26,7 +27,6 @@
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/save.hh>
#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/set.hh>
@@ -36,8 +36,12 @@
#include <paludis/util/config_file.hh>
#include <paludis/util/tribool.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/standard_output_manager.hh>
#include <paludis/util/safe_ofstream.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_iterator.hh>
+#include <paludis/util/fs_error.hh>
+
+#include <paludis/standard_output_manager.hh>
#include <paludis/hooker.hh>
#include <paludis/hook.hh>
#include <paludis/mask.hh>
@@ -52,12 +56,14 @@
#include <paludis/repository_factory.hh>
#include <paludis/choice.hh>
#include <paludis/partially_made_package_dep_spec.hh>
+
#include <functional>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <list>
+
#include "config.h"
using namespace paludis;
@@ -78,7 +84,7 @@ namespace paludis
template<>
struct Imp<PortageEnvironment>
{
- const FSEntry conf_dir;
+ const FSPath conf_dir;
std::string paludis_command;
std::shared_ptr<KeyValueConfigFile> vars;
@@ -99,22 +105,22 @@ namespace paludis
mutable Mutex hook_mutex;
mutable bool done_hooks;
mutable std::shared_ptr<Hooker> hooker;
- mutable std::list<FSEntry> hook_dirs;
+ mutable std::list<FSPath> hook_dirs;
int overlay_importance;
std::shared_ptr<PackageDatabase> package_database;
- const FSEntry world_file;
+ const FSPath world_file;
mutable Mutex world_mutex;
std::shared_ptr<LiteralMetadataValueKey<std::string> > format_key;
- std::shared_ptr<LiteralMetadataValueKey<FSEntry> > config_location_key;
- std::shared_ptr<LiteralMetadataValueKey<FSEntry> > world_file_key;
- std::shared_ptr<LiteralMetadataValueKey<FSEntry> > preferred_root_key;
+ std::shared_ptr<LiteralMetadataValueKey<FSPath> > config_location_key;
+ std::shared_ptr<LiteralMetadataValueKey<FSPath> > world_file_key;
+ std::shared_ptr<LiteralMetadataValueKey<FSPath> > preferred_root_key;
Imp(Environment * const e, const std::string & s) :
- conf_dir(FSEntry(s.empty() ? "/" : s) / SYSCONFDIR),
+ conf_dir(FSPath(s.empty() ? "/" : s) / SYSCONFDIR),
paludis_command("paludis"),
ignore_all_breaks_portage(false),
done_hooks(false),
@@ -122,18 +128,18 @@ namespace paludis
package_database(std::make_shared<PackageDatabase>(e)),
world_file(s + "/var/lib/portage/world"),
format_key(std::make_shared<LiteralMetadataValueKey<std::string>>("format", "Format", mkt_significant, "portage")),
- config_location_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("conf_dir", "Config dir", mkt_normal,
+ config_location_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("conf_dir", "Config dir", mkt_normal,
conf_dir)),
- world_file_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("world_file", "World file", mkt_normal,
+ world_file_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("world_file", "World file", mkt_normal,
world_file))
{
}
- void add_one_hook(const FSEntry & r) const
+ void add_one_hook(const FSPath & r) const
{
try
{
- if (r.is_directory())
+ if (r.stat().is_directory())
{
Log::get_instance()->message("portage_environment.hooks.add_dir", ll_debug, lc_no_context)
<< "Adding hook directory '" << r << "'";
@@ -156,7 +162,7 @@ namespace paludis
if (! done_hooks)
{
if (getenv_with_default("PALUDIS_NO_GLOBAL_HOOKS", "").empty())
- add_one_hook(FSEntry(LIBEXECDIR) / "paludis" / "hooks");
+ add_one_hook(FSPath(LIBEXECDIR) / "paludis" / "hooks");
done_hooks = true;
}
@@ -236,16 +242,16 @@ PortageEnvironment::PortageEnvironment(const std::string & s) :
"functionality. Full support for Portage configuration formats is not "
"guaranteed; issues should be reported via trac.";
- _imp->vars = std::make_shared<KeyValueConfigFile>(FSEntry("/dev/null"), KeyValueConfigFileOptions(),
+ _imp->vars = std::make_shared<KeyValueConfigFile>(FSPath("/dev/null"), KeyValueConfigFileOptions(),
&KeyValueConfigFile::no_defaults, &KeyValueConfigFile::no_transformation);
_load_profile((_imp->conf_dir / "make.profile").realpath());
- if ((_imp->conf_dir / "make.globals").exists())
+ if ((_imp->conf_dir / "make.globals").stat().exists())
_imp->vars = std::make_shared<KeyValueConfigFile>(_imp->conf_dir / "make.globals", KeyValueConfigFileOptions() +
kvcfo_disallow_space_inside_unquoted_values + kvcfo_allow_inline_comments + kvcfo_allow_multiple_assigns_per_line,
std::bind(&predefined, _imp->vars, std::placeholders::_1, std::placeholders::_2),
&do_incremental);
- if ((_imp->conf_dir / "make.conf").exists())
+ if ((_imp->conf_dir / "make.conf").stat().exists())
_imp->vars = std::make_shared<KeyValueConfigFile>(_imp->conf_dir / "make.conf", KeyValueConfigFileOptions() +
kvcfo_disallow_space_inside_unquoted_values + kvcfo_allow_inline_comments + kvcfo_allow_multiple_assigns_per_line,
std::bind(&predefined, _imp->vars, std::placeholders::_1, std::placeholders::_2),
@@ -255,7 +261,7 @@ PortageEnvironment::PortageEnvironment(const std::string & s) :
std::string fixed_root_var(_imp->vars->get("ROOT"));
if (fixed_root_var.empty())
fixed_root_var = "/";
- _imp->preferred_root_key = std::make_shared<LiteralMetadataValueKey<FSEntry>>("root", "Root", mkt_normal, FSEntry(fixed_root_var));
+ _imp->preferred_root_key = std::make_shared<LiteralMetadataValueKey<FSPath>>("root", "Root", mkt_normal, FSPath(fixed_root_var));
}
/* TODO: load USE etc from env? */
@@ -266,11 +272,11 @@ PortageEnvironment::PortageEnvironment(const std::string & s) :
_add_installed_virtuals_repository();
if (_imp->vars->get("PORTDIR").empty())
throw PortageEnvironmentConfigurationError("PORTDIR empty or unset");
- _add_portdir_repository(FSEntry(_imp->vars->get("PORTDIR")));
+ _add_portdir_repository(FSPath(_imp->vars->get("PORTDIR")));
_add_vdb_repository();
- std::list<FSEntry> portdir_overlay;
+ std::list<FSPath> portdir_overlay;
tokenise_whitespace(_imp->vars->get("PORTDIR_OVERLAY"),
- create_inserter<FSEntry>(std::back_inserter(portdir_overlay)));
+ create_inserter<FSPath>(std::back_inserter(portdir_overlay)));
std::for_each(portdir_overlay.begin(), portdir_overlay.end(),
std::bind(std::mem_fn(&PortageEnvironment::_add_portdir_overlay_repository), this, _1));
@@ -319,7 +325,7 @@ PortageEnvironment::PortageEnvironment(const std::string & s) :
m != m_end ; ++m)
_imp->mirrors.insert(std::make_pair("*", *m + "/distfiles/"));
- if ((_imp->conf_dir / "portage" / "mirrors").exists())
+ if ((_imp->conf_dir / "portage" / "mirrors").stat().exists())
{
LineConfigFile m(_imp->conf_dir / "portage" / "mirrors", { lcfo_disallow_continuations });
for (LineConfigFile::ConstIterator line(m.begin()), line_end(m.end()) ;
@@ -356,18 +362,18 @@ PortageEnvironment::PortageEnvironment(const std::string & s) :
template<typename I_>
void
-PortageEnvironment::_load_atom_file(const FSEntry & f, I_ i, const std::string & def_value, const bool reject_additional)
+PortageEnvironment::_load_atom_file(const FSPath & f, I_ i, const std::string & def_value, const bool reject_additional)
{
using namespace std::placeholders;
Context context("When loading '" + stringify(f) + "':");
- if (! f.exists())
+ if (! f.stat().exists())
return;
- if (f.is_directory())
+ if (f.stat().is_directory())
{
- std::for_each(DirIterator(f), DirIterator(), std::bind(
+ std::for_each(FSIterator(f, { }), FSIterator(), std::bind(
&PortageEnvironment::_load_atom_file<I_>, this, _1, i, def_value, reject_additional));
}
else
@@ -409,18 +415,18 @@ PortageEnvironment::_load_atom_file(const FSEntry & f, I_ i, const std::string &
template<typename I_>
void
-PortageEnvironment::_load_lined_file(const FSEntry & f, I_ i)
+PortageEnvironment::_load_lined_file(const FSPath & f, I_ i)
{
using namespace std::placeholders;
Context context("When loading '" + stringify(f) + "':");
- if (! f.exists())
+ if (! f.stat().exists())
return;
- if (f.is_directory())
+ if (f.stat().is_directory())
{
- std::for_each(DirIterator(f), DirIterator(), std::bind(
+ std::for_each(FSIterator(f, { }), FSIterator(), std::bind(
&PortageEnvironment::_load_lined_file<I_>, this, _1, i));
}
else
@@ -435,11 +441,11 @@ PortageEnvironment::_load_lined_file(const FSEntry & f, I_ i)
}
void
-PortageEnvironment::_load_profile(const FSEntry & d)
+PortageEnvironment::_load_profile(const FSPath & d)
{
Context context("When loading profile directory '" + stringify(d) + "':");
- if ((d / "parent").exists())
+ if ((d / "parent").stat().exists())
{
Context context_local("When loading parent profiles:");
@@ -449,7 +455,7 @@ PortageEnvironment::_load_profile(const FSEntry & d)
_load_profile((d / *line).realpath());
}
- if ((d / "make.defaults").exists())
+ if ((d / "make.defaults").stat().exists())
_imp->vars = std::make_shared<KeyValueConfigFile>(d / "make.defaults", KeyValueConfigFileOptions()
+ kvcfo_disallow_source + kvcfo_disallow_space_inside_unquoted_values + kvcfo_allow_inline_comments + kvcfo_allow_multiple_assigns_per_line,
std::bind(&predefined, _imp->vars, std::placeholders::_1, std::placeholders::_2),
@@ -481,21 +487,21 @@ PortageEnvironment::_add_installed_virtuals_repository()
}
void
-PortageEnvironment::_add_portdir_repository(const FSEntry & portdir)
+PortageEnvironment::_add_portdir_repository(const FSPath & portdir)
{
Context context("When creating PORTDIR repository:");
_add_ebuild_repository(portdir, "", _imp->vars->get("SYNC"), 1);
}
void
-PortageEnvironment::_add_ebuild_repository(const FSEntry & portdir, const std::string & master,
+PortageEnvironment::_add_ebuild_repository(const FSPath & portdir, const std::string & master,
const std::string & sync, int importance)
{
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("root", stringify(preferred_root_key()->value()));
keys->insert("location", stringify(portdir));
keys->insert("profiles", stringify((_imp->conf_dir / "make.profile").realpath()) + " " +
- ((_imp->conf_dir / "portage" / "profile").is_directory() ?
+ ((_imp->conf_dir / "portage" / "profile").stat().is_directory() ?
stringify(_imp->conf_dir / "portage" / "profile") : ""));
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
@@ -512,7 +518,7 @@ PortageEnvironment::_add_ebuild_repository(const FSEntry & portdir, const std::s
}
void
-PortageEnvironment::_add_portdir_overlay_repository(const FSEntry & portdir)
+PortageEnvironment::_add_portdir_overlay_repository(const FSPath & portdir)
{
Context context("When creating PORTDIR_OVERLAY repository '" + stringify(portdir) + "':");
_add_ebuild_repository(portdir, "gentoo", "", ++_imp->overlay_importance);
@@ -722,24 +728,24 @@ PortageEnvironment::perform_hook(
return _imp->hooker->perform_hook(hook, optional_output_manager);
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
PortageEnvironment::hook_dirs() const
{
Lock l(_imp->hook_mutex);
_imp->need_hook_dirs();
- std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> result(std::make_shared<FSPathSequence>());
std::copy(_imp->hook_dirs.begin(), _imp->hook_dirs.end(), result->back_inserter());
return result;
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
PortageEnvironment::bashrc_files() const
{
- std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> result(std::make_shared<FSPathSequence>());
if (! getenv_with_default("PALUDIS_PORTAGE_BASHRC", "").empty())
- result->push_back(FSEntry(getenv_with_default("PALUDIS_PORTAGE_BASHRC", "")).realpath());
+ result->push_back(FSPath(getenv_with_default("PALUDIS_PORTAGE_BASHRC", "")).realpath());
else
- result->push_back(FSEntry(LIBEXECDIR) / "paludis" / "environments" / "portage" / "bashrc");
+ result->push_back(FSPath(LIBEXECDIR) / "paludis" / "environments" / "portage" / "bashrc");
result->push_back(_imp->conf_dir / "make.globals");
result->push_back(_imp->conf_dir / "make.conf");
return result;
@@ -904,7 +910,7 @@ PortageEnvironment::_add_string_to_world(const std::string & s) const
using namespace std::placeholders;
- if (! _imp->world_file.exists())
+ if (! _imp->world_file.stat().exists())
{
try
{
@@ -942,7 +948,7 @@ PortageEnvironment::_remove_string_from_world(const std::string & s) const
using namespace std::placeholders;
- if (_imp->world_file.exists())
+ if (_imp->world_file.stat().exists())
{
SetFile world(make_named_values<SetFileParams>(
n::environment() = this,
@@ -979,13 +985,13 @@ PortageEnvironment::format_key() const
return _imp->format_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
PortageEnvironment::config_location_key() const
{
return _imp->config_location_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
PortageEnvironment::preferred_root_key() const
{
return _imp->preferred_root_key;
@@ -1001,11 +1007,11 @@ namespace
{
std::shared_ptr<const SetSpecTree> make_world_set(
const Environment * const env,
- const FSEntry & f)
+ const FSPath & f)
{
Context context("When loading world from '" + stringify(f) + "':");
- if (! f.exists())
+ if (! f.stat().exists())
{
Log::get_instance()->message("portage_environment.world.does_not_exist", ll_warning, lc_no_context)
<< "World file '" << f << "' doesn't exist";
@@ -1034,7 +1040,7 @@ PortageEnvironment::populate_sets() const
}
const std::shared_ptr<Repository>
-PortageEnvironment::repository_from_new_config_file(const FSEntry &)
+PortageEnvironment::repository_from_new_config_file(const FSPath &)
{
throw InternalError(PALUDIS_HERE, "can't create repositories on the fly for PortageEnvironment");
}
diff --git a/paludis/environments/portage/portage_environment.hh b/paludis/environments/portage/portage_environment.hh
index 09c6fc1..43940e6 100644
--- a/paludis/environments/portage/portage_environment.hh
+++ b/paludis/environments/portage/portage_environment.hh
@@ -61,20 +61,20 @@ namespace paludis
private:
Pimp<PortageEnvironment>::ImpPtr & _imp;
- void _load_profile(const FSEntry &);
+ void _load_profile(const FSPath &);
void _add_virtuals_repository();
void _add_installed_virtuals_repository();
- void _add_portdir_repository(const FSEntry &);
- void _add_portdir_overlay_repository(const FSEntry &);
- void _add_ebuild_repository(const FSEntry &, const std::string &,
+ void _add_portdir_repository(const FSPath &);
+ void _add_portdir_overlay_repository(const FSPath &);
+ void _add_ebuild_repository(const FSPath &, const std::string &,
const std::string &, int importance);
void _add_vdb_repository();
template<typename I_>
- void _load_lined_file(const FSEntry &, I_);
+ void _load_lined_file(const FSPath &, I_);
template<typename I_>
- void _load_atom_file(const FSEntry &, I_, const std::string &, const bool);
+ void _load_atom_file(const FSPath &, I_, const std::string &, const bool);
bool _add_string_to_world(const std::string &) const;
bool _remove_string_from_world(const std::string &) const;
@@ -112,10 +112,10 @@ namespace paludis
) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> bashrc_files() const
+ virtual std::shared_ptr<const FSPathSequence> bashrc_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> hook_dirs() const
+ virtual std::shared_ptr<const FSPathSequence> hook_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual std::shared_ptr<const MirrorsSequence> mirrors(const std::string &) const
@@ -165,14 +165,14 @@ namespace paludis
virtual bool remove_from_world(const SetName &) const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > config_location_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > preferred_root_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > config_location_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > preferred_root_key() const;
virtual const std::shared_ptr<OutputManager> create_output_manager(
const CreateOutputManagerInfo &) const;
virtual const std::shared_ptr<Repository> repository_from_new_config_file(
- const FSEntry &) PALUDIS_ATTRIBUTE((noreturn));
+ const FSPath &) PALUDIS_ATTRIBUTE((noreturn));
virtual void update_config_files_for_package_move(
const PackageDepSpec &, const QualifiedPackageName &) const;
diff --git a/paludis/environments/portage/portage_environment_TEST.cc b/paludis/environments/portage/portage_environment_TEST.cc
index b8e8067..28e1fd8 100644
--- a/paludis/environments/portage/portage_environment_TEST.cc
+++ b/paludis/environments/portage/portage_environment_TEST.cc
@@ -81,7 +81,7 @@ namespace test_cases
void run()
{
- PortageEnvironment env(stringify(FSEntry("portage_environment_TEST_dir/query_use").realpath()));
+ PortageEnvironment env(stringify(FSPath("portage_environment_TEST_dir/query_use").realpath()));
const std::shared_ptr<const PackageID> idx(*env[selection::RequireExactlyOne(
generator::Matches(PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-x-1",
@@ -116,7 +116,7 @@ namespace test_cases
void run()
{
- PortageEnvironment env(stringify(FSEntry("portage_environment_TEST_dir/known_use_expand_names").realpath()));
+ PortageEnvironment env(stringify(FSPath("portage_environment_TEST_dir/known_use_expand_names").realpath()));
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1",
@@ -195,7 +195,7 @@ namespace test_cases
void run()
{
TestPortageEnvironment env("portage_environment_TEST_dir/world");
- FSEntry w(FSEntry::cwd() / "portage_environment_TEST_dir" / "world" / "var" / "lib" / "portage" / "world");
+ FSPath w(FSPath::cwd() / "portage_environment_TEST_dir" / "world" / "var" / "lib" / "portage" / "world");
env.update_config_files_for_package_move(make_package_dep_spec({ })
.package(QualifiedPackageName("cat/before")),
diff --git a/paludis/environments/test/test_environment.cc b/paludis/environments/test/test_environment.cc
index f962171..f263dff 100644
--- a/paludis/environments/test/test_environment.cc
+++ b/paludis/environments/test/test_environment.cc
@@ -52,28 +52,28 @@ namespace paludis
std::shared_ptr<PackageDatabase> package_database;
std::string paludis_command;
std::unordered_map<std::string, Tribool> override_want_choice_enabled;
- FSEntry root;
+ FSPath root;
Sets sets;
- std::shared_ptr<LiteralMetadataValueKey<FSEntry> > preferred_root_key;
+ std::shared_ptr<LiteralMetadataValueKey<FSPath> > preferred_root_key;
- Imp(Environment * const e, const FSEntry & r) :
+ Imp(Environment * const e, const FSPath & r) :
package_database(std::make_shared<PackageDatabase>(e)),
paludis_command(""),
root(r),
- preferred_root_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("root", "Root", mkt_normal, root))
+ preferred_root_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("root", "Root", mkt_normal, root))
{
}
};
}
TestEnvironment::TestEnvironment() :
- Pimp<TestEnvironment>(this, FSEntry("/")),
+ Pimp<TestEnvironment>(this, FSPath("/")),
_imp(Pimp<TestEnvironment>::_imp)
{
add_metadata_key(_imp->preferred_root_key);
}
-TestEnvironment::TestEnvironment(const FSEntry & r) :
+TestEnvironment::TestEnvironment(const FSPath & r) :
Pimp<TestEnvironment>(this, r),
_imp(Pimp<TestEnvironment>::_imp)
{
@@ -168,10 +168,10 @@ TestEnvironment::perform_hook(
return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
TestEnvironment::hook_dirs() const
{
- return std::make_shared<FSEntrySequence>();
+ return std::make_shared<FSPathSequence>();
}
const std::shared_ptr<const Mask>
@@ -227,13 +227,13 @@ TestEnvironment::format_key() const
return std::shared_ptr<const MetadataValueKey<std::string> >();
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
TestEnvironment::config_location_key() const
{
- return std::shared_ptr<const MetadataValueKey<FSEntry> >();
+ return std::shared_ptr<const MetadataValueKey<FSPath> >();
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
TestEnvironment::preferred_root_key() const
{
return _imp->preferred_root_key;
@@ -305,7 +305,7 @@ TestEnvironment::populate_sets() const
}
const std::shared_ptr<Repository>
-TestEnvironment::repository_from_new_config_file(const FSEntry &)
+TestEnvironment::repository_from_new_config_file(const FSPath &)
{
throw InternalError(PALUDIS_HERE, "can't create repositories on the fly for TestEnvironment");
}
diff --git a/paludis/environments/test/test_environment.hh b/paludis/environments/test/test_environment.hh
index 6db83f0..a31f035 100644
--- a/paludis/environments/test/test_environment.hh
+++ b/paludis/environments/test/test_environment.hh
@@ -55,7 +55,7 @@ namespace paludis
///\{
TestEnvironment();
- TestEnvironment(const FSEntry &);
+ TestEnvironment(const FSPath &);
~TestEnvironment();
@@ -93,7 +93,7 @@ namespace paludis
virtual bool unmasked_by_user(const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> hook_dirs() const
+ virtual std::shared_ptr<const FSPathSequence> hook_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual uid_t reduced_uid() const;
@@ -117,8 +117,8 @@ namespace paludis
virtual bool remove_from_world(const SetName &) const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > config_location_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > preferred_root_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > config_location_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > preferred_root_key() const;
virtual const Tribool want_choice_enabled(
const std::shared_ptr<const PackageID> &,
@@ -146,7 +146,7 @@ namespace paludis
void set_want_choice_enabled(const ChoicePrefixName &, const UnprefixedChoiceName &, const Tribool);
virtual const std::shared_ptr<Repository> repository_from_new_config_file(
- const FSEntry &) PALUDIS_ATTRIBUTE((noreturn));
+ const FSPath &) PALUDIS_ATTRIBUTE((noreturn));
virtual void update_config_files_for_package_move(
const PackageDepSpec &, const QualifiedPackageName &) const;
diff --git a/paludis/file_output_manager.cc b/paludis/file_output_manager.cc
index e7b965b..d7bab19 100644
--- a/paludis/file_output_manager.cc
+++ b/paludis/file_output_manager.cc
@@ -24,7 +24,8 @@
#include <paludis/util/map.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/destringify.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_path.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/util/stringify.hh>
using namespace paludis;
@@ -34,7 +35,7 @@ namespace paludis
template <>
struct Imp<FileOutputManager>
{
- FSEntry filename;
+ FSPath filename;
std::shared_ptr<SafeOFStream> stream;
const bool keep_on_success, keep_on_empty;
const std::shared_ptr<OutputManager> summary_output_manager;
@@ -43,7 +44,7 @@ namespace paludis
bool succeeded, unlinked, nothing_more_to_come;
Imp(
- const FSEntry & o,
+ const FSPath & o,
const bool k,
const bool l,
const std::shared_ptr<OutputManager> & m,
@@ -63,7 +64,7 @@ namespace paludis
};
}
-FileOutputManager::FileOutputManager(const FSEntry & o, const bool k, const bool l,
+FileOutputManager::FileOutputManager(const FSPath & o, const bool k, const bool l,
const std::shared_ptr<OutputManager> & m, const std::string & s) :
Pimp<FileOutputManager>(o, k, l, m, s)
{
@@ -136,8 +137,9 @@ FileOutputManager::nothing_more_to_come()
if (! _imp->keep_on_empty)
{
- FSEntry filename_now(stringify(_imp->filename));
- if (filename_now.exists() && 0 == filename_now.file_size())
+ FSPath filename_now(stringify(_imp->filename));
+ FSStat filename_now_stat(filename_now);
+ if (filename_now_stat.exists() && 0 == filename_now_stat.file_size())
{
filename_now.unlink();
_imp->unlinked = true;
@@ -181,7 +183,7 @@ FileOutputManager::factory_create(
summary_output_message_s = replace_vars_func(summary_output_message_s, std::make_shared<Map<std::string, std::string>>());
- return std::make_shared<FileOutputManager>(FSEntry(filename_s),
+ return std::make_shared<FileOutputManager>(FSPath(filename_s),
destringify<bool>(keep_on_success_s), destringify<bool>(keep_on_empty_s),
summary_output_manager, summary_output_message_s);
}
diff --git a/paludis/file_output_manager.hh b/paludis/file_output_manager.hh
index 3823e19..a81eae7 100644
--- a/paludis/file_output_manager.hh
+++ b/paludis/file_output_manager.hh
@@ -25,7 +25,7 @@
#include <paludis/output_manager_factory.hh>
#include <paludis/util/set-fwd.hh>
#include <paludis/util/pimp.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <memory>
#include <functional>
@@ -36,7 +36,8 @@ namespace paludis
public OutputManager
{
public:
- FileOutputManager(const FSEntry &,
+ FileOutputManager(
+ const FSPath &,
const bool keep_on_success,
const bool keep_on_empty,
const std::shared_ptr<OutputManager> & summary_output_manager,
diff --git a/paludis/filter.cc b/paludis/filter.cc
index f0dc1f2..ec0890e 100644
--- a/paludis/filter.cc
+++ b/paludis/filter.cc
@@ -31,7 +31,6 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/wrapped_output_iterator.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/action_names.hh>
using namespace paludis;
@@ -207,10 +206,10 @@ namespace
struct InstalledAtFilterHandler :
AllFilterHandlerBase
{
- const FSEntry root;
+ const FSPath root;
const bool equal;
- InstalledAtFilterHandler(const FSEntry & r, const bool e) :
+ InstalledAtFilterHandler(const FSPath & r, const bool e) :
root(r),
equal(e)
{
@@ -445,18 +444,18 @@ filter::NotMasked::NotMasked() :
{
}
-filter::InstalledAtRoot::InstalledAtRoot(const FSEntry & r) :
+filter::InstalledAtRoot::InstalledAtRoot(const FSPath & r) :
Filter(std::make_shared<InstalledAtFilterHandler>(r, true))
{
}
filter::InstalledAtSlash::InstalledAtSlash() :
- Filter(std::make_shared<InstalledAtFilterHandler>(FSEntry("/"), true))
+ Filter(std::make_shared<InstalledAtFilterHandler>(FSPath("/"), true))
{
}
filter::InstalledAtNotSlash::InstalledAtNotSlash() :
- Filter(std::make_shared<InstalledAtFilterHandler>(FSEntry("/"), false))
+ Filter(std::make_shared<InstalledAtFilterHandler>(FSPath("/"), false))
{
}
diff --git a/paludis/filter.hh b/paludis/filter.hh
index 34d4f87..17b6004 100644
--- a/paludis/filter.hh
+++ b/paludis/filter.hh
@@ -25,7 +25,7 @@
#include <paludis/util/attributes.hh>
#include <paludis/util/pimp.hh>
#include <paludis/util/set-fwd.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/name-fwd.hh>
#include <paludis/environment-fwd.hh>
#include <paludis/package_id-fwd.hh>
@@ -167,7 +167,7 @@ namespace paludis
public Filter
{
public:
- InstalledAtRoot(const FSEntry &);
+ InstalledAtRoot(const FSPath &);
};
/**
diff --git a/paludis/filter_TEST.cc b/paludis/filter_TEST.cc
index 9cb4932..24a9d8a 100644
--- a/paludis/filter_TEST.cc
+++ b/paludis/filter_TEST.cc
@@ -142,7 +142,7 @@ namespace test_cases
struct SupportsInstalledAtRootFilterTestCase : FilterTestCaseBase
{
SupportsInstalledAtRootFilterTestCase() :
- FilterTestCaseBase("installed at root /", filter::InstalledAtRoot(FSEntry("/")))
+ FilterTestCaseBase("installed at root /", filter::InstalledAtRoot(FSPath("/")))
{
}
@@ -156,7 +156,7 @@ namespace test_cases
struct SupportsInstalledAtRootOtherFilterTestCase : FilterTestCaseBase
{
SupportsInstalledAtRootOtherFilterTestCase() :
- FilterTestCaseBase("installed at root /blah", filter::InstalledAtRoot(FSEntry("/blah")))
+ FilterTestCaseBase("installed at root /blah", filter::InstalledAtRoot(FSPath("/blah")))
{
}
diff --git a/paludis/forward_at_finish_output_manager.cc b/paludis/forward_at_finish_output_manager.cc
index 823eefb..d111b6a 100644
--- a/paludis/forward_at_finish_output_manager.cc
+++ b/paludis/forward_at_finish_output_manager.cc
@@ -23,7 +23,6 @@
#include <paludis/util/map.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/destringify.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/stringify.hh>
using namespace paludis;
diff --git a/paludis/fs_merger-fwd.hh b/paludis/fs_merger-fwd.hh
index 804dde1..003778c 100644
--- a/paludis/fs_merger-fwd.hh
+++ b/paludis/fs_merger-fwd.hh
@@ -23,7 +23,6 @@
#include <iosfwd>
#include <paludis/util/attributes.hh>
#include <paludis/util/options-fwd.hh>
-#include <paludis/util/fs_entry-fwd.hh>
/** \file
* Forward declarations for paludis/fs_merger.hh .
diff --git a/paludis/fs_merger.cc b/paludis/fs_merger.cc
index 6770b76..4205c3b 100644
--- a/paludis/fs_merger.cc
+++ b/paludis/fs_merger.cc
@@ -19,7 +19,6 @@
*/
#include <paludis/fs_merger.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/fd_holder.hh>
#include <paludis/util/log.hh>
@@ -30,6 +29,9 @@
#include <paludis/util/timestamp.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_iterator.hh>
+#include <paludis/util/fs_error.hh>
#include <paludis/selinux/security_context.hh>
#include <paludis/environment.hh>
#include <paludis/hook.hh>
@@ -124,14 +126,14 @@ FSMerger::prepare_install_under()
Context context("When preparing install_under directory '" + stringify(_imp->params.install_under()) + "' under root '"
+ stringify(_imp->params.root()) + "':");
- std::list<FSEntry> dd;
- for (FSEntry d(_imp->params.root().realpath() / _imp->params.install_under()), d_end(_imp->params.root().realpath()) ;
+ std::list<FSPath> dd;
+ for (FSPath d(_imp->params.root().realpath() / _imp->params.install_under()), d_end(_imp->params.root().realpath()) ;
d != d_end ; d = d.dirname())
dd.push_front(d);
- for (std::list<FSEntry>::iterator d(dd.begin()), d_end(dd.end()) ; d != d_end ; ++d)
- if (! d->exists())
+ for (std::list<FSPath>::iterator d(dd.begin()), d_end(dd.end()) ; d != d_end ; ++d)
+ if (! d->stat().exists())
{
- d->mkdir();
+ d->mkdir(0755, { });
track_install_under_dir(*d, FSMergerStatusFlags());
}
else
@@ -139,7 +141,7 @@ FSMerger::prepare_install_under()
}
void
-FSMerger::on_file_over_nothing(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_file_over_nothing(bool is_check, const FSPath & src, const FSPath & dst)
{
if (is_check)
return;
@@ -148,7 +150,7 @@ FSMerger::on_file_over_nothing(bool is_check, const FSEntry & src, const FSEntry
}
void
-FSMerger::on_file_over_file(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_file_over_file(bool is_check, const FSPath & src, const FSPath & dst)
{
if (is_check)
return;
@@ -163,14 +165,14 @@ FSMerger::on_file_over_file(bool is_check, const FSEntry & src, const FSEntry &
}
void
-FSMerger::on_file_over_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_file_over_dir(bool is_check, const FSPath & src, const FSPath & dst)
{
on_error(is_check, "Cannot overwrite directory '" + stringify(dst / src.basename()) + "' with file '"
+ stringify(src) + "'");
}
void
-FSMerger::on_file_over_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_file_over_sym(bool is_check, const FSPath & src, const FSPath & dst)
{
if (is_check)
return;
@@ -179,7 +181,7 @@ FSMerger::on_file_over_sym(bool is_check, const FSEntry & src, const FSEntry & d
}
void
-FSMerger::on_file_over_misc(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_file_over_misc(bool is_check, const FSPath & src, const FSPath & dst)
{
if (is_check)
return;
@@ -188,7 +190,7 @@ FSMerger::on_file_over_misc(bool is_check, const FSEntry & src, const FSEntry &
}
void
-FSMerger::on_dir_over_nothing(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_dir_over_nothing(bool is_check, const FSPath & src, const FSPath & dst)
{
if (is_check)
return;
@@ -197,14 +199,14 @@ FSMerger::on_dir_over_nothing(bool is_check, const FSEntry & src, const FSEntry
}
void
-FSMerger::on_dir_over_file(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_dir_over_file(bool is_check, const FSPath & src, const FSPath & dst)
{
on_error(is_check, "Cannot overwrite file '" + stringify(dst / src.basename()) + "' with directory '"
+ stringify(src) + "'");
}
void
-FSMerger::on_dir_over_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_dir_over_dir(bool is_check, const FSPath & src, const FSPath & dst)
{
if (is_check)
return;
@@ -213,7 +215,7 @@ FSMerger::on_dir_over_dir(bool is_check, const FSEntry & src, const FSEntry & ds
}
void
-FSMerger::on_dir_over_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_dir_over_sym(bool is_check, const FSPath & src, const FSPath & dst)
{
EntryType m;
try
@@ -238,7 +240,7 @@ FSMerger::on_dir_over_sym(bool is_check, const FSEntry & src, const FSEntry & ds
}
void
-FSMerger::on_dir_over_misc(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_dir_over_misc(bool is_check, const FSPath & src, const FSPath & dst)
{
if (is_check)
return;
@@ -248,7 +250,7 @@ FSMerger::on_dir_over_misc(bool is_check, const FSEntry & src, const FSEntry & d
}
void
-FSMerger::on_sym_over_nothing(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_sym_over_nothing(bool is_check, const FSPath & src, const FSPath & dst)
{
if (is_check)
return;
@@ -257,7 +259,7 @@ FSMerger::on_sym_over_nothing(bool is_check, const FSEntry & src, const FSEntry
}
void
-FSMerger::on_sym_over_file(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_sym_over_file(bool is_check, const FSPath & src, const FSPath & dst)
{
if (is_check)
return;
@@ -267,14 +269,14 @@ FSMerger::on_sym_over_file(bool is_check, const FSEntry & src, const FSEntry & d
}
void
-FSMerger::on_sym_over_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_sym_over_dir(bool is_check, const FSPath & src, const FSPath & dst)
{
on_error(is_check, "Cannot overwrite directory '" + stringify(dst / src.basename()) + "' with symlink '"
+ stringify(src) + "'");
}
void
-FSMerger::on_sym_over_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_sym_over_sym(bool is_check, const FSPath & src, const FSPath & dst)
{
if (is_check)
return;
@@ -284,7 +286,7 @@ FSMerger::on_sym_over_sym(bool is_check, const FSEntry & src, const FSEntry & ds
}
void
-FSMerger::on_sym_over_misc(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_sym_over_misc(bool is_check, const FSPath & src, const FSPath & dst)
{
if (is_check)
return;
@@ -294,16 +296,19 @@ FSMerger::on_sym_over_misc(bool is_check, const FSEntry & src, const FSEntry & d
}
FSMergerStatusFlags
-FSMerger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::string & dst_name)
+FSMerger::install_file(const FSPath & src, const FSPath & dst_dir, const std::string & dst_name)
{
Context context("When installing file '" + stringify(src) + "' to '" + stringify(dst_dir) + "' with protection '"
+ stringify(dst_name) + "':");
FSMergerStatusFlags result;
- FSEntry dst(dst_dir / (stringify(dst_name) + "|paludis-midmerge"));
- FSEntry dst_real(dst_dir / dst_name);
+ FSStat src_stat(src);
- if (dst_real.is_regular_file())
+ FSPath dst(dst_dir / (stringify(dst_name) + "|paludis-midmerge"));
+ FSPath dst_real(dst_dir / dst_name);
+ FSStat dst_real_stat(dst_real);
+
+ if (dst_real_stat.is_regular_file())
dst_real.chmod(0);
if (0 != _imp->params.environment()->perform_hook(extend_hook(
@@ -315,17 +320,16 @@ FSMerger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::
Log::get_instance()->message("merger.file.pre_hooks.failure", ll_warning, lc_context) <<
"Merge of '" << src << "' to '" << dst_dir << "' pre hooks returned non-zero";
- std::shared_ptr<const SecurityContext> secctx(MatchPathCon::get_instance()->match(stringify(dst_real), src.permissions()));
+ std::shared_ptr<const SecurityContext> secctx(MatchPathCon::get_instance()->match(stringify(dst_real), src_stat.permissions()));
FSCreateCon createcon(secctx);
if (0 != paludis::setfilecon(src, secctx))
throw FSMergerError("Could not set SELinux context on '"
+ stringify(src) + "': " + stringify(::strerror(errno)));
- mode_t src_perms(src.permissions());
+ mode_t src_perms(src_stat.permissions());
if (0 != (src_perms & (S_ISVTX | S_ISUID | S_ISGID)))
result += msi_setid_bits;
-
bool do_copy(false);
if ((! _imp->params.options()[mo_nondestructive]) &&
@@ -333,10 +337,10 @@ FSMerger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::
{
result += msi_rename;
- bool touch(_imp->merged_ids.end() == _imp->merged_ids.find(src.lowlevel_id()));
- _imp->merged_ids.insert(make_pair(src.lowlevel_id(), stringify(dst_real)));
+ bool touch(_imp->merged_ids.end() == _imp->merged_ids.find(src_stat.lowlevel_id()));
+ _imp->merged_ids.insert(make_pair(src_stat.lowlevel_id(), stringify(dst_real)));
- FSEntry d(stringify(dst_real));
+ FSPath d(stringify(dst_real));
if (touch && ! _imp->params.options()[mo_preserve_mtimes])
if (! d.utime(Timestamp::now()))
throw FSMergerError("utime(" + stringify(dst_real) + ", 0) failed: " + stringify(::strerror(errno)));
@@ -347,8 +351,7 @@ FSMerger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::
else
{
do_copy = true;
- std::pair<MergedMap::const_iterator, MergedMap::const_iterator> ii(
- _imp->merged_ids.equal_range(src.lowlevel_id()));
+ std::pair<MergedMap::const_iterator, MergedMap::const_iterator> ii(_imp->merged_ids.equal_range(src_stat.lowlevel_id()));
for (MergedMap::const_iterator i = ii.first ; i != ii.second ; ++i)
{
if (0 == ::link(i->second.c_str(), stringify(dst).c_str()))
@@ -379,7 +382,7 @@ FSMerger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::
throw FSMergerError("Cannot write '" + stringify(dst) + "': " + stringify(::strerror(errno)));
if (! _imp->params.no_chown())
- if (0 != ::fchown(output_fd, src.owner(), src.group()))
+ if (0 != ::fchown(output_fd, src_stat.owner(), src_stat.group()))
throw FSMergerError("Cannot fchown '" + stringify(dst) + "': " + stringify(::strerror(errno)));
/* set*id bits */
@@ -398,7 +401,7 @@ FSMerger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::
/* might need to copy mtime */
if (_imp->params.options()[mo_preserve_mtimes])
{
- Timestamp timestamp(src.mtim());
+ Timestamp timestamp(src_stat.mtim());
struct timespec ts[2];
ts[0] = ts[1] = timestamp.as_timespec();
if (0 != ::futimens(output_fd, ts))
@@ -409,7 +412,7 @@ FSMerger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::
throw FSMergerError(
"rename(" + stringify(dst) + ", " + stringify(dst_real) + ") failed: " + stringify(::strerror(errno)));
- _imp->merged_ids.insert(make_pair(src.lowlevel_id(), stringify(dst_real)));
+ _imp->merged_ids.insert(make_pair(src_stat.lowlevel_id(), stringify(dst_real)));
}
if (fixed_ownership_for(src))
@@ -428,9 +431,9 @@ FSMerger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::
}
void
-FSMerger::track_renamed_dir_recursive(const FSEntry & dst)
+FSMerger::track_renamed_dir_recursive(const FSPath & dst)
{
- for (DirIterator d(dst, { dio_include_dotfiles, dio_inode_sort }), d_end ; d != d_end ; ++d)
+ for (FSIterator d(dst, { fsio_include_dotfiles, fsio_inode_sort }), d_end ; d != d_end ; ++d)
{
FSMergerStatusFlags merged_how;
if (fixed_ownership_for(_imp->params.image() / *d))
@@ -441,16 +444,17 @@ FSMerger::track_renamed_dir_recursive(const FSEntry & dst)
case et_sym:
rewrite_symlink_as_needed(*d, dst);
track_install_sym(*d, dst, merged_how + msi_parent_rename);
- _imp->merged_ids.insert(make_pair(d->lowlevel_id(), stringify(*d)));
+ _imp->merged_ids.insert(make_pair(d->stat().lowlevel_id(), stringify(*d)));
continue;
case et_file:
{
- bool touch(_imp->merged_ids.end() == _imp->merged_ids.find(d->lowlevel_id()));
- _imp->merged_ids.insert(make_pair(d->lowlevel_id(), stringify(*d)));
+ FSStat d_star_stat(*d);
+ bool touch(_imp->merged_ids.end() == _imp->merged_ids.find(d_star_stat.lowlevel_id()));
+ _imp->merged_ids.insert(make_pair(d_star_stat.lowlevel_id(), stringify(*d)));
if (touch && ! _imp->params.options()[mo_preserve_mtimes])
- if (! FSEntry(*d).utime(Timestamp::now()))
+ if (! d->utime(Timestamp::now()))
throw FSMergerError("utime(" + stringify(*d) + ", 0) failed: " + stringify(::strerror(errno)));
track_install_file(*d, dst, stringify(d->basename()), merged_how + msi_parent_rename);
}
@@ -475,27 +479,30 @@ FSMerger::track_renamed_dir_recursive(const FSEntry & dst)
}
void
-FSMerger::relabel_dir_recursive(const FSEntry & src, const FSEntry & dst)
+FSMerger::relabel_dir_recursive(const FSPath & src, const FSPath & dst)
{
- for (DirIterator d(src, { dio_include_dotfiles, dio_inode_sort }), d_end ; d != d_end ; ++d)
+ for (FSIterator d(src, { fsio_include_dotfiles, fsio_inode_sort }), d_end ; d != d_end ; ++d)
{
- mode_t mode(d->permissions());
+ FSStat d_star_stat(*d);
+
+ mode_t mode(d_star_stat.permissions());
std::shared_ptr<const SecurityContext> secctx(
MatchPathCon::get_instance()->match(stringify(dst / d->basename()), mode));
if (0 != paludis::setfilecon(*d, secctx))
throw FSMergerError("Could not set SELinux context on '"
+ stringify(*d) + "' : " + stringify(::strerror(errno)));
- if (d->is_directory())
+ if (d_star_stat.is_directory())
relabel_dir_recursive(*d, dst / d->basename());
}
}
FSMergerStatusFlags
-FSMerger::install_dir(const FSEntry & src, const FSEntry & dst_dir)
+FSMerger::install_dir(const FSPath & src, const FSPath & dst_dir)
{
Context context("When installing dir '" + stringify(src) + "' to '" + stringify(dst_dir) + "':");
FSMergerStatusFlags result;
+ FSStat src_stat(src);
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_install_dir_pre")
@@ -505,11 +512,11 @@ FSMerger::install_dir(const FSEntry & src, const FSEntry & dst_dir)
Log::get_instance()->message("merger.dir.pre_hooks.failure", ll_warning, lc_context)
<< "Merge of '" << src << "' to '" << dst_dir << "' pre hooks returned non-zero";
- mode_t mode(src.permissions());
+ mode_t mode(src_stat.permissions());
if (0 != (mode & (S_ISVTX | S_ISUID | S_ISGID)))
result += msi_setid_bits;
- FSEntry dst(dst_dir / src.basename());
+ FSPath dst(dst_dir / src.basename());
std::shared_ptr<const SecurityContext> secctx(MatchPathCon::get_instance()->match(stringify(dst), mode));
FSCreateCon createcon(secctx);
if (0 != paludis::setfilecon(src, secctx))
@@ -531,7 +538,7 @@ FSMerger::install_dir(const FSEntry & src, const FSEntry & dst_dir)
Log::get_instance()->message("merger.dir.rename_failed", ll_debug, lc_context) <<
"rename failed. Falling back to recursive copy.";
- dst.mkdir(mode);
+ dst.mkdir(mode, { fspmkdo_ok_if_exists });
FDHolder dst_fd(::open(stringify(dst).c_str(), O_RDONLY));
struct stat sb;
if (-1 == dst_fd)
@@ -543,7 +550,7 @@ FSMerger::install_dir(const FSEntry & src, const FSEntry & dst_dir)
if ( !S_ISDIR(sb.st_mode))
throw FSMergerError("The directory that we just created is not a directory anymore");
if (! _imp->params.no_chown())
- if (-1 == ::fchown(dst_fd, src.owner(), src.group()))
+ if (-1 == ::fchown(dst_fd, src_stat.owner(), src_stat.group()))
throw FSMergerError("Could not fchown the directory '" + stringify(dst) + "' that we just created: "
+ stringify(::strerror(errno)));
/* pick up set*id bits */
@@ -566,13 +573,14 @@ FSMerger::install_dir(const FSEntry & src, const FSEntry & dst_dir)
}
FSMergerStatusFlags
-FSMerger::install_sym(const FSEntry & src, const FSEntry & dst_dir)
+FSMerger::install_sym(const FSPath & src, const FSPath & dst_dir)
{
Context context("When installing sym '" + stringify(src) + "' to '" + stringify(dst_dir) + "':");
FSMergerStatusFlags result;
- FSEntry dst(dst_dir / src.basename());
+ FSPath dst(dst_dir / src.basename());
+ FSStat src_stat(src);
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_install_sym_pre")
@@ -582,14 +590,14 @@ FSMerger::install_sym(const FSEntry & src, const FSEntry & dst_dir)
Log::get_instance()->message("merger.sym.pre_hooks.failure", ll_warning, lc_context)
<< "Merge of '" << src << "' to '" << dst_dir << "' pre hooks returned non-zero";
- if (0 != (src.permissions() & (S_ISVTX | S_ISUID | S_ISGID)))
+ if (0 != (src_stat.permissions() & (S_ISVTX | S_ISUID | S_ISGID)))
result += msi_setid_bits;
bool do_sym(true);
FSCreateCon createcon(MatchPathCon::get_instance()->match(stringify(dst), S_IFLNK));
std::pair<MergedMap::const_iterator, MergedMap::const_iterator> ii(
- _imp->merged_ids.equal_range(src.lowlevel_id()));
+ _imp->merged_ids.equal_range(src_stat.lowlevel_id()));
for (MergedMap::const_iterator i = ii.first ; i != ii.second ; ++i)
{
if (0 == ::link(i->second.c_str(), stringify(dst).c_str()))
@@ -608,12 +616,12 @@ FSMerger::install_sym(const FSEntry & src, const FSEntry & dst_dir)
if (0 != ::symlink(stringify(src.readlink()).c_str(), stringify(dst).c_str()))
throw FSMergerError("Couldn't create symlink at '" + stringify(dst) + "': "
+ stringify(::strerror(errno)));
- _imp->merged_ids.insert(make_pair(src.lowlevel_id(), stringify(dst)));
+ _imp->merged_ids.insert(make_pair(src_stat.lowlevel_id(), stringify(dst)));
}
if (! _imp->params.no_chown())
{
- dst.lchown(src.owner(), src.group());
+ dst.lchown(src_stat.owner(), src_stat.group());
if (fixed_ownership_for(src))
result += msi_fixed_ownership;
}
@@ -630,7 +638,7 @@ FSMerger::install_sym(const FSEntry & src, const FSEntry & dst_dir)
}
void
-FSMerger::unlink_file(FSEntry d)
+FSMerger::unlink_file(FSPath d)
{
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_unlink_file_pre")
@@ -651,7 +659,7 @@ FSMerger::unlink_file(FSEntry d)
}
void
-FSMerger::unlink_sym(FSEntry d)
+FSMerger::unlink_sym(FSPath d)
{
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_unlink_sym_pre")
@@ -671,7 +679,7 @@ FSMerger::unlink_sym(FSEntry d)
}
void
-FSMerger::unlink_dir(FSEntry d)
+FSMerger::unlink_dir(FSPath d)
{
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_unlink_dir_pre")
@@ -691,7 +699,7 @@ FSMerger::unlink_dir(FSEntry d)
}
void
-FSMerger::unlink_misc(FSEntry d)
+FSMerger::unlink_misc(FSPath d)
{
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_unlink_misc_pre")
@@ -721,7 +729,7 @@ FSMerger::extend_hook(const Hook & h)
#ifdef HAVE_XATTRS
void
-FSMerger::try_to_copy_xattrs(const FSEntry & src, int dst_fd, FSMergerStatusFlags & flags)
+FSMerger::try_to_copy_xattrs(const FSPath & src, int dst_fd, FSMergerStatusFlags & flags)
{
FDHolder src_fd(::open(stringify(src).c_str(), O_RDONLY));
@@ -799,42 +807,42 @@ FSMerger::try_to_copy_xattrs(const FSEntry & src, int dst_fd, FSMergerStatusFlag
#else
void
-FSMerger::try_to_copy_xattrs(const FSEntry &, int, FSMergerStatusFlags &)
+FSMerger::try_to_copy_xattrs(const FSPath &, int, FSMergerStatusFlags &)
{
}
#endif
void
-FSMerger::track_install_file(const FSEntry & src, const FSEntry & dst_dir, const std::string & dst_name, const FSMergerStatusFlags & flags)
+FSMerger::track_install_file(const FSPath & src, const FSPath & dst_dir, const std::string & dst_name, const FSMergerStatusFlags & flags)
{
_imp->params.merged_entries()->insert(dst_dir / dst_name);
record_install_file(src, dst_dir, dst_name, flags);
}
void
-FSMerger::track_install_dir(const FSEntry & src, const FSEntry & dst_dir, const FSMergerStatusFlags & flags)
+FSMerger::track_install_dir(const FSPath & src, const FSPath & dst_dir, const FSMergerStatusFlags & flags)
{
_imp->params.merged_entries()->insert(dst_dir / src.basename());
record_install_dir(src, dst_dir, flags);
}
void
-FSMerger::track_install_under_dir(const FSEntry & dst, const FSMergerStatusFlags & flags)
+FSMerger::track_install_under_dir(const FSPath & dst, const FSMergerStatusFlags & flags)
{
_imp->params.merged_entries()->insert(dst);
record_install_under_dir(dst, flags);
}
void
-FSMerger::track_install_sym(const FSEntry & src, const FSEntry & dst_dir, const FSMergerStatusFlags & flags)
+FSMerger::track_install_sym(const FSPath & src, const FSPath & dst_dir, const FSMergerStatusFlags & flags)
{
_imp->params.merged_entries()->insert(dst_dir / src.basename());
record_install_sym(src, dst_dir, flags);
}
void
-FSMerger::on_file_main(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_file_main(bool is_check, const FSPath & src, const FSPath & dst)
{
EntryType m(entry_type(dst / src.basename()));
@@ -871,7 +879,7 @@ FSMerger::on_file_main(bool is_check, const FSEntry & src, const FSEntry & dst)
}
void
-FSMerger::on_dir_main(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_dir_main(bool is_check, const FSPath & src, const FSPath & dst)
{
EntryType m(entry_type(dst / src.basename()));
@@ -909,7 +917,7 @@ FSMerger::on_dir_main(bool is_check, const FSEntry & src, const FSEntry & dst)
}
void
-FSMerger::on_sym_main(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_sym_main(bool is_check, const FSPath & src, const FSPath & dst)
{
EntryType m(entry_type(dst / src.basename()));
@@ -945,16 +953,18 @@ FSMerger::on_sym_main(bool is_check, const FSEntry & src, const FSEntry & dst)
} while (false);
}
-FSEntry
-FSMerger::canonicalise_root_path(const FSEntry & f)
+FSPath
+FSMerger::canonicalise_root_path(const FSPath & f)
{
return f.realpath();
}
void
-FSMerger::do_dir_recursive(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::do_dir_recursive(bool is_check, const FSPath & src, const FSPath & dst)
{
- if ((! is_check) && (! dst.is_directory()))
+ FSStat dst_stat(dst);
+
+ if ((! is_check) && (! dst_stat.is_directory()))
throw MergerError("Destination directory '" + stringify(dst) + "' is not a directory");
Merger::do_dir_recursive(is_check, src, dst);
diff --git a/paludis/fs_merger.hh b/paludis/fs_merger.hh
index 52f3935..aae23c0 100644
--- a/paludis/fs_merger.hh
+++ b/paludis/fs_merger.hh
@@ -21,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_FS_MERGER_HH 1
#include <paludis/fs_merger-fwd.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/options.hh>
#include <paludis/util/named_value.hh>
@@ -82,9 +81,9 @@ namespace paludis
*/
NamedValue<n::fix_mtimes_before, Timestamp> fix_mtimes_before;
- NamedValue<n::get_new_ids_or_minus_one, std::function<std::pair<uid_t, gid_t> (const FSEntry &)> > get_new_ids_or_minus_one;
- NamedValue<n::image, FSEntry> image;
- NamedValue<n::install_under, FSEntry> install_under;
+ NamedValue<n::get_new_ids_or_minus_one, std::function<std::pair<uid_t, gid_t> (const FSPath &)> > get_new_ids_or_minus_one;
+ NamedValue<n::image, FSPath> image;
+ NamedValue<n::install_under, FSPath> install_under;
NamedValue<n::maybe_output_manager, std::shared_ptr<OutputManager> > maybe_output_manager;
@@ -93,11 +92,11 @@ namespace paludis
*
* \since 0.41
*/
- NamedValue<n::merged_entries, std::shared_ptr<FSEntrySet> > merged_entries;
+ NamedValue<n::merged_entries, std::shared_ptr<FSPathSet> > merged_entries;
NamedValue<n::no_chown, bool> no_chown;
NamedValue<n::options, MergerOptions> options;
- NamedValue<n::root, FSEntry> root;
+ NamedValue<n::root, FSPath> root;
};
/**
@@ -132,9 +131,9 @@ namespace paludis
public Merger
{
private:
- void track_renamed_dir_recursive(const FSEntry &);
- void relabel_dir_recursive(const FSEntry &, const FSEntry &);
- void try_to_copy_xattrs(const FSEntry &, int, FSMergerStatusFlags &);
+ void track_renamed_dir_recursive(const FSPath &);
+ void relabel_dir_recursive(const FSPath &, const FSPath &);
+ void try_to_copy_xattrs(const FSPath &, int, FSMergerStatusFlags &);
Pimp<FSMerger>::ImpPtr & _imp;
@@ -151,65 +150,65 @@ namespace paludis
///\name Track and record merges
///\{
- void track_install_file(const FSEntry &, const FSEntry &, const std::string &, const FSMergerStatusFlags &);
- void track_install_dir(const FSEntry &, const FSEntry &, const FSMergerStatusFlags &);
- void track_install_under_dir(const FSEntry &, const FSMergerStatusFlags &);
- void track_install_sym(const FSEntry &, const FSEntry &, const FSMergerStatusFlags &);
+ void track_install_file(const FSPath &, const FSPath &, const std::string &, const FSMergerStatusFlags &);
+ void track_install_dir(const FSPath &, const FSPath &, const FSMergerStatusFlags &);
+ void track_install_under_dir(const FSPath &, const FSMergerStatusFlags &);
+ void track_install_sym(const FSPath &, const FSPath &, const FSMergerStatusFlags &);
///\}
///\name Handle filesystem entry things
///\{
- virtual void on_file_main(bool is_check, const FSEntry & src, const FSEntry & dst);
- virtual void on_file_over_nothing(bool is_check, const FSEntry &, const FSEntry &);
- virtual void on_file_over_file(bool is_check, const FSEntry &, const FSEntry &);
- virtual void on_file_over_dir(bool is_check, const FSEntry &, const FSEntry &);
- virtual void on_file_over_sym(bool is_check, const FSEntry &, const FSEntry &);
- virtual void on_file_over_misc(bool is_check, const FSEntry &, const FSEntry &);
-
- virtual FSMergerStatusFlags install_file(const FSEntry &, const FSEntry &, const std::string &) PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual void unlink_file(FSEntry);
- virtual void record_install_file(const FSEntry &, const FSEntry &, const std::string &, const FSMergerStatusFlags &) = 0;
-
- virtual void on_dir_main(bool is_check, const FSEntry & src, const FSEntry & dst);
- virtual void on_dir_over_nothing(bool is_check, const FSEntry &, const FSEntry &);
- virtual void on_dir_over_file(bool is_check, const FSEntry &, const FSEntry &);
- virtual void on_dir_over_dir(bool is_check, const FSEntry &, const FSEntry &);
- virtual void on_dir_over_sym(bool is_check, const FSEntry &, const FSEntry &);
- virtual void on_dir_over_misc(bool is_check, const FSEntry &, const FSEntry &);
-
- virtual FSMergerStatusFlags install_dir(const FSEntry &, const FSEntry &) PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual void unlink_dir(FSEntry);
- virtual void record_install_dir(const FSEntry &, const FSEntry &, const FSMergerStatusFlags &) = 0;
- virtual void record_install_under_dir(const FSEntry &, const FSMergerStatusFlags &) = 0;
-
- virtual void on_sym_main(bool is_check, const FSEntry & src, const FSEntry & dst);
- virtual void on_sym_over_nothing(bool is_check, const FSEntry &, const FSEntry &);
- virtual void on_sym_over_file(bool is_check, const FSEntry &, const FSEntry &);
- virtual void on_sym_over_dir(bool is_check, const FSEntry &, const FSEntry &);
- virtual void on_sym_over_sym(bool is_check, const FSEntry &, const FSEntry &);
- virtual void on_sym_over_misc(bool is_check, const FSEntry &, const FSEntry &);
-
- virtual FSMergerStatusFlags install_sym(const FSEntry &, const FSEntry &) PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual void unlink_sym(FSEntry);
- virtual void record_install_sym(const FSEntry &, const FSEntry &, const FSMergerStatusFlags &) = 0;
-
- virtual void unlink_misc(FSEntry);
+ virtual void on_file_main(bool is_check, const FSPath & src, const FSPath & dst);
+ virtual void on_file_over_nothing(bool is_check, const FSPath &, const FSPath &);
+ virtual void on_file_over_file(bool is_check, const FSPath &, const FSPath &);
+ virtual void on_file_over_dir(bool is_check, const FSPath &, const FSPath &);
+ virtual void on_file_over_sym(bool is_check, const FSPath &, const FSPath &);
+ virtual void on_file_over_misc(bool is_check, const FSPath &, const FSPath &);
+
+ virtual FSMergerStatusFlags install_file(const FSPath &, const FSPath &, const std::string &) PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual void unlink_file(FSPath);
+ virtual void record_install_file(const FSPath &, const FSPath &, const std::string &, const FSMergerStatusFlags &) = 0;
+
+ virtual void on_dir_main(bool is_check, const FSPath & src, const FSPath & dst);
+ virtual void on_dir_over_nothing(bool is_check, const FSPath &, const FSPath &);
+ virtual void on_dir_over_file(bool is_check, const FSPath &, const FSPath &);
+ virtual void on_dir_over_dir(bool is_check, const FSPath &, const FSPath &);
+ virtual void on_dir_over_sym(bool is_check, const FSPath &, const FSPath &);
+ virtual void on_dir_over_misc(bool is_check, const FSPath &, const FSPath &);
+
+ virtual FSMergerStatusFlags install_dir(const FSPath &, const FSPath &) PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual void unlink_dir(FSPath);
+ virtual void record_install_dir(const FSPath &, const FSPath &, const FSMergerStatusFlags &) = 0;
+ virtual void record_install_under_dir(const FSPath &, const FSMergerStatusFlags &) = 0;
+
+ virtual void on_sym_main(bool is_check, const FSPath & src, const FSPath & dst);
+ virtual void on_sym_over_nothing(bool is_check, const FSPath &, const FSPath &);
+ virtual void on_sym_over_file(bool is_check, const FSPath &, const FSPath &);
+ virtual void on_sym_over_dir(bool is_check, const FSPath &, const FSPath &);
+ virtual void on_sym_over_sym(bool is_check, const FSPath &, const FSPath &);
+ virtual void on_sym_over_misc(bool is_check, const FSPath &, const FSPath &);
+
+ virtual FSMergerStatusFlags install_sym(const FSPath &, const FSPath &) PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual void unlink_sym(FSPath);
+ virtual void record_install_sym(const FSPath &, const FSPath &, const FSMergerStatusFlags &) = 0;
+
+ virtual void unlink_misc(FSPath);
virtual void prepare_install_under();
- virtual FSEntry canonicalise_root_path(const FSEntry & f);
+ virtual FSPath canonicalise_root_path(const FSPath & f);
- virtual void do_dir_recursive(bool is_check, const FSEntry &, const FSEntry &);
+ virtual void do_dir_recursive(bool is_check, const FSPath &, const FSPath &);
///\}
///\name Configuration protection
///\{
- virtual bool config_protected(const FSEntry &, const FSEntry &) = 0;
- virtual std::string make_config_protect_name(const FSEntry &, const FSEntry &) = 0;
+ virtual bool config_protected(const FSPath &, const FSPath &) = 0;
+ virtual std::string make_config_protect_name(const FSPath &, const FSPath &) = 0;
///\}
diff --git a/paludis/fs_merger_TEST.cc b/paludis/fs_merger_TEST.cc
index 9af9fe3..633afad 100644
--- a/paludis/fs_merger_TEST.cc
+++ b/paludis/fs_merger_TEST.cc
@@ -21,12 +21,15 @@
#include <paludis/environments/test/test_environment.hh>
#include <paludis/hooker.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/set.hh>
#include <paludis/util/timestamp.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_iterator.hh>
+#include <paludis/util/fs_path.hh>
+#include <paludis/util/fs_error.hh>
#include <paludis/hook.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -39,7 +42,7 @@ using namespace test;
namespace
{
std::pair<uid_t, gid_t>
- get_new_ids_or_minus_one(const FSEntry &)
+ get_new_ids_or_minus_one(const FSPath &)
{
return std::make_pair(-1, -1);
}
@@ -61,21 +64,20 @@ namespace paludis
{
private:
mutable std::shared_ptr<Hooker> hooker;
- mutable std::list<std::pair<FSEntry, bool> > hook_dirs;
+ mutable std::list<std::pair<FSPath, bool> > hook_dirs;
public:
- HookTestEnvironment(const FSEntry & hooks);
+ HookTestEnvironment(const FSPath & hooks);
virtual ~HookTestEnvironment();
virtual HookResult perform_hook(const Hook &, const std::shared_ptr<OutputManager> &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
-
};
- HookTestEnvironment::HookTestEnvironment(const FSEntry & hooks)
+ HookTestEnvironment::HookTestEnvironment(const FSPath & hooks)
{
- if (hooks.is_directory())
+ if (hooks.stat().is_directory())
hook_dirs.push_back(std::make_pair(hooks, false));
}
@@ -89,7 +91,7 @@ namespace paludis
if (! hooker)
{
hooker = std::make_shared<Hooker>(this);
- for (std::list<std::pair<FSEntry, bool> >::const_iterator h(hook_dirs.begin()),
+ for (std::list<std::pair<FSPath, bool> >::const_iterator h(hook_dirs.begin()),
h_end(hook_dirs.end()) ; h != h_end ; ++h)
hooker->add_dir(h->first, h->second);
}
@@ -108,19 +110,19 @@ namespace
{
}
- void record_install_file(const FSEntry &, const FSEntry &, const std::string &, const FSMergerStatusFlags &)
+ void record_install_file(const FSPath &, const FSPath &, const std::string &, const FSMergerStatusFlags &)
{
}
- void record_install_dir(const FSEntry &, const FSEntry &, const FSMergerStatusFlags &)
+ void record_install_dir(const FSPath &, const FSPath &, const FSMergerStatusFlags &)
{
}
- void record_install_sym(const FSEntry &, const FSEntry &, const FSMergerStatusFlags &)
+ void record_install_sym(const FSPath &, const FSPath &, const FSMergerStatusFlags &)
{
}
- virtual void record_install_under_dir(const FSEntry &, const FSMergerStatusFlags &)
+ virtual void record_install_under_dir(const FSPath &, const FSMergerStatusFlags &)
{
}
@@ -140,12 +142,12 @@ namespace
{
}
- bool config_protected(const FSEntry &, const FSEntry &)
+ bool config_protected(const FSPath &, const FSPath &)
{
return false;
}
- std::string make_config_protect_name(const FSEntry & src, const FSEntry &)
+ std::string make_config_protect_name(const FSPath & src, const FSPath &)
{
return src.basename() + ".cfgpro";
}
@@ -155,8 +157,8 @@ namespace
public TestCase
{
public:
- FSEntry image_dir;
- FSEntry root_dir;
+ FSPath image_dir;
+ FSPath root_dir;
HookTestEnvironment env;
TestMerger merger;
@@ -173,15 +175,15 @@ namespace
+ (0 == n ? "" : "_" + stringify(n)) + "_dir/image"),
root_dir("fs_merger_TEST_dir/" + stringify(src_type) + "_over_" + stringify(dst_type)
+ (0 == n ? "" : "_" + stringify(n)) + "_dir/root"),
- env(FSEntry("fs_merger_TEST_dir/hooks")),
+ env(FSPath("fs_merger_TEST_dir/hooks")),
merger(make_named_values<FSMergerParams>(
n::environment() = &env,
n::fix_mtimes_before() = Timestamp(0, 0),
n::get_new_ids_or_minus_one() = &get_new_ids_or_minus_one,
n::image() = image_dir,
- n::install_under() = FSEntry("/"),
+ n::install_under() = FSPath("/"),
n::maybe_output_manager() = make_null_shared_ptr(),
- n::merged_entries() = std::make_shared<FSEntrySet>(),
+ n::merged_entries() = std::make_shared<FSPathSet>(),
n::no_chown() = true,
n::options() = MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs,
n::root() = root_dir
@@ -195,15 +197,15 @@ namespace
TestCase("merge " + custom_test + " test"),
image_dir("fs_merger_TEST_dir/" + custom_test + "/image"),
root_dir("fs_merger_TEST_dir/" + custom_test + "/root"),
- env(FSEntry("fs_merger_TEST_dir/hooks")),
+ env(FSPath("fs_merger_TEST_dir/hooks")),
merger(make_named_values<FSMergerParams>(
n::environment() = &env,
- n::fix_mtimes_before() = fix ? FSEntry("fs_merger_TEST_dir/reference").mtim() : Timestamp(0, 0),
+ n::fix_mtimes_before() = fix ? FSPath("fs_merger_TEST_dir/reference").stat().mtim() : Timestamp(0, 0),
n::get_new_ids_or_minus_one() = &get_new_ids_or_minus_one,
n::image() = image_dir,
- n::install_under() = FSEntry("/"),
+ n::install_under() = FSPath("/"),
n::maybe_output_manager() = make_null_shared_ptr(),
- n::merged_entries() = std::make_shared<FSEntrySet>(),
+ n::merged_entries() = std::make_shared<FSPathSet>(),
n::no_chown() = true,
n::options() = o,
n::root() = root_dir
@@ -221,13 +223,13 @@ namespace test_cases
void run()
{
- TEST_CHECK(! (root_dir / "sym").exists());
+ TEST_CHECK(! (root_dir / "sym").stat().exists());
TEST_CHECK(merger.check());
merger.merge();
- TEST_CHECK((root_dir / "sym").is_symbolic_link());
- TEST_CHECK((root_dir / "rewrite_me").is_symbolic_link());
+ TEST_CHECK((root_dir / "sym").stat().is_symlink());
+ TEST_CHECK((root_dir / "rewrite_me").stat().is_symlink());
TEST_CHECK_EQUAL((root_dir / "sym").readlink(), "image_dst");
TEST_CHECK_EQUAL((root_dir / "rewrite_me").readlink(), "/rewrite_target");
}
@@ -239,14 +241,14 @@ namespace test_cases
void run()
{
- TEST_CHECK((root_dir / "sym").is_symbolic_link());
+ TEST_CHECK((root_dir / "sym").stat().is_symlink());
TEST_CHECK_EQUAL((root_dir / "sym").readlink(), "root_dst");
TEST_CHECK(merger.check());
merger.merge();
- TEST_CHECK((root_dir / "sym").is_symbolic_link());
- TEST_CHECK((root_dir / "rewrite_me").is_symbolic_link());
+ TEST_CHECK((root_dir / "sym").stat().is_symlink());
+ TEST_CHECK((root_dir / "rewrite_me").stat().is_symlink());
TEST_CHECK_EQUAL((root_dir / "sym").readlink(), "image_dst");
TEST_CHECK_EQUAL((root_dir / "rewrite_me").readlink(), "/rewrite_target");
}
@@ -258,13 +260,13 @@ namespace test_cases
void run()
{
- TEST_CHECK((root_dir / "sym").is_regular_file());
+ TEST_CHECK((root_dir / "sym").stat().is_regular_file());
TEST_CHECK(merger.check());
merger.merge();
- TEST_CHECK((root_dir / "sym").is_symbolic_link());
- TEST_CHECK((root_dir / "rewrite_me").is_symbolic_link());
+ TEST_CHECK((root_dir / "sym").stat().is_symlink());
+ TEST_CHECK((root_dir / "rewrite_me").stat().is_symlink());
TEST_CHECK_EQUAL((root_dir / "sym").readlink(), "image_dst");
TEST_CHECK_EQUAL((root_dir / "rewrite_me").readlink(), "/rewrite_target");
}
@@ -276,12 +278,12 @@ namespace test_cases
void run()
{
- TEST_CHECK((root_dir / "sym").is_directory());
+ TEST_CHECK((root_dir / "sym").stat().is_directory());
TEST_CHECK(! merger.check());
TEST_CHECK_THROWS(merger.merge(), FSMergerError);
- TEST_CHECK((root_dir / "sym").is_directory());
+ TEST_CHECK((root_dir / "sym").stat().is_directory());
}
} test_merger_sym_dir;
@@ -291,12 +293,12 @@ namespace test_cases
void run()
{
- TEST_CHECK(! (root_dir / "dir").exists());
+ TEST_CHECK(! (root_dir / "dir").stat().exists());
TEST_CHECK(merger.check());
merger.merge();
- TEST_CHECK((root_dir / "dir").is_directory());
+ TEST_CHECK((root_dir / "dir").stat().is_directory());
}
} test_merger_dir_nothing;
@@ -306,12 +308,12 @@ namespace test_cases
void run()
{
- TEST_CHECK((root_dir / "dir").is_directory());
+ TEST_CHECK((root_dir / "dir").stat().is_directory());
TEST_CHECK(merger.check());
merger.merge();
- TEST_CHECK((root_dir / "dir").is_directory());
+ TEST_CHECK((root_dir / "dir").stat().is_directory());
}
} test_merger_dir_dir;
@@ -321,12 +323,12 @@ namespace test_cases
void run()
{
- TEST_CHECK((root_dir / "dir").is_regular_file());
+ TEST_CHECK((root_dir / "dir").stat().is_regular_file());
TEST_CHECK(! merger.check());
TEST_CHECK_THROWS(merger.merge(), FSMergerError);
- TEST_CHECK((root_dir / "dir").is_regular_file());
+ TEST_CHECK((root_dir / "dir").stat().is_regular_file());
}
} test_merger_dir_file;
@@ -336,16 +338,16 @@ namespace test_cases
void run()
{
- TEST_CHECK((root_dir / "dir").is_symbolic_link());
- TEST_CHECK((root_dir / "dir").realpath().is_directory());
- TEST_CHECK(! (root_dir / "dir" / "file").exists());
+ TEST_CHECK((root_dir / "dir").stat().is_symlink());
+ TEST_CHECK((root_dir / "dir").realpath().stat().is_directory());
+ TEST_CHECK(! (root_dir / "dir" / "file").stat().exists());
TEST_CHECK(merger.check());
merger.merge();
- TEST_CHECK((root_dir / "dir").is_symbolic_link());
- TEST_CHECK((root_dir / "dir").realpath().is_directory());
- TEST_CHECK((root_dir / "dir" / "file").is_regular_file());
+ TEST_CHECK((root_dir / "dir").stat().is_symlink());
+ TEST_CHECK((root_dir / "dir").realpath().stat().is_directory());
+ TEST_CHECK((root_dir / "dir" / "file").stat().is_regular_file());
}
} test_merger_dir_sym_1;
@@ -355,14 +357,14 @@ namespace test_cases
void run()
{
- TEST_CHECK((root_dir / "dir").is_symbolic_link());
- TEST_CHECK((root_dir / "dir").realpath().is_regular_file());
+ TEST_CHECK((root_dir / "dir").stat().is_symlink());
+ TEST_CHECK((root_dir / "dir").realpath().stat().is_regular_file());
TEST_CHECK(! merger.check());
TEST_CHECK_THROWS(merger.merge(), FSMergerError);
- TEST_CHECK((root_dir / "dir").is_symbolic_link());
- TEST_CHECK((root_dir / "dir").realpath().is_regular_file());
+ TEST_CHECK((root_dir / "dir").stat().is_symlink());
+ TEST_CHECK((root_dir / "dir").realpath().stat().is_regular_file());
}
} test_merger_dir_sym_2;
@@ -372,13 +374,13 @@ namespace test_cases
void run()
{
- TEST_CHECK((root_dir / "dir").is_symbolic_link());
+ TEST_CHECK((root_dir / "dir").stat().is_symlink());
TEST_CHECK_THROWS((root_dir / "dir").realpath(), FSError);
TEST_CHECK(! merger.check());
TEST_CHECK_THROWS(merger.merge(), FSMergerError);
- TEST_CHECK((root_dir / "dir").is_symbolic_link());
+ TEST_CHECK((root_dir / "dir").stat().is_symlink());
TEST_CHECK_THROWS((root_dir / "dir").realpath(), FSError);
}
} test_merger_dir_sym_3;
@@ -389,12 +391,12 @@ namespace test_cases
void run()
{
- TEST_CHECK(! (root_dir / "file").exists());
+ TEST_CHECK(! (root_dir / "file").stat().exists());
TEST_CHECK(merger.check());
merger.merge();
- TEST_CHECK((root_dir / "file").is_regular_file());
+ TEST_CHECK((root_dir / "file").stat().is_regular_file());
SafeIFStream f(root_dir / "file");
TEST_CHECK(f);
std::string fs(std::string((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>()));
@@ -408,7 +410,7 @@ namespace test_cases
void run()
{
- TEST_CHECK((root_dir / "file").is_regular_file());
+ TEST_CHECK((root_dir / "file").stat().is_regular_file());
SafeIFStream b(root_dir / "file");
TEST_CHECK(b);
std::string bs((std::istreambuf_iterator<char>(b)), std::istreambuf_iterator<char>());
@@ -417,7 +419,7 @@ namespace test_cases
TEST_CHECK(merger.check());
merger.merge();
- TEST_CHECK((root_dir / "file").is_regular_file());
+ TEST_CHECK((root_dir / "file").stat().is_regular_file());
SafeIFStream f(root_dir / "file");
TEST_CHECK(f);
std::string fs((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());
@@ -431,26 +433,26 @@ namespace test_cases
void run()
{
- TEST_CHECK((root_dir / "file1").is_symbolic_link());
- TEST_CHECK((root_dir / "file2").is_symbolic_link());
- TEST_CHECK((root_dir / "file3").is_symbolic_link());
+ TEST_CHECK((root_dir / "file1").stat().is_symlink());
+ TEST_CHECK((root_dir / "file2").stat().is_symlink());
+ TEST_CHECK((root_dir / "file3").stat().is_symlink());
TEST_CHECK(merger.check());
merger.merge();
- TEST_CHECK((root_dir / "file1").is_regular_file());
+ TEST_CHECK((root_dir / "file1").stat().is_regular_file());
SafeIFStream f(root_dir / "file1");
TEST_CHECK(f);
std::string fs((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());
TEST_CHECK_EQUAL(fs, "image 1 contents\n");
- TEST_CHECK((root_dir / "file2").is_regular_file());
+ TEST_CHECK((root_dir / "file2").stat().is_regular_file());
SafeIFStream f2(root_dir / "file2");
TEST_CHECK(f2);
std::string fs2((std::istreambuf_iterator<char>(f2)), std::istreambuf_iterator<char>());
TEST_CHECK_EQUAL(fs2, "image 2 contents\n");
- TEST_CHECK((root_dir / "file3").is_regular_file());
+ TEST_CHECK((root_dir / "file3").stat().is_regular_file());
SafeIFStream f3(root_dir / "file3");
TEST_CHECK(f3);
std::string fs3((std::istreambuf_iterator<char>(f3)), std::istreambuf_iterator<char>());
@@ -464,12 +466,12 @@ namespace test_cases
void run()
{
- TEST_CHECK((root_dir / "file").is_directory());
+ TEST_CHECK((root_dir / "file").stat().is_directory());
TEST_CHECK(! merger.check());
TEST_CHECK_THROWS(merger.merge(), FSMergerError);
- TEST_CHECK((root_dir / "file").is_directory());
+ TEST_CHECK((root_dir / "file").stat().is_directory());
}
} test_merger_file_dir;
@@ -479,23 +481,23 @@ namespace test_cases
void run()
{
- TEST_CHECK((image_dir / "dir_skip_me").is_directory());
- TEST_CHECK((image_dir / "dir_install_me").is_directory());
- TEST_CHECK((image_dir / "file_skip_me").is_regular_file());
- TEST_CHECK((image_dir / "file_install_me").is_regular_file());
- TEST_CHECK((image_dir / "sym_skip_me").is_symbolic_link());
- TEST_CHECK((image_dir / "sym_install_me").is_symbolic_link());
+ TEST_CHECK((image_dir / "dir_skip_me").stat().is_directory());
+ TEST_CHECK((image_dir / "dir_install_me").stat().is_directory());
+ TEST_CHECK((image_dir / "file_skip_me").stat().is_regular_file());
+ TEST_CHECK((image_dir / "file_install_me").stat().is_regular_file());
+ TEST_CHECK((image_dir / "sym_skip_me").stat().is_symlink());
+ TEST_CHECK((image_dir / "sym_install_me").stat().is_symlink());
TEST_CHECK(merger.check());
merger.merge();
- TEST_CHECK(! (root_dir / "dir_skip_me").exists());
- TEST_CHECK((root_dir / "dir_install_me").is_directory());
- TEST_CHECK(! (root_dir / "file_skip_me").exists());
- TEST_CHECK((root_dir / "file_install_me").is_regular_file());
- TEST_CHECK(! (root_dir / "sym_skip_me").exists());
- TEST_CHECK((root_dir / "sym_install_me").is_symbolic_link());
+ TEST_CHECK(! (root_dir / "dir_skip_me").stat().exists());
+ TEST_CHECK((root_dir / "dir_install_me").stat().is_directory());
+ TEST_CHECK(! (root_dir / "file_skip_me").stat().exists());
+ TEST_CHECK((root_dir / "file_install_me").stat().is_regular_file());
+ TEST_CHECK(! (root_dir / "sym_skip_me").stat().exists());
+ TEST_CHECK((root_dir / "sym_install_me").stat().is_symlink());
}
} test_merger_override;
@@ -505,8 +507,8 @@ namespace test_cases
void run()
{
- TEST_CHECK((image_dir / "empty").is_directory());
- TEST_CHECK(DirIterator(image_dir / "empty", { dio_include_dotfiles, dio_first_only }) == DirIterator());
+ TEST_CHECK((image_dir / "empty").stat().is_directory());
+ TEST_CHECK(FSIterator(image_dir / "empty", { fsio_include_dotfiles, fsio_first_only }) == FSIterator());
TEST_CHECK(merger.check());
}
@@ -518,8 +520,8 @@ namespace test_cases
void run()
{
- TEST_CHECK((image_dir / "empty").is_directory());
- TEST_CHECK(DirIterator(image_dir / "empty", { dio_include_dotfiles, dio_first_only }) == DirIterator());
+ TEST_CHECK((image_dir / "empty").stat().is_directory());
+ TEST_CHECK(FSIterator(image_dir / "empty", { fsio_include_dotfiles, fsio_first_only }) == FSIterator());
TEST_CHECK(! merger.check());
}
@@ -531,7 +533,7 @@ namespace test_cases
void run()
{
- TEST_CHECK(DirIterator(image_dir, { dio_include_dotfiles, dio_first_only }) == DirIterator());
+ TEST_CHECK(FSIterator(image_dir, { fsio_include_dotfiles, fsio_first_only }) == FSIterator());
TEST_CHECK(merger.check());
}
@@ -543,7 +545,7 @@ namespace test_cases
void run()
{
- TEST_CHECK(DirIterator(image_dir, { dio_include_dotfiles, dio_first_only }) == DirIterator());
+ TEST_CHECK(FSIterator(image_dir, { fsio_include_dotfiles, fsio_first_only }) == FSIterator());
TEST_CHECK(! merger.check());
}
@@ -555,19 +557,19 @@ namespace test_cases
void run()
{
- Timestamp m_new((image_dir / "new_file").mtim());
- Timestamp m_existing((image_dir / "existing_file").mtim());
- Timestamp m_dir_new((image_dir / "dir" / "new_file").mtim());
+ Timestamp m_new((image_dir / "new_file").stat().mtim());
+ Timestamp m_existing((image_dir / "existing_file").stat().mtim());
+ Timestamp m_dir_new((image_dir / "dir" / "new_file").stat().mtim());
TEST_CHECK(merger.check());
merger.merge();
- TEST_CHECK(timestamps_nearly_equal((root_dir / "new_file").mtim(), m_new));
- TEST_CHECK(timestamps_nearly_equal((root_dir / "existing_file").mtim(), m_existing));
- TEST_CHECK(Timestamp::now().seconds() - (root_dir / "dodgy_file").mtim().seconds() >= (60 * 60 * 24 * 365 * 3) - 1);
+ TEST_CHECK(timestamps_nearly_equal((root_dir / "new_file").stat().mtim(), m_new));
+ TEST_CHECK(timestamps_nearly_equal((root_dir / "existing_file").stat().mtim(), m_existing));
+ TEST_CHECK(Timestamp::now().seconds() - (root_dir / "dodgy_file").stat().mtim().seconds() >= (60 * 60 * 24 * 365 * 3) - 1);
- TEST_CHECK(timestamps_nearly_equal((root_dir / "dir" / "new_file").mtim(), m_dir_new));
- TEST_CHECK(Timestamp::now().seconds() - (root_dir / "dir" / "dodgy_file").mtim().seconds() >= (60 * 60 * 24 * 365 * 3) - 1);
+ TEST_CHECK(timestamps_nearly_equal((root_dir / "dir" / "new_file").stat().mtim(), m_dir_new));
+ TEST_CHECK(Timestamp::now().seconds() - (root_dir / "dir" / "dodgy_file").stat().mtim().seconds() >= (60 * 60 * 24 * 365 * 3) - 1);
}
} test_merger_mtimes;
@@ -577,19 +579,19 @@ namespace test_cases
void run()
{
- Timestamp m_new((image_dir / "new_file").mtim());
- Timestamp m_existing((image_dir / "existing_file").mtim());
- Timestamp m_dir_new((image_dir / "dir" / "new_file").mtim());
+ Timestamp m_new((image_dir / "new_file").stat().mtim());
+ Timestamp m_existing((image_dir / "existing_file").stat().mtim());
+ Timestamp m_dir_new((image_dir / "dir" / "new_file").stat().mtim());
TEST_CHECK(merger.check());
merger.merge();
- TEST_CHECK(timestamps_nearly_equal((root_dir / "new_file").mtim(), m_new));
- TEST_CHECK(timestamps_nearly_equal((root_dir / "existing_file").mtim(), m_existing));
- TEST_CHECK(timestamps_nearly_equal((root_dir / "dodgy_file").mtim(), FSEntry("fs_merger_TEST_dir/reference").mtim()));
+ TEST_CHECK(timestamps_nearly_equal((root_dir / "new_file").stat().mtim(), m_new));
+ TEST_CHECK(timestamps_nearly_equal((root_dir / "existing_file").stat().mtim(), m_existing));
+ TEST_CHECK(timestamps_nearly_equal((root_dir / "dodgy_file").stat().mtim(), FSPath("fs_merger_TEST_dir/reference").stat().mtim()));
- TEST_CHECK(timestamps_nearly_equal((root_dir / "dir" / "new_file").mtim(), m_dir_new));
- TEST_CHECK(timestamps_nearly_equal((root_dir / "dir" / "dodgy_file").mtim(), FSEntry("fs_merger_TEST_dir/reference").mtim()));
+ TEST_CHECK(timestamps_nearly_equal((root_dir / "dir" / "new_file").stat().mtim(), m_dir_new));
+ TEST_CHECK(timestamps_nearly_equal((root_dir / "dir" / "dodgy_file").stat().mtim(), FSPath("fs_merger_TEST_dir/reference").stat().mtim()));
}
} test_merger_mtimes_fix;
}
diff --git a/paludis/hooker.cc b/paludis/hooker.cc
index 2eea86e..741eefc 100644
--- a/paludis/hooker.cc
+++ b/paludis/hooker.cc
@@ -24,8 +24,6 @@
#include <paludis/hook.hh>
#include <paludis/package_database.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/dir_iterator.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/system.hh>
#include <paludis/util/pimp-impl.hh>
@@ -38,6 +36,8 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/singleton-impl.hh>
#include <paludis/util/process.hh>
+#include <paludis/util/fs_iterator.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/about.hh>
#include <paludis/output_manager.hh>
#include <paludis/metadata_key.hh>
@@ -64,12 +64,12 @@ namespace
public HookFile
{
private:
- const FSEntry _file_name;
+ const FSPath _file_name;
const bool _run_prefixed;
const Environment * const _env;
public:
- BashHookFile(const FSEntry & f, const bool r, const Environment * const e) :
+ BashHookFile(const FSPath & f, const bool r, const Environment * const e) :
_file_name(f),
_run_prefixed(r),
_env(e)
@@ -80,7 +80,7 @@ namespace
const Hook &,
const std::shared_ptr<OutputManager> &) const PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual const FSEntry file_name() const
+ virtual const FSPath file_name() const
{
return _file_name;
}
@@ -99,14 +99,14 @@ namespace
public HookFile
{
private:
- const FSEntry _file_name;
+ const FSPath _file_name;
const bool _run_prefixed;
const Environment * const _env;
void _add_dependency_class(const Hook &, DirectedGraph<std::string, int> &, bool);
public:
- FancyHookFile(const FSEntry & f, const bool r, const Environment * const e) :
+ FancyHookFile(const FSPath & f, const bool r, const Environment * const e) :
_file_name(f),
_run_prefixed(r),
_env(e)
@@ -117,7 +117,7 @@ namespace
const Hook &,
const std::shared_ptr<OutputManager> &) const PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual const FSEntry file_name() const
+ virtual const FSPath file_name() const
{
return _file_name;
}
@@ -131,7 +131,7 @@ namespace
public HookFile
{
private:
- const FSEntry _file_name;
+ const FSPath _file_name;
const Environment * const _env;
void * _dl;
@@ -140,13 +140,13 @@ namespace
const std::shared_ptr<const Sequence<std::string > > (*_auto_hook_names)(const Environment *);
public:
- SoHookFile(const FSEntry &, const bool, const Environment * const);
+ SoHookFile(const FSPath &, const bool, const Environment * const);
virtual HookResult run(
const Hook &,
const std::shared_ptr<OutputManager> &) const PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual const FSEntry file_name() const
+ virtual const FSPath file_name() const
{
return _file_name;
}
@@ -397,7 +397,7 @@ FancyHookFile::_add_dependency_class(const Hook & hook, DirectedGraph<std::strin
<< "Hook dependencies for '" << file_name() << "' returned failure '" << exit_status << "'";
}
-SoHookFile::SoHookFile(const FSEntry & f, const bool, const Environment * const e) :
+SoHookFile::SoHookFile(const FSPath & f, const bool, const Environment * const e) :
_file_name(f),
_env(e),
_dl(0),
@@ -470,7 +470,7 @@ namespace paludis
struct Imp<Hooker>
{
const Environment * const env;
- std::list<std::pair<FSEntry, bool> > dirs;
+ std::list<std::pair<FSPath, bool> > dirs;
mutable Mutex hook_files_mutex;
mutable std::map<std::string, std::shared_ptr<Sequence<std::shared_ptr<HookFile> > > > hook_files;
@@ -493,14 +493,14 @@ namespace paludis
Context context("When loading auto hooks:");
- for (std::list<std::pair<FSEntry, bool> >::const_iterator d(dirs.begin()), d_end(dirs.end()) ;
+ for (std::list<std::pair<FSPath, bool> >::const_iterator d(dirs.begin()), d_end(dirs.end()) ;
d != d_end ; ++d)
{
- FSEntry d_a(d->first / "auto");
- if (! d_a.is_directory())
+ FSPath d_a(d->first / "auto");
+ if (! d_a.stat().is_directory())
continue;
- for (DirIterator e(d_a), e_end ; e != e_end ; ++e)
+ for (FSIterator e(d_a, { }), e_end ; e != e_end ; ++e)
{
std::shared_ptr<HookFile> hook_file;
std::string name;
@@ -544,7 +544,7 @@ Hooker::~Hooker()
}
void
-Hooker::add_dir(const FSEntry & dir, const bool v)
+Hooker::add_dir(const FSPath & dir, const bool v)
{
Lock l(_imp->hook_files_mutex);
_imp->hook_files.clear();
@@ -559,7 +559,7 @@ namespace
{
Mutex mutex;
void * handle;
- std::shared_ptr<HookFile> (* create_py_hook_file_handle)(const FSEntry &,
+ std::shared_ptr<HookFile> (* create_py_hook_file_handle)(const FSPath &,
const bool, const Environment * const);
@@ -594,13 +594,13 @@ Hooker::_find_hooks(const Hook & hook) const
}
/* named subdirectories */
- for (std::list<std::pair<FSEntry, bool> >::const_iterator d(_imp->dirs.begin()), d_end(_imp->dirs.end()) ;
+ for (std::list<std::pair<FSPath, bool> >::const_iterator d(_imp->dirs.begin()), d_end(_imp->dirs.end()) ;
d != d_end ; ++d)
{
- if (! (d->first / hook.name()).is_directory())
+ if (! (d->first / hook.name()).stat().is_directory())
continue;
- for (DirIterator e(d->first / hook.name()), e_end ; e != e_end ; ++e)
+ for (FSIterator e(d->first / hook.name(), { }), e_end ; e != e_end ; ++e)
{
if (ignore_hooks.find(e->basename()) != ignore_hooks.end())
continue;
@@ -645,7 +645,7 @@ Hooker::_find_hooks(const Hook & hook) const
{
PyHookFileHandle::get_instance()->create_py_hook_file_handle =
reinterpret_cast<std::shared_ptr<HookFile> (*)(
- const FSEntry &, const bool, const Environment * const)>(
+ const FSPath &, const bool, const Environment * const)>(
reinterpret_cast<uintptr_t>(dlsym(
PyHookFileHandle::get_instance()->handle, "create_py_hook_file")));
if (PyHookFileHandle::get_instance()->create_py_hook_file_handle)
@@ -798,7 +798,7 @@ Hooker::perform_hook(
case hod_stdout:
for (Sequence<std::shared_ptr<HookFile> >::ConstIterator f(h->second->begin()),
f_end(h->second->end()) ; f != f_end ; ++f)
- if ((*f)->file_name().is_regular_file_or_symlink_to_regular_file())
+ if ((*f)->file_name().stat().is_regular_file_or_symlink_to_regular_file())
result.max_exit_status() = std::max(result.max_exit_status(), (*f)->run(hook, optional_output_manager).max_exit_status());
else
Log::get_instance()->message("hook.not_regular_file", ll_warning, lc_context) << "Hook file '" <<
@@ -809,7 +809,7 @@ Hooker::perform_hook(
for (Sequence<std::shared_ptr<HookFile> >::ConstIterator f(h->second->begin()),
f_end(h->second->end()) ; f != f_end ; ++f)
{
- if (! (*f)->file_name().is_regular_file_or_symlink_to_regular_file())
+ if (! (*f)->file_name().stat().is_regular_file_or_symlink_to_regular_file())
{
Log::get_instance()->message("hook.not_regular_file", ll_warning, lc_context) << "Hook file '" <<
(*f)->file_name() << "' is not a regular file or has been removed";
diff --git a/paludis/hooker.hh b/paludis/hooker.hh
index 0efc36f..7371715 100644
--- a/paludis/hooker.hh
+++ b/paludis/hooker.hh
@@ -24,6 +24,7 @@
#include <paludis/util/pimp.hh>
#include <paludis/util/graph-fwd.hh>
#include <paludis/util/sequence-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/output_manager-fwd.hh>
#include <memory>
#include <string>
@@ -40,7 +41,6 @@
namespace paludis
{
- class FSEntry;
class Environment;
class Hook;
class HookResult;
@@ -72,7 +72,7 @@ namespace paludis
const Hook &,
const std::shared_ptr<OutputManager> & optional_output_manager) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual const FSEntry file_name() const = 0;
+ virtual const FSPath file_name() const = 0;
virtual void add_dependencies(const Hook &, DirectedGraph<std::string, int> &) = 0;
@@ -115,7 +115,7 @@ namespace paludis
/**
* Add a new hook directory.
*/
- void add_dir(const FSEntry &, const bool output_prefixed);
+ void add_dir(const FSPath &, const bool output_prefixed);
};
}
diff --git a/paludis/hooker_TEST.cc b/paludis/hooker_TEST.cc
index f33aa17..a4ba32f 100644
--- a/paludis/hooker_TEST.cc
+++ b/paludis/hooker_TEST.cc
@@ -21,7 +21,6 @@
#include <paludis/hooker.hh>
#include <paludis/hook.hh>
#include <paludis/environments/test/test_environment.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/make_null_shared_ptr.hh>
@@ -44,7 +43,7 @@ namespace test_cases
Hooker hooker(&env);
HookResult result(make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = ""));
- hooker.add_dir(FSEntry("hooker_TEST_dir/"), false);
+ hooker.add_dir(FSPath("hooker_TEST_dir/"), false);
#ifdef ENABLE_PYTHON_HOOKS
result = hooker.perform_hook(Hook("py_hook"),
make_null_shared_ptr());
@@ -79,15 +78,15 @@ namespace test_cases
TestEnvironment env;
Hooker hooker(&env);
- FSEntry("hooker_TEST_dir/ordering.out").unlink();
+ FSPath("hooker_TEST_dir/ordering.out").unlink();
- hooker.add_dir(FSEntry("hooker_TEST_dir/"), false);
+ hooker.add_dir(FSPath("hooker_TEST_dir/"), false);
HookResult result(hooker.perform_hook(Hook("ordering"),
make_null_shared_ptr()));
TEST_CHECK_EQUAL(result.max_exit_status(), 0);
TEST_CHECK_EQUAL(result.output(), "");
- SafeIFStream f(FSEntry("hooker_TEST_dir/ordering.out"));
+ SafeIFStream f(FSPath("hooker_TEST_dir/ordering.out"));
std::string line((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());
#ifdef ENABLE_PYTHON_HOOKS
@@ -108,15 +107,15 @@ namespace test_cases
TestEnvironment env;
Hooker hooker(&env);
- FSEntry("hooker_TEST_dir/bad_hooks.out").unlink();
+ FSPath("hooker_TEST_dir/bad_hooks.out").unlink();
- hooker.add_dir(FSEntry("hooker_TEST_dir/"), false);
+ hooker.add_dir(FSPath("hooker_TEST_dir/"), false);
HookResult result(hooker.perform_hook(Hook("bad_hooks"),
make_null_shared_ptr()));
TEST_CHECK_EQUAL(result.max_exit_status(), 123);
TEST_CHECK_EQUAL(result.output(), "");
- SafeIFStream f(FSEntry("hooker_TEST_dir/bad_hooks.out"));
+ SafeIFStream f(FSPath("hooker_TEST_dir/bad_hooks.out"));
std::string line((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());
TEST_CHECK_EQUAL(line, "one\nthree\n");
@@ -132,15 +131,15 @@ namespace test_cases
TestEnvironment env;
Hooker hooker(&env);
- FSEntry("hooker_TEST_dir/cycles.out").unlink();
+ FSPath("hooker_TEST_dir/cycles.out").unlink();
- hooker.add_dir(FSEntry("hooker_TEST_dir/"), false);
+ hooker.add_dir(FSPath("hooker_TEST_dir/"), false);
HookResult result(hooker.perform_hook(Hook("cycles"),
make_null_shared_ptr()));
TEST_CHECK_EQUAL(result.max_exit_status(), 0);
TEST_CHECK_EQUAL(result.output(), "");
- SafeIFStream f(FSEntry("hooker_TEST_dir/cycles.out"));
+ SafeIFStream f(FSPath("hooker_TEST_dir/cycles.out"));
std::string line((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());
TEST_CHECK_EQUAL(line, "b\na\ng\nf\ni\n");
@@ -157,9 +156,9 @@ namespace test_cases
Hooker hooker(&env);
HookResult result(make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = ""));
- FSEntry("hooker_TEST_dir/several_output.out").unlink();
+ FSPath("hooker_TEST_dir/several_output.out").unlink();
- hooker.add_dir(FSEntry("hooker_TEST_dir/"), false);
+ hooker.add_dir(FSPath("hooker_TEST_dir/"), false);
result = hooker.perform_hook(Hook("simple_hook_output")
.grab_output(Hook::AllowedOutputValues()("foo")),
@@ -211,7 +210,7 @@ namespace test_cases
TEST_CHECK_EQUAL(result.output(), "");
TEST_CHECK_EQUAL(result.max_exit_status(), 0);
- SafeIFStream f(FSEntry("hooker_TEST_dir/several_output.out"));
+ SafeIFStream f(FSPath("hooker_TEST_dir/several_output.out"));
std::string line((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());
TEST_CHECK_EQUAL(line, "one\none\none\ntwo\none\ntwo\nthree\n");
@@ -228,9 +227,9 @@ namespace test_cases
TestEnvironment env;
Hooker hooker(&env);
- FSEntry("hooker_TEST_dir/several_output_bad.out").unlink();
+ FSPath("hooker_TEST_dir/several_output_bad.out").unlink();
- hooker.add_dir(FSEntry("hooker_TEST_dir/"), false);
+ hooker.add_dir(FSPath("hooker_TEST_dir/"), false);
HookResult result(hooker.perform_hook(Hook("several_hooks_output_bad")
.grab_output(Hook::AllowedOutputValues()),
@@ -238,7 +237,7 @@ namespace test_cases
TEST_CHECK_EQUAL(result.output(), "two");
TEST_CHECK_EQUAL(result.max_exit_status(), 99);
- SafeIFStream f(FSEntry("hooker_TEST_dir/several_output_bad.out"));
+ SafeIFStream f(FSPath("hooker_TEST_dir/several_output_bad.out"));
std::string line((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());
TEST_CHECK_EQUAL(line, "one\ntwo\nthree\n");
diff --git a/paludis/ipc_output_manager.cc b/paludis/ipc_output_manager.cc
index 6a55a64..5bb7d31 100644
--- a/paludis/ipc_output_manager.cc
+++ b/paludis/ipc_output_manager.cc
@@ -25,7 +25,6 @@
#include <paludis/util/map.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/destringify.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/system.hh>
#include <paludis/util/tokeniser.hh>
diff --git a/paludis/legacy/dep_list_TEST.hh b/paludis/legacy/dep_list_TEST.hh
index c5d0e85..9bd5fa1 100644
--- a/paludis/legacy/dep_list_TEST.hh
+++ b/paludis/legacy/dep_list_TEST.hh
@@ -24,7 +24,6 @@
#include <paludis/legacy/dep_list_exceptions.hh>
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/user_dep_spec.hh>
diff --git a/paludis/legacy/range_rewriter.cc b/paludis/legacy/range_rewriter.cc
index 39002ee..65b69d9 100644
--- a/paludis/legacy/range_rewriter.cc
+++ b/paludis/legacy/range_rewriter.cc
@@ -175,7 +175,7 @@ namespace
return make_null_shared_ptr();
}
- virtual std::shared_ptr<const FSEntry> installed_at_path_ptr() const
+ virtual std::shared_ptr<const FSPath> installed_at_path_ptr() const
{
return make_null_shared_ptr();
}
diff --git a/paludis/legacy/uninstall_task.cc b/paludis/legacy/uninstall_task.cc
index 6523716..e02f4b8 100644
--- a/paludis/legacy/uninstall_task.cc
+++ b/paludis/legacy/uninstall_task.cc
@@ -232,7 +232,7 @@ UninstallTask::add_unused()
namespace
{
- bool ignore_nothing(const FSEntry &)
+ bool ignore_nothing(const FSPath &)
{
return false;
}
diff --git a/paludis/libtool_linkage_checker.cc b/paludis/libtool_linkage_checker.cc
index 22bbd1a..b96a96e 100644
--- a/paludis/libtool_linkage_checker.cc
+++ b/paludis/libtool_linkage_checker.cc
@@ -21,7 +21,7 @@
#include <paludis/util/realpath.hh>
#include <paludis/util/config_file.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_path.hh>
#include <paludis/util/log.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/options.hh>
@@ -29,6 +29,8 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/safe_ifstream.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_error.hh>
#include <algorithm>
#include <cstring>
@@ -38,20 +40,20 @@
using namespace paludis;
-typedef std::vector<std::pair<FSEntry, std::string> > Breakage;
+typedef std::vector<std::pair<FSPath, std::string> > Breakage;
namespace paludis
{
template <>
struct Imp<LibtoolLinkageChecker>
{
- FSEntry root;
+ FSPath root;
Mutex mutex;
Breakage breakage;
- Imp(const FSEntry & the_root) :
+ Imp(const FSPath & the_root) :
root(the_root)
{
}
@@ -69,7 +71,7 @@ namespace
};
}
-LibtoolLinkageChecker::LibtoolLinkageChecker(const FSEntry & root) :
+LibtoolLinkageChecker::LibtoolLinkageChecker(const FSPath & root) :
Pimp<LibtoolLinkageChecker>(root)
{
}
@@ -79,7 +81,7 @@ LibtoolLinkageChecker::~LibtoolLinkageChecker()
}
bool
-LibtoolLinkageChecker::check_file(const FSEntry & file)
+LibtoolLinkageChecker::check_file(const FSPath & file)
{
std::string basename(file.basename());
if (! (3 <= basename.length() &&
@@ -121,8 +123,8 @@ LibtoolLinkageChecker::check_file(const FSEntry & file)
{
try
{
- FSEntry dep(_imp->root / *it);
- if (! dereference_with_root(dep, _imp->root).is_regular_file())
+ FSPath dep(_imp->root / *it);
+ if (! dereference_with_root(dep, _imp->root).stat().is_regular_file())
{
Log::get_instance()->message("reconcilio.broken_linkage_finder.dependency_missing",
ll_debug, lc_context) << "Dependency '" << *it <<
@@ -147,18 +149,18 @@ LibtoolLinkageChecker::check_file(const FSEntry & file)
}
void
-LibtoolLinkageChecker::note_symlink(const FSEntry &, const FSEntry &)
+LibtoolLinkageChecker::note_symlink(const FSPath &, const FSPath &)
{
}
void
-LibtoolLinkageChecker::add_extra_lib_dir(const FSEntry &)
+LibtoolLinkageChecker::add_extra_lib_dir(const FSPath &)
{
}
void
LibtoolLinkageChecker::need_breakage_added(
- const std::function<void (const FSEntry &, const std::string &)> & callback)
+ const std::function<void (const FSPath &, const std::string &)> & callback)
{
for (Breakage::const_iterator it(_imp->breakage.begin()), it_end(_imp->breakage.end()); it_end != it; ++it)
callback(it->first, it->second);
diff --git a/paludis/libtool_linkage_checker.hh b/paludis/libtool_linkage_checker.hh
index a11e1ab..c841bb8 100644
--- a/paludis/libtool_linkage_checker.hh
+++ b/paludis/libtool_linkage_checker.hh
@@ -27,18 +27,18 @@ namespace paludis
{
class LibtoolLinkageChecker :
public LinkageChecker,
- private paludis::Pimp<LibtoolLinkageChecker>
+ private Pimp<LibtoolLinkageChecker>
{
public:
- LibtoolLinkageChecker(const paludis::FSEntry &);
+ LibtoolLinkageChecker(const FSPath &);
virtual ~LibtoolLinkageChecker();
- virtual bool check_file(const paludis::FSEntry &) PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual void note_symlink(const paludis::FSEntry &, const paludis::FSEntry &);
+ virtual bool check_file(const FSPath &) PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual void note_symlink(const FSPath &, const FSPath &);
- virtual void add_extra_lib_dir(const paludis::FSEntry &);
+ virtual void add_extra_lib_dir(const FSPath &);
virtual void need_breakage_added(
- const std::function<void (const paludis::FSEntry &, const std::string &)> &);
+ const std::function<void (const FSPath &, const std::string &)> &);
};
}
diff --git a/paludis/linkage_checker.hh b/paludis/linkage_checker.hh
index 977b4f9..bea870c 100644
--- a/paludis/linkage_checker.hh
+++ b/paludis/linkage_checker.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_BROKEN_LINKAGE_FINDER_LINKAGE_CHECKER_HH
#include <paludis/broken_linkage_finder.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/util/set-fwd.hh>
#include <paludis/package_id-fwd.hh>
@@ -40,12 +40,12 @@ namespace paludis
LinkageChecker(const LinkageChecker &) = delete;
LinkageChecker & operator= (const LinkageChecker &) = delete;
- virtual bool check_file(const paludis::FSEntry &) PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual void note_symlink(const paludis::FSEntry &, const paludis::FSEntry &) = 0;
+ virtual bool check_file(const FSPath &) PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual void note_symlink(const FSPath &, const FSPath &) = 0;
- virtual void add_extra_lib_dir(const paludis::FSEntry &) = 0;
+ virtual void add_extra_lib_dir(const FSPath &) = 0;
virtual void need_breakage_added(
- const std::function<void (const paludis::FSEntry &, const std::string &)> &) = 0;
+ const std::function<void (const FSPath &, const std::string &)> &) = 0;
};
}
diff --git a/paludis/literal_metadata_key.cc b/paludis/literal_metadata_key.cc
index 001b062..9fbc234 100644
--- a/paludis/literal_metadata_key.cc
+++ b/paludis/literal_metadata_key.cc
@@ -19,7 +19,6 @@
#include <paludis/literal_metadata_key.hh>
#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/join.hh>
@@ -36,15 +35,15 @@ using namespace paludis;
namespace paludis
{
template <>
- struct Imp<LiteralMetadataFSEntrySequenceKey>
+ struct Imp<LiteralMetadataFSPathSequenceKey>
{
const std::string raw_name;
const std::string human_name;
const MetadataKeyType type;
- const std::shared_ptr<const FSEntrySequence> value;
+ const std::shared_ptr<const FSPathSequence> value;
Imp(const std::string & r, const std::string & h, const MetadataKeyType t,
- const std::shared_ptr<const FSEntrySequence> & v) :
+ const std::shared_ptr<const FSPathSequence> & v) :
raw_name(r),
human_name(h),
type(t),
@@ -107,52 +106,52 @@ namespace paludis
};
}
-LiteralMetadataFSEntrySequenceKey::LiteralMetadataFSEntrySequenceKey(const std::string & r, const std::string & h,
- const MetadataKeyType t, const std::shared_ptr<const FSEntrySequence> & v) :
- Pimp<LiteralMetadataFSEntrySequenceKey>(r, h, t, v),
- _imp(Pimp<LiteralMetadataFSEntrySequenceKey>::_imp)
+LiteralMetadataFSPathSequenceKey::LiteralMetadataFSPathSequenceKey(const std::string & r, const std::string & h,
+ const MetadataKeyType t, const std::shared_ptr<const FSPathSequence> & v) :
+ Pimp<LiteralMetadataFSPathSequenceKey>(r, h, t, v),
+ _imp(Pimp<LiteralMetadataFSPathSequenceKey>::_imp)
{
}
-LiteralMetadataFSEntrySequenceKey::~LiteralMetadataFSEntrySequenceKey()
+LiteralMetadataFSPathSequenceKey::~LiteralMetadataFSPathSequenceKey()
{
}
-const std::shared_ptr<const FSEntrySequence>
-LiteralMetadataFSEntrySequenceKey::value() const
+const std::shared_ptr<const FSPathSequence>
+LiteralMetadataFSPathSequenceKey::value() const
{
return _imp->value;
}
namespace
{
- std::string format_fsentry(const FSEntry & i, const Formatter<FSEntry> & f)
+ std::string format_fsentry(const FSPath & i, const Formatter<FSPath> & f)
{
return f.format(i, format::Plain());
}
}
std::string
-LiteralMetadataFSEntrySequenceKey::pretty_print_flat(const Formatter<FSEntry> & f) const
+LiteralMetadataFSPathSequenceKey::pretty_print_flat(const Formatter<FSPath> & f) const
{
using namespace std::placeholders;
return join(value()->begin(), value()->end(), " ", std::bind(&format_fsentry, _1, f));
}
const std::string
-LiteralMetadataFSEntrySequenceKey::human_name() const
+LiteralMetadataFSPathSequenceKey::human_name() const
{
return _imp->human_name;
}
const std::string
-LiteralMetadataFSEntrySequenceKey::raw_name() const
+LiteralMetadataFSPathSequenceKey::raw_name() const
{
return _imp->raw_name;
}
MetadataKeyType
-LiteralMetadataFSEntrySequenceKey::type() const
+LiteralMetadataFSPathSequenceKey::type() const
{
return _imp->type;
}
@@ -395,7 +394,7 @@ LiteralMetadataTimeKey::value() const
return _imp->value;
}
-template class LiteralMetadataValueKey<FSEntry>;
+template class LiteralMetadataValueKey<FSPath>;
template class LiteralMetadataValueKey<std::string>;
template class LiteralMetadataValueKey<SlotName>;
template class LiteralMetadataValueKey<bool>;
diff --git a/paludis/literal_metadata_key.hh b/paludis/literal_metadata_key.hh
index 594286b..112fa30 100644
--- a/paludis/literal_metadata_key.hh
+++ b/paludis/literal_metadata_key.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -21,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_LITERAL_METADATA_KEY_HH 1
#include <paludis/metadata_key.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/pimp.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/set.hh>
@@ -140,32 +139,32 @@ namespace paludis
};
/**
- * A LiteralMetadataFSEntrySequenceKey is a MetadataCollectionKey<FSEntrySequence>
+ * A LiteralMetadataFSPathSequenceKey is a MetadataCollectionKey<FSPathSequence>
* whose value is known at construction time.
*
* \ingroup g_literal_metadata_key
* \since 0.26
*/
- class PALUDIS_VISIBLE LiteralMetadataFSEntrySequenceKey :
- public MetadataCollectionKey<FSEntrySequence>,
- private Pimp<LiteralMetadataFSEntrySequenceKey>
+ class PALUDIS_VISIBLE LiteralMetadataFSPathSequenceKey :
+ public MetadataCollectionKey<FSPathSequence>,
+ private Pimp<LiteralMetadataFSPathSequenceKey>
{
private:
- Pimp<LiteralMetadataFSEntrySequenceKey>::ImpPtr & _imp;
+ Pimp<LiteralMetadataFSPathSequenceKey>::ImpPtr & _imp;
public:
///\name Basic operations
///\{
- LiteralMetadataFSEntrySequenceKey(const std::string &, const std::string &, const MetadataKeyType,
- const std::shared_ptr<const FSEntrySequence> &);
- ~LiteralMetadataFSEntrySequenceKey();
+ LiteralMetadataFSPathSequenceKey(const std::string &, const std::string &, const MetadataKeyType,
+ const std::shared_ptr<const FSPathSequence> &);
+ ~LiteralMetadataFSPathSequenceKey();
///\}
- virtual const std::shared_ptr<const FSEntrySequence> value() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual const std::shared_ptr<const FSPathSequence> value() const PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::string pretty_print_flat(const Formatter<FSEntry> &) const
+ virtual std::string pretty_print_flat(const Formatter<FSPath> &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/mask.cc b/paludis/mask.cc
index e4b5627..08ac243 100644
--- a/paludis/mask.cc
+++ b/paludis/mask.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -19,6 +19,7 @@
#include <paludis/mask.hh>
#include <paludis/util/stringify.hh>
+#include <paludis/util/exception.hh>
#include <istream>
#include <ostream>
diff --git a/paludis/mask.hh b/paludis/mask.hh
index 7471c11..727a01f 100644
--- a/paludis/mask.hh
+++ b/paludis/mask.hh
@@ -25,7 +25,7 @@
#include <paludis/package_id-fwd.hh>
#include <paludis/util/simple_visitor.hh>
#include <paludis/util/attributes.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_path.hh>
#include <paludis/util/sequence-fwd.hh>
#include <paludis/util/named_value.hh>
#include <paludis/util/type_list.hh>
@@ -65,7 +65,7 @@ namespace paludis
struct RepositoryMaskInfo
{
NamedValue<n::comment, std::shared_ptr<const Sequence<std::string> > > comment;
- NamedValue<n::mask_file, FSEntry> mask_file;
+ NamedValue<n::mask_file, FSPath> mask_file;
};
/**
diff --git a/paludis/match_package.cc b/paludis/match_package.cc
index 4b770d5..e891569 100644
--- a/paludis/match_package.cc
+++ b/paludis/match_package.cc
@@ -27,7 +27,6 @@
#include <paludis/slot_requirement.hh>
#include <paludis/metadata_key.hh>
#include <paludis/util/set.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/options.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/sequence.hh>
diff --git a/paludis/merger-fwd.hh b/paludis/merger-fwd.hh
index e0c2732..5897aa1 100644
--- a/paludis/merger-fwd.hh
+++ b/paludis/merger-fwd.hh
@@ -23,7 +23,6 @@
#include <iosfwd>
#include <paludis/util/attributes.hh>
#include <paludis/util/options-fwd.hh>
-#include <paludis/util/fs_entry-fwd.hh>
namespace paludis
{
diff --git a/paludis/merger.cc b/paludis/merger.cc
index 1aa8726..b7ac649 100644
--- a/paludis/merger.cc
+++ b/paludis/merger.cc
@@ -20,11 +20,12 @@
#include <paludis/merger.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/exception.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/log.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/timestamp.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/fs_iterator.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/selinux/security_context.hh>
#include <paludis/environment.hh>
#include <paludis/hook.hh>
@@ -48,7 +49,7 @@ namespace paludis
bool result;
bool skip_dir;
- std::set<FSEntry> fixed_entries;
+ std::set<FSPath, FSPathComparator> fixed_entries;
Imp(const MergerParams & p) :
params(p),
@@ -138,17 +139,17 @@ Merger::make_check_fail()
}
void
-Merger::do_dir_recursive(bool is_check, const FSEntry & src, const FSEntry & dst)
+Merger::do_dir_recursive(bool is_check, const FSPath & src, const FSPath & dst)
{
Context context("When " + stringify(is_check ? "checking" : "performing") + " merge from '" +
stringify(src) + "' to '" + stringify(dst) + "':");
- if (! src.is_directory())
+ if (! src.stat().is_directory())
throw MergerError("Source directory '" + stringify(src) + "' is not a directory");
on_enter_dir(is_check, src);
- DirIterator d(src, { dio_include_dotfiles, dio_inode_sort }), d_end;
+ FSIterator d(src, { fsio_include_dotfiles, fsio_inode_sort }), d_end;
if (is_check && d == d_end && dst != _imp->params.root().realpath())
{
@@ -200,37 +201,39 @@ Merger::do_dir_recursive(bool is_check, const FSEntry & src, const FSEntry & dst
}
void
-Merger::on_enter_dir(bool, const FSEntry)
+Merger::on_enter_dir(bool, const FSPath)
{
}
void
-Merger::on_leave_dir(bool, const FSEntry)
+Merger::on_leave_dir(bool, const FSPath)
{
}
EntryType
-Merger::entry_type(const FSEntry & f)
+Merger::entry_type(const FSPath & f)
{
Context context("When checking type of '" + stringify(f) + "':");
- if (! f.exists())
+ FSStat f_stat(f);
+
+ if (! f_stat.exists())
return et_nothing;
- if (f.is_symbolic_link())
+ if (f_stat.is_symlink())
return et_sym;
- if (f.is_regular_file())
+ if (f_stat.is_regular_file())
return et_file;
- if (f.is_directory())
+ if (f_stat.is_directory())
return et_dir;
return et_misc;
}
void
-Merger::on_file(bool is_check, const FSEntry & src, const FSEntry & dst)
+Merger::on_file(bool is_check, const FSPath & src, const FSPath & dst)
{
Context context("When handling file '" + stringify(src) + "' to '" + stringify(dst) + "':");
@@ -262,10 +265,11 @@ Merger::on_file(bool is_check, const FSEntry & src, const FSEntry & dst)
}
}
- if (is_check && src.mtim() < _imp->params.fix_mtimes_before())
- FSEntry(src).utime(_imp->params.fix_mtimes_before());
+ FSStat src_stat(src);
+ if (is_check && src_stat.mtim() < _imp->params.fix_mtimes_before())
+ src.utime(_imp->params.fix_mtimes_before());
- on_file_main(is_check, FSEntry(stringify(src)), dst);
+ on_file_main(is_check, FSPath(stringify(src)), dst);
if (is_check &&
0 != _imp->params.environment()->perform_hook(extend_hook(
@@ -277,7 +281,7 @@ Merger::on_file(bool is_check, const FSEntry & src, const FSEntry & dst)
}
void
-Merger::on_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
+Merger::on_dir(bool is_check, const FSPath & src, const FSPath & dst)
{
Context context("When handling dir '" + stringify(src) + "' to '" + stringify(dst) + "':");
@@ -322,7 +326,7 @@ Merger::on_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
}
void
-Merger::on_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
+Merger::on_sym(bool is_check, const FSPath & src, const FSPath & dst)
{
Context context("When handling sym '" + stringify(src) + "' to '" + stringify(dst) + "':");
@@ -363,7 +367,7 @@ Merger::on_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
rewrite_symlink_as_needed(src, dst);
}
- on_sym_main(is_check, FSEntry(stringify(src)), dst);
+ on_sym_main(is_check, FSPath(stringify(src)), dst);
if (is_check &&
0 != _imp->params.environment()->perform_hook(extend_hook(
@@ -375,7 +379,7 @@ Merger::on_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
}
void
-Merger::on_misc(bool is_check, const FSEntry & src, const FSEntry & dst)
+Merger::on_misc(bool is_check, const FSPath & src, const FSPath & dst)
{
Context context("When handling misc '" + stringify(src) + "' to '" + stringify(dst) + "':");
@@ -384,7 +388,7 @@ Merger::on_misc(bool is_check, const FSEntry & src, const FSEntry & dst)
}
bool
-Merger::symlink_needs_rewriting(const FSEntry & sym)
+Merger::symlink_needs_rewriting(const FSPath & sym)
{
std::string target(sym.readlink());
std::string real_image(stringify(_imp->params.image().realpath()));
@@ -399,19 +403,20 @@ Merger::set_skipped_dir(const bool value)
}
void
-Merger::do_ownership_fixes_recursive(const FSEntry & dir)
+Merger::do_ownership_fixes_recursive(const FSPath & dir)
{
- for (DirIterator d(dir, { dio_include_dotfiles, dio_inode_sort }), d_end ; d != d_end ; ++d)
+ for (FSIterator d(dir, { fsio_include_dotfiles, fsio_inode_sort }), d_end ; d != d_end ; ++d)
{
std::pair<uid_t, gid_t> new_ids(_imp->params.get_new_ids_or_minus_one()(*d));
if (uid_t(-1) != new_ids.first || gid_t(-1) != new_ids.second)
{
- FSEntry f(*d);
+ FSPath f(*d);
+ FSStat f_stat(f);
f.lchown(new_ids.first, new_ids.second);
if (et_sym != entry_type(*d))
{
- mode_t mode(f.permissions());
+ mode_t mode(f_stat.permissions());
if (et_dir == entry_type(*d))
{
@@ -452,7 +457,7 @@ Merger::do_ownership_fixes_recursive(const FSEntry & dir)
}
bool
-Merger::fixed_ownership_for(const FSEntry & f)
+Merger::fixed_ownership_for(const FSPath & f)
{
return _imp->fixed_entries.end() != _imp->fixed_entries.find(f);
}
@@ -463,21 +468,21 @@ Merger::on_done_merge()
}
void
-Merger::rewrite_symlink_as_needed(const FSEntry & src, const FSEntry & dst_dir)
+Merger::rewrite_symlink_as_needed(const FSPath & src, const FSPath & dst_dir)
{
if (! symlink_needs_rewriting(src))
return;
FSCreateCon createcon(MatchPathCon::get_instance()->match(stringify(dst_dir / src.basename()), S_IFLNK));
- FSEntry real_image(_imp->params.image().realpath());
- FSEntry dst(src.readlink());
+ FSPath real_image(_imp->params.image().realpath());
+ FSPath dst(src.readlink());
std::string fixed_dst(stringify(dst.strip_leading(real_image)));
Log::get_instance()->message("merger.rewriting_symlink", ll_qa, lc_context) << "Rewriting bad symlink: "
<< src << " -> " << dst << " to " << fixed_dst;
- FSEntry s(src);
+ FSPath s(src);
s.unlink();
s.symlink(fixed_dst);
}
diff --git a/paludis/merger.hh b/paludis/merger.hh
index 38ad13c..2571564 100644
--- a/paludis/merger.hh
+++ b/paludis/merger.hh
@@ -22,9 +22,9 @@
#include <paludis/merger-fwd.hh>
#include <paludis/util/named_value.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/options.hh>
#include <paludis/util/timestamp.hh>
+#include <paludis/util/fs_path.hh>
#include <paludis/hook-fwd.hh>
#include <paludis/environment-fwd.hh>
#include <paludis/merger_entry_type.hh>
@@ -58,14 +58,14 @@ namespace paludis
{
NamedValue<n::environment, Environment *> environment;
NamedValue<n::fix_mtimes_before, Timestamp> fix_mtimes_before;
- NamedValue<n::get_new_ids_or_minus_one, std::function<std::pair<uid_t, gid_t> (const FSEntry &)> > get_new_ids_or_minus_one;
- NamedValue<n::image, FSEntry> image;
- NamedValue<n::install_under, FSEntry> install_under;
+ NamedValue<n::get_new_ids_or_minus_one, std::function<std::pair<uid_t, gid_t> (const FSPath &)> > get_new_ids_or_minus_one;
+ NamedValue<n::image, FSPath> image;
+ NamedValue<n::install_under, FSPath> install_under;
NamedValue<n::maybe_output_manager, std::shared_ptr<OutputManager> > maybe_output_manager;
- NamedValue<n::merged_entries, std::shared_ptr<FSEntrySet> > merged_entries;
+ NamedValue<n::merged_entries, std::shared_ptr<FSPathSet> > merged_entries;
NamedValue<n::no_chown, bool> no_chown;
NamedValue<n::options, MergerOptions> options;
- NamedValue<n::root, FSEntry> root;
+ NamedValue<n::root, FSPath> root;
};
class PALUDIS_VISIBLE MergerError :
@@ -79,11 +79,11 @@ namespace paludis
private Pimp<Merger>
{
protected:
- bool symlink_needs_rewriting(const FSEntry &);
- void rewrite_symlink_as_needed(const FSEntry &, const FSEntry &);
+ bool symlink_needs_rewriting(const FSPath &);
+ void rewrite_symlink_as_needed(const FSPath &, const FSPath &);
void set_skipped_dir(const bool);
- void do_ownership_fixes_recursive(const FSEntry &);
- bool fixed_ownership_for(const FSEntry &);
+ void do_ownership_fixes_recursive(const FSPath &);
+ bool fixed_ownership_for(const FSPath &);
/**
* Allows subclasses to extend hook calls.
@@ -98,22 +98,22 @@ namespace paludis
/**
* Handle a directory, recursively.
*/
- virtual void do_dir_recursive(bool is_check, const FSEntry &, const FSEntry &);
+ virtual void do_dir_recursive(bool is_check, const FSPath &, const FSPath &);
/**
* Determine the entry type of a filesystem entry.
*/
- virtual EntryType entry_type(const FSEntry &);
+ virtual EntryType entry_type(const FSPath &);
/**
* Allows subclasses to perform behaviour when entering a directory.
*/
- virtual void on_enter_dir(bool is_check, const FSEntry);
+ virtual void on_enter_dir(bool is_check, const FSPath);
/**
* Allows subclasses to perform behaviour when leaving a directory.
*/
- virtual void on_leave_dir(bool is_check, const FSEntry);
+ virtual void on_leave_dir(bool is_check, const FSPath);
/**
* Allows subclasses to perform behaviour when everything has been
@@ -133,18 +133,18 @@ namespace paludis
virtual void display_override(const std::string &) const = 0;
- virtual void on_misc(bool is_check, const FSEntry &, const FSEntry &);
- virtual void on_file(bool is_check, const FSEntry &, const FSEntry &);
- virtual void on_dir(bool is_check, const FSEntry &, const FSEntry &);
- virtual void on_sym(bool is_check, const FSEntry &, const FSEntry &);
+ virtual void on_misc(bool is_check, const FSPath &, const FSPath &);
+ virtual void on_file(bool is_check, const FSPath &, const FSPath &);
+ virtual void on_dir(bool is_check, const FSPath &, const FSPath &);
+ virtual void on_sym(bool is_check, const FSPath &, const FSPath &);
- virtual void on_file_main(bool is_check, const FSEntry &, const FSEntry &) = 0;
- virtual void on_dir_main(bool is_check, const FSEntry &, const FSEntry &) = 0;
- virtual void on_sym_main(bool is_check, const FSEntry &, const FSEntry &) = 0;
+ virtual void on_file_main(bool is_check, const FSPath &, const FSPath &) = 0;
+ virtual void on_dir_main(bool is_check, const FSPath &, const FSPath &) = 0;
+ virtual void on_sym_main(bool is_check, const FSPath &, const FSPath &) = 0;
virtual void prepare_install_under() = 0;
- virtual FSEntry canonicalise_root_path(const FSEntry &) = 0;
+ virtual FSPath canonicalise_root_path(const FSPath &) = 0;
public:
explicit Merger(const MergerParams &);
diff --git a/paludis/metadata_key.cc b/paludis/metadata_key.cc
index d451010..e294ba9 100644
--- a/paludis/metadata_key.cc
+++ b/paludis/metadata_key.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -102,7 +102,7 @@ template class MetadataCollectionKey<KeywordNameSet>;
template class MetadataCollectionKey<Set<std::string> >;
template class MetadataCollectionKey<Sequence<std::string> >;
template class MetadataCollectionKey<PackageIDSequence>;
-template class MetadataCollectionKey<FSEntrySequence>;
+template class MetadataCollectionKey<FSPathSequence>;
template class MetadataSpecTreeKey<LicenseSpecTree>;
template class MetadataSpecTreeKey<ProvideSpecTree>;
@@ -116,7 +116,7 @@ template class MetadataSpecTreeKey<SimpleURISpecTree>;
template class MetadataValueKey<std::string>;
template class MetadataValueKey<long>;
template class MetadataValueKey<bool>;
-template class MetadataValueKey<FSEntry>;
+template class MetadataValueKey<FSPath>;
template class MetadataValueKey<SlotName>;
template class MetadataValueKey<std::shared_ptr<const PackageID> >;
template class MetadataValueKey<std::shared_ptr<const Contents> >;
diff --git a/paludis/metadata_key.hh b/paludis/metadata_key.hh
index 792ec34..798b616 100644
--- a/paludis/metadata_key.hh
+++ b/paludis/metadata_key.hh
@@ -31,7 +31,7 @@
#include <paludis/formatter-fwd.hh>
#include <paludis/metadata_key_holder.hh>
#include <paludis/choice-fwd.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/remove_shared_ptr.hh>
#include <paludis/util/simple_visitor.hh>
@@ -89,7 +89,7 @@ namespace paludis
MetadataCollectionKey<Set<std::string> >,
MetadataCollectionKey<Sequence<std::string> >,
MetadataCollectionKey<PackageIDSequence>,
- MetadataCollectionKey<FSEntrySequence>,
+ MetadataCollectionKey<FSPathSequence>,
MetadataSpecTreeKey<DependencySpecTree>,
MetadataSpecTreeKey<LicenseSpecTree>,
MetadataSpecTreeKey<FetchableURISpecTree>,
@@ -99,7 +99,7 @@ namespace paludis
MetadataValueKey<std::string>,
MetadataValueKey<long>,
MetadataValueKey<bool>,
- MetadataValueKey<FSEntry>,
+ MetadataValueKey<FSPath>,
MetadataValueKey<SlotName>,
MetadataValueKey<std::shared_ptr<const PackageID> >,
MetadataValueKey<std::shared_ptr<const Contents> >,
diff --git a/paludis/ndbam.cc b/paludis/ndbam.cc
index 2dc6da0..a4b2ae6 100644
--- a/paludis/ndbam.cc
+++ b/paludis/ndbam.cc
@@ -21,7 +21,6 @@
#include <paludis/util/set.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/destringify.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/options.hh>
#include <paludis/util/log.hh>
@@ -30,6 +29,9 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/safe_ofstream.hh>
#include <paludis/util/timestamp.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_iterator.hh>
+#include <paludis/util/fs_error.hh>
#include <paludis/ndbam.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
@@ -83,7 +85,7 @@ namespace paludis
template <>
struct Imp<NDBAM>
{
- const FSEntry location;
+ const FSPath location;
const VersionSpecOptions version_options;
mutable Mutex category_names_mutex;
@@ -93,7 +95,7 @@ namespace paludis
mutable Mutex category_names_containing_package_mutex;
mutable CategoryNamesContainingPackage category_names_containing_package;
- Imp(const FSEntry & l, const VersionSpecOptions & o) :
+ Imp(const FSPath & l, const VersionSpecOptions & o) :
location(l),
version_options(o)
{
@@ -101,14 +103,14 @@ namespace paludis
};
}
-NDBAM::NDBAM(const FSEntry & l,
+NDBAM::NDBAM(const FSPath & l,
const std::function<bool (const std::string &)> & check_format,
const std::string & preferred_format,
const VersionSpecOptions & version_options) :
Pimp<NDBAM>(l, version_options)
{
Context c("When checking NDBAM layout at '" + stringify(l) + "':");
- if ((l / "ndbam.conf").exists())
+ if ((l / "ndbam.conf").stat().exists())
{
Context cc("When reading '" + stringify(l / "ndbam.conf") + "':");
KeyValueConfigFile k(l / "ndbam.conf", { }, &KeyValueConfigFile::no_defaults,
@@ -118,16 +120,16 @@ NDBAM::NDBAM(const FSEntry & l,
if (! check_format(k.get("repository_format")))
throw ConfigurationError("Unsupported NDBAM repository format '" + k.get("ndbam_format") + "'");
}
- else if (DirIterator(l) != DirIterator())
+ else if (FSIterator(l, { fsio_first_only, fsio_inode_sort }) != FSIterator())
throw ConfigurationError("No NDBAM repository found at '" + stringify(l) +
"', and it is not an empty directory");
else
{
Context cc("When creating skeleton NDBAM layout at '" + stringify(l) + "':");
- (l / "indices").mkdir();
- (l / "indices" / "categories").mkdir();
- (l / "indices" / "packages").mkdir();
- (l / "data").mkdir();
+ (l / "indices").mkdir(0755, { fspmkdo_ok_if_exists });
+ (l / "indices" / "categories").mkdir(0755, { fspmkdo_ok_if_exists });
+ (l / "indices" / "packages").mkdir(0755, { fspmkdo_ok_if_exists });
+ (l / "data").mkdir(0755, { fspmkdo_ok_if_exists });
SafeOFStream n(l / "ndbam.conf");
n << "ndbam_format = 1" << std::endl;
n << "repository_format = " << preferred_format << std::endl;
@@ -148,10 +150,10 @@ NDBAM::category_names()
{
Context context("When loading category names for NDBAM at '" + stringify(_imp->location) + "':");
_imp->category_names = std::make_shared<CategoryNamePartSet>();
- for (DirIterator d(_imp->location / "indices" / "categories"), d_end ;
+ for (FSIterator d(_imp->location / "indices" / "categories", { }), d_end ;
d != d_end ; ++d)
{
- if (! d->is_directory_or_symlink_to_directory())
+ if (! d->stat().is_directory_or_symlink_to_directory())
continue;
if ('-' == d->basename().at(0))
continue;
@@ -193,10 +195,10 @@ NDBAM::package_names(const CategoryNamePart & c)
{
Context context("When loading package names in '" + stringify(c) + "' for NDBAM at '" + stringify(_imp->location) + "':");
cc.package_names = std::make_shared<QualifiedPackageNameSet>();
- for (DirIterator d(_imp->location / "indices" / "categories" / stringify(c)), d_end ;
+ for (FSIterator d(_imp->location / "indices" / "categories" / stringify(c), { }), d_end ;
d != d_end ; ++d)
{
- if (! d->is_directory_or_symlink_to_directory())
+ if (! d->stat().is_directory_or_symlink_to_directory())
continue;
if ('-' == d->basename().at(0))
continue;
@@ -229,7 +231,7 @@ NDBAM::has_category_named(const CategoryNamePart & c)
if (! _imp->category_names)
{
- if (FSEntry(_imp->location / "indices" / "categories" / stringify(c)).is_directory_or_symlink_to_directory())
+ if (FSPath(_imp->location / "indices" / "categories" / stringify(c)).stat().is_directory_or_symlink_to_directory())
{
_imp->category_contents_map.insert(std::make_pair(c, std::make_shared<CategoryContents>()));
return true;
@@ -260,7 +262,8 @@ NDBAM::has_package_named(const QualifiedPackageName & q)
if (! cc.package_names)
{
- if (FSEntry(_imp->location / "indices" / "categories" / stringify(q.category()) / stringify(q.package())).is_directory_or_symlink_to_directory())
+ if (FSPath(_imp->location / "indices" / "categories" /
+ stringify(q.category()) / stringify(q.package())).stat().is_directory_or_symlink_to_directory())
{
cc.package_contents_map.insert(std::make_pair(q, new PackageContents));
return true;
@@ -306,10 +309,10 @@ NDBAM::entries(const QualifiedPackageName & q)
pc.entries = std::make_shared<NDBAMEntrySequence>();
Context context("When loading versions in '" + stringify(q) + "' for NDBAM at '" + stringify(_imp->location) + "':");
pc.entries = std::make_shared<NDBAMEntrySequence>();
- for (DirIterator d(_imp->location / "indices" / "categories" / stringify(q.category()) / stringify(q.package())), d_end ;
+ for (FSIterator d(_imp->location / "indices" / "categories" / stringify(q.category()) / stringify(q.package()), { }), d_end ;
d != d_end ; ++d)
{
- if (! d->is_directory_or_symlink_to_directory())
+ if (! d->stat().is_directory_or_symlink_to_directory())
continue;
if ('-' == d->basename().at(0))
continue;
@@ -357,7 +360,7 @@ NDBAM::entries(const QualifiedPackageName & q)
}
void
-NDBAM::add_entry(const QualifiedPackageName & q, const FSEntry & d)
+NDBAM::add_entry(const QualifiedPackageName & q, const FSPath & d)
{
Lock l(_imp->category_names_mutex);
CategoryContentsMap::iterator cc_i(_imp->category_contents_map.find(q.category()));
@@ -396,9 +399,9 @@ namespace
{
struct FSLocationIs
{
- FSEntry _d;
+ FSPath _d;
- FSLocationIs(const FSEntry & d) :
+ FSLocationIs(const FSPath & d) :
_d(d)
{
}
@@ -411,7 +414,7 @@ namespace
}
void
-NDBAM::remove_entry(const QualifiedPackageName & q, const FSEntry & d)
+NDBAM::remove_entry(const QualifiedPackageName & q, const FSPath & d)
{
Lock l(_imp->category_names_mutex);
CategoryContentsMap::iterator cc_i(_imp->category_contents_map.find(q.category()));
@@ -446,8 +449,8 @@ NDBAM::parse_contents(const PackageID & id,
if (! id.fs_location_key())
throw InternalError(PALUDIS_HERE, "No id.fs_location_key");
- FSEntry ff(id.fs_location_key()->value() / "contents");
- if (! ff.is_regular_file_or_symlink_to_regular_file())
+ FSPath ff(id.fs_location_key()->value() / "contents");
+ if (! ff.stat().is_regular_file_or_symlink_to_regular_file())
{
Log::get_instance()->message("ndbam.contents.skipping", ll_warning, lc_context)
<< "Contents file '" << ff << "' not a regular file, skipping";
@@ -554,14 +557,14 @@ NDBAM::parse_contents(const PackageID & id,
}
time_t mtime(destringify<time_t>(tokens.find("mtime")->second));
- std::shared_ptr<ContentsFileEntry> entry(std::make_shared<ContentsFileEntry>(path));
+ std::shared_ptr<ContentsFileEntry> entry(std::make_shared<ContentsFileEntry>(FSPath(path)));
entry->add_metadata_key(std::make_shared<LiteralMetadataValueKey<std::string>>("md5", "md5", mkt_normal, md5));
entry->add_metadata_key(std::make_shared<LiteralMetadataTimeKey>("mtime", "mtime", mkt_normal, Timestamp(mtime, 0)));
on_file(entry);
}
else if ("dir" == type)
{
- std::shared_ptr<ContentsDirEntry> entry(std::make_shared<ContentsDirEntry>(path));
+ std::shared_ptr<ContentsDirEntry> entry(std::make_shared<ContentsDirEntry>(FSPath(path)));
on_dir(entry);
}
else if ("sym" == type)
@@ -582,7 +585,7 @@ NDBAM::parse_contents(const PackageID & id,
}
time_t mtime(destringify<time_t>(tokens.find("mtime")->second));
- std::shared_ptr<ContentsSymEntry> entry(std::make_shared<ContentsSymEntry>(path, target));
+ std::shared_ptr<ContentsSymEntry> entry(std::make_shared<ContentsSymEntry>(FSPath(path), target));
entry->add_metadata_key(std::make_shared<LiteralMetadataTimeKey>("mtime", "mtime", mkt_normal, Timestamp(mtime, 0)));
on_sym(entry);
}
@@ -608,13 +611,12 @@ NDBAM::category_names_containing_package(const PackageNamePart & p) const
"' in NDBAM at '" + stringify(_imp->location) + "':");
cncp.category_names_containing_package = std::make_shared<CategoryNamePartSet>();
- FSEntry dd(_imp->location / "indices" / "packages" / stringify(p));
- if (dd.is_directory_or_symlink_to_directory())
+ FSPath dd(_imp->location / "indices" / "packages" / stringify(p));
+ if (dd.stat().is_directory_or_symlink_to_directory())
{
- for (DirIterator d(dd), d_end ;
- d != d_end ; ++d)
+ for (FSIterator d(dd, { }), d_end ; d != d_end ; ++d)
{
- if (! d->is_directory_or_symlink_to_directory())
+ if (! d->stat().is_directory_or_symlink_to_directory())
continue;
if ('-' == d->basename().at(0))
continue;
@@ -645,10 +647,10 @@ NDBAM::deindex(const QualifiedPackageName & q) const
{
Context context("When deindexing '" + stringify(q) + "' in NDBAM at '" + stringify(_imp->location) + "':");
- FSEntry cp_index_sym(_imp->location / "indices" / "categories" / stringify(q.category()) / stringify(q.package()));
+ FSPath cp_index_sym(_imp->location / "indices" / "categories" / stringify(q.category()) / stringify(q.package()));
cp_index_sym.unlink();
- FSEntry pc_index_sym(_imp->location / "indices" / "packages" / stringify(q.package()) / stringify(q.category()));
+ FSPath pc_index_sym(_imp->location / "indices" / "packages" / stringify(q.package()) / stringify(q.category()));
pc_index_sym.unlink();
}
@@ -658,16 +660,16 @@ NDBAM::index(const QualifiedPackageName & q, const std::string & d) const
Context context("When indexing '" + stringify(q) + "' to '" + stringify(d) +
"' in NDBAM at '" + stringify(_imp->location) + "':");
- FSEntry cp_index_sym(_imp->location / "indices" / "categories" / stringify(q.category()));
- cp_index_sym.mkdir();
+ FSPath cp_index_sym(_imp->location / "indices" / "categories" / stringify(q.category()));
+ cp_index_sym.mkdir(0755, { fspmkdo_ok_if_exists });
cp_index_sym /= stringify(q.package());
- if (! cp_index_sym.exists())
+ if (! cp_index_sym.stat().exists())
cp_index_sym.symlink("../../../data/" + d);
- FSEntry pc_index_sym(_imp->location / "indices" / "packages" / stringify(q.package()));
- pc_index_sym.mkdir();
+ FSPath pc_index_sym(_imp->location / "indices" / "packages" / stringify(q.package()));
+ pc_index_sym.mkdir(0755, { fspmkdo_ok_if_exists });
pc_index_sym /= stringify(q.category());
- if (! pc_index_sym.exists())
+ if (! pc_index_sym.stat().exists())
pc_index_sym.symlink("../../../data/" + d);
}
diff --git a/paludis/ndbam.hh b/paludis/ndbam.hh
index 7e45401..f338bd1 100644
--- a/paludis/ndbam.hh
+++ b/paludis/ndbam.hh
@@ -23,7 +23,7 @@
#include <paludis/ndbam-fwd.hh>
#include <paludis/util/pimp.hh>
#include <paludis/util/attributes.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_path.hh>
#include <paludis/util/sequence-fwd.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/named_value.hh>
@@ -48,7 +48,7 @@ namespace paludis
struct NDBAMEntry
{
- NamedValue<n::fs_location, FSEntry> fs_location;
+ NamedValue<n::fs_location, FSPath> fs_location;
NamedValue<n::magic, std::string> magic;
NamedValue<n::mutex, std::shared_ptr<Mutex> > mutex;
NamedValue<n::name, QualifiedPackageName> name;
@@ -78,7 +78,7 @@ namespace paludis
*
* \param version_options \since 0.38
*/
- NDBAM(const FSEntry &,
+ NDBAM(const FSPath &,
const std::function<bool (const std::string &)> & check_format,
const std::string & preferred_format, const VersionSpecOptions & version_options);
~NDBAM();
@@ -108,8 +108,8 @@ namespace paludis
std::shared_ptr<NDBAMEntrySequence> entries(const QualifiedPackageName &)
PALUDIS_ATTRIBUTE((warn_unused_result));
- void add_entry(const QualifiedPackageName &, const FSEntry &);
- void remove_entry(const QualifiedPackageName &, const FSEntry &);
+ void add_entry(const QualifiedPackageName &, const FSPath &);
+ void remove_entry(const QualifiedPackageName &, const FSPath &);
///\}
diff --git a/paludis/ndbam_merger.cc b/paludis/ndbam_merger.cc
index fa4957a..3458cbf 100644
--- a/paludis/ndbam_merger.cc
+++ b/paludis/ndbam_merger.cc
@@ -23,7 +23,6 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/system.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/options.hh>
@@ -33,6 +32,7 @@
#include <paludis/util/safe_ofstream.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/timestamp.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/hook.hh>
#include <paludis/package_id.hh>
#include <paludis/util/md5.hh>
@@ -51,7 +51,7 @@ namespace paludis
struct Imp<NDBAMMerger>
{
NDBAMMergerParams params;
- FSEntry realroot;
+ FSPath realroot;
std::shared_ptr<SafeOFStream> contents_file;
std::list<std::string> config_protect;
@@ -92,7 +92,7 @@ NDBAMMerger::~NDBAMMerger()
Hook
NDBAMMerger::extend_hook(const Hook & h)
{
- std::shared_ptr<const FSEntrySequence> bashrc_files(_imp->params.environment()->bashrc_files());
+ std::shared_ptr<const FSPathSequence> bashrc_files(_imp->params.environment()->bashrc_files());
if (_imp->params.package_id())
{
@@ -150,21 +150,25 @@ namespace
}
void
-NDBAMMerger::record_install_file(const FSEntry & src, const FSEntry & dst_dir, const std::string & dst_name, const FSMergerStatusFlags & flags)
+NDBAMMerger::record_install_file(const FSPath & src, const FSPath & dst_dir, const std::string & dst_name, const FSMergerStatusFlags & flags)
{
std::string tidy(stringify((dst_dir / dst_name).strip_leading(_imp->realroot))),
tidy_real(stringify((dst_dir / src.basename()).strip_leading(_imp->realroot)));
- time_t timestamp((dst_dir / dst_name).mtim().seconds());
- SafeIFStream infile(FSEntry(dst_dir / dst_name));
+ FSPath dst_dir_name(dst_dir / dst_name);
+ FSStat dst_dir_name_stat(dst_dir_name);
+
+ time_t timestamp(dst_dir_name_stat.mtim().seconds());
+
+ SafeIFStream infile(dst_dir_name);
if (! infile)
- throw FSMergerError("Cannot read '" + stringify(FSEntry(dst_dir / dst_name)) + "'");
+ throw FSMergerError("Cannot read '" + stringify(dst_dir_name) + "'");
MD5 md5(infile);
std::string line(make_arrows(flags) + " [obj] " + tidy_real);
if (tidy_real != tidy)
- line.append(" (" + FSEntry(tidy).basename() + ")");
+ line.append(" (" + FSPath(tidy).basename() + ")");
display_override(line);
*_imp->contents_file << "type=file";
@@ -175,7 +179,7 @@ NDBAMMerger::record_install_file(const FSEntry & src, const FSEntry & dst_dir, c
}
void
-NDBAMMerger::record_install_dir(const FSEntry & src, const FSEntry & dst_dir, const FSMergerStatusFlags & flags)
+NDBAMMerger::record_install_dir(const FSPath & src, const FSPath & dst_dir, const FSMergerStatusFlags & flags)
{
std::string tidy(stringify((dst_dir / src.basename()).strip_leading(_imp->realroot)));
display_override(make_arrows(flags) + " [dir] " + tidy);
@@ -184,7 +188,7 @@ NDBAMMerger::record_install_dir(const FSEntry & src, const FSEntry & dst_dir, co
}
void
-NDBAMMerger::record_install_under_dir(const FSEntry & dst, const FSMergerStatusFlags & flags)
+NDBAMMerger::record_install_under_dir(const FSPath & dst, const FSMergerStatusFlags & flags)
{
std::string tidy(stringify(dst.strip_leading(_imp->realroot)));
display_override(make_arrows(flags) + " [dir] " + tidy);
@@ -193,11 +197,11 @@ NDBAMMerger::record_install_under_dir(const FSEntry & dst, const FSMergerStatusF
}
void
-NDBAMMerger::record_install_sym(const FSEntry & src, const FSEntry & dst_dir, const FSMergerStatusFlags & flags)
+NDBAMMerger::record_install_sym(const FSPath & src, const FSPath & dst_dir, const FSMergerStatusFlags & flags)
{
std::string tidy(stringify((dst_dir / src.basename()).strip_leading(_imp->realroot)));
std::string target((dst_dir / src.basename()).readlink());
- Timestamp timestamp((dst_dir / src.basename()).mtim());
+ Timestamp timestamp((dst_dir / src.basename()).stat().mtim());
display_override(make_arrows(flags) + " [sym] " + tidy);
@@ -225,7 +229,7 @@ NDBAMMerger::on_warn(bool is_check, const std::string & s)
}
bool
-NDBAMMerger::config_protected(const FSEntry & src, const FSEntry & dst_dir)
+NDBAMMerger::config_protected(const FSPath & src, const FSPath & dst_dir)
{
std::string tidy(stringify((dst_dir / src.basename()).strip_leading(_imp->realroot)));
@@ -250,7 +254,7 @@ NDBAMMerger::config_protected(const FSEntry & src, const FSEntry & dst_dir)
}
std::string
-NDBAMMerger::make_config_protect_name(const FSEntry & src, const FSEntry & dst)
+NDBAMMerger::make_config_protect_name(const FSPath & src, const FSPath & dst)
{
std::string result_name(src.basename());
int n(0);
@@ -262,10 +266,13 @@ NDBAMMerger::make_config_protect_name(const FSEntry & src, const FSEntry & dst)
while (true)
{
- if (! (dst / result_name).exists())
+ FSPath dst_result_name(dst / result_name);
+ FSStat dst_result_name_stat(dst_result_name);
+
+ if (! dst_result_name_stat.exists())
break;
- if ((dst / result_name).is_regular_file_or_symlink_to_regular_file())
+ if (dst_result_name_stat.is_regular_file_or_symlink_to_regular_file())
{
SafeIFStream other_md5_file(dst / result_name);
if (other_md5_file)
@@ -356,7 +363,7 @@ NDBAMMerger::check()
}
void
-NDBAMMerger::on_enter_dir(bool is_check, const FSEntry)
+NDBAMMerger::on_enter_dir(bool is_check, const FSPath)
{
if (! is_check)
return;
diff --git a/paludis/ndbam_merger.hh b/paludis/ndbam_merger.hh
index 04ac67d..81a2ba3 100644
--- a/paludis/ndbam_merger.hh
+++ b/paludis/ndbam_merger.hh
@@ -49,17 +49,17 @@ namespace paludis
{
NamedValue<n::config_protect, std::string> config_protect;
NamedValue<n::config_protect_mask, std::string> config_protect_mask;
- NamedValue<n::contents_file, FSEntry> contents_file;
+ NamedValue<n::contents_file, FSPath> contents_file;
NamedValue<n::environment, Environment *> environment;
NamedValue<n::fix_mtimes_before, Timestamp> fix_mtimes_before;
- NamedValue<n::get_new_ids_or_minus_one, std::function<std::pair<uid_t, gid_t> (const FSEntry &)> > get_new_ids_or_minus_one;
- NamedValue<n::image, FSEntry> image;
- NamedValue<n::install_under, FSEntry> install_under;
- NamedValue<n::merged_entries, std::shared_ptr<FSEntrySet> > merged_entries;
+ NamedValue<n::get_new_ids_or_minus_one, std::function<std::pair<uid_t, gid_t> (const FSPath &)> > get_new_ids_or_minus_one;
+ NamedValue<n::image, FSPath> image;
+ NamedValue<n::install_under, FSPath> install_under;
+ NamedValue<n::merged_entries, std::shared_ptr<FSPathSet> > merged_entries;
NamedValue<n::options, MergerOptions> options;
NamedValue<n::output_manager, std::shared_ptr<OutputManager> > output_manager;
NamedValue<n::package_id, std::shared_ptr<const PackageID> > package_id;
- NamedValue<n::root, FSEntry> root;
+ NamedValue<n::root, FSPath> root;
};
/**
@@ -84,17 +84,17 @@ namespace paludis
virtual Hook extend_hook(const Hook &);
- virtual void record_install_file(const FSEntry &, const FSEntry &, const std::string &, const FSMergerStatusFlags &);
- virtual void record_install_dir(const FSEntry &, const FSEntry &, const FSMergerStatusFlags &);
- virtual void record_install_under_dir(const FSEntry &, const FSMergerStatusFlags &);
- virtual void record_install_sym(const FSEntry &, const FSEntry &, const FSMergerStatusFlags &);
+ virtual void record_install_file(const FSPath &, const FSPath &, const std::string &, const FSMergerStatusFlags &);
+ virtual void record_install_dir(const FSPath &, const FSPath &, const FSMergerStatusFlags &);
+ virtual void record_install_under_dir(const FSPath &, const FSMergerStatusFlags &);
+ virtual void record_install_sym(const FSPath &, const FSPath &, const FSMergerStatusFlags &);
virtual void on_error(bool is_check, const std::string &);
virtual void on_warn(bool is_check, const std::string &);
- virtual void on_enter_dir(bool is_check, const FSEntry);
+ virtual void on_enter_dir(bool is_check, const FSPath);
- virtual bool config_protected(const FSEntry &, const FSEntry &);
- virtual std::string make_config_protect_name(const FSEntry &, const FSEntry &);
+ virtual bool config_protected(const FSPath &, const FSPath &);
+ virtual std::string make_config_protect_name(const FSPath &, const FSPath &);
virtual void merge();
virtual bool check();
diff --git a/paludis/ndbam_unmerger.cc b/paludis/ndbam_unmerger.cc
index d69fa43..0f8864d 100644
--- a/paludis/ndbam_unmerger.cc
+++ b/paludis/ndbam_unmerger.cc
@@ -27,7 +27,6 @@
#include <paludis/hook.hh>
#include <paludis/package_database.hh>
#include <paludis/package_id.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
#include <paludis/util/pimp-impl.hh>
@@ -40,6 +39,8 @@
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/set.hh>
#include <paludis/util/timestamp.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_iterator.hh>
#include <paludis/output_manager.hh>
#include <paludis/metadata_key.hh>
#include <functional>
@@ -87,7 +88,7 @@ NDBAMUnmerger::~NDBAMUnmerger()
Hook
NDBAMUnmerger::extend_hook(const Hook & h) const
{
- std::shared_ptr<const FSEntrySequence> bashrc_files(_imp->options.environment()->bashrc_files());
+ std::shared_ptr<const FSPathSequence> bashrc_files(_imp->options.environment()->bashrc_files());
Hook result(Unmerger::extend_hook(h)
("CONFIG_PROTECT", _imp->options.config_protect())
@@ -120,7 +121,7 @@ NDBAMUnmerger::extend_hook(const Hook & h) const
}
bool
-NDBAMUnmerger::config_protected(const FSEntry & f) const
+NDBAMUnmerger::config_protected(const FSPath & f) const
{
std::string tidy(make_tidy(f));
@@ -145,7 +146,7 @@ NDBAMUnmerger::config_protected(const FSEntry & f) const
}
std::string
-NDBAMUnmerger::make_tidy(const FSEntry & f) const
+NDBAMUnmerger::make_tidy(const FSPath & f) const
{
std::string root_str(stringify(_imp->options.root())), f_str(stringify(f));
if (root_str == "/")
@@ -204,26 +205,27 @@ namespace
bool
NDBAMUnmerger::check_file(const std::shared_ptr<const ContentsEntry> & e) const
{
- const FSEntry f(e->location_key()->value());
+ const FSPath f(e->location_key()->value());
+ const FSPath root_f(_imp->options.root() / f);
+ const FSStat root_f_stat(root_f);
- if (! (_imp->options.root() / f).exists())
+ if (! root_f_stat.exists())
display("--- [gone ] " + stringify(f));
- else if (! (_imp->options.root() / f).is_regular_file())
+ else if (! root_f_stat.is_regular_file())
display("--- [!type] " + stringify(f));
- else if ((_imp->options.root() / f).mtim().seconds() != require_key<MetadataTimeKey>(*e, "mtime").value().seconds())
+ else if (root_f_stat.mtim().seconds() != require_key<MetadataTimeKey>(*e, "mtime").value().seconds())
display("--- [!time] " + stringify(f));
else
{
- SafeIFStream md5_file(_imp->options.root() / f);
+ SafeIFStream md5_file(root_f);
if (! md5_file)
{
- Log::get_instance()->message("ndbam.unmerger.md5_failed", ll_warning, lc_no_context) << "Cannot get md5 for '" <<
- (_imp->options.root() / f) << "'";
+ Log::get_instance()->message("ndbam.unmerger.md5_failed", ll_warning, lc_no_context) << "Cannot get md5 for '" << root_f << "'";
display("--- [!md5?] " + stringify(f));
}
else if (MD5(md5_file).hexsum() != require_key<MetadataValueKey<std::string> >(*e, "md5").value())
display("--- [!md5 ] " + stringify(f));
- else if (config_protected(_imp->options.root() / f))
+ else if (config_protected(root_f))
display("--- [cfgpr] " + stringify(f));
else
return true;
@@ -235,15 +237,17 @@ NDBAMUnmerger::check_file(const std::shared_ptr<const ContentsEntry> & e) const
bool
NDBAMUnmerger::check_sym(const std::shared_ptr<const ContentsEntry> & e) const
{
- const FSEntry f(e->location_key()->value());
+ const FSPath f(e->location_key()->value());
+ const FSPath root_f(_imp->options.root() / f);
+ const FSStat root_f_stat(root_f);
- if (! (_imp->options.root() / f).exists())
+ if (! root_f_stat.exists())
display("--- [gone ] " + stringify(f));
- else if (! (_imp->options.root() / f).is_symbolic_link())
+ else if (! root_f_stat.is_symlink())
display("--- [!type] " + stringify(f));
- else if ((_imp->options.root() / f).mtim().seconds() != require_key<MetadataTimeKey>(*e, "mtime").value().seconds())
+ else if (root_f_stat.mtim().seconds() != require_key<MetadataTimeKey>(*e, "mtime").value().seconds())
display("--- [!time] " + stringify(f));
- else if ((_imp->options.root() / f).readlink() != require_key<MetadataValueKey<std::string> >(*e, "target").value())
+ else if (root_f.readlink() != require_key<MetadataValueKey<std::string> >(*e, "target").value())
display("--- [!dest] " + stringify(f));
else
return true;
@@ -260,13 +264,15 @@ NDBAMUnmerger::check_misc(const std::shared_ptr<const ContentsEntry> &) const
bool
NDBAMUnmerger::check_dir(const std::shared_ptr<const ContentsEntry> & e) const
{
- const FSEntry f(e->location_key()->value());
+ const FSPath f(e->location_key()->value());
+ const FSPath root_f(_imp->options.root() / f);
+ const FSStat root_f_stat(root_f);
- if (! (_imp->options.root() / f).exists())
+ if (! root_f_stat.exists())
display("--- [gone ] " + stringify(f));
- else if (! (_imp->options.root() / f).is_directory())
+ else if (! root_f_stat.is_directory())
display("--- [!type] " + stringify(f));
- else if (DirIterator(_imp->options.root() / f, { dio_include_dotfiles, dio_first_only }) != DirIterator())
+ else if (FSIterator(root_f, { fsio_include_dotfiles, fsio_first_only }) != FSIterator())
display("--- [!empt] " + stringify(f));
else
return true;
diff --git a/paludis/ndbam_unmerger.hh b/paludis/ndbam_unmerger.hh
index 3c72e5e..84419b2 100644
--- a/paludis/ndbam_unmerger.hh
+++ b/paludis/ndbam_unmerger.hh
@@ -22,7 +22,6 @@
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_UNPACKAGED_NDBAM_UNMERGER_HH 1
#include <paludis/util/pimp.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/output_manager-fwd.hh>
#include <paludis/unmerger.hh>
#include <paludis/environment-fwd.hh>
@@ -50,13 +49,13 @@ namespace paludis
{
NamedValue<n::config_protect, std::string> config_protect;
NamedValue<n::config_protect_mask, std::string> config_protect_mask;
- NamedValue<n::contents_file, FSEntry> contents_file;
+ NamedValue<n::contents_file, FSPath> contents_file;
NamedValue<n::environment, const Environment *> environment;
- NamedValue<n::ignore, const std::function<bool (const FSEntry &)> > ignore;
+ NamedValue<n::ignore, const std::function<bool (const FSPath &)> > ignore;
NamedValue<n::ndbam, const NDBAM *> ndbam;
NamedValue<n::output_manager, std::shared_ptr<OutputManager> > output_manager;
NamedValue<n::package_id, std::shared_ptr<const PackageID> > package_id;
- NamedValue<n::root, FSEntry> root;
+ NamedValue<n::root, FSPath> root;
};
class PALUDIS_VISIBLE NDBAMUnmergerError :
@@ -84,8 +83,8 @@ namespace paludis
void _add_sym(const std::shared_ptr<const ContentsEntry> &);
protected:
- bool config_protected(const FSEntry &) const;
- std::string make_tidy(const FSEntry &) const;
+ bool config_protected(const FSPath &) const;
+ std::string make_tidy(const FSPath &) const;
void populate_unmerge_set();
diff --git a/paludis/notifier_callback.cc b/paludis/notifier_callback.cc
index f80aae5..9e7178b 100644
--- a/paludis/notifier_callback.cc
+++ b/paludis/notifier_callback.cc
@@ -46,12 +46,12 @@ NotifierCallbackResolverStageEvent::stage() const
return _stage;
}
-NotifierCallbackLinkageStepEvent::NotifierCallbackLinkageStepEvent(const FSEntry & r) :
+NotifierCallbackLinkageStepEvent::NotifierCallbackLinkageStepEvent(const FSPath & r) :
_location(r)
{
}
-const FSEntry
+const FSPath
NotifierCallbackLinkageStepEvent::location() const
{
return _location;
diff --git a/paludis/notifier_callback.hh b/paludis/notifier_callback.hh
index 294d5c4..25fb9b9 100644
--- a/paludis/notifier_callback.hh
+++ b/paludis/notifier_callback.hh
@@ -24,7 +24,7 @@
#include <paludis/util/pimp.hh>
#include <paludis/util/simple_visitor.hh>
#include <paludis/util/type_list.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_path.hh>
#include <paludis/name.hh>
#include <paludis/environment-fwd.hh>
@@ -76,12 +76,12 @@ namespace paludis
public ImplementAcceptMethods<NotifierCallbackEvent, NotifierCallbackLinkageStepEvent>
{
private:
- const FSEntry _location;
+ const FSPath _location;
public:
- NotifierCallbackLinkageStepEvent(const FSEntry &);
+ NotifierCallbackLinkageStepEvent(const FSPath &);
- const FSEntry location() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ const FSPath location() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class PALUDIS_VISIBLE ScopedNotifierCallback :
diff --git a/paludis/output_manager_factory.cc b/paludis/output_manager_factory.cc
index bbdfcd7..4d2d4b6 100644
--- a/paludis/output_manager_factory.cc
+++ b/paludis/output_manager_factory.cc
@@ -26,9 +26,7 @@
#include <paludis/util/named_value.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set-impl.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/system.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/about.hh>
#include <unordered_map>
diff --git a/paludis/package_id.hh b/paludis/package_id.hh
index 505f41c..b348469 100644
--- a/paludis/package_id.hh
+++ b/paludis/package_id.hh
@@ -26,7 +26,7 @@
#include <paludis/util/operators.hh>
#include <paludis/util/pimp.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/action-fwd.hh>
#include <paludis/dep_spec-fwd.hh>
@@ -304,7 +304,7 @@ namespace paludis
* location (for example, the ebuild file or VDB directory) that
* best describes the location of a PackageID.
*/
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const = 0;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > fs_location_key() const = 0;
/**
* The choices_key, if non-zero, contains zero or more
diff --git a/paludis/paludislike_options_conf.cc b/paludis/paludislike_options_conf.cc
index 393ee62..db65766 100644
--- a/paludis/paludislike_options_conf.cc
+++ b/paludis/paludislike_options_conf.cc
@@ -132,7 +132,7 @@ namespace
const std::shared_ptr<const SetSpecTree> make_set_value(
const Environment * const env,
- const FSEntry from,
+ const FSPath & from,
const SetName name)
{
std::shared_ptr<const SetSpecTree> result(env->set(name));
@@ -175,7 +175,7 @@ PaludisLikeOptionsConf::~PaludisLikeOptionsConf()
}
void
-PaludisLikeOptionsConf::add_file(const FSEntry & f)
+PaludisLikeOptionsConf::add_file(const FSPath & f)
{
Context context("When adding '" + stringify(f) + "':");
diff --git a/paludis/paludislike_options_conf.hh b/paludis/paludislike_options_conf.hh
index fc6d64e..f2237cb 100644
--- a/paludis/paludislike_options_conf.hh
+++ b/paludis/paludislike_options_conf.hh
@@ -26,7 +26,7 @@
#include <paludis/util/named_value.hh>
#include <paludis/util/tribool-fwd.hh>
#include <paludis/util/set-fwd.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/util/config_file-fwd.hh>
#include <paludis/choice-fwd.hh>
#include <paludis/package_id-fwd.hh>
@@ -44,7 +44,7 @@ namespace paludis
}
/**
- * Turn an FSEntry into a config file for PaludisLikeOptionsConf.
+ * Turn an FSPath into a config file for PaludisLikeOptionsConf.
*
* This might need to deal with weird things like bash config files, so we
* leave it up to the caller to specify how it works.
@@ -53,7 +53,7 @@ namespace paludis
*/
typedef std::function<
const std::shared_ptr<const LineConfigFile> (
- const FSEntry &,
+ const FSPath &,
const LineConfigFileOptions &)
> PaludisLikeOptionsConfMakeConfigFileFunction;
@@ -84,7 +84,7 @@ namespace paludis
PaludisLikeOptionsConf(const PaludisLikeOptionsConfParams &);
~PaludisLikeOptionsConf();
- void add_file(const FSEntry &);
+ void add_file(const FSPath &);
const std::pair<Tribool, bool> want_choice_enabled_locked(
const std::shared_ptr<const PackageID> &,
diff --git a/paludis/partially_made_package_dep_spec.cc b/paludis/partially_made_package_dep_spec.cc
index fe015d3..8e85177 100644
--- a/paludis/partially_made_package_dep_spec.cc
+++ b/paludis/partially_made_package_dep_spec.cc
@@ -56,7 +56,7 @@ namespace
std::shared_ptr<const RepositoryName> in_repository;
std::shared_ptr<const RepositoryName> from_repository;
std::shared_ptr<const InstallableToRepository> installable_to_repository;
- std::shared_ptr<const FSEntry> installed_at_path;
+ std::shared_ptr<const FSPath> installed_at_path;
std::shared_ptr<const InstallableToPath> installable_to_path;
std::shared_ptr<AdditionalPackageDepSpecRequirements> additional_requirements;
std::shared_ptr<const MetadataSectionKey> annotations;
@@ -325,7 +325,7 @@ namespace
return from_repository;
}
- virtual std::shared_ptr<const FSEntry> installed_at_path_ptr() const
+ virtual std::shared_ptr<const FSPath> installed_at_path_ptr() const
{
return installed_at_path;
}
@@ -431,9 +431,9 @@ PartiallyMadePackageDepSpec::installable_to_repository(const InstallableToReposi
}
PartiallyMadePackageDepSpec &
-PartiallyMadePackageDepSpec::installed_at_path(const FSEntry & s)
+PartiallyMadePackageDepSpec::installed_at_path(const FSPath & s)
{
- _imp->data->installed_at_path = std::make_shared<FSEntry>(s);
+ _imp->data->installed_at_path = std::make_shared<FSPath>(s);
return *this;
}
diff --git a/paludis/partially_made_package_dep_spec.hh b/paludis/partially_made_package_dep_spec.hh
index e3376e3..9be8426 100644
--- a/paludis/partially_made_package_dep_spec.hh
+++ b/paludis/partially_made_package_dep_spec.hh
@@ -22,7 +22,6 @@
#include <paludis/partially_made_package_dep_spec-fwd.hh>
#include <paludis/util/pimp.hh>
-#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/name-fwd.hh>
#include <paludis/dep_spec.hh>
@@ -81,7 +80,7 @@ namespace paludis
*
* \since 0.32
*/
- PartiallyMadePackageDepSpec & installed_at_path(const FSEntry &);
+ PartiallyMadePackageDepSpec & installed_at_path(const FSPath &);
/**
* Set our installable-to-path requirement, return ourself.
diff --git a/paludis/python_hooks.cc b/paludis/python_hooks.cc
index 0f0cd1a..58853cf 100644
--- a/paludis/python_hooks.cc
+++ b/paludis/python_hooks.cc
@@ -5,7 +5,6 @@
#include <paludis/hooker.hh>
#include <paludis/hook.hh>
#include <paludis/environment.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/graph-impl.hh>
#include <paludis/util/log.hh>
#include <paludis/util/stringify.hh>
@@ -22,7 +21,7 @@ namespace bp = boost::python;
extern "C"
{
- std::shared_ptr<HookFile> create_py_hook_file(const FSEntry &, const bool, const Environment * const)
+ std::shared_ptr<HookFile> create_py_hook_file(const FSPath &, const bool, const Environment * const)
PALUDIS_VISIBLE;
}
@@ -38,7 +37,7 @@ namespace
static bp::dict _output_wrapper_namespace;
static bp::object _format_exception;
- const FSEntry _file_name;
+ const FSPath _file_name;
const Environment * const _env;
const bool _run_prefixed;
bool _loaded;
@@ -61,11 +60,11 @@ namespace
void _add_dependency_class(const Hook &, DirectedGraph<std::string, int> &, bool);
public:
- PyHookFile(const FSEntry &, const bool, const Environment * const);
+ PyHookFile(const FSPath &, const bool, const Environment * const);
virtual HookResult run(const Hook &, const std::shared_ptr<OutputManager> &) const PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual const FSEntry file_name() const
+ virtual const FSPath file_name() const
{
return _file_name;
}
@@ -84,7 +83,7 @@ namespace
bp::object PyHookFile::_format_exception;
}
-PyHookFile::PyHookFile(const FSEntry & f, const bool r, const Environment * const e) :
+PyHookFile::PyHookFile(const FSPath & f, const bool r, const Environment * const e) :
_file_name(f),
_env(e),
_run_prefixed(r),
@@ -438,7 +437,7 @@ PyHookFile::_get_traceback() const
}
std::shared_ptr<HookFile>
-create_py_hook_file(const FSEntry & f, const bool b, const Environment * const e)
+create_py_hook_file(const FSPath & f, const bool b, const Environment * const e)
{
return std::make_shared<PyHookFile>(f, b, e);
}
diff --git a/paludis/repositories/accounts/accounts_id.cc b/paludis/repositories/accounts/accounts_id.cc
index 0a1466e..73b66ef 100644
--- a/paludis/repositories/accounts/accounts_id.cc
+++ b/paludis/repositories/accounts/accounts_id.cc
@@ -73,7 +73,7 @@ namespace paludis
const VersionSpec version;
const std::shared_ptr<const Repository> repository;
- const std::shared_ptr<const LiteralMetadataValueKey<FSEntry> > fs_location_key;
+ const std::shared_ptr<const LiteralMetadataValueKey<FSPath> > fs_location_key;
const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > from_repositories_key;
const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > behaviours_key;
const std::shared_ptr<const AccountsInstalledMask> mask;
@@ -99,12 +99,12 @@ namespace paludis
Imp(const Environment * const e,
const QualifiedPackageName & q, const std::shared_ptr<const Repository> & r,
const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > & f,
- const FSEntry & l, const bool u, const bool m) :
+ const FSPath & l, const bool u, const bool m) :
env(e),
name(q),
version("0", { }),
repository(r),
- fs_location_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("location", "Location", mkt_internal, l)),
+ fs_location_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("location", "Location", mkt_internal, l)),
from_repositories_key(f),
behaviours_key(AccountsIDBehaviours::get_instance()->behaviours_key),
mask(m ? std::make_shared<AccountsInstalledMask>() : make_null_shared_ptr()),
@@ -118,7 +118,7 @@ namespace paludis
AccountsID::AccountsID(const Environment * const e,
const QualifiedPackageName & q, const std::shared_ptr<const Repository> & r,
- const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > & f, const FSEntry & l,
+ const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > & f, const FSPath & l,
const bool u, const bool m) :
Pimp<AccountsID>(e, q, r, f, l, u, m),
_imp(Pimp<AccountsID>::_imp)
@@ -418,7 +418,7 @@ AccountsID::from_repositories_key() const
return _imp->from_repositories_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
AccountsID::fs_location_key() const
{
return _imp->fs_location_key;
@@ -478,7 +478,7 @@ namespace
s = v;
}
- bool ignore_nothing(const FSEntry &)
+ bool ignore_nothing(const FSPath &)
{
return false;
}
@@ -510,9 +510,9 @@ AccountsID::perform_action(Action & action) const
(*install_action->options.destination()).destination_interface()->merge(
make_named_values<MergeParams>(
n::build_start_time() = build_start_time,
- n::environment_file() = FSEntry("/dev/null"),
+ n::environment_file() = FSPath("/dev/null"),
n::image_dir() = fs_location_key()->value(),
- n::merged_entries() = std::make_shared<FSEntrySet>(),
+ n::merged_entries() = std::make_shared<FSPathSet>(),
n::options() = MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs,
n::output_manager() = output_manager,
n::package_id() = shared_from_this(),
diff --git a/paludis/repositories/accounts/accounts_id.hh b/paludis/repositories/accounts/accounts_id.hh
index f163a9e..6285e42 100644
--- a/paludis/repositories/accounts/accounts_id.hh
+++ b/paludis/repositories/accounts/accounts_id.hh
@@ -49,7 +49,7 @@ namespace paludis
AccountsID(const Environment * const,
const QualifiedPackageName &, const std::shared_ptr<const Repository> &,
const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > &,
- const FSEntry &, const bool is_user, const bool masked);
+ const FSPath &, const bool is_user, const bool masked);
~AccountsID();
virtual const std::string canonical_form(const PackageIDCanonicalForm) const;
@@ -79,7 +79,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<std::shared_ptr<const Contents> > > contents_key() const;
virtual const std::shared_ptr<const MetadataTimeKey> installed_time_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > from_repositories_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > fs_location_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > behaviours_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::shared_ptr<const Choices> > > choices_key() const;
virtual const std::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > dependencies_key() const;
diff --git a/paludis/repositories/accounts/accounts_repository.cc b/paludis/repositories/accounts/accounts_repository.cc
index dca2427..b056a5b 100644
--- a/paludis/repositories/accounts/accounts_repository.cc
+++ b/paludis/repositories/accounts/accounts_repository.cc
@@ -80,7 +80,7 @@ namespace paludis
const std::shared_ptr<LiteralMetadataValueKey<std::string> > format_key;
const std::shared_ptr<LiteralMetadataValueKey<std::string> > handler_key;
- const std::shared_ptr<LiteralMetadataValueKey<FSEntry> > installed_root_key;
+ const std::shared_ptr<LiteralMetadataValueKey<FSPath> > installed_root_key;
const ActiveObjectPtr<DeferredConstructionPtr<std::shared_ptr<AccountsRepositoryStore> > > store;
@@ -97,7 +97,7 @@ namespace paludis
handler_if_installed(make_handler(p.handler())),
format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format", mkt_significant, "installed-accounts")),
handler_key(std::make_shared<LiteralMetadataValueKey<std::string> >("handler", "handler", mkt_normal, p.handler())),
- installed_root_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("root", "root", mkt_normal, p.root())),
+ installed_root_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("root", "root", mkt_normal, p.root())),
store(DeferredConstructionPtr<std::shared_ptr<AccountsRepositoryStore> > (
std::bind(&make_installed_store, repo, std::cref(*params_if_installed))))
{
@@ -205,7 +205,7 @@ AccountsRepository::repository_factory_installed_create(
n::environment() = env,
n::handler() = handler,
n::name() = RepositoryName(name_str),
- n::root() = FSEntry(root_str)
+ n::root() = FSPath(root_str)
));
}
@@ -253,13 +253,13 @@ AccountsRepository::format_key() const
return _imp->format_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
AccountsRepository::location_key() const
{
return make_null_shared_ptr();
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
AccountsRepository::installed_root_key() const
{
return _imp->installed_root_key;
diff --git a/paludis/repositories/accounts/accounts_repository.hh b/paludis/repositories/accounts/accounts_repository.hh
index a7c6a4e..0ce4e5b 100644
--- a/paludis/repositories/accounts/accounts_repository.hh
+++ b/paludis/repositories/accounts/accounts_repository.hh
@@ -49,7 +49,7 @@ namespace paludis
NamedValue<n::environment, Environment *> environment;
NamedValue<n::handler, std::string> handler;
NamedValue<n::name, RepositoryName> name;
- NamedValue<n::root, FSEntry> root;
+ NamedValue<n::root, FSPath> root;
};
class PALUDIS_VISIBLE AccountsRepository :
@@ -110,8 +110,8 @@ namespace paludis
///\{
virtual const std::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
diff --git a/paludis/repositories/accounts/accounts_repository_store.cc b/paludis/repositories/accounts/accounts_repository_store.cc
index 4f0855d..02208f0 100644
--- a/paludis/repositories/accounts/accounts_repository_store.cc
+++ b/paludis/repositories/accounts/accounts_repository_store.cc
@@ -29,10 +29,11 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/log.hh>
#include <paludis/util/simple_visitor_cast.hh>
-#include <paludis/util/dir_iterator.hh>
+#include <paludis/util/fs_iterator.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/options.hh>
#include <paludis/util/strip.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/name.hh>
#include <paludis/package_database.hh>
#include <paludis/metadata_key.hh>
@@ -114,16 +115,16 @@ AccountsRepositoryStore::_load(const std::shared_ptr<const Repository> & repo)
continue;
}
- const MetadataValueKey<FSEntry> * k(simple_visitor_cast<const MetadataValueKey<FSEntry> >(**k_iter));
+ const MetadataValueKey<FSPath> * k(simple_visitor_cast<const MetadataValueKey<FSPath> >(**k_iter));
if (! k)
{
Log::get_instance()->message("accounts.bad_key_from_repository", ll_warning, lc_context) <<
- "Repository " << (*r)->name() << " defines an accounts_repository_data_location key, but it is not an FSEntry key";
+ "Repository " << (*r)->name() << " defines an accounts_repository_data_location key, but it is not an FSPath key";
continue;
}
- FSEntry dir(k->value());
- if (! dir.is_directory_or_symlink_to_directory())
+ FSPath dir(k->value());
+ if (! dir.stat().is_directory_or_symlink_to_directory())
{
Log::get_instance()->message("accounts.empty_key_from_repository", ll_warning, lc_context) <<
"Repository " << (*r)->name() << " has accounts_repository_data_location " << dir << ", but this is not a directory";
@@ -141,18 +142,20 @@ void
AccountsRepositoryStore::_load_one(
const std::shared_ptr<const Repository> & repo,
const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > & from_repo,
- const FSEntry & dir)
+ const FSPath & dir)
{
Context context("When loading accounts from directory '" + stringify(dir) + "':");
- if ((dir / "users").is_directory_or_symlink_to_directory())
- _load_one_users(repo, from_repo, dir / "users");
+ FSPath users_dir(dir / "users");
+ if (users_dir.stat().is_directory_or_symlink_to_directory())
+ _load_one_users(repo, from_repo, users_dir);
else
Log::get_instance()->message("accounts.no_users", ll_debug, lc_context) <<
"Repository " << repo->name() << " has accounts_repository_data_location " << dir << ", but no users subdirectory";
- if ((dir / "groups").is_directory_or_symlink_to_directory())
- _load_one_groups(repo, from_repo, dir / "groups");
+ FSPath groups_dir(dir / "groups");
+ if (groups_dir.stat().is_directory_or_symlink_to_directory())
+ _load_one_groups(repo, from_repo, groups_dir);
else
Log::get_instance()->message("accounts.no_groups", ll_debug, lc_context) <<
"Repository " << repo->name() << " has accounts_repository_data_location " << dir << ", but no groups subdirectory";
@@ -163,9 +166,9 @@ void
AccountsRepositoryStore::_load_one_users(
const std::shared_ptr<const Repository> & repo,
const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > & from_repo,
- const FSEntry & dir)
+ const FSPath & dir)
{
- for (DirIterator d(dir, { }), d_end ; d != d_end ; ++d)
+ for (FSIterator d(dir, { fsio_inode_sort }), d_end ; d != d_end ; ++d)
if (is_file_with_extension(*d, ".conf", { }))
_load_one_user(repo, from_repo, *d);
else
@@ -177,7 +180,7 @@ void
AccountsRepositoryStore::_load_one_user(
const std::shared_ptr<const Repository> & repo,
const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > & from_repo,
- const FSEntry & filename)
+ const FSPath & filename)
{
CategoryNamePart cat("user");
PackageNamePart pkg(strip_trailing_string(filename.basename(), ".conf"));
@@ -219,9 +222,9 @@ void
AccountsRepositoryStore::_load_one_groups(
const std::shared_ptr<const Repository> & repo,
const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > & from_repo,
- const FSEntry & dir)
+ const FSPath & dir)
{
- for (DirIterator d(dir, { }), d_end ; d != d_end ; ++d)
+ for (FSIterator d(dir, { fsio_inode_sort }), d_end ; d != d_end ; ++d)
if (is_file_with_extension(*d, ".conf", { }))
_load_one_group(repo, from_repo, *d);
else
@@ -233,7 +236,7 @@ void
AccountsRepositoryStore::_load_one_group(
const std::shared_ptr<const Repository> & repo,
const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > & from_repo,
- const FSEntry & filename)
+ const FSPath & filename)
{
CategoryNamePart cat("group");
PackageNamePart pkg(strip_trailing_string(filename.basename(), ".conf"));
diff --git a/paludis/repositories/accounts/accounts_repository_store.hh b/paludis/repositories/accounts/accounts_repository_store.hh
index 1e4477a..c27ab12 100644
--- a/paludis/repositories/accounts/accounts_repository_store.hh
+++ b/paludis/repositories/accounts/accounts_repository_store.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_ACCOUNTS_ACCOUNTS_REPOSITORY_STORE_HH 1
#include <paludis/util/pimp.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/name-fwd.hh>
#include <paludis/package_id-fwd.hh>
#include <paludis/environment-fwd.hh>
@@ -44,27 +44,27 @@ namespace paludis
void _load_one(
const std::shared_ptr<const Repository> & repo,
const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > & from_repo,
- const FSEntry & dir);
+ const FSPath & dir);
void _load_one_users(
const std::shared_ptr<const Repository> & repo,
const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > & from_repo,
- const FSEntry & dir);
+ const FSPath & dir);
void _load_one_user(
const std::shared_ptr<const Repository> & repo,
const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > & from_repo,
- const FSEntry & file);
+ const FSPath & file);
void _load_one_groups(
const std::shared_ptr<const Repository> & repo,
const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > & from_repo,
- const FSEntry & dir);
+ const FSPath & dir);
void _load_one_group(
const std::shared_ptr<const Repository> & repo,
const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > & from_repo,
- const FSEntry & file);
+ const FSPath & file);
public:
AccountsRepositoryStore(
diff --git a/paludis/repositories/accounts/installed_accounts_id.cc b/paludis/repositories/accounts/installed_accounts_id.cc
index 74bfcd3..f84bdfd 100644
--- a/paludis/repositories/accounts/installed_accounts_id.cc
+++ b/paludis/repositories/accounts/installed_accounts_id.cc
@@ -331,7 +331,7 @@ InstalledAccountsID::from_repositories_key() const
return make_null_shared_ptr();
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
InstalledAccountsID::fs_location_key() const
{
return make_null_shared_ptr();
diff --git a/paludis/repositories/accounts/installed_accounts_id.hh b/paludis/repositories/accounts/installed_accounts_id.hh
index 1a55302..2e7d9de 100644
--- a/paludis/repositories/accounts/installed_accounts_id.hh
+++ b/paludis/repositories/accounts/installed_accounts_id.hh
@@ -77,7 +77,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<std::shared_ptr<const Contents> > > contents_key() const;
virtual const std::shared_ptr<const MetadataTimeKey> installed_time_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > from_repositories_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > fs_location_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > behaviours_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::shared_ptr<const Choices> > > choices_key() const;
virtual const std::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > dependencies_key() const;
diff --git a/paludis/repositories/accounts/passwd_accounts_handler.cc b/paludis/repositories/accounts/passwd_accounts_handler.cc
index e5d5eee..59deece 100644
--- a/paludis/repositories/accounts/passwd_accounts_handler.cc
+++ b/paludis/repositories/accounts/passwd_accounts_handler.cc
@@ -20,7 +20,6 @@
#include <paludis/repositories/accounts/passwd_accounts_handler.hh>
#include <paludis/util/system.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/set.hh>
#include <paludis/util/destringify.hh>
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index 646df75..fdaac6d 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -37,8 +37,6 @@
#include <paludis/repositories/cran/cran_dep_parser.hh>
#include <paludis/repositories/cran/cran_installed_repository.hh>
#include <paludis/repositories/cran/package_dep_spec.hh>
-#include <paludis/util/dir_iterator.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/system.hh>
#include <paludis/util/log.hh>
@@ -75,8 +73,8 @@ namespace paludis
Imp(const CRANInstalledRepositoryParams &);
~Imp();
- std::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > location_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key;
std::shared_ptr<const MetadataValueKey<std::string> > format_key;
};
}
@@ -84,8 +82,8 @@ namespace paludis
Imp<CRANInstalledRepository>::Imp(const CRANInstalledRepositoryParams & p) :
params(p),
has_ids(false),
- location_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("location", "location", mkt_significant, params.location())),
- installed_root_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("root", "root", mkt_normal, params.root())),
+ location_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("location", "location", mkt_significant, params.location())),
+ installed_root_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("root", "root", mkt_normal, params.root())),
format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format", mkt_significant, "installed_cran"))
{
}
@@ -109,7 +107,7 @@ Imp<CRANInstalledRepository>::need_ids() const
if (! d->is_directory())
continue;
- FSEntry f(FSEntry(stringify(*d)) / "DESCRIPTION");
+ FSPath f(FSPath(stringify(*d)) / "DESCRIPTION");
if (! f.is_regular_file())
continue;
@@ -123,7 +121,7 @@ Imp<CRANInstalledRepository>::need_ids() const
metadata.insert(std::make_pair(std::make_pair(q, VersionSpec(desc.version)), desc.metadata));
}
- if (! FSEntry(location / "paludis" / "bundles").is_directory())
+ if (! FSPath(location / "paludis" / "bundles").is_directory())
return;
// Load Bundle Metadata
@@ -274,7 +272,7 @@ CRANInstalledRepository::do_contents(const Package ID & id) const
std::string pn = stringify(q.package());
CRANDescription::normalise_name(pn);
- FSEntry f(_imp->location / "paludis" / pn / "CONTENTS");
+ FSPath f(_imp->location / "paludis" / pn / "CONTENTS");
if (! f.is_regular_file())
{
Log::get_instance()->message(ll_warning, lc_no_context, "CONTENTS lookup failed for request for' " +
@@ -357,7 +355,7 @@ CRANInstalledRepository::do_installed_time(const QualifiedPackageName & q,
{
std::string pn(stringify(q.package()));
CRANDescription::normalise_name(pn);
- FSEntry f(_imp->location / "paludis" / pn / "CONTENTS");
+ FSPath f(_imp->location / "paludis" / pn / "CONTENTS");
try
{
r->installed_time = f.mtime();
@@ -435,7 +433,7 @@ CRANInstalledRepository::do_uninstall(const QualifiedPackageName & q, const Vers
stringify(v) + "' because its location ('" + stringify(_imp->location) + "') is not a directory");
std::shared_ptr<const VersionMetadata> vm(do_version_metadata(q, v));
- std::shared_ptr<const FSEntryCollection> bashrc_files(_imp->env->bashrc_files());
+ std::shared_ptr<const FSPath> bashrc_files(_imp->env->bashrc_files());
Command cmd(Command(LIBEXECDIR "/paludis/cran.bash unmerge")
.with_setenv("PN", vm->cran_interface->package())
@@ -560,13 +558,13 @@ CRANInstalledRepository::format_key() const
return _imp->format_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
CRANInstalledRepository::location_key() const
{
return _imp->location_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
CRANInstalledRepository::installed_root_key() const
{
return _imp->installed_root_key;
diff --git a/paludis/repositories/cran/cran_installed_repository.hh b/paludis/repositories/cran/cran_installed_repository.hh
index 74865ed..e2f2544 100644
--- a/paludis/repositories/cran/cran_installed_repository.hh
+++ b/paludis/repositories/cran/cran_installed_repository.hh
@@ -24,7 +24,6 @@
#include <paludis/repository.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/pimp.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/map-fwd.hh>
/** \file
@@ -52,8 +51,8 @@ namespace paludis
struct CRANInstalledRepositoryParams
{
NamedValue<n::environment, const Environment *> environment;
- NamedValue<n::location, FSEntry> location;
- NamedValue<n::root, FSEntry> root;
+ NamedValue<n::location, FSPath> location;
+ NamedValue<n::root, FSPath> root;
};
/**
@@ -153,8 +152,8 @@ namespace paludis
/* Keys */
virtual const std::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
diff --git a/paludis/repositories/cran/cran_package_id.cc b/paludis/repositories/cran/cran_package_id.cc
index 3cb2a37..2047ca7 100644
--- a/paludis/repositories/cran/cran_package_id.cc
+++ b/paludis/repositories/cran/cran_package_id.cc
@@ -34,6 +34,7 @@
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/return_literal_function.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
@@ -63,7 +64,7 @@ namespace paludis
QualifiedPackageName name;
VersionSpec version;
- std::shared_ptr<LiteralMetadataValueKey<FSEntry> > fs_location_key;
+ std::shared_ptr<LiteralMetadataValueKey<FSPath> > fs_location_key;
std::shared_ptr<LiteralMetadataValueKey<std::string> > url_key;
std::shared_ptr<LiteralMetadataValueKey<std::string> > short_description_key;
std::shared_ptr<LiteralMetadataValueKey<std::string> > long_description_key;
@@ -77,7 +78,7 @@ namespace paludis
std::shared_ptr<DependenciesLabelSequence> depends_labels;
Imp(const Environment * const e,
- const std::shared_ptr<const CRANRepository> & r, const FSEntry & f) :
+ const std::shared_ptr<const CRANRepository> & r, const FSPath & f) :
env(e),
repository(r),
cran_repository(r),
@@ -107,20 +108,20 @@ namespace paludis
};
}
-CRANPackageID::CRANPackageID(const Environment * const env, const std::shared_ptr<const CRANRepository> & r, const FSEntry & f) :
+CRANPackageID::CRANPackageID(const Environment * const env, const std::shared_ptr<const CRANRepository> & r, const FSPath & f) :
Pimp<CRANPackageID>(env, r, f),
_imp(Pimp<CRANPackageID>::_imp)
{
Context context("When parsing file '" + stringify(f) + "' to create a CRAN Package ID:");
- if (! f.is_regular_file())
+ if (! f.stat().is_regular_file())
{
add_mask(std::make_shared<BrokenMask>('B', "Broken", "DESCRIPTION file not a file"));
Log::get_instance()->message("cran.id.not_a_file", ll_warning, lc_context) << "Unexpected irregular file: '" << stringify(f) << "'";
return;
}
- _imp->fs_location_key = std::make_shared<LiteralMetadataValueKey<FSEntry> >("DescriptionFileLocation", "Description File Location",
+ _imp->fs_location_key = std::make_shared<LiteralMetadataValueKey<FSPath> >("DescriptionFileLocation", "Description File Location",
mkt_internal, f);
add_metadata_key(_imp->fs_location_key);
@@ -540,7 +541,7 @@ CRANPackageID::contained_in_key() const
return _imp->contained_in_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
CRANPackageID::fs_location_key() const
{
return _imp->fs_location_key;
diff --git a/paludis/repositories/cran/cran_package_id.hh b/paludis/repositories/cran/cran_package_id.hh
index 6d32ce5..af8acb3 100644
--- a/paludis/repositories/cran/cran_package_id.hh
+++ b/paludis/repositories/cran/cran_package_id.hh
@@ -22,7 +22,6 @@
#define PALUDIS_GUARD_PALUDIS_CRAN_PACKAGE_ID_HH 1
#include <paludis/package_id.hh>
-#include <paludis/util/fs_entry.hh>
namespace paludis
{
@@ -45,7 +44,7 @@ namespace paludis
public:
CRANPackageID(const Environment * const, const std::shared_ptr<const CRANRepository> &,
- const FSEntry &);
+ const FSPath &);
CRANPackageID(const Environment * const, const std::shared_ptr<const CRANRepository> &,
const CRANPackageID * const, const std::string &);
~CRANPackageID();
@@ -75,7 +74,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataTimeKey> installed_time_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<PackageIDSequence> > contains_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::shared_ptr<const PackageID> > > contained_in_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > fs_location_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > behaviours_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > from_repositories_key() const;
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index 776f2e1..6df82a4 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -26,11 +26,9 @@
#include <paludis/literal_metadata_key.hh>
#include <paludis/repositories/cran/cran_package_id.hh>
#include <paludis/repositories/cran/cran_repository.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/options.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
#include <paludis/util/map.hh>
@@ -48,6 +46,7 @@
#include <paludis/util/extract_host_from_url.hh>
#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/process.hh>
+#include <paludis/util/fs_iterator.hh>
#include <paludis/output_manager.hh>
#include <paludis/syncer.hh>
#include <paludis/hook.hh>
@@ -77,11 +76,11 @@ namespace paludis
Imp(const CRANRepositoryParams &, const std::shared_ptr<Mutex> &);
~Imp();
- std::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > distdir_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > location_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > distdir_key;
std::shared_ptr<const MetadataValueKey<std::string> > format_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > builddir_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > library_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > builddir_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > library_key;
std::shared_ptr<const MetadataValueKey<std::string> > sync_key;
std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key;
};
@@ -91,11 +90,11 @@ Imp<CRANRepository>::Imp(const CRANRepositoryParams & p, const std::shared_ptr<M
params(p),
big_nasty_mutex(m),
has_ids(false),
- location_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("location", "location", mkt_significant, params.location())),
- distdir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("distdir", "distdir", mkt_normal, params.distdir())),
+ location_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("location", "location", mkt_significant, params.location())),
+ distdir_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("distdir", "distdir", mkt_normal, params.distdir())),
format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format", mkt_significant, "cran")),
- builddir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("builddir", "builddir", mkt_normal, params.builddir())),
- library_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("library", "library", mkt_normal, params.library())),
+ builddir_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("builddir", "builddir", mkt_normal, params.builddir())),
+ library_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("library", "library", mkt_normal, params.library())),
sync_key(std::make_shared<LiteralMetadataValueKey<std::string> >("sync", "sync", mkt_normal, params.sync())),
sync_host_key(std::make_shared<LiteralMetadataValueKey<std::string> >("sync_host", "sync_host", mkt_internal, extract_host_from_url(params.sync())))
{
@@ -220,7 +219,7 @@ CRANRepository::need_ids() const
Context context("When loading IDs for " + stringify(name()) + ":");
- for (DirIterator d(_imp->params.location()), d_end ; d != d_end ; ++d)
+ for (FSIterator d(_imp->params.location(), { fsio_inode_sort }), d_end ; d != d_end ; ++d)
if (is_file_with_extension(*d, ".DESCRIPTION", { }))
{
std::shared_ptr<cranrepository::CRANPackageID> id(std::make_shared<cranrepository::CRANPackageID>(_imp->params.environment(),
@@ -244,7 +243,7 @@ CRANRepository::need_ids() const
RepositoryName
CRANRepository::fetch_repo_name(const std::string & location)
{
- std::string modified_location(FSEntry(location).basename());
+ std::string modified_location(FSPath(location).basename());
std::replace(modified_location.begin(), modified_location.end(), '/', '-');
if (modified_location == "cran")
return RepositoryName("cran");
@@ -283,8 +282,8 @@ CRANRepository::do_install(const std::shared_ptr<const PackageID> & id_uncasted,
if (o.fetch_only)
return;
- FSEntry image(_imp->params.buildroot / stringify(id->native_package()) / "image");
- FSEntry workdir(_imp->params.buildroot / stringify(id->native_package()) / "work");
+ FSPath image(_imp->params.buildroot / stringify(id->native_package()) / "image");
+ FSPath workdir(_imp->params.buildroot / stringify(id->native_package()) / "work");
if (! o.destination)
throw PackageInstallActionError("Can't merge '" + stringify(*id) + "' because no destination was provided.");
@@ -310,7 +309,7 @@ CRANRepository::do_install(const std::shared_ptr<const PackageID> & id_uncasted,
throw PackageInstallActionError("Couldn't install '" + stringify(*id) + "' to '" +
stringify(image) + "'");
- MergeOptions m(id, image, FSEntry("/dev/null"));
+ MergeOptions m(id, image, FSPath("/dev/null"));
if (! o.destination->destination_interface)
throw PackageInstallActionError("Couldn't install '" + stringify(*id) + "' to '" +
@@ -543,16 +542,16 @@ CRANRepository::format_key() const
return _imp->format_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
CRANRepository::location_key() const
{
return _imp->location_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
CRANRepository::installed_root_key() const
{
- return std::shared_ptr<const MetadataValueKey<FSEntry> >();
+ return std::shared_ptr<const MetadataValueKey<FSPath> >();
}
const std::shared_ptr<const MetadataValueKey<std::string> >
diff --git a/paludis/repositories/cran/cran_repository.hh b/paludis/repositories/cran/cran_repository.hh
index 0355e56..1e0d946 100644
--- a/paludis/repositories/cran/cran_repository.hh
+++ b/paludis/repositories/cran/cran_repository.hh
@@ -22,7 +22,6 @@
#define PALUDIS_GUARD_PALUDIS_CRAN_REPOSITORY_HH 1
#include <paludis/repository.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/pimp.hh>
#include <paludis/environment-fwd.hh>
#include <memory>
@@ -58,11 +57,11 @@ namespace paludis
*/
struct CRANRepositoryParams
{
- NamedValue<n::builddir, FSEntry> builddir;
- NamedValue<n::distdir, FSEntry> distdir;
+ NamedValue<n::builddir, FSPath> builddir;
+ NamedValue<n::distdir, FSPath> distdir;
NamedValue<n::environment, const Environment *> environment;
- NamedValue<n::library, FSEntry> library;
- NamedValue<n::location, FSEntry> location;
+ NamedValue<n::library, FSPath> library;
+ NamedValue<n::location, FSPath> location;
NamedValue<n::mirror, std::string> mirror;
NamedValue<n::sync, std::string> sync;
};
@@ -156,8 +155,8 @@ namespace paludis
/* Keys */
virtual const std::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
diff --git a/paludis/repositories/cran/dep_spec_pretty_printer.cc b/paludis/repositories/cran/dep_spec_pretty_printer.cc
index 1a365fa..5d93d86 100644
--- a/paludis/repositories/cran/dep_spec_pretty_printer.cc
+++ b/paludis/repositories/cran/dep_spec_pretty_printer.cc
@@ -21,7 +21,6 @@
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/options.hh>
#include <paludis/util/accept_visitor.hh>
#include <paludis/environment.hh>
diff --git a/paludis/repositories/cran/keys.hh b/paludis/repositories/cran/keys.hh
index bb10301..1a0eca5 100644
--- a/paludis/repositories/cran/keys.hh
+++ b/paludis/repositories/cran/keys.hh
@@ -21,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_PALUDIS_REPOSITORIES_CRAN_KEYS_HH 1
#include <paludis/metadata_key.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/sequence.hh>
diff --git a/paludis/repositories/cran/package_dep_spec.cc b/paludis/repositories/cran/package_dep_spec.cc
index 8928b5e..6c8e555 100644
--- a/paludis/repositories/cran/package_dep_spec.cc
+++ b/paludis/repositories/cran/package_dep_spec.cc
@@ -143,7 +143,7 @@ namespace
return make_null_shared_ptr();
}
- virtual std::shared_ptr<const FSEntry> installed_at_path_ptr() const
+ virtual std::shared_ptr<const FSPath> installed_at_path_ptr() const
{
return make_null_shared_ptr();
}
diff --git a/paludis/repositories/e/check_fetched_files_visitor.cc b/paludis/repositories/e/check_fetched_files_visitor.cc
index 0b6cfa9..94c5a92 100644
--- a/paludis/repositories/e/check_fetched_files_visitor.cc
+++ b/paludis/repositories/e/check_fetched_files_visitor.cc
@@ -31,7 +31,7 @@
#include <paludis/action.hh>
#include <paludis/util/system.hh>
#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/util/log.hh>
#include <paludis/util/join.hh>
#include <paludis/util/save.hh>
@@ -61,7 +61,7 @@ namespace paludis
{
const Environment * const env;
const std::shared_ptr<const PackageID> id;
- const FSEntry distdir;
+ const FSPath distdir;
const bool check_unneeded;
const bool exclude_unmirrorable;
const bool ignore_unfetched;
@@ -79,10 +79,10 @@ namespace paludis
Imp(
const Environment * const e,
const std::shared_ptr<const PackageID> & i,
- const FSEntry & d,
+ const FSPath & d,
const bool c,
const bool n,
- const FSEntry & m2,
+ const FSPath & m2,
const UseManifest um,
const std::shared_ptr<OutputManager> & md,
const bool x,
@@ -109,10 +109,10 @@ namespace paludis
CheckFetchedFilesVisitor::CheckFetchedFilesVisitor(
const Environment * const e,
const std::shared_ptr<const PackageID> & i,
- const FSEntry & d,
+ const FSPath & d,
const bool c,
const bool n,
- const FSEntry & m2,
+ const FSPath & m2,
const UseManifest um,
const std::shared_ptr<OutputManager> & md,
const bool x,
@@ -189,7 +189,7 @@ CheckFetchedFilesVisitor::visit(const FetchableURISpecTree::NodeType<URILabelsDe
}
bool
-CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
+CheckFetchedFilesVisitor::check_distfile_manifest(const FSPath & distfile)
{
if (_imp->m2r->begin() == _imp->m2r->end())
{
@@ -225,10 +225,12 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
continue;
found = true;
+ FSStat distfile_stat(distfile);
+
Log::get_instance()->message("e.manifest.size", ll_debug, lc_context)
- << "Actual size = " << distfile.file_size()
+ << "Actual size = " << distfile_stat.file_size()
<< "; Manifest file size = " << m->size();
- if (distfile.file_size() != m->size())
+ if (distfile_stat.file_size() != m->size())
{
Log::get_instance()->message("e.manifest.no_size", ll_debug, lc_context)
<< "Malformed Manifest: no file size found";
@@ -375,7 +377,8 @@ CheckFetchedFilesVisitor::visit(const FetchableURISpecTree::NodeType<FetchableUR
_imp->output_manager->stdout_stream() << "Checking '" << node.spec()->filename() << "'... " << std::flush;
- if (! (_imp->distdir / node.spec()->filename()).is_regular_file())
+ FSStat distfile_stat(_imp->distdir / node.spec()->filename());
+ if (! distfile_stat.is_regular_file())
{
if (_imp->in_nofetch)
{
@@ -408,7 +411,7 @@ CheckFetchedFilesVisitor::visit(const FetchableURISpecTree::NodeType<FetchableUR
else
_imp->output_manager->stdout_stream() << "not fetched yet";
}
- else if (0 == (_imp->distdir / node.spec()->filename()).file_size())
+ else if (0 == distfile_stat.file_size())
{
Log::get_instance()->message("e.check_fetched_files.empty", ll_debug, lc_context) << "Empty file for '" << node.spec()->filename() << "'";
_imp->output_manager->stdout_stream() << "empty file";
diff --git a/paludis/repositories/e/check_fetched_files_visitor.hh b/paludis/repositories/e/check_fetched_files_visitor.hh
index ecfb27c..6e96b67 100644
--- a/paludis/repositories/e/check_fetched_files_visitor.hh
+++ b/paludis/repositories/e/check_fetched_files_visitor.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -23,7 +23,6 @@
#include <paludis/repositories/e/e_repository_params.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/pimp.hh>
-#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/output_manager-fwd.hh>
#include <paludis/dep_spec-fwd.hh>
#include <paludis/spec_tree.hh>
@@ -40,16 +39,16 @@ namespace paludis
private Pimp<CheckFetchedFilesVisitor>
{
private:
- bool check_distfile_manifest(const FSEntry & distfile);
+ bool check_distfile_manifest(const FSPath & distfile);
public:
CheckFetchedFilesVisitor(
const Environment * const,
const std::shared_ptr<const PackageID> &,
- const FSEntry & distdir,
+ const FSPath & distdir,
const bool check_unneeded,
const bool fetch_restrict,
- const FSEntry & m2,
+ const FSPath & m2,
const UseManifest um,
const std::shared_ptr<OutputManager> & output_manager,
const bool exclude_unmirrorable,
diff --git a/paludis/repositories/e/dep_spec_pretty_printer.cc b/paludis/repositories/e/dep_spec_pretty_printer.cc
index 2803125..5f20eb8 100644
--- a/paludis/repositories/e/dep_spec_pretty_printer.cc
+++ b/paludis/repositories/e/dep_spec_pretty_printer.cc
@@ -25,7 +25,6 @@
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/set.hh>
#include <paludis/util/options.hh>
#include <paludis/util/indirect_iterator-impl.hh>
diff --git a/paludis/repositories/e/depend_rdepend_TEST.cc b/paludis/repositories/e/depend_rdepend_TEST.cc
index 0e409c6..e0a4a26 100644
--- a/paludis/repositories/e/depend_rdepend_TEST.cc
+++ b/paludis/repositories/e/depend_rdepend_TEST.cc
@@ -105,19 +105,19 @@ namespace
TestEnvironment env;
env.set_paludis_command("/bin/false");
- FSEntry root(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "root");
+ FSPath root(FSPath::cwd() / "depend_rdepend_TEST_dir" / "root");
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "depend_rdepend_TEST_dir" / "repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "depend_rdepend_TEST_dir" / "repo/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "depend_rdepend_TEST_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "depend_rdepend_TEST_dir" / "build"));
keys->insert("root", stringify(root));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -127,7 +127,7 @@ namespace
v_keys->insert("format", "vdb");
v_keys->insert("names_cache", "/var/empty");
v_keys->insert("provides_cache", "/var/empty");
- v_keys->insert("location", stringify(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "vdb"));
+ v_keys->insert("location", stringify(FSPath::cwd() / "depend_rdepend_TEST_dir" / "vdb"));
v_keys->insert("root", stringify(root));
std::shared_ptr<Repository> v_repo(VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
diff --git a/paludis/repositories/e/e_installed_repository.cc b/paludis/repositories/e/e_installed_repository.cc
index 97aaeb9..b305e81 100644
--- a/paludis/repositories/e/e_installed_repository.cc
+++ b/paludis/repositories/e/e_installed_repository.cc
@@ -38,6 +38,7 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/process.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/action.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
@@ -190,18 +191,18 @@ EInstalledRepository::get_environment_variable(
Context context("When fetching environment variable '" + var + "' for '" +
stringify(*id) + "':");
- FSEntry ver_dir(id->fs_location_key()->value());
+ FSPath ver_dir(id->fs_location_key()->value());
- if (! ver_dir.is_directory_or_symlink_to_directory())
+ if (! ver_dir.stat().is_directory_or_symlink_to_directory())
throw ActionFailedError("Could not find Exndbam entry for '" + stringify(*id) + "'");
- if ((ver_dir / var).is_regular_file_or_symlink_to_regular_file())
+ if ((ver_dir / var).stat().is_regular_file_or_symlink_to_regular_file())
{
SafeIFStream f(ver_dir / var);
return strip_trailing_string(
std::string((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>()), "\n");
}
- else if ((ver_dir / "environment.bz2").is_regular_file_or_symlink_to_regular_file())
+ else if ((ver_dir / "environment.bz2").stat().is_regular_file_or_symlink_to_regular_file())
{
std::stringstream p;
Process env_process(ProcessCommand({"bash", "-c", "'( bunzip2 < " + stringify(ver_dir / "environment.bz2" ) +
@@ -226,18 +227,18 @@ EInstalledRepository::perform_config(
{
Context context("When configuring '" + stringify(*id) + "':");
- if (! _imp->params.root().is_directory())
+ if (! _imp->params.root().stat().is_directory())
throw ActionFailedError("Couldn't configure '" + stringify(*id) +
"' because root ('" + stringify(_imp->params.root()) + "') is not a directory");
std::shared_ptr<OutputManager> output_manager(a.options.make_output_manager()(a));
- FSEntry ver_dir(id->fs_location_key()->value());
+ FSPath ver_dir(id->fs_location_key()->value());
- std::shared_ptr<FSEntrySequence> eclassdirs(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> eclassdirs(std::make_shared<FSPathSequence>());
eclassdirs->push_back(ver_dir);
- std::shared_ptr<FSEntry> load_env(std::make_shared<FSEntry>(ver_dir / "environment.bz2"));
+ FSPath load_env(ver_dir / "environment.bz2");
EAPIPhases phases(id->eapi()->supported()->ebuild_phases()->ebuild_config());
for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
@@ -252,7 +253,7 @@ EInstalledRepository::perform_config(
n::ebuild_file() = ver_dir / (stringify(id->name().package()) + "-" + stringify(id->version()) + ".ebuild"),
n::eclassdirs() = eclassdirs,
n::environment() = _imp->params.environment(),
- n::exlibsdirs() = std::make_shared<FSEntrySequence>(),
+ n::exlibsdirs() = std::make_shared<FSPathSequence>(),
n::files_dir() = ver_dir,
n::maybe_output_manager() = output_manager,
n::package_builddir() = _imp->params.builddir() / (stringify(id->name().category()) + "-" + stringify(id->name().package()) + "-" + stringify(id->version()) + "-config"),
@@ -265,7 +266,7 @@ EInstalledRepository::perform_config(
),
make_named_values<EbuildConfigCommandParams>(
- n::load_environment() = load_env.get()
+ n::load_environment() = &load_env
));
config_cmd();
@@ -281,18 +282,18 @@ EInstalledRepository::perform_info(
{
Context context("When infoing '" + stringify(*id) + "':");
- if (! _imp->params.root().is_directory())
+ if (! _imp->params.root().stat().is_directory())
throw ActionFailedError("Couldn't info '" + stringify(*id) +
"' because root ('" + stringify(_imp->params.root()) + "') is not a directory");
std::shared_ptr<OutputManager> output_manager(a.options.make_output_manager()(a));
- FSEntry ver_dir(id->fs_location_key()->value());
+ FSPath ver_dir(id->fs_location_key()->value());
- std::shared_ptr<FSEntrySequence> eclassdirs(std::make_shared<FSEntrySequence>());
+ auto eclassdirs(std::make_shared<FSPathSequence>());
eclassdirs->push_back(ver_dir);
- std::shared_ptr<FSEntry> load_env(std::make_shared<FSEntry>(ver_dir / "environment.bz2"));
+ FSPath load_env(ver_dir / "environment.bz2");
EAPIPhases phases(id->eapi()->supported()->ebuild_phases()->ebuild_info());
@@ -361,7 +362,7 @@ EInstalledRepository::perform_info(
n::ebuild_file() = ver_dir / (stringify(id->name().package()) + "-" + stringify(id->version()) + ".ebuild"),
n::eclassdirs() = eclassdirs,
n::environment() = _imp->params.environment(),
- n::exlibsdirs() = std::make_shared<FSEntrySequence>(),
+ n::exlibsdirs() = std::make_shared<FSPathSequence>(),
n::files_dir() = ver_dir,
n::maybe_output_manager() = output_manager,
n::package_builddir() = _imp->params.builddir() / (stringify(id->name().category()) + "-" + stringify(id->name().package()) + "-" + stringify(id->version()) + "-info"),
@@ -376,9 +377,9 @@ EInstalledRepository::perform_info(
make_named_values<EbuildInfoCommandParams>(
n::expand_vars() = std::make_shared<Map<std::string, std::string> >(),
n::info_vars() = i ? i : std::make_shared<const Set<std::string> >(),
- n::load_environment() = load_env.get(),
- n::profiles() = std::make_shared<FSEntrySequence>(),
- n::profiles_with_parents() = std::make_shared<FSEntrySequence>(),
+ n::load_environment() = &load_env,
+ n::profiles() = std::make_shared<FSPathSequence>(),
+ n::profiles_with_parents() = std::make_shared<FSPathSequence>(),
n::use() = "",
n::use_ebuild_file() = false,
n::use_expand() = "",
diff --git a/paludis/repositories/e/e_installed_repository.hh b/paludis/repositories/e/e_installed_repository.hh
index 2950dec..e028bda 100644
--- a/paludis/repositories/e/e_installed_repository.hh
+++ b/paludis/repositories/e/e_installed_repository.hh
@@ -36,9 +36,9 @@ namespace paludis
{
struct EInstalledRepositoryParams
{
- NamedValue<n::builddir, FSEntry> builddir;
+ NamedValue<n::builddir, FSPath> builddir;
NamedValue<n::environment, Environment *> environment;
- NamedValue<n::root, FSEntry> root;
+ NamedValue<n::root, FSPath> root;
};
class EInstalledRepository :
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index 8c04dd4..fd4b01a 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -27,13 +27,6 @@
#include <paludis/repositories/e/dependencies_rewriter.hh>
#include <paludis/repositories/e/e_choice_value.hh>
-#include <paludis/name.hh>
-#include <paludis/version_spec.hh>
-#include <paludis/repository.hh>
-#include <paludis/distribution.hh>
-#include <paludis/environment.hh>
-#include <paludis/action.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/log.hh>
#include <paludis/util/pimp-impl.hh>
@@ -44,10 +37,19 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/return_literal_function.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/fs_stat.hh>
+
+#include <paludis/name.hh>
+#include <paludis/version_spec.hh>
+#include <paludis/repository.hh>
+#include <paludis/distribution.hh>
+#include <paludis/environment.hh>
+#include <paludis/action.hh>
#include <paludis/output_manager.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/elike_choices.hh>
+
#include <iterator>
using namespace paludis;
@@ -55,7 +57,7 @@ using namespace paludis::erepository;
namespace
{
- std::string file_contents(const FSEntry & f)
+ std::string file_contents(const FSPath & f)
{
Context c("When reading '" + stringify(f) + "':");
SafeIFStream i(f);
@@ -120,12 +122,12 @@ namespace paludis
const VersionSpec version;
const Environment * const environment;
const std::shared_ptr<const Repository> repository;
- const FSEntry dir;
+ const FSPath dir;
mutable std::shared_ptr<EInstalledRepositoryIDKeys> keys;
/* fs location and eapi are special */
- std::shared_ptr<const MetadataValueKey<FSEntry> > fs_location;
+ std::shared_ptr<const MetadataValueKey<FSPath> > fs_location;
std::shared_ptr<const EAPI> eapi;
std::shared_ptr<DependenciesLabelSequence> raw_dependencies_labels;
@@ -135,7 +137,7 @@ namespace paludis
Imp(const QualifiedPackageName & q, const VersionSpec & v,
const Environment * const e,
- const std::shared_ptr<const Repository> r, const FSEntry & f) :
+ const std::shared_ptr<const Repository> r, const FSPath & f) :
name(q),
version(v),
environment(e),
@@ -164,7 +166,7 @@ namespace paludis
EInstalledRepositoryID::EInstalledRepositoryID(const QualifiedPackageName & q, const VersionSpec & v,
const Environment * const e,
const std::shared_ptr<const Repository> & r,
- const FSEntry & f) :
+ const FSPath & f) :
Pimp<EInstalledRepositoryID>(q, v, e, r, f),
_imp(Pimp<EInstalledRepositoryID>::_imp)
{
@@ -187,7 +189,7 @@ EInstalledRepositoryID::need_keys_added() const
// at the top, other keys use it.
if (! _imp->fs_location)
{
- _imp->fs_location = std::make_shared<LiteralMetadataValueKey<FSEntry> >(fs_location_raw_name(), fs_location_human_name(),
+ _imp->fs_location = std::make_shared<LiteralMetadataValueKey<FSPath> >(fs_location_raw_name(), fs_location_human_name(),
mkt_internal, _imp->dir);
add_metadata_key(_imp->fs_location);
}
@@ -208,7 +210,7 @@ EInstalledRepositoryID::need_keys_added() const
std::shared_ptr<const EAPIEbuildEnvironmentVariables> env(eapi()->supported()->ebuild_environment_variables());
if (! env->env_use().empty())
- if ((_imp->dir / env->env_use()).exists())
+ if ((_imp->dir / env->env_use()).stat().exists())
{
_imp->keys->raw_use = std::make_shared<EStringSetKey>(shared_from_this(), env->env_use(), env->description_use(),
file_contents(_imp->dir / env->env_use()), mkt_internal);
@@ -216,7 +218,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->slot()->name().empty())
- if ((_imp->dir / vars->slot()->name()).exists())
+ if ((_imp->dir / vars->slot()->name()).stat().exists())
{
_imp->keys->slot = std::make_shared<LiteralMetadataValueKey<SlotName>>(vars->slot()->name(), vars->slot()->description(),
mkt_internal, SlotName(file_contents(_imp->dir / vars->slot()->name())));
@@ -224,7 +226,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->inherited()->name().empty())
- if ((_imp->dir / vars->inherited()->name()).exists())
+ if ((_imp->dir / vars->inherited()->name()).stat().exists())
{
_imp->keys->inherited = std::make_shared<EStringSetKey>(shared_from_this(), vars->inherited()->name(), vars->inherited()->description(),
file_contents(_imp->dir / vars->inherited()->name()), mkt_internal);
@@ -232,7 +234,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->defined_phases()->name().empty())
- if ((_imp->dir / vars->defined_phases()->name()).exists())
+ if ((_imp->dir / vars->defined_phases()->name()).stat().exists())
{
std::string d(file_contents(_imp->dir / vars->defined_phases()->name()));
if (! d.empty())
@@ -245,7 +247,7 @@ EInstalledRepositoryID::need_keys_added() const
if (! vars->iuse()->name().empty())
{
- if ((_imp->dir / vars->iuse()->name()).exists())
+ if ((_imp->dir / vars->iuse()->name()).stat().exists())
_imp->keys->raw_iuse = std::make_shared<EStringSetKey>(shared_from_this(), vars->iuse()->name(), vars->iuse()->description(),
file_contents(_imp->dir / vars->iuse()->name()), mkt_internal);
else
@@ -260,7 +262,7 @@ EInstalledRepositoryID::need_keys_added() const
if (! vars->iuse_effective()->name().empty())
{
- if ((_imp->dir / vars->iuse_effective()->name()).exists())
+ if ((_imp->dir / vars->iuse_effective()->name()).stat().exists())
{
_imp->keys->raw_iuse_effective = std::make_shared<EStringSetKey>(
shared_from_this(), vars->iuse_effective()->name(), vars->iuse_effective()->description(),
@@ -270,7 +272,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->myoptions()->name().empty())
- if ((_imp->dir / vars->myoptions()->name()).exists())
+ if ((_imp->dir / vars->myoptions()->name()).stat().exists())
{
_imp->keys->raw_myoptions = std::make_shared<EMyOptionsKey>(_imp->environment, shared_from_this(), vars->myoptions()->name(),
vars->myoptions()->description(), file_contents(_imp->dir / vars->myoptions()->name()), mkt_internal);
@@ -278,7 +280,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->use_expand()->name().empty())
- if ((_imp->dir / vars->use_expand()->name()).exists())
+ if ((_imp->dir / vars->use_expand()->name()).stat().exists())
{
_imp->keys->raw_use_expand = std::make_shared<EStringSetKey>(shared_from_this(), vars->use_expand()->name(), vars->use_expand()->description(),
file_contents(_imp->dir / vars->use_expand()->name()), mkt_internal);
@@ -286,7 +288,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->use_expand_hidden()->name().empty())
- if ((_imp->dir / vars->use_expand_hidden()->name()).exists())
+ if ((_imp->dir / vars->use_expand_hidden()->name()).stat().exists())
{
_imp->keys->raw_use_expand_hidden = std::make_shared<EStringSetKey>(shared_from_this(), vars->use_expand_hidden()->name(), vars->use_expand_hidden()->description(),
file_contents(_imp->dir / vars->use_expand_hidden()->name()), mkt_internal);
@@ -294,7 +296,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->license()->name().empty())
- if ((_imp->dir / vars->license()->name()).exists())
+ if ((_imp->dir / vars->license()->name()).stat().exists())
{
_imp->keys->license = std::make_shared<ELicenseKey>(_imp->environment, shared_from_this(), vars->license(),
file_contents(_imp->dir / vars->license()->name()), mkt_normal);
@@ -302,7 +304,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->provide()->name().empty())
- if ((_imp->dir / vars->provide()->name()).exists())
+ if ((_imp->dir / vars->provide()->name()).stat().exists())
{
_imp->keys->provide = std::make_shared<EProvideKey>(_imp->environment, shared_from_this(), vars->provide()->name(), vars->provide()->description(),
file_contents(_imp->dir / vars->provide()->name()), mkt_internal);
@@ -311,7 +313,7 @@ EInstalledRepositoryID::need_keys_added() const
if (! vars->dependencies()->name().empty())
{
- if ((_imp->dir / vars->dependencies()->name()).exists())
+ if ((_imp->dir / vars->dependencies()->name()).stat().exists())
{
DependenciesRewriter rewriter;
std::string raw_deps_str(file_contents(_imp->dir / vars->dependencies()->name()));
@@ -339,7 +341,7 @@ EInstalledRepositoryID::need_keys_added() const
else
{
if (! vars->build_depend()->name().empty())
- if ((_imp->dir / vars->build_depend()->name()).exists())
+ if ((_imp->dir / vars->build_depend()->name()).stat().exists())
{
_imp->keys->build_dependencies = std::make_shared<EDependenciesKey>(_imp->environment, shared_from_this(), vars->build_depend()->name(),
vars->build_depend()->description(), file_contents(_imp->dir / vars->build_depend()->name()),
@@ -348,7 +350,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->run_depend()->name().empty())
- if ((_imp->dir / vars->run_depend()->name()).exists())
+ if ((_imp->dir / vars->run_depend()->name()).stat().exists())
{
_imp->keys->run_dependencies = std::make_shared<EDependenciesKey>(_imp->environment, shared_from_this(), vars->run_depend()->name(),
vars->run_depend()->description(), file_contents(_imp->dir / vars->run_depend()->name()),
@@ -357,7 +359,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->pdepend()->name().empty())
- if ((_imp->dir / vars->pdepend()->name()).exists())
+ if ((_imp->dir / vars->pdepend()->name()).stat().exists())
{
_imp->keys->post_dependencies = std::make_shared<EDependenciesKey>(_imp->environment, shared_from_this(), vars->pdepend()->name(),
vars->pdepend()->description(), file_contents(_imp->dir / vars->pdepend()->name()),
@@ -367,7 +369,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->restrictions()->name().empty())
- if ((_imp->dir / vars->restrictions()->name()).exists())
+ if ((_imp->dir / vars->restrictions()->name()).stat().exists())
{
_imp->keys->restrictions = std::make_shared<EPlainTextSpecKey>(_imp->environment, shared_from_this(), vars->restrictions(),
file_contents(_imp->dir / vars->restrictions()->name()), mkt_internal);
@@ -375,7 +377,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->properties()->name().empty())
- if ((_imp->dir / vars->properties()->name()).exists())
+ if ((_imp->dir / vars->properties()->name()).stat().exists())
{
_imp->keys->properties = std::make_shared<EPlainTextSpecKey>(_imp->environment, shared_from_this(), vars->properties(),
file_contents(_imp->dir / vars->properties()->name()), mkt_internal);
@@ -383,7 +385,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->src_uri()->name().empty())
- if ((_imp->dir / vars->src_uri()->name()).exists())
+ if ((_imp->dir / vars->src_uri()->name()).stat().exists())
{
_imp->keys->src_uri = std::make_shared<EFetchableURIKey>(_imp->environment, shared_from_this(), vars->src_uri(),
file_contents(_imp->dir / vars->src_uri()->name()), mkt_dependencies);
@@ -391,7 +393,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->short_description()->name().empty())
- if ((_imp->dir / vars->short_description()->name()).exists())
+ if ((_imp->dir / vars->short_description()->name()).stat().exists())
{
_imp->keys->short_description = std::make_shared<LiteralMetadataValueKey<std::string> >(vars->short_description()->name(),
vars->short_description()->description(), mkt_significant, file_contents(_imp->dir / vars->short_description()->name()));
@@ -399,7 +401,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->long_description()->name().empty())
- if ((_imp->dir / vars->long_description()->name()).exists())
+ if ((_imp->dir / vars->long_description()->name()).stat().exists())
{
std::string value(file_contents(_imp->dir / vars->long_description()->name()));
if (! value.empty())
@@ -411,7 +413,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->upstream_changelog()->name().empty())
- if ((_imp->dir / vars->upstream_changelog()->name()).exists())
+ if ((_imp->dir / vars->upstream_changelog()->name()).stat().exists())
{
std::string value(file_contents(_imp->dir / vars->upstream_changelog()->name()));
if (! value.empty())
@@ -424,7 +426,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->upstream_release_notes()->name().empty())
- if ((_imp->dir / vars->upstream_release_notes()->name()).exists())
+ if ((_imp->dir / vars->upstream_release_notes()->name()).stat().exists())
{
std::string value(file_contents(_imp->dir / vars->upstream_release_notes()->name()));
if (! value.empty())
@@ -437,7 +439,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->upstream_documentation()->name().empty())
- if ((_imp->dir / vars->upstream_documentation()->name()).exists())
+ if ((_imp->dir / vars->upstream_documentation()->name()).stat().exists())
{
std::string value(file_contents(_imp->dir / vars->upstream_documentation()->name()));
if (! value.empty())
@@ -450,7 +452,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->bugs_to()->name().empty())
- if ((_imp->dir / vars->bugs_to()->name()).exists())
+ if ((_imp->dir / vars->bugs_to()->name()).stat().exists())
{
std::string value(file_contents(_imp->dir / vars->bugs_to()->name()));
if (! value.empty())
@@ -462,7 +464,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->remote_ids()->name().empty())
- if ((_imp->dir / vars->remote_ids()->name()).exists())
+ if ((_imp->dir / vars->remote_ids()->name()).stat().exists())
{
std::string value(file_contents(_imp->dir / vars->remote_ids()->name()));
if (! value.empty())
@@ -474,7 +476,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->homepage()->name().empty())
- if ((_imp->dir / vars->homepage()->name()).exists())
+ if ((_imp->dir / vars->homepage()->name()).stat().exists())
{
_imp->keys->homepage = std::make_shared<ESimpleURIKey>(_imp->environment, shared_from_this(), vars->homepage()->name(),
vars->homepage()->description(),
@@ -500,11 +502,11 @@ EInstalledRepositoryID::need_keys_added() const
add_metadata_key(_imp->keys->choices);
std::shared_ptr<Set<std::string> > from_repositories_value(std::make_shared<Set<std::string>>());
- if ((_imp->dir / "REPOSITORY").exists())
+ if ((_imp->dir / "REPOSITORY").stat().exists())
from_repositories_value->insert(file_contents(_imp->dir / "REPOSITORY"));
- if ((_imp->dir / "repository").exists())
+ if ((_imp->dir / "repository").stat().exists())
from_repositories_value->insert(file_contents(_imp->dir / "repository"));
- if ((_imp->dir / "BINARY_REPOSITORY").exists())
+ if ((_imp->dir / "BINARY_REPOSITORY").stat().exists())
from_repositories_value->insert(file_contents(_imp->dir / "BINARY_REPOSITORY"));
if (! from_repositories_value->empty())
{
@@ -513,70 +515,70 @@ EInstalledRepositoryID::need_keys_added() const
add_metadata_key(_imp->keys->from_repositories);
}
- if ((_imp->dir / "ASFLAGS").exists())
+ if ((_imp->dir / "ASFLAGS").stat().exists())
{
_imp->keys->asflags = std::make_shared<LiteralMetadataValueKey<std::string> >("ASFLAGS", "ASFLAGS",
mkt_internal, file_contents(_imp->dir / "ASFLAGS"));
add_metadata_key(_imp->keys->asflags);
}
- if ((_imp->dir / "CBUILD").exists())
+ if ((_imp->dir / "CBUILD").stat().exists())
{
_imp->keys->cbuild = std::make_shared<LiteralMetadataValueKey<std::string> >("CBUILD", "CBUILD",
mkt_internal, file_contents(_imp->dir / "CBUILD"));
add_metadata_key(_imp->keys->cbuild);
}
- if ((_imp->dir / "CFLAGS").exists())
+ if ((_imp->dir / "CFLAGS").stat().exists())
{
_imp->keys->cflags = std::make_shared<LiteralMetadataValueKey<std::string> >("CFLAGS", "CFLAGS",
mkt_internal, file_contents(_imp->dir / "CFLAGS"));
add_metadata_key(_imp->keys->cflags);
}
- if ((_imp->dir / "CHOST").exists())
+ if ((_imp->dir / "CHOST").stat().exists())
{
_imp->keys->chost = std::make_shared<LiteralMetadataValueKey<std::string> >("CHOST", "CHOST",
mkt_internal, file_contents(_imp->dir / "CHOST"));
add_metadata_key(_imp->keys->chost);
}
- if ((_imp->dir / "CONFIG_PROTECT").exists())
+ if ((_imp->dir / "CONFIG_PROTECT").stat().exists())
{
_imp->keys->config_protect = std::make_shared<LiteralMetadataValueKey<std::string> >("CONFIG_PROTECT", "CONFIG_PROTECT",
mkt_internal, file_contents(_imp->dir / "CONFIG_PROTECT"));
add_metadata_key(_imp->keys->config_protect);
}
- if ((_imp->dir / "CONFIG_PROTECT_MASK").exists())
+ if ((_imp->dir / "CONFIG_PROTECT_MASK").stat().exists())
{
_imp->keys->config_protect_mask = std::make_shared<LiteralMetadataValueKey<std::string> >("CONFIG_PROTECT_MASK", "CONFIG_PROTECT_MASK",
mkt_internal, file_contents(_imp->dir / "CONFIG_PROTECT_MASK"));
add_metadata_key(_imp->keys->config_protect_mask);
}
- if ((_imp->dir / "CXXFLAGS").exists())
+ if ((_imp->dir / "CXXFLAGS").stat().exists())
{
_imp->keys->cxxflags = std::make_shared<LiteralMetadataValueKey<std::string> >("CXXFLAGS", "CXXFLAGS",
mkt_internal, file_contents(_imp->dir / "CXXFLAGS"));
add_metadata_key(_imp->keys->cxxflags);
}
- if ((_imp->dir / "LDFLAGS").exists())
+ if ((_imp->dir / "LDFLAGS").stat().exists())
{
_imp->keys->ldflags = std::make_shared<LiteralMetadataValueKey<std::string> >("LDFLAGS", "LDFLAGS",
mkt_internal, file_contents(_imp->dir / "LDFLAGS"));
add_metadata_key(_imp->keys->ldflags);
}
- if ((_imp->dir / "PKGMANAGER").exists())
+ if ((_imp->dir / "PKGMANAGER").stat().exists())
{
_imp->keys->pkgmanager = std::make_shared<LiteralMetadataValueKey<std::string> >("PKGMANAGER", "Installed using",
mkt_normal, file_contents(_imp->dir / "PKGMANAGER"));
add_metadata_key(_imp->keys->pkgmanager);
}
- if ((_imp->dir / "VDB_FORMAT").exists())
+ if ((_imp->dir / "VDB_FORMAT").stat().exists())
{
_imp->keys->vdb_format = std::make_shared<LiteralMetadataValueKey<std::string> >("VDB_FORMAT", "VDB Format",
mkt_internal, file_contents(_imp->dir / "VDB_FORMAT"));
@@ -661,7 +663,7 @@ EInstalledRepositoryID::eapi() const
Context context("When finding EAPI for '" + canonical_form(idcf_full) + "':");
- if ((_imp->dir / "EAPI").exists())
+ if ((_imp->dir / "EAPI").stat().exists())
_imp->eapi = EAPIData::get_instance()->eapi_from_string(file_contents(_imp->dir / "EAPI"));
else
{
@@ -867,7 +869,7 @@ EInstalledRepositoryID::from_repositories_key() const
return _imp->keys->from_repositories;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
EInstalledRepositoryID::fs_location_key() const
{
// Avoid loading whole metadata
@@ -875,7 +877,7 @@ EInstalledRepositoryID::fs_location_key() const
{
Lock l(_imp->mutex);
- _imp->fs_location = std::make_shared<LiteralMetadataValueKey<FSEntry> >(fs_location_raw_name(),
+ _imp->fs_location = std::make_shared<LiteralMetadataValueKey<FSPath> >(fs_location_raw_name(),
fs_location_human_name(), mkt_internal, _imp->dir);
add_metadata_key(_imp->fs_location);
}
diff --git a/paludis/repositories/e/e_installed_repository_id.hh b/paludis/repositories/e/e_installed_repository_id.hh
index 12f4985..16dea83 100644
--- a/paludis/repositories/e/e_installed_repository_id.hh
+++ b/paludis/repositories/e/e_installed_repository_id.hh
@@ -23,7 +23,6 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/environment-fwd.hh>
-#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/repositories/e/e_repository_id.hh>
namespace paludis
@@ -45,7 +44,7 @@ namespace paludis
EInstalledRepositoryID(const QualifiedPackageName &, const VersionSpec &,
const Environment * const,
const std::shared_ptr<const Repository> &,
- const FSEntry & file);
+ const FSPath & file);
public:
~EInstalledRepositoryID();
@@ -77,7 +76,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataTimeKey> installed_time_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<PackageIDSequence> > contains_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::shared_ptr<const PackageID> > > contained_in_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > fs_location_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > from_repositories_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > raw_use_key() const;
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index e8acece..fb96a94 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -30,7 +30,6 @@
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/tokeniser.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/log.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/join.hh>
@@ -43,6 +42,8 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/timestamp.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_error.hh>
#include <paludis/contents.hh>
#include <paludis/repository.hh>
@@ -943,7 +944,7 @@ namespace paludis
struct Imp<EContentsKey>
{
const std::shared_ptr<const ERepositoryID> id;
- const FSEntry filename;
+ const FSPath filename;
mutable Mutex value_mutex;
mutable std::shared_ptr<Contents> value;
@@ -951,7 +952,7 @@ namespace paludis
const std::string human_name;
const MetadataKeyType type;
- Imp(const std::shared_ptr<const ERepositoryID> & i, const FSEntry & v,
+ Imp(const std::shared_ptr<const ERepositoryID> & i, const FSPath & v,
const std::string & r, const std::string & h, const MetadataKeyType & t) :
id(i),
filename(v),
@@ -964,7 +965,7 @@ namespace paludis
}
EContentsKey::EContentsKey(const std::shared_ptr<const ERepositoryID> & id,
- const std::string & r, const std::string & h, const FSEntry & v, const MetadataKeyType t) :
+ const std::string & r, const std::string & h, const FSPath & v, const MetadataKeyType t) :
Pimp<EContentsKey>(id, v, r, h, t)
{
}
@@ -985,8 +986,8 @@ EContentsKey::value() const
_imp->value = std::make_shared<Contents>();
- FSEntry f(_imp->filename);
- if (! f.is_regular_file_or_symlink_to_regular_file())
+ FSPath f(_imp->filename);
+ if (! f.stat().is_regular_file_or_symlink_to_regular_file())
{
Log::get_instance()->message("e.contents.not_a_file", ll_warning, lc_context) << "CONTENTS lookup failed for request for '" <<
*_imp->id << "' using '" << _imp->filename << "'";
@@ -1011,7 +1012,7 @@ EContentsKey::value() const
if ("obj" == tokens.at(0))
{
- std::shared_ptr<ContentsEntry> e(std::make_shared<ContentsFileEntry>(tokens.at(1)));
+ std::shared_ptr<ContentsEntry> e(std::make_shared<ContentsFileEntry>(FSPath(tokens.at(1))));
e->add_metadata_key(std::make_shared<LiteralMetadataTimeKey>("mtime", "mtime", mkt_normal,
Timestamp(destringify<time_t>(tokens.at(3)), 0)));
e->add_metadata_key(std::make_shared<LiteralMetadataValueKey<std::string>>("md5", "md5", mkt_normal, tokens.at(2)));
@@ -1019,18 +1020,18 @@ EContentsKey::value() const
}
else if ("dir" == tokens.at(0))
{
- std::shared_ptr<ContentsEntry> e(std::make_shared<ContentsDirEntry>(tokens.at(1)));
+ std::shared_ptr<ContentsEntry> e(std::make_shared<ContentsDirEntry>(FSPath(tokens.at(1))));
_imp->value->add(e);
}
else if ("sym" == tokens.at(0))
{
- std::shared_ptr<ContentsEntry> e(std::make_shared<ContentsSymEntry>(tokens.at(1), tokens.at(2)));
+ std::shared_ptr<ContentsEntry> e(std::make_shared<ContentsSymEntry>(FSPath(tokens.at(1)), tokens.at(2)));
e->add_metadata_key(std::make_shared<LiteralMetadataTimeKey>("mtime", "mtime", mkt_normal,
Timestamp(destringify<time_t>(tokens.at(3)), 0)));
_imp->value->add(e);
}
else if ("misc" == tokens.at(0) || "fif" == tokens.at(0) || "dev" == tokens.at(0))
- _imp->value->add(std::shared_ptr<ContentsEntry>(std::make_shared<ContentsOtherEntry>(tokens.at(1))));
+ _imp->value->add(std::shared_ptr<ContentsEntry>(std::make_shared<ContentsOtherEntry>(FSPath(tokens.at(1)))));
else
Log::get_instance()->message("e.contents.unknown", ll_warning, lc_context) << "CONTENTS has unsupported entry type '" <<
tokens.at(0) << "', skipping";
@@ -1063,7 +1064,7 @@ namespace paludis
struct Imp<EMTimeKey>
{
const std::shared_ptr<const ERepositoryID> id;
- const FSEntry filename;
+ const FSPath filename;
mutable Mutex value_mutex;
mutable std::shared_ptr<Timestamp> value;
@@ -1071,7 +1072,7 @@ namespace paludis
const std::string human_name;
const MetadataKeyType type;
- Imp(const std::shared_ptr<const ERepositoryID> & i, const FSEntry & v,
+ Imp(const std::shared_ptr<const ERepositoryID> & i, const FSPath & v,
const std::string & r, const std::string & h, const MetadataKeyType t) :
id(i),
filename(v),
@@ -1084,7 +1085,7 @@ namespace paludis
}
EMTimeKey::EMTimeKey(const std::shared_ptr<const ERepositoryID> & id,
- const std::string & r, const std::string & h, const FSEntry & v, const MetadataKeyType t) :
+ const std::string & r, const std::string & h, const FSPath & v, const MetadataKeyType t) :
Pimp<EMTimeKey>(id, v, r, h, t)
{
}
@@ -1105,7 +1106,7 @@ EMTimeKey::value() const
try
{
- *_imp->value = _imp->filename.mtim();
+ *_imp->value = _imp->filename.stat().mtim();
}
catch (const FSError & e)
{
diff --git a/paludis/repositories/e/e_key.hh b/paludis/repositories/e/e_key.hh
index 626113f..695b677 100644
--- a/paludis/repositories/e/e_key.hh
+++ b/paludis/repositories/e/e_key.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -21,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_GENTOO_E_KEY_HH 1
#include <paludis/metadata_key.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/set.hh>
#include <paludis/util/map-fwd.hh>
#include <paludis/repositories/e/eapi-fwd.hh>
@@ -289,7 +288,7 @@ namespace paludis
public:
EContentsKey(
const std::shared_ptr<const ERepositoryID> &,
- const std::string &, const std::string &, const FSEntry &, const MetadataKeyType);
+ const std::string &, const std::string &, const FSPath &, const MetadataKeyType);
~EContentsKey();
const std::shared_ptr<const Contents> value() const
@@ -306,7 +305,7 @@ namespace paludis
{
public:
EMTimeKey(const std::shared_ptr<const ERepositoryID> &,
- const std::string &, const std::string &, const FSEntry &, const MetadataKeyType);
+ const std::string &, const std::string &, const FSPath &, const MetadataKeyType);
~EMTimeKey();
Timestamp value() const
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index b1e9a57..e5ab9d7 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -68,9 +68,9 @@
#include <paludis/util/config_file.hh>
#include <paludis/util/create_iterator-impl.hh>
#include <paludis/util/destringify.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/extract_host_from_url.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_iterator.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/singleton-impl.hh>
@@ -135,18 +135,18 @@ typedef std::unordered_map<QualifiedPackageName,
typedef std::unordered_map<std::string, std::shared_ptr<MirrorsSequence> > MirrorMap;
typedef std::unordered_map<QualifiedPackageName, std::shared_ptr<const PackageDepSpec>, Hash<QualifiedPackageName> > VirtualsMap;
-typedef std::map<FSEntry, std::string> EAPIForFileMap;
+typedef std::map<FSPath, std::string, FSPathComparator> EAPIForFileMap;
namespace
{
- std::shared_ptr<FSEntrySequence> get_master_locations(
+ std::shared_ptr<FSPathSequence> get_master_locations(
const std::shared_ptr<const ERepositorySequence> & r)
{
- std::shared_ptr<FSEntrySequence> result;
+ std::shared_ptr<FSPathSequence> result;
if (r)
{
- result = std::make_shared<FSEntrySequence>();
+ result = std::make_shared<FSPathSequence>();
for (ERepositorySequence::ConstIterator e(r->begin()), e_end(r->end()) ;
e != e_end ; ++e)
result->push_back((*e)->location_key()->value());
@@ -220,7 +220,7 @@ namespace paludis
mutable MirrorMap mirrors;
mutable std::shared_ptr<erepository::Profile> profile_ptr;
- mutable std::shared_ptr<const FSEntry> main_profile_path;
+ mutable std::shared_ptr<const FSPath> main_profile_path;
mutable std::shared_ptr<ERepositoryNews> news_ptr;
@@ -237,21 +237,21 @@ namespace paludis
std::shared_ptr<const MetadataValueKey<std::string> > format_key;
std::shared_ptr<const MetadataValueKey<std::string> > layout_key;
std::shared_ptr<const MetadataValueKey<std::string> > profile_layout_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
- std::shared_ptr<const MetadataCollectionKey<FSEntrySequence> > profiles_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > cache_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > write_cache_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > location_key;
+ std::shared_ptr<const MetadataCollectionKey<FSPathSequence> > profiles_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > cache_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > write_cache_key;
std::shared_ptr<const MetadataValueKey<std::string> > append_repository_name_to_write_cache_key;
std::shared_ptr<const MetadataValueKey<std::string> > ignore_deprecated_profiles;
- std::shared_ptr<const MetadataValueKey<FSEntry> > names_cache_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > distdir_key;
- std::shared_ptr<const MetadataCollectionKey<FSEntrySequence> > eclassdirs_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > securitydir_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > setsdir_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > newsdir_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > names_cache_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > distdir_key;
+ std::shared_ptr<const MetadataCollectionKey<FSPathSequence> > eclassdirs_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > securitydir_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > setsdir_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > newsdir_key;
std::shared_ptr<const MetadataValueKey<std::string> > sync_key;
std::shared_ptr<const MetadataValueKey<std::string> > sync_options_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > builddir_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > builddir_key;
std::shared_ptr<const MetadataCollectionKey<Sequence<std::string> > > master_repositories_key;
std::shared_ptr<const MetadataValueKey<std::string> > eapi_when_unknown_key;
std::shared_ptr<const MetadataValueKey<std::string> > eapi_when_unspecified_key;
@@ -262,8 +262,8 @@ namespace paludis
std::shared_ptr<const MetadataValueKey<std::string> > binary_destination_key;
std::shared_ptr<const MetadataValueKey<std::string> > binary_src_uri_prefix_key;
std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > binary_keywords_filter;
- std::shared_ptr<const MetadataValueKey<FSEntry> > accounts_repository_data_location_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > e_updates_location_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > accounts_repository_data_location_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > e_updates_location_key;
std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key;
std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key;
std::list<std::shared_ptr<const MetadataKey> > about_keys;
@@ -289,13 +289,13 @@ namespace paludis
mkt_normal, params.layout())),
profile_layout_key(std::make_shared<LiteralMetadataValueKey<std::string> >("profile_layout", "profile_layout",
mkt_normal, params.profile_layout())),
- location_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("location", "location",
+ location_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("location", "location",
mkt_significant, params.location())),
- profiles_key(std::make_shared<LiteralMetadataFSEntrySequenceKey>(
+ profiles_key(std::make_shared<LiteralMetadataFSPathSequenceKey>(
"profiles", "profiles", mkt_normal, params.profiles())),
- cache_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("cache", "cache",
+ cache_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("cache", "cache",
mkt_normal, params.cache())),
- write_cache_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("write_cache", "write_cache",
+ write_cache_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("write_cache", "write_cache",
mkt_normal, params.write_cache())),
append_repository_name_to_write_cache_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"append_repository_name_to_write_cache", "append_repository_name_to_write_cache",
@@ -303,23 +303,23 @@ namespace paludis
ignore_deprecated_profiles(std::make_shared<LiteralMetadataValueKey<std::string> >(
"ignore_deprecated_profiles", "ignore_deprecated_profiles",
mkt_internal, stringify(params.ignore_deprecated_profiles()))),
- names_cache_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >(
+ names_cache_key(std::make_shared<LiteralMetadataValueKey<FSPath> >(
"names_cache", "names_cache", mkt_normal, params.names_cache())),
- distdir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >(
+ distdir_key(std::make_shared<LiteralMetadataValueKey<FSPath> >(
"distdir", "distdir", mkt_normal, params.distdir())),
- eclassdirs_key(std::make_shared<LiteralMetadataFSEntrySequenceKey>(
+ eclassdirs_key(std::make_shared<LiteralMetadataFSPathSequenceKey>(
"eclassdirs", "eclassdirs", mkt_normal, params.eclassdirs())),
- securitydir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >(
+ securitydir_key(std::make_shared<LiteralMetadataValueKey<FSPath> >(
"securitydir", "securitydir", mkt_normal, params.securitydir())),
- setsdir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >(
+ setsdir_key(std::make_shared<LiteralMetadataValueKey<FSPath> >(
"setsdir", "setsdir", mkt_normal, params.setsdir())),
- newsdir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >(
+ newsdir_key(std::make_shared<LiteralMetadataValueKey<FSPath> >(
"newsdir", "newsdir", mkt_normal, params.newsdir())),
sync_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"sync", "sync", mkt_normal, params.sync())),
sync_options_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"sync_options", "sync_options", mkt_normal, params.sync_options())),
- builddir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >(
+ builddir_key(std::make_shared<LiteralMetadataValueKey<FSPath> >(
"builddir", "builddir", mkt_normal, params.builddir())),
master_repositories_key(params.master_repositories() ?
std::shared_ptr<MetadataCollectionKey<Sequence<std::string> > >(std::make_shared<LiteralMetadataStringSequenceKey>(
@@ -335,15 +335,15 @@ namespace paludis
"use_manifest", "use_manifest", mkt_normal, stringify(params.use_manifest()))),
info_pkgs_key(layout->info_packages_files()->end() != std::find_if(layout->info_packages_files()->begin(),
layout->info_packages_files()->end(),
- std::bind(std::mem_fn(&FSEntry::is_regular_file_or_symlink_to_regular_file),
- std::placeholders::_1)) ?
+ std::bind(std::mem_fn(&FSStat::is_regular_file_or_symlink_to_regular_file),
+ std::bind(std::mem_fn(&FSPath::stat), std::placeholders::_1))) ?
std::make_shared<InfoPkgsMetadataKey>(params.environment(), layout->info_packages_files(), repo) :
std::shared_ptr<InfoPkgsMetadataKey>()
),
info_vars_key(layout->info_variables_files()->end() != std::find_if(layout->info_variables_files()->begin(),
layout->info_variables_files()->end(),
- std::bind(std::mem_fn(&FSEntry::is_regular_file_or_symlink_to_regular_file),
- std::placeholders::_1)) ?
+ std::bind(std::mem_fn(&FSStat::is_regular_file_or_symlink_to_regular_file),
+ std::bind(std::mem_fn(&FSPath::stat), std::placeholders::_1))) ?
std::make_shared<InfoVarsMetadataKey>(layout->info_variables_files()) :
std::shared_ptr<InfoVarsMetadataKey>()
),
@@ -363,7 +363,7 @@ namespace paludis
master_mtime(0)
{
- if ((params.location() / "metadata" / "about.conf").is_regular_file_or_symlink_to_regular_file())
+ if ((params.location() / "metadata" / "about.conf").stat().is_regular_file_or_symlink_to_regular_file())
{
Context context("When loading about.conf:");
KeyValueConfigFile k(params.location() / "metadata" / "about.conf", { },
@@ -385,9 +385,10 @@ namespace paludis
mkt_significant, k.get("homepage")));
}
- FSEntry mtf(params.location() / "metadata" / "timestamp");
- if (mtf.exists())
- master_mtime = mtf.mtim().seconds();
+ FSPath mtf(params.location() / "metadata" / "timestamp");
+ FSStat mtfs(mtf.stat());
+ if (mtfs.exists())
+ master_mtime = mtfs.mtim().seconds();
}
Imp<ERepository>::~Imp()
@@ -402,23 +403,23 @@ namespace paludis
if (profile_ptr)
return;
- std::shared_ptr<const FSEntrySequence> profiles(params.profiles());
+ std::shared_ptr<const FSPathSequence> profiles(params.profiles());
if (params.auto_profiles())
{
- FSEntry profiles_desc("/dev/null");
- for (FSEntrySequence::ConstIterator f(layout->profiles_desc_files()->begin()),
+ FSPath profiles_desc("/dev/null");
+ for (FSPathSequence::ConstIterator f(layout->profiles_desc_files()->begin()),
f_end(layout->profiles_desc_files()->end()) ;
f != f_end ; ++f)
- if (f->is_regular_file_or_symlink_to_regular_file())
+ if (f->stat().is_regular_file_or_symlink_to_regular_file())
profiles_desc = *f;
- std::shared_ptr<FSEntrySequence> auto_profiles(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> auto_profiles(std::make_shared<FSPathSequence>());
- if (profiles_desc == FSEntry("/dev/null"))
+ if (profiles_desc == FSPath("/dev/null"))
{
- auto_profiles->push_back(FSEntry("/var/empty"));
- main_profile_path = std::make_shared<FSEntry>("/var/empty");
+ auto_profiles->push_back(FSPath("/var/empty"));
+ main_profile_path = std::make_shared<FSPath>("/var/empty");
}
else
{
@@ -432,18 +433,18 @@ namespace paludis
if (tokens.size() < 3)
continue;
- FSEntry p(profiles_desc.dirname().realpath().dirname() / "profiles" / tokens.at(1));
+ FSPath p(profiles_desc.dirname().realpath().dirname() / "profiles" / tokens.at(1));
auto_profiles->push_back(p);
- main_profile_path = std::make_shared<FSEntry>(p);
+ main_profile_path = std::make_shared<FSPath>(p);
break;
}
}
profiles = auto_profiles;
}
else if (params.profiles()->empty())
- main_profile_path = std::make_shared<FSEntry>("/var/empty");
+ main_profile_path = std::make_shared<FSPath>("/var/empty");
else
- main_profile_path = std::make_shared<FSEntry>(*params.profiles()->begin());
+ main_profile_path = std::make_shared<FSPath>(*params.profiles()->begin());
profile_ptr = ProfileFactory::get_instance()->create(
params.profile_layout(),
@@ -457,18 +458,18 @@ namespace paludis
namespace
{
RepositoryName
- fetch_repo_name(const FSEntry & tree_root)
+ fetch_repo_name(const FSPath & tree_root)
{
bool illegal(false);
try
{
do
{
- FSEntry name_file(tree_root);
+ FSPath name_file(tree_root);
name_file /= "profiles";
name_file /= "repo_name";
- if (! name_file.is_regular_file())
+ if (! name_file.stat().is_regular_file())
break;
LineConfigFile f(name_file, { lcfo_disallow_comments, lcfo_disallow_continuations, lcfo_no_skip_blank_lines });
@@ -612,7 +613,7 @@ ERepository::repository_masked(const PackageID & id) const
using namespace std::placeholders;
- std::shared_ptr<const FSEntrySequence> repository_mask_files(_imp->layout->repository_mask_files());
+ std::shared_ptr<const FSPathSequence> repository_mask_files(_imp->layout->repository_mask_files());
ProfileFile<MaskFile> repository_mask_file(this);
std::for_each(repository_mask_files->begin(), repository_mask_files->end(),
std::bind(&ProfileFile<MaskFile>::add_file, std::ref(repository_mask_file), _1));
@@ -671,11 +672,11 @@ ERepository::arch_flags() const
_imp->arch_flags = std::make_shared<Set<UnprefixedChoiceName>>();
bool found_one(false);
- std::shared_ptr<const FSEntrySequence> arch_list_files(_imp->layout->arch_list_files());
- for (FSEntrySequence::ConstIterator p(arch_list_files->begin()), p_end(arch_list_files->end()) ;
+ std::shared_ptr<const FSPathSequence> arch_list_files(_imp->layout->arch_list_files());
+ for (FSPathSequence::ConstIterator p(arch_list_files->begin()), p_end(arch_list_files->end()) ;
p != p_end ; ++p)
{
- if (! p->exists())
+ if (! p->stat().exists())
continue;
LineConfigFile archs(*p, { lcfo_disallow_continuations });
@@ -702,11 +703,11 @@ ERepository::need_mirrors() const
if (! _imp->has_mirrors)
{
bool found_one(false);
- std::shared_ptr<const FSEntrySequence> mirror_files(_imp->layout->mirror_files());
- for (FSEntrySequence::ConstIterator p(mirror_files->begin()), p_end(mirror_files->end()) ;
+ std::shared_ptr<const FSPathSequence> mirror_files(_imp->layout->mirror_files());
+ for (FSPathSequence::ConstIterator p(mirror_files->begin()), p_end(mirror_files->end()) ;
p != p_end ; ++p)
{
- if (p->exists())
+ if (p->stat().exists())
{
LineConfigFile mirrors(*p, { lcfo_disallow_continuations });
for (LineConfigFile::ConstIterator line(mirrors.begin()) ; line != mirrors.end() ; ++line)
@@ -800,14 +801,14 @@ ERepository::purge_invalid_cache() const
{
Context context("When purging invalid write_cache:");
- FSEntry write_cache(_imp->params.write_cache());
- if (write_cache == FSEntry("/var/empty"))
+ FSPath write_cache(_imp->params.write_cache());
+ if (write_cache == FSPath("/var/empty"))
return;
if (_imp->params.append_repository_name_to_write_cache())
write_cache /= stringify(name());
- if (! write_cache.is_directory_or_symlink_to_directory())
+ if (! write_cache.stat().is_directory_or_symlink_to_directory())
return;
const std::shared_ptr<const EAPI> eapi(EAPIData::get_instance()->eapi_from_string(
@@ -815,18 +816,19 @@ ERepository::purge_invalid_cache() const
std::shared_ptr<EclassMtimes> eclass_mtimes(std::make_shared<EclassMtimes>(this, _imp->params.eclassdirs()));
time_t master_mtime(0);
- FSEntry master_mtime_file(_imp->params.location() / "metadata" / "timestamp");
- if (master_mtime_file.exists())
- master_mtime = master_mtime_file.mtim().seconds();
+ FSPath master_mtime_file(_imp->params.location() / "metadata" / "timestamp");
+ FSStat master_mtime_file_stat(master_mtime_file.stat());
+ if (master_mtime_file_stat.exists())
+ master_mtime = master_mtime_file_stat.mtim().seconds();
- for (DirIterator dc(write_cache, { dio_inode_sort }), dc_end ; dc != dc_end ; ++dc)
+ for (FSIterator dc(write_cache, { fsio_inode_sort }), dc_end ; dc != dc_end ; ++dc)
{
- if (! dc->is_directory_or_symlink_to_directory())
+ if (! dc->stat().is_directory_or_symlink_to_directory())
continue;
- for (DirIterator dp(*dc, { dio_inode_sort }), dp_end ; dp != dp_end ; ++dp)
+ for (FSIterator dp(*dc, { fsio_inode_sort }), dp_end ; dp != dp_end ; ++dp)
{
- if (! dp->is_regular_file_or_symlink_to_regular_file())
+ if (! dp->stat().is_regular_file_or_symlink_to_regular_file())
continue;
try
@@ -852,7 +854,7 @@ ERepository::purge_invalid_cache() const
}
if (! found)
- FSEntry(*dp).unlink();
+ FSPath(*dp).unlink();
}
catch (const Exception & e)
{
@@ -1075,19 +1077,19 @@ ERepository::some_ids_might_not_be_masked() const
void
ERepository::make_manifest(const QualifiedPackageName & qpn)
{
- FSEntry package_dir = _imp->layout->package_directory(qpn);
+ FSPath package_dir = _imp->layout->package_directory(qpn);
- FSEntry(package_dir / "Manifest").unlink();
- SafeOFStream manifest(FSEntry(package_dir / "Manifest"));
+ FSPath(package_dir / "Manifest").unlink();
+ SafeOFStream manifest(FSPath(package_dir / "Manifest"));
if (! manifest)
throw ERepositoryConfigurationError("Couldn't open Manifest for writing.");
- std::shared_ptr<Map<FSEntry, std::string> > files = _imp->layout->manifest_files(qpn);
+ auto files(_imp->layout->manifest_files(qpn));
- for (Map<FSEntry, std::string>::ConstIterator f(files->begin()) ;
- f != files->end() ; ++f)
+ for (auto f(files->begin()) ; f != files->end() ; ++f)
{
- FSEntry file(f->first);
+ FSPath file(f->first);
+ FSStat file_stat(file);
std::string filename = file.basename();
std::string file_type(f->second);
@@ -1100,7 +1102,7 @@ ERepository::make_manifest(const QualifiedPackageName & qpn)
RMD160 rmd160sum(file_stream);
manifest << file_type << " " << filename << " "
- << file.file_size() << " RMD160 " << rmd160sum.hexsum();
+ << file.stat().file_size() << " RMD160 " << rmd160sum.hexsum();
file_stream.clear();
file_stream.seekg(0, std::ios::beg);
@@ -1135,9 +1137,10 @@ ERepository::make_manifest(const QualifiedPackageName & qpn)
continue;
done_files.insert(*d);
- FSEntry f(params().distdir() / *d);
+ FSPath f(params().distdir() / *d);
+ FSStat f_stat(f);
- if (! f.is_regular_file_or_symlink_to_regular_file())
+ if (! f_stat.is_regular_file_or_symlink_to_regular_file())
throw MissingDistfileError("Distfile '" + f.basename() + "' does not exist");
SafeIFStream file_stream(f);
@@ -1145,7 +1148,7 @@ ERepository::make_manifest(const QualifiedPackageName & qpn)
MemoisedHashes * hashes = MemoisedHashes::get_instance();
manifest << "DIST " << f.basename() << " "
- << f.file_size()
+ << f_stat.file_size()
<< " RMD160 " << hashes->get<RMD160>(f, file_stream)
<< " SHA1 " << hashes->get<SHA1>(f, file_stream)
<< " SHA256 " << hashes->get<SHA256>(f, file_stream)
@@ -1192,16 +1195,16 @@ ERepository::format_key() const
return _imp->format_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
ERepository::location_key() const
{
return _imp->location_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
ERepository::installed_root_key() const
{
- return std::shared_ptr<const MetadataValueKey<FSEntry> >();
+ return std::shared_ptr<const MetadataValueKey<FSPath> >();
}
const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > >
@@ -1219,7 +1222,7 @@ ERepository::repository_factory_name(
if (key_function("location").empty())
throw ERepositoryConfigurationError("Key 'location' unspecified or empty");
- return fetch_repo_name(FSEntry(key_function("location")));
+ return fetch_repo_name(FSPath(key_function("location")));
}
std::shared_ptr<Repository>
@@ -1235,8 +1238,8 @@ ERepository::repository_factory_create(
if ('/' != location.at(0))
throw ERepositoryConfigurationError("Key 'location' must start with a / (relative paths are not allowed)");
- std::shared_ptr<KeyValueConfigFile> layout_conf((FSEntry(location) / "metadata/layout.conf").exists() ?
- new KeyValueConfigFile(FSEntry(location) / "metadata/layout.conf", { },
+ std::shared_ptr<KeyValueConfigFile> layout_conf((FSPath(location) / "metadata/layout.conf").stat().exists() ?
+ new KeyValueConfigFile(FSPath(location) / "metadata/layout.conf", { },
&KeyValueConfigFile::no_defaults, &KeyValueConfigFile::no_transformation)
: 0);
@@ -1246,7 +1249,7 @@ ERepository::repository_factory_create(
if (layout_conf)
{
Log::get_instance()->message("e.ebuild.configuration.master_repository", ll_warning, lc_context) << "Key 'master_repository' in '"
- << f("repo_file") << "' will override '" << (FSEntry(location) / "metadata/layout.conf")
+ << f("repo_file") << "' will override '" << (FSPath(location) / "metadata/layout.conf")
<< "'. You should probably remove the 'master_repository' setting from your repository config file.";
}
@@ -1297,23 +1300,23 @@ ERepository::repository_factory_create(
}
catch (const NoSuchRepositoryError &)
{
- throw ERepositoryConfigurationError("According to '" + stringify(FSEntry(location) / "metadata/layout.conf")
+ throw ERepositoryConfigurationError("According to '" + stringify(FSPath(location) / "metadata/layout.conf")
+ "', the repository specified by '" + f("repo_file") + "' requires repository '" + *t +
"', which you do not have available");
}
}
}
- std::shared_ptr<FSEntrySequence> profiles(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> profiles(std::make_shared<FSPathSequence>());
bool profiles_explicitly_set(false), auto_profiles(false);
- tokenise_whitespace(f("profiles"), create_inserter<FSEntry>(std::back_inserter(*profiles)));
+ tokenise_whitespace(f("profiles"), create_inserter<FSPath>(std::back_inserter(*profiles)));
if (profiles->empty())
{
if (master_repositories)
std::copy((*master_repositories->begin())->params().profiles()->begin(),
(*master_repositories->begin())->params().profiles()->end(), profiles->back_inserter());
- else if (FSEntry(location).is_directory_or_symlink_to_directory() &&
- (DirIterator(FSEntry(location)) != DirIterator()))
+ else if (FSPath(location).stat().is_directory_or_symlink_to_directory() &&
+ (FSIterator(FSPath(location), { fsio_inode_sort, fsio_first_only }) != FSIterator()))
{
/* only require profiles = if we've definitely been synced. requiring profiles = on
* unsynced doesn't play nice with layout.conf specifying masters. */
@@ -1325,8 +1328,8 @@ ERepository::repository_factory_create(
else
profiles_explicitly_set = true;
- std::shared_ptr<FSEntrySequence> eclassdirs(std::make_shared<FSEntrySequence>());
- tokenise_whitespace(f("eclassdirs"), create_inserter<FSEntry>(std::back_inserter(*eclassdirs)));
+ std::shared_ptr<FSPathSequence> eclassdirs(std::make_shared<FSPathSequence>());
+ tokenise_whitespace(f("eclassdirs"), create_inserter<FSPath>(std::back_inserter(*eclassdirs)));
if (eclassdirs->empty())
{
if (master_repositories)
@@ -1335,7 +1338,7 @@ ERepository::repository_factory_create(
e_end(master_repositories->end()) ; e != e_end ; ++e)
std::copy((*e)->params().eclassdirs()->begin(), (*e)->params().eclassdirs()->end(), eclassdirs->back_inserter());
}
- eclassdirs->push_back(location + "/eclass");
+ eclassdirs->push_back(FSPath(location + "/eclass"));
}
std::string distdir(f("distdir"));
@@ -1371,7 +1374,7 @@ ERepository::repository_factory_create(
if (cache.empty())
{
cache = location + "/metadata/cache";
- if (! FSEntry(cache).exists())
+ if (! FSPath(cache).stat().exists())
cache = "/var/empty";
}
@@ -1513,9 +1516,9 @@ ERepository::repository_factory_create(
n::binary_distdir() = binary_distdir,
n::binary_keywords_filter() = binary_keywords_filter,
n::binary_uri_prefix() = binary_uri_prefix,
- n::builddir() = FSEntry(builddir).realpath_if_exists(),
+ n::builddir() = FSPath(builddir).realpath_if_exists(),
n::cache() = cache,
- n::distdir() = FSEntry(distdir).realpath_if_exists(),
+ n::distdir() = FSPath(distdir).realpath_if_exists(),
n::eapi_when_unknown() = eapi_when_unknown,
n::eapi_when_unspecified() = eapi_when_unspecified,
n::eclassdirs() = eclassdirs,
@@ -1523,21 +1526,21 @@ ERepository::repository_factory_create(
n::environment() = env,
n::ignore_deprecated_profiles() = ignore_deprecated_profiles,
n::layout() = layout,
- n::location() = FSEntry(location).realpath_if_exists(),
+ n::location() = FSPath(location).realpath_if_exists(),
n::master_repositories() = master_repositories,
- n::names_cache() = FSEntry(names_cache).realpath_if_exists(),
- n::newsdir() = FSEntry(newsdir).realpath_if_exists(),
+ n::names_cache() = FSPath(names_cache).realpath_if_exists(),
+ n::newsdir() = FSPath(newsdir).realpath_if_exists(),
n::profile_eapi_when_unspecified() = profile_eapi,
n::profile_layout() = profile_layout,
n::profiles() = profiles,
n::profiles_explicitly_set() = profiles_explicitly_set,
- n::securitydir() = FSEntry(securitydir).realpath_if_exists(),
- n::setsdir() = FSEntry(setsdir).realpath_if_exists(),
+ n::securitydir() = FSPath(securitydir).realpath_if_exists(),
+ n::setsdir() = FSPath(setsdir).realpath_if_exists(),
n::sync() = sync,
n::sync_options() = sync_options,
n::use_manifest() = use_manifest,
n::write_bin_uri_prefix() = "",
- n::write_cache() = FSEntry(write_cache).realpath_if_exists()
+ n::write_cache() = FSPath(write_cache).realpath_if_exists()
));
}
@@ -1555,8 +1558,8 @@ ERepository::repository_factory_dependencies(
if (location.empty())
throw ERepositoryConfigurationError("Key 'location' not specified or empty");
- std::shared_ptr<KeyValueConfigFile> layout_conf((FSEntry(location) / "metadata/layout.conf").exists() ?
- new KeyValueConfigFile(FSEntry(location) / "metadata/layout.conf", { },
+ std::shared_ptr<KeyValueConfigFile> layout_conf((FSPath(location) / "metadata/layout.conf").stat().exists() ?
+ new KeyValueConfigFile(FSPath(location) / "metadata/layout.conf", { },
&KeyValueConfigFile::no_defaults, &KeyValueConfigFile::no_transformation)
: 0);
@@ -1586,15 +1589,15 @@ ERepository::use_desc() const
}
const std::string
-ERepository::eapi_for_file(const FSEntry & f) const
+ERepository::eapi_for_file(const FSPath & f) const
{
- FSEntry dir(f.dirname());
+ FSPath dir(f.dirname());
Lock lock(_imp->mutexes->eapi_for_file_mutex);
EAPIForFileMap::const_iterator i(_imp->eapi_for_file_map.find(dir));
if (i == _imp->eapi_for_file_map.end())
{
Context context("When finding the EAPI to use for file '" + stringify(f) + "':");
- if ((dir / "eapi").is_regular_file_or_symlink_to_regular_file())
+ if ((dir / "eapi").stat().is_regular_file_or_symlink_to_regular_file())
{
LineConfigFile file(dir / "eapi", { lcfo_disallow_continuations });
if (file.begin() == file.end())
@@ -1684,7 +1687,7 @@ namespace
KeyValueConfigFile file;
Suffixes() :
- file(FSEntry(getenv_with_default("PALUDIS_SUFFIXES_FILE", DATADIR "/paludis/ebuild_entries_suffixes.conf")),
+ file(FSPath(getenv_with_default("PALUDIS_SUFFIXES_FILE", DATADIR "/paludis/ebuild_entries_suffixes.conf")),
{ }, &KeyValueConfigFile::no_defaults, &KeyValueConfigFile::no_transformation)
{
}
@@ -1715,7 +1718,7 @@ namespace
}
const std::shared_ptr<const ERepositoryID>
-ERepository::make_id(const QualifiedPackageName & q, const FSEntry & f) const
+ERepository::make_id(const QualifiedPackageName & q, const FSPath & f) const
{
Context context("When creating ID for '" + stringify(q) + "' from '" + stringify(f) + "':");
@@ -1877,27 +1880,28 @@ namespace
namespace
{
bool
- check_userpriv(const FSEntry & f, const Environment * env, bool mandatory)
+ check_userpriv(const FSPath & f, const Environment * env, bool mandatory)
{
Context c("When checking permissions on '" + stringify(f) + "' for userpriv:");
if (! getenv_with_default("PALUDIS_BYPASS_USERPRIV_CHECKS", "").empty())
return false;
- if (f.exists())
+ FSStat f_stat(f);
+ if (f_stat.exists())
{
- if (f.group() != env->reduced_gid())
+ if (f_stat.group() != env->reduced_gid())
{
if (mandatory)
- throw ConfigurationError("Directory '" + stringify(f) + "' owned by group '" + get_group_name(f.group())
+ throw ConfigurationError("Directory '" + stringify(f) + "' owned by group '" + get_group_name(f_stat.group())
+ "', not '" + get_group_name(env->reduced_gid()) + "'");
else
Log::get_instance()->message("e.ebuild.userpriv_disabled", ll_warning, lc_context) << "Directory '" <<
- f << "' owned by group '" << get_group_name(f.group()) << "', not '"
+ f << "' owned by group '" << get_group_name(f_stat.group()) << "', not '"
<< get_group_name(env->reduced_gid()) << "', so cannot enable userpriv";
return false;
}
- else if (! f.has_permission(fs_ug_group, fs_perm_write))
+ else if (0 == (f_stat.permissions() & S_IWGRP))
{
if (mandatory)
throw ConfigurationError("Directory '" + stringify(f) + "' does not have group write permission");
@@ -1949,7 +1953,7 @@ ERepository::fetch(const std::shared_ptr<const ERepositoryID> & id,
}
bool fetch_userpriv_ok(_imp->params.environment()->reduced_gid() != getgid() &&
- check_userpriv(FSEntry(_imp->params.distdir()), _imp->params.environment(),
+ check_userpriv(FSPath(_imp->params.distdir()), _imp->params.environment(),
id->eapi()->supported()->userpriv_cannot_use_root()));
std::string archives, all_archives;
@@ -2040,18 +2044,18 @@ ERepository::fetch(const std::shared_ptr<const ERepositoryID> & id,
((! fetch_action.options.ignore_unfetched()) && (! id->eapi()->supported()->ebuild_phases()->ebuild_fetch_extra().empty()))))
{
bool userpriv_ok((! userpriv_restrict) && (_imp->params.environment()->reduced_gid() != getgid()) &&
- check_userpriv(FSEntry(_imp->params.builddir()), _imp->params.environment(),
+ check_userpriv(FSPath(_imp->params.builddir()), _imp->params.environment(),
id->eapi()->supported()->userpriv_cannot_use_root()));
std::string use(make_use(_imp->params.environment(), *id, profile()));
std::shared_ptr<Map<std::string, std::string> > expand_vars(make_expand(
_imp->params.environment(), *id, profile()));
- std::shared_ptr<const FSEntrySequence> exlibsdirs(layout()->exlibsdirs(id->name()));
+ std::shared_ptr<const FSPathSequence> exlibsdirs(layout()->exlibsdirs(id->name()));
EAPIPhases fetch_extra_phases(id->eapi()->supported()->ebuild_phases()->ebuild_fetch_extra());
if ((! fetch_action.options.ignore_unfetched()) && (fetch_extra_phases.begin_phases() != fetch_extra_phases.end_phases()))
{
- FSEntry package_builddir(_imp->params.builddir() / (stringify(id->name().category()) + "-" +
+ FSPath package_builddir(_imp->params.builddir() / (stringify(id->name().category()) + "-" +
stringify(id->name().package()) + "-" + stringify(id->version()) + "-fetch_extra"));
for (EAPIPhases::ConstIterator phase(fetch_extra_phases.begin_phases()), phase_end(fetch_extra_phases.end_phases()) ;
@@ -2224,12 +2228,11 @@ namespace
return o;
}
- void installed_this(const FSEntry &)
+ void installed_this(const FSPath &)
{
}
- bool ignore_merged(const std::shared_ptr<const FSEntrySet> & s,
- const FSEntry & f)
+ bool ignore_merged(const std::shared_ptr<const FSPathSet> & s, const FSPath & f)
{
return s->end() != s->find(f);
}
@@ -2372,17 +2375,17 @@ ERepository::install(const std::shared_ptr<const ERepositoryID> & id,
std::shared_ptr<Map<std::string, std::string> > expand_vars(make_expand(
_imp->params.environment(), *id, profile()));
- std::shared_ptr<const FSEntrySequence> exlibsdirs(layout()->exlibsdirs(id->name()));
+ std::shared_ptr<const FSPathSequence> exlibsdirs(layout()->exlibsdirs(id->name()));
bool userpriv_ok((! userpriv_restrict) && (_imp->params.environment()->reduced_gid() != getgid()) &&
- check_userpriv(FSEntry(_imp->params.distdir()), _imp->params.environment(), id->eapi()->supported()->userpriv_cannot_use_root()) &&
- check_userpriv(FSEntry(_imp->params.builddir()), _imp->params.environment(), id->eapi()->supported()->userpriv_cannot_use_root()));
+ check_userpriv(FSPath(_imp->params.distdir()), _imp->params.environment(), id->eapi()->supported()->userpriv_cannot_use_root()) &&
+ check_userpriv(FSPath(_imp->params.builddir()), _imp->params.environment(), id->eapi()->supported()->userpriv_cannot_use_root()));
- FSEntry package_builddir(_imp->params.builddir() / (stringify(id->name().category()) + "-" +
+ FSPath package_builddir(_imp->params.builddir() / (stringify(id->name().category()) + "-" +
stringify(id->name().package()) + "-" + stringify(id->version())));
std::string used_config_protect;
- std::shared_ptr<FSEntrySet> merged_entries(std::make_shared<FSEntrySet>());
+ auto merged_entries(std::make_shared<FSPathSet>());
std::shared_ptr<const ChoiceValue> preserve_work_choice(
id->choices_key()->value()->find_by_name_with_prefix(
@@ -2441,7 +2444,7 @@ ERepository::install(const std::shared_ptr<const ERepositoryID> & id,
if (preserve_work_choice && preserve_work_choice->enabled())
extra_merger_options += mo_nondestructive;
- Timestamp build_start_time(FSEntry(package_builddir / "temp" / "build_start_time").mtim());
+ Timestamp build_start_time(FSPath(package_builddir / "temp" / "build_start_time").stat().mtim());
(*install_action.options.destination()).destination_interface()->merge(
make_named_values<MergeParams>(
n::build_start_time() = build_start_time,
@@ -2461,9 +2464,9 @@ ERepository::install(const std::shared_ptr<const ERepositoryID> & id,
if ((! id->eapi()->supported()->is_pbin()) && (! strip_restrict))
{
std::string libdir("lib");
- FSEntry root(install_action.options.destination()->installed_root_key() ?
+ FSPath root(install_action.options.destination()->installed_root_key() ?
stringify(install_action.options.destination()->installed_root_key()->value()) : "/");
- if ((root / "usr" / "lib").is_symbolic_link())
+ if ((root / "usr" / "lib").stat().is_symlink())
{
libdir = (root / "usr" / "lib").readlink();
if (std::string::npos != libdir.find_first_of("./"))
@@ -2616,7 +2619,7 @@ ERepository::info(const std::shared_ptr<const ERepositoryID> & id,
std::bind(std::equal_to<std::string>(), std::bind(std::mem_fn(&StringDepSpec::text), _1), "nouserpriv"));
}
bool userpriv_ok((! userpriv_restrict) && (_imp->params.environment()->reduced_gid() != getgid()) &&
- check_userpriv(FSEntry(_imp->params.builddir()), _imp->params.environment(), id->eapi()->supported()->userpriv_cannot_use_root()));
+ check_userpriv(FSPath(_imp->params.builddir()), _imp->params.environment(), id->eapi()->supported()->userpriv_cannot_use_root()));
/* make use */
std::string use(make_use(_imp->params.environment(), *id, profile()));
@@ -2626,7 +2629,7 @@ ERepository::info(const std::shared_ptr<const ERepositoryID> & id,
std::shared_ptr<Map<std::string, std::string> > expand_vars(make_expand(
_imp->params.environment(), *id, profile()));
- std::shared_ptr<const FSEntrySequence> exlibsdirs(layout()->exlibsdirs(id->name()));
+ std::shared_ptr<const FSPathSequence> exlibsdirs(layout()->exlibsdirs(id->name()));
EAPIPhases phases(id->eapi()->supported()->ebuild_phases()->ebuild_info());
for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
@@ -2663,7 +2666,7 @@ ERepository::info(const std::shared_ptr<const ERepositoryID> & id,
n::expand_vars() = expand_vars,
n::info_vars() = info_vars_key() ?
info_vars_key()->value() : std::make_shared<const Set<std::string>>(),
- n::load_environment() = static_cast<const FSEntry *>(0),
+ n::load_environment() = static_cast<const FSPath *>(0),
n::profiles() = _imp->params.profiles(),
n::profiles_with_parents() = profile()->profiles_with_parents(),
n::use() = use,
@@ -2708,9 +2711,9 @@ ERepository::get_environment_variable(
std::bind(std::equal_to<std::string>(), std::bind(std::mem_fn(&StringDepSpec::text), _1), "nouserpriv"));
}
bool userpriv_ok((! userpriv_restrict) && (_imp->params.environment()->reduced_gid() != getgid()) &&
- check_userpriv(FSEntry(_imp->params.builddir()), _imp->params.environment(), id->eapi()->supported()->userpriv_cannot_use_root()));
+ check_userpriv(FSPath(_imp->params.builddir()), _imp->params.environment(), id->eapi()->supported()->userpriv_cannot_use_root()));
- std::shared_ptr<const FSEntrySequence> exlibsdirs(layout()->exlibsdirs(id->name()));
+ std::shared_ptr<const FSPathSequence> exlibsdirs(layout()->exlibsdirs(id->name()));
EbuildVariableCommand cmd(make_named_values<EbuildCommandParams>(
n::builddir() = _imp->params.builddir(),
@@ -2780,12 +2783,12 @@ ERepository::merge(const MergeParams & m)
n::environment_file() = m.environment_file(),
n::fix_mtimes_before() = fix_mtimes ? m.build_start_time() : Timestamp(0, 0),
n::image() = m.image_dir(),
- n::install_under() = FSEntry("/"),
+ n::install_under() = FSPath("/"),
n::merged_entries() = m.merged_entries(),
n::options() = m.options(),
n::output_manager() = m.output_manager(),
n::package_id() = m.package_id(),
- n::root() = FSEntry("/"),
+ n::root() = FSPath("/"),
n::tar_file() = _imp->params.binary_distdir() / (bin_dist_base + ".tar")
));
@@ -2798,12 +2801,12 @@ ERepository::merge(const MergeParams & m)
if (0 != compress_process.run().wait())
throw ActionFailedError("Compressing tarball failed");
- FSEntry binary_ebuild_location(layout()->binary_ebuild_location(
+ FSPath binary_ebuild_location(layout()->binary_ebuild_location(
m.package_id()->name(), m.package_id()->version(),
"pbin-1+" + std::static_pointer_cast<const ERepositoryID>(m.package_id())->eapi()->name()));
- binary_ebuild_location.dirname().dirname().mkdir();
- binary_ebuild_location.dirname().mkdir();
+ binary_ebuild_location.dirname().dirname().mkdir(0755, { fspmkdo_ok_if_exists });
+ binary_ebuild_location.dirname().mkdir(0755, { fspmkdo_ok_if_exists });
std::string binary_keywords;
if (m.package_id()->keywords_key())
@@ -2840,12 +2843,12 @@ ERepository::merge(const MergeParams & m)
{
/* 0.1 replacing 00.1 etc */
if (is_replace->fs_location_key()->value() != binary_ebuild_location)
- FSEntry(is_replace->fs_location_key()->value()).unlink();
+ FSPath(is_replace->fs_location_key()->value()).unlink();
do
{
- FSEntry cache(_imp->params.write_cache());
- if (cache == FSEntry("/var/empty"))
+ FSPath cache(_imp->params.write_cache());
+ if (cache == FSPath("/var/empty"))
break;
if (_imp->params.append_repository_name_to_write_cache())
@@ -2854,7 +2857,7 @@ ERepository::merge(const MergeParams & m)
cache /= stringify(is_replace->name().category());
cache /= (stringify(is_replace->name().package()) + "-" + stringify(is_replace->version()));
- if (cache.is_regular_file_or_symlink_to_regular_file())
+ if (cache.stat().is_regular_file_or_symlink_to_regular_file())
cache.unlink();
}
while (false);
@@ -2868,7 +2871,7 @@ ERepository::merge(const MergeParams & m)
}
bool
-ERepository::is_package_file(const QualifiedPackageName & n, const FSEntry & e) const
+ERepository::is_package_file(const QualifiedPackageName & n, const FSPath & e) const
{
Context context("When working out whether '" + stringify(e) + "' is a package file for '" + stringify(n) + "':");
@@ -2884,7 +2887,7 @@ ERepository::is_package_file(const QualifiedPackageName & n, const FSEntry & e)
}
VersionSpec
-ERepository::extract_package_file_version(const QualifiedPackageName & n, const FSEntry & e) const
+ERepository::extract_package_file_version(const QualifiedPackageName & n, const FSPath & e) const
{
Context context("When extracting version from '" + stringify(e) + "':");
std::string::size_type p(e.basename().rfind('.'));
@@ -2926,13 +2929,13 @@ ERepository::pretend(
std::bind(std::equal_to<std::string>(), std::bind(std::mem_fn(&StringDepSpec::text), _1), "nouserpriv"));
}
bool userpriv_ok((! userpriv_restrict) && (_imp->params.environment()->reduced_gid() != getgid()) &&
- check_userpriv(FSEntry(_imp->params.builddir()), _imp->params.environment(), id->eapi()->supported()->userpriv_cannot_use_root()));
+ check_userpriv(FSPath(_imp->params.builddir()), _imp->params.environment(), id->eapi()->supported()->userpriv_cannot_use_root()));
std::string use(make_use(_imp->params.environment(), *id, profile()));
std::shared_ptr<Map<std::string, std::string> > expand_vars(make_expand(
_imp->params.environment(), *id, profile()));
- std::shared_ptr<const FSEntrySequence> exlibsdirs(layout()->exlibsdirs(id->name()));
+ std::shared_ptr<const FSPathSequence> exlibsdirs(layout()->exlibsdirs(id->name()));
std::shared_ptr<OutputManager> output_manager;
@@ -3053,7 +3056,7 @@ ERepository::pretend(
}
const std::string
-ERepository::get_package_file_manifest_key(const FSEntry & e, const QualifiedPackageName & q) const
+ERepository::get_package_file_manifest_key(const FSPath & e, const QualifiedPackageName & q) const
{
if (! is_package_file(q, e))
return "";
@@ -3073,7 +3076,7 @@ ERepository::binary_ebuild_name(const QualifiedPackageName & q, const VersionSpe
}
const std::string
-ERepository::_guess_eapi(const QualifiedPackageName &, const FSEntry & e) const
+ERepository::_guess_eapi(const QualifiedPackageName &, const FSPath & e) const
{
std::string::size_type p(e.basename().rfind('.'));
if (std::string::npos == p)
diff --git a/paludis/repositories/e/e_repository.hh b/paludis/repositories/e/e_repository.hh
index e8b4b7c..2891bb8 100644
--- a/paludis/repositories/e/e_repository.hh
+++ b/paludis/repositories/e/e_repository.hh
@@ -23,7 +23,6 @@
#include <paludis/repository.hh>
#include <paludis/package_database.hh>
#include <paludis/mask-fwd.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/pimp.hh>
#include <paludis/repositories/e/e_repository_params.hh>
#include <paludis/repositories/e/e_repository_id.hh>
@@ -64,7 +63,7 @@ namespace paludis
void need_mirrors() const;
- const std::string _guess_eapi(const QualifiedPackageName &, const FSEntry & e) const;
+ const std::string _guess_eapi(const QualifiedPackageName &, const FSPath & e) const;
protected:
virtual void need_keys_added() const;
@@ -170,8 +169,8 @@ namespace paludis
/* Keys */
virtual const std::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > info_vars_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
@@ -196,7 +195,7 @@ namespace paludis
const std::shared_ptr<const Set<UnprefixedChoiceName> > arch_flags() const PALUDIS_ATTRIBUTE((warn_unused_result));
const std::shared_ptr<const UseDesc> use_desc() const PALUDIS_ATTRIBUTE((warn_unused_result));
- const std::string eapi_for_file(const FSEntry &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+ const std::string eapi_for_file(const FSPath &) const PALUDIS_ATTRIBUTE((warn_unused_result));
///\name Set methods
///\{
@@ -208,14 +207,14 @@ namespace paludis
///\name Entries
///\{
- bool is_package_file(const QualifiedPackageName &, const FSEntry &) const
+ bool is_package_file(const QualifiedPackageName &, const FSPath &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- VersionSpec extract_package_file_version(const QualifiedPackageName &, const FSEntry &) const
+ VersionSpec extract_package_file_version(const QualifiedPackageName &, const FSPath &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
const std::shared_ptr<const erepository::ERepositoryID> make_id(
- const QualifiedPackageName &, const FSEntry &) const
+ const QualifiedPackageName &, const FSPath &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
void fetch(const std::shared_ptr<const erepository::ERepositoryID> &,
@@ -233,7 +232,7 @@ namespace paludis
void info(const std::shared_ptr<const erepository::ERepositoryID> &,
const InfoAction &) const;
- const std::string get_package_file_manifest_key(const FSEntry &, const QualifiedPackageName &) const;
+ const std::string get_package_file_manifest_key(const FSPath &, const QualifiedPackageName &) const;
const std::string binary_ebuild_name(const QualifiedPackageName &, const VersionSpec &, const std::string &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index ece9777..b593474 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -32,6 +32,7 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
#include <paludis/util/return_literal_function.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/package_id.hh>
@@ -102,9 +103,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo1"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo1/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo1"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo1/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "test-repo-1");
@@ -122,9 +123,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo2"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo2/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo2"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo2/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "x-repo2");
@@ -142,9 +143,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo3"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo3/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo3"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo3/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "x-repo3");
@@ -162,9 +163,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo1"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo1/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo1"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo1/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -191,9 +192,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo1"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo1/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo1"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo1/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -222,9 +223,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo4"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo4/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -259,9 +260,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo4"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo4/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -300,9 +301,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo4"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo4/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -350,9 +351,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo5"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo5/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo5"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo5/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -383,9 +384,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo4"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo4/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -428,9 +429,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo8"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo8/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo8"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo8/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -480,10 +481,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("write_cache", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo7/metadata/cache"));
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo7"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo7/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("write_cache", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo7/metadata/cache"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo7"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo7/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -562,9 +563,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo7"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo7/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo7"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo7/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -606,9 +607,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo9"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo9/profiles/child"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo9"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo9/profiles/child"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<ERepository> repo(std::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1))));
env.package_database()->add_repository(1, repo);
@@ -687,9 +688,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys18(std::make_shared<Map<std::string, std::string>>());
keys18->insert("format", "e");
keys18->insert("names_cache", "/var/empty");
- keys18->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo18"));
- keys18->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo18/profiles/profile"));
- keys18->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys18->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo18"));
+ keys18->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo18/profiles/profile"));
+ keys18->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo18(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys18, std::placeholders::_1)));
env.package_database()->add_repository(1, repo18);
@@ -697,9 +698,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys19(std::make_shared<Map<std::string, std::string>>());
keys19->insert("format", "e");
keys19->insert("names_cache", "/var/empty");
- keys19->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo19"));
+ keys19->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo19"));
keys19->insert("master_repository", "test-repo-18");
- keys19->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys19->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo19(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys19, std::placeholders::_1)));
env.package_database()->add_repository(1, repo19);
@@ -743,9 +744,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo10"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo10/profiles/profile/subprofile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo10"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo10/profiles/profile/subprofile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -778,9 +779,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo15"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo15/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo15"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo15/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<ERepository> repo(std::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1))));
env.package_database()->add_repository(1, repo);
@@ -820,9 +821,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo15"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo15/profiles/profile/subprofile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo15"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo15/profiles/profile/subprofile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<ERepository> repo(std::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1))));
env.package_database()->add_repository(1, repo);
@@ -868,16 +869,16 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo11"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo11/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo11"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo11/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<ERepository> repo(std::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1))));
repo->make_manifest(QualifiedPackageName("category/package"));
std::multiset<std::string> made_manifest, reference_manifest;
- SafeIFStream made_manifest_stream(FSEntry("e_repository_TEST_dir/repo11/category/package/Manifest")),
- reference_manifest_stream(FSEntry("e_repository_TEST_dir/repo11/Manifest_correct"));
+ SafeIFStream made_manifest_stream(FSPath("e_repository_TEST_dir/repo11/category/package/Manifest")),
+ reference_manifest_stream(FSPath("e_repository_TEST_dir/repo11/Manifest_correct"));
std::string line;
@@ -913,14 +914,14 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "exheres");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo12"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo12/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo12"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo12/profiles/profile"));
keys->insert("layout", "exheres");
keys->insert("eapi_when_unknown", "exheres-0");
keys->insert("eapi_when_unspecified", "exheres-0");
keys->insert("profile_eapi", "exheres-0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -953,31 +954,31 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/fetched-files",
&env, { })), { }))]->last());
TEST_CHECK(bool(fetched_files_id));
- TEST_CHECK((FSEntry("e_repository_TEST_dir") / "distdir" / "already-fetched.txt").is_regular_file());
+ TEST_CHECK((FSPath("e_repository_TEST_dir") / "distdir" / "already-fetched.txt").stat().is_regular_file());
fetched_files_id->perform_action(action);
- TEST_CHECK((FSEntry("e_repository_TEST_dir") / "distdir" / "already-fetched.txt").is_regular_file());
+ TEST_CHECK((FSPath("e_repository_TEST_dir") / "distdir" / "already-fetched.txt").stat().is_regular_file());
}
{
TestMessageSuffix suffix("fetchable files", true);
- TEST_CHECK(! (FSEntry("e_repository_TEST_dir") / "distdir" / "fetchable-1.txt").is_regular_file());
+ TEST_CHECK(! (FSPath("e_repository_TEST_dir") / "distdir" / "fetchable-1.txt").stat().is_regular_file());
const std::shared_ptr<const PackageID> fetchable_files_id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/fetchable-files",
&env, { })), { }))]->last());
TEST_CHECK(bool(fetchable_files_id));
fetchable_files_id->perform_action(action);
- TEST_CHECK((FSEntry("e_repository_TEST_dir") / "distdir" / "fetchable-1.txt").is_regular_file());
+ TEST_CHECK((FSPath("e_repository_TEST_dir") / "distdir" / "fetchable-1.txt").stat().is_regular_file());
}
{
TestMessageSuffix suffix("arrow files", true);
- TEST_CHECK(! (FSEntry("e_repository_TEST_dir") / "distdir" / "arrowed.txt").is_regular_file());
+ TEST_CHECK(! (FSPath("e_repository_TEST_dir") / "distdir" / "arrowed.txt").stat().is_regular_file());
const std::shared_ptr<const PackageID> arrow_files_id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/arrow-files",
&env, { })), { }))]->last());
TEST_CHECK(bool(arrow_files_id));
arrow_files_id->perform_action(action);
- TEST_CHECK((FSEntry("e_repository_TEST_dir") / "distdir" / "arrowed.txt").is_regular_file());
+ TEST_CHECK((FSPath("e_repository_TEST_dir") / "distdir" / "arrowed.txt").stat().is_regular_file());
}
{
@@ -1026,9 +1027,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo11"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo11/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo11"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo11/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<ERepository> repo(std::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1))));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_0.cc b/paludis/repositories/e/e_repository_TEST_0.cc
index 8dab2f6..106d475 100644
--- a/paludis/repositories/e/e_repository_TEST_0.cc
+++ b/paludis/repositories/e/e_repository_TEST_0.cc
@@ -114,14 +114,14 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_0_dir" / "repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_0_dir" / "repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_0_dir" / "repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_0_dir" / "repo/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_0_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_0_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_0_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_0_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_1.cc b/paludis/repositories/e/e_repository_TEST_1.cc
index 417c7b2..d30c80b 100644
--- a/paludis/repositories/e/e_repository_TEST_1.cc
+++ b/paludis/repositories/e/e_repository_TEST_1.cc
@@ -107,14 +107,14 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_1_dir" / "repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_1_dir" / "repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_1_dir" / "repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_1_dir" / "repo/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_1_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_1_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_1_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_1_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_2.cc b/paludis/repositories/e/e_repository_TEST_2.cc
index 6a63c6d..88d5201 100644
--- a/paludis/repositories/e/e_repository_TEST_2.cc
+++ b/paludis/repositories/e/e_repository_TEST_2.cc
@@ -107,14 +107,14 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_2_dir" / "repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_2_dir" / "repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_2_dir" / "repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_2_dir" / "repo/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_2_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_2_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_2_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_2_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_3.cc b/paludis/repositories/e/e_repository_TEST_3.cc
index ee84192..6a2fb3d 100644
--- a/paludis/repositories/e/e_repository_TEST_3.cc
+++ b/paludis/repositories/e/e_repository_TEST_3.cc
@@ -107,14 +107,14 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_3_dir" / "repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_3_dir" / "repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_3_dir" / "repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_3_dir" / "repo/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_3_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_3_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_3_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_3_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_4.cc b/paludis/repositories/e/e_repository_TEST_4.cc
index ce63a15..6971d52 100644
--- a/paludis/repositories/e/e_repository_TEST_4.cc
+++ b/paludis/repositories/e/e_repository_TEST_4.cc
@@ -107,14 +107,14 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_4_dir" / "repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_4_dir" / "repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_4_dir" / "repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_4_dir" / "repo/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_4_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_4_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_4_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_4_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc b/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc
index 9060904..1ca688e 100644
--- a/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc
+++ b/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc
@@ -97,9 +97,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dependencies_rewriter_dir" / "repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dependencies_rewriter_dir" / "repo/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dependencies_rewriter_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dependencies_rewriter_dir" / "repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dependencies_rewriter_dir" / "repo/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dependencies_rewriter_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_ever.cc b/paludis/repositories/e/e_repository_TEST_ever.cc
index f29ed9d..ed65748 100644
--- a/paludis/repositories/e/e_repository_TEST_ever.cc
+++ b/paludis/repositories/e/e_repository_TEST_ever.cc
@@ -115,14 +115,14 @@ namespace
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_ever_dir" / "repo1"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_ever_dir" / "repo1/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_ever_dir" / "repo1"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_ever_dir" / "repo1/profiles/profile"));
keys->insert("layout", "exheres");
keys->insert("eapi_when_unknown", "exheres-0");
keys->insert("eapi_when_unspecified", "exheres-0");
keys->insert("profile_eapi", "exheres-0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_ever_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_ever_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_ever_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_ever_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_exheres_0.cc b/paludis/repositories/e/e_repository_TEST_exheres_0.cc
index 0f5d831..acaf812 100644
--- a/paludis/repositories/e/e_repository_TEST_exheres_0.cc
+++ b/paludis/repositories/e/e_repository_TEST_exheres_0.cc
@@ -112,14 +112,14 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_exheres_0_dir" / "repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_exheres_0_dir" / "repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_exheres_0_dir" / "repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_exheres_0_dir" / "repo/profiles/profile"));
keys->insert("layout", "exheres");
keys->insert("eapi_when_unknown", "exheres-0");
keys->insert("eapi_when_unspecified", "exheres-0");
keys->insert("profile_eapi_when_unspecified", "exheres-0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_exheres_0_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_exheres_0_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_exheres_0_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_exheres_0_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_exlibs.cc b/paludis/repositories/e/e_repository_TEST_exlibs.cc
index 9e9254f..9c6bb89 100644
--- a/paludis/repositories/e/e_repository_TEST_exlibs.cc
+++ b/paludis/repositories/e/e_repository_TEST_exlibs.cc
@@ -123,14 +123,14 @@ namespace
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_exlibs_dir" / "repo1"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_exlibs_dir" / "repo1/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_exlibs_dir" / "repo1"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_exlibs_dir" / "repo1/profiles/profile"));
keys->insert("layout", "exheres");
keys->insert("eapi_when_unknown", "exheres-0");
keys->insert("eapi_when_unspecified", "exheres-0");
keys->insert("profile_eapi", "exheres-0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_exlibs_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_exlibs_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_exlibs_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_exlibs_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_pbin.cc b/paludis/repositories/e/e_repository_TEST_pbin.cc
index c041f0b..2831bc5 100644
--- a/paludis/repositories/e/e_repository_TEST_pbin.cc
+++ b/paludis/repositories/e/e_repository_TEST_pbin.cc
@@ -31,6 +31,7 @@
#include <paludis/util/map.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/package_id.hh>
@@ -110,19 +111,19 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- FSEntry root(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / "root");
+ FSPath root(FSPath::cwd() / "e_repository_TEST_pbin_dir" / "root");
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / ("repo" + base_eapi)));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / ("repo" + base_eapi + "/profiles/profile")));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_pbin_dir" / ("repo" + base_eapi)));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_pbin_dir" / ("repo" + base_eapi + "/profiles/profile")));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_pbin_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_pbin_dir" / "build"));
keys->insert("root", stringify(root));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -131,18 +132,18 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > b_keys(std::make_shared<Map<std::string, std::string>>());
b_keys->insert("format", "e");
b_keys->insert("names_cache", "/var/empty");
- b_keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / ("binrepo" + base_eapi)));
- b_keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / ("binrepo" + base_eapi + "/profiles/profile")));
+ b_keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_pbin_dir" / ("binrepo" + base_eapi)));
+ b_keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_pbin_dir" / ("binrepo" + base_eapi + "/profiles/profile")));
b_keys->insert("layout", "traditional");
b_keys->insert("eapi_when_unknown", "0");
b_keys->insert("eapi_when_unspecified", "0");
b_keys->insert("profile_eapi", "0");
- b_keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / "distdir"));
- b_keys->insert("binary_distdir", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / "distdir"));
+ b_keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_pbin_dir" / "distdir"));
+ b_keys->insert("binary_distdir", stringify(FSPath::cwd() / "e_repository_TEST_pbin_dir" / "distdir"));
b_keys->insert("binary_keywords_filter", "test");
b_keys->insert("binary_destination", "true");
b_keys->insert("master_repository", "repo" + base_eapi);
- b_keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / "build"));
+ b_keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_pbin_dir" / "build"));
b_keys->insert("root", stringify(root));
std::shared_ptr<Repository> b_repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, b_keys, std::placeholders::_1)));
@@ -152,7 +153,7 @@ namespace test_cases
v_keys->insert("format", "vdb");
v_keys->insert("names_cache", "/var/empty");
v_keys->insert("provides_cache", "/var/empty");
- v_keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / "vdb"));
+ v_keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_pbin_dir" / "vdb"));
v_keys->insert("root", stringify(root));
std::shared_ptr<Repository> v_repo(VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -176,7 +177,7 @@ namespace test_cases
id->perform_action(bin_action);
}
- TEST_CHECK(! (root / ("installed-" + base_eapi)).exists());
+ TEST_CHECK(! (root / ("installed-" + base_eapi)).stat().exists());
b_repo->invalidate();
{
@@ -198,7 +199,7 @@ namespace test_cases
id->perform_action(install_action);
}
- TEST_CHECK((root / ("installed-" + base_eapi)).exists());
+ TEST_CHECK((root / ("installed-" + base_eapi)).stat().exists());
}
} test_e_repository_install_eapi_pbin_0("0"), test_e_repository_install_eapi_pbin_1("1"),
test_e_repository_install_eapi_pbin_2("2"), test_e_repository_install_eapi_pbin_3("3"),
diff --git a/paludis/repositories/e/e_repository_TEST_phases.cc b/paludis/repositories/e/e_repository_TEST_phases.cc
index 1129c5b..7e36036 100644
--- a/paludis/repositories/e/e_repository_TEST_phases.cc
+++ b/paludis/repositories/e/e_repository_TEST_phases.cc
@@ -123,14 +123,14 @@ namespace
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_phases_dir" / "repo1"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_phases_dir" / "repo1/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_phases_dir" / "repo1"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_phases_dir" / "repo1/profiles/profile"));
keys->insert("layout", "exheres");
keys->insert("eapi_when_unknown", "exheres-0");
keys->insert("eapi_when_unspecified", "exheres-0");
keys->insert("profile_eapi", "exheres-0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_phases_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_phases_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_phases_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_phases_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_replacing.cc b/paludis/repositories/e/e_repository_TEST_replacing.cc
index b68234a..e873be4 100644
--- a/paludis/repositories/e/e_repository_TEST_replacing.cc
+++ b/paludis/repositories/e/e_repository_TEST_replacing.cc
@@ -116,15 +116,15 @@ namespace
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_replacing_dir" / repo_path));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_replacing_dir" / repo_path
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_replacing_dir" / repo_path));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_replacing_dir" / repo_path
/ "profiles/profile"));
keys->insert("layout", "exheres");
keys->insert("eapi_when_unknown", eapi);
keys->insert("eapi_when_unspecified", eapi);
keys->insert("profile_eapi", eapi);
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_replacing_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_replacing_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_replacing_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_replacing_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc b/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
index c8fcbb3..a69984c 100644
--- a/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
+++ b/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
@@ -108,15 +108,15 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "repo/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "symlinked_build"));
- keys->insert("root", stringify(FSEntry(stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "root")).realpath()));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "symlinked_build"));
+ keys->insert("root", stringify(FSPath(stringify(FSPath::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "root")).realpath()));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -125,9 +125,9 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "vdb"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "build"));
- keys->insert("root", stringify(FSEntry(stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "root")).realpath()));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "vdb"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "build"));
+ keys->insert("root", stringify(FSPath(stringify(FSPath::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "root")).realpath()));
std::shared_ptr<Repository> installed_repo(VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, installed_repo);
@@ -146,7 +146,7 @@ namespace test_cases
TEST_CHECK(bool(id));
id->perform_action(action);
- TEST_CHECK_EQUAL(FSEntry(stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "root/bar")).readlink(), "/foo");
+ TEST_CHECK_EQUAL(FSPath(stringify(FSPath::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "root/bar")).readlink(), "/foo");
}
} test_e_repository_symlink_rewriting;
}
diff --git a/paludis/repositories/e/e_repository_mask_file.cc b/paludis/repositories/e/e_repository_mask_file.cc
index c8201c3..fe286a6 100644
--- a/paludis/repositories/e/e_repository_mask_file.cc
+++ b/paludis/repositories/e/e_repository_mask_file.cc
@@ -51,7 +51,7 @@ namespace paludis
};
}
-MaskFile::MaskFile(const FSEntry & f, const LineConfigFileOptions & opts) :
+MaskFile::MaskFile(const FSPath & f, const LineConfigFileOptions & opts) :
Pimp<MaskFile>()
{
LineConfigFileOptions myopts(opts);
diff --git a/paludis/repositories/e/e_repository_mask_file.hh b/paludis/repositories/e/e_repository_mask_file.hh
index fdb7fd8..be1582f 100644
--- a/paludis/repositories/e/e_repository_mask_file.hh
+++ b/paludis/repositories/e/e_repository_mask_file.hh
@@ -22,7 +22,6 @@
#include <paludis/util/pimp.hh>
#include <paludis/util/attributes.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/config_file.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/mask-fwd.hh>
@@ -45,7 +44,7 @@ namespace paludis
///\name Basic operations
///\{
- MaskFile(const FSEntry &, const LineConfigFileOptions &);
+ MaskFile(const FSPath &, const LineConfigFileOptions &);
~MaskFile();
///\}
diff --git a/paludis/repositories/e/e_repository_news.cc b/paludis/repositories/e/e_repository_news.cc
index e098825..c8b8476 100644
--- a/paludis/repositories/e/e_repository_news.cc
+++ b/paludis/repositories/e/e_repository_news.cc
@@ -23,9 +23,6 @@
#include <paludis/repositories/e/extra_distribution_data.hh>
#include <paludis/util/config_file.hh>
-#include <paludis/environment.hh>
-#include <paludis/util/dir_iterator.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/log.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/pimp-impl.hh>
@@ -33,6 +30,11 @@
#include <paludis/util/options.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/safe_ofstream.hh>
+#include <paludis/util/fs_path.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_iterator.hh>
+
+#include <paludis/environment.hh>
#include <paludis/distribution.hh>
#include <paludis/elike_package_dep_spec.hh>
#include <paludis/selection.hh>
@@ -67,9 +69,9 @@ namespace paludis
const ERepository * const e_repository;
const erepository::ERepositoryParams params;
- const FSEntry news_directory;
- const FSEntry skip_file;
- const FSEntry unread_file;
+ const FSPath news_directory;
+ const FSPath skip_file;
+ const FSPath unread_file;
Imp(const Environment * const e, const ERepository * const p,
const erepository::ERepositoryParams & k) :
@@ -123,12 +125,12 @@ ERepositoryNews::update_news() const
stringify(_imp->params.newsdir()) + "' for repository '" +
stringify(_imp->e_repository->name()) + "':");
- if (! _imp->params.newsdir().is_directory_or_symlink_to_directory())
+ if (! _imp->params.newsdir().stat().is_directory_or_symlink_to_directory())
return;
std::set<std::string> skip;
- if (_imp->skip_file.is_regular_file_or_symlink_to_regular_file())
+ if (_imp->skip_file.stat().is_regular_file_or_symlink_to_regular_file())
{
Context local_context("When handling news skip file '" + stringify(
_imp->skip_file) + "':");
@@ -136,7 +138,7 @@ ERepositoryNews::update_news() const
std::copy(s.begin(), s.end(), std::inserter(skip, skip.end()));
}
- for (DirIterator d(_imp->params.newsdir()), d_end ; d != d_end ; ++d)
+ for (FSIterator d(_imp->params.newsdir(), { }), d_end ; d != d_end ; ++d)
{
Context local_context("When handling news entry '" + stringify(*d) + "':");
@@ -148,9 +150,9 @@ ERepositoryNews::update_news() const
return;
}
- if (! d->is_directory_or_symlink_to_directory())
+ if (! d->stat().is_directory_or_symlink_to_directory())
continue;
- if (! (*d / (d->basename() + ".en.txt")).is_regular_file_or_symlink_to_regular_file())
+ if (! (*d / (d->basename() + ".en.txt")).stat().is_regular_file_or_symlink_to_regular_file())
continue;
if (skip.end() != skip.find(d->basename()))
@@ -198,8 +200,8 @@ ERepositoryNews::update_news() const
Context header_context("When checking Display-If-Profile headers:");
bool local_show(false);
- std::shared_ptr<const FSEntrySequence> c(_imp->params.profiles());
- for (FSEntrySequence::ConstIterator p(c->begin()), p_end(c->end()) ; p != p_end ; ++p)
+ std::shared_ptr<const FSPathSequence> c(_imp->params.profiles());
+ for (FSPathSequence::ConstIterator p(c->begin()), p_end(c->end()) ; p != p_end ; ++p)
{
std::string profile(strip_leading_string(strip_trailing_string(
strip_leading_string(stringify(p->realpath()),
@@ -267,7 +269,7 @@ namespace paludis
};
}
-NewsFile::NewsFile(const FSEntry & our_filename) :
+NewsFile::NewsFile(const FSPath & our_filename) :
Pimp<NewsFile>()
{
Context context("When parsing GLEP 42 news file '" + stringify(our_filename) + "':");
@@ -389,7 +391,7 @@ NewsFile::end_display_if_profile() const
return DisplayIfProfileConstIterator(_imp->display_if_profile.end());
}
-NewsError::NewsError(const FSEntry & f, const std::string & m) throw () :
+NewsError::NewsError(const FSPath & f, const std::string & m) throw () :
Exception("Error in news file '" + stringify(f) + "': " + m)
{
}
diff --git a/paludis/repositories/e/e_repository_news.hh b/paludis/repositories/e/e_repository_news.hh
index cb15a45..cb3c274 100644
--- a/paludis/repositories/e/e_repository_news.hh
+++ b/paludis/repositories/e/e_repository_news.hh
@@ -33,7 +33,6 @@
namespace paludis
{
class Environment;
- class FSEntry;
class ERepository;
/**
@@ -65,7 +64,7 @@ namespace paludis
public Exception
{
public:
- NewsError(const FSEntry &, const std::string &) throw ();
+ NewsError(const FSPath &, const std::string &) throw ();
};
/**
@@ -84,7 +83,7 @@ namespace paludis
/**
* Constructor, from a filename.
*/
- NewsFile(const FSEntry & filename);
+ NewsFile(const FSPath & filename);
~NewsFile();
diff --git a/paludis/repositories/e/e_repository_params.hh b/paludis/repositories/e/e_repository_params.hh
index c83b89e..30112a3 100644
--- a/paludis/repositories/e/e_repository_params.hh
+++ b/paludis/repositories/e/e_repository_params.hh
@@ -20,8 +20,9 @@
#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_E_E_REPOSITORY_PARAMS_HH
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_E_E_REPOSITORY_PARAMS_HH 1
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_path.hh>
#include <paludis/util/named_value.hh>
+#include <memory>
/** \file
* Declaration for the ERepositoryParams class.
@@ -81,34 +82,34 @@ namespace paludis
NamedValue<n::append_repository_name_to_write_cache, bool> append_repository_name_to_write_cache;
NamedValue<n::auto_profiles, bool> auto_profiles;
NamedValue<n::binary_destination, bool> binary_destination;
- NamedValue<n::binary_distdir, FSEntry> binary_distdir;
+ NamedValue<n::binary_distdir, FSPath> binary_distdir;
NamedValue<n::binary_keywords_filter, std::string> binary_keywords_filter;
NamedValue<n::binary_uri_prefix, std::string> binary_uri_prefix;
- NamedValue<n::builddir, FSEntry> builddir;
- NamedValue<n::cache, FSEntry> cache;
- NamedValue<n::distdir, FSEntry> distdir;
+ NamedValue<n::builddir, FSPath> builddir;
+ NamedValue<n::cache, FSPath> cache;
+ NamedValue<n::distdir, FSPath> distdir;
NamedValue<n::eapi_when_unknown, std::string> eapi_when_unknown;
NamedValue<n::eapi_when_unspecified, std::string> eapi_when_unspecified;
- NamedValue<n::eclassdirs, std::shared_ptr<const FSEntrySequence> > eclassdirs;
+ NamedValue<n::eclassdirs, std::shared_ptr<const FSPathSequence> > eclassdirs;
NamedValue<n::entry_format, std::string> entry_format;
NamedValue<n::environment, Environment *> environment;
NamedValue<n::ignore_deprecated_profiles, bool> ignore_deprecated_profiles;
NamedValue<n::layout, std::string> layout;
- NamedValue<n::location, FSEntry> location;
+ NamedValue<n::location, FSPath> location;
NamedValue<n::master_repositories, std::shared_ptr<const ERepositorySequence> > master_repositories;
- NamedValue<n::names_cache, FSEntry> names_cache;
- NamedValue<n::newsdir, FSEntry> newsdir;
+ NamedValue<n::names_cache, FSPath> names_cache;
+ NamedValue<n::newsdir, FSPath> newsdir;
NamedValue<n::profile_eapi_when_unspecified, std::string> profile_eapi_when_unspecified;
NamedValue<n::profile_layout, std::string> profile_layout;
- NamedValue<n::profiles, std::shared_ptr<const FSEntrySequence> > profiles;
+ NamedValue<n::profiles, std::shared_ptr<const FSPathSequence> > profiles;
NamedValue<n::profiles_explicitly_set, bool> profiles_explicitly_set;
- NamedValue<n::securitydir, FSEntry> securitydir;
- NamedValue<n::setsdir, FSEntry> setsdir;
+ NamedValue<n::securitydir, FSPath> securitydir;
+ NamedValue<n::setsdir, FSPath> setsdir;
NamedValue<n::sync, std::string> sync;
NamedValue<n::sync_options, std::string> sync_options;
NamedValue<n::use_manifest, erepository::UseManifest> use_manifest;
NamedValue<n::write_bin_uri_prefix, std::string> write_bin_uri_prefix;
- NamedValue<n::write_cache, FSEntry> write_cache;
+ NamedValue<n::write_cache, FSPath> write_cache;
};
}
diff --git a/paludis/repositories/e/e_repository_sets.cc b/paludis/repositories/e/e_repository_sets.cc
index c380d68..1f8771c 100644
--- a/paludis/repositories/e/e_repository_sets.cc
+++ b/paludis/repositories/e/e_repository_sets.cc
@@ -42,8 +42,6 @@
#include <paludis/version_requirements.hh>
#include <paludis/util/config_file.hh>
-#include <paludis/util/dir_iterator.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/log.hh>
#include <paludis/util/make_named_values.hh>
@@ -54,6 +52,8 @@
#include <paludis/util/strip.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_iterator.hh>
#include <functional>
#include <algorithm>
@@ -114,11 +114,11 @@ ERepositorySets::package_set(const SetName & ss) const
std::pair<SetName, SetFileSetOperatorMode> s(find_base_se