mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
install: Prefer FileSystem over DeprecatedFile
This commit is contained in:
parent
5031603cdc
commit
6c9383ce89
Notes:
sideshowbarker
2024-07-16 22:34:39 +09:00
Author: https://github.com/BenWiederhake Commit: https://github.com/SerenityOS/serenity/commit/6c9383ce89 Pull-request: https://github.com/SerenityOS/serenity/pull/18815 Reviewed-by: https://github.com/gmta ✅
2 changed files with 7 additions and 6 deletions
|
@ -100,6 +100,7 @@ target_link_libraries(icc PRIVATE LibGfx LibVideo)
|
|||
target_link_libraries(image PRIVATE LibGfx)
|
||||
target_link_libraries(image2bin PRIVATE LibGfx)
|
||||
target_link_libraries(ini PRIVATE LibFileSystem)
|
||||
target_link_libraries(install-bin PRIVATE LibFileSystem)
|
||||
target_link_libraries(jail-attach PRIVATE LibCore LibMain)
|
||||
target_link_libraries(jail-create PRIVATE LibCore LibMain)
|
||||
target_link_libraries(js PRIVATE LibCrypto LibJS LibLine LibLocale LibTextCodec)
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
#include <AK/LexicalPath.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibCore/ArgsParser.h>
|
||||
#include <LibCore/DeprecatedFile.h>
|
||||
#include <LibCore/Directory.h>
|
||||
#include <LibCore/FilePermissionsMask.h>
|
||||
#include <LibCore/System.h>
|
||||
#include <LibFileSystem/FileSystem.h>
|
||||
#include <LibMain/Main.h>
|
||||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
|
@ -35,8 +35,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
DeprecatedString destination_dir = (sources.size() > 1 ? DeprecatedString { destination } : LexicalPath::dirname(destination));
|
||||
|
||||
if (create_leading_dest_components) {
|
||||
DeprecatedString destination_dir_absolute = Core::DeprecatedFile::absolute_path(destination_dir);
|
||||
MUST(Core::Directory::create(destination_dir_absolute, Core::Directory::CreateDirectories::Yes));
|
||||
String destination_dir_absolute = TRY(FileSystem::absolute_path(destination_dir));
|
||||
MUST(Core::Directory::create(destination_dir_absolute.to_deprecated_string(), Core::Directory::CreateDirectories::Yes));
|
||||
}
|
||||
|
||||
for (auto const& source : sources) {
|
||||
|
@ -47,9 +47,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
final_destination = destination;
|
||||
}
|
||||
|
||||
TRY(Core::DeprecatedFile::copy_file_or_directory(final_destination, source, Core::DeprecatedFile::RecursionMode::Allowed,
|
||||
Core::DeprecatedFile::LinkMode::Disallowed, Core::DeprecatedFile::AddDuplicateFileMarker::No,
|
||||
Core::DeprecatedFile::PreserveMode::Nothing));
|
||||
TRY(FileSystem::copy_file_or_directory(final_destination, source, FileSystem::RecursionMode::Allowed,
|
||||
FileSystem::LinkMode::Disallowed, FileSystem::AddDuplicateFileMarker::No,
|
||||
FileSystem::PreserveMode::Nothing));
|
||||
|
||||
auto current_access = TRY(Core::System::stat(final_destination));
|
||||
TRY(Core::System::chmod(final_destination, permission_mask.apply(current_access.st_mode)));
|
||||
|
|
Loading…
Reference in a new issue