summaryrefslogtreecommitdiff
path: root/Userland/Utilities
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2023-05-13 13:23:30 +0200
committerJelle Raaijmakers <jelle@gmta.nl>2023-05-19 21:12:15 +0200
commit6c9383ce89d396684240d995513cdacc4850bb97 (patch)
tree2ada7d9e5578660f59a75dcb17b5feda249983af /Userland/Utilities
parent5031603cdcbda19425727c6c72e6324a41515951 (diff)
downloadserenity-6c9383ce89d396684240d995513cdacc4850bb97.zip
install: Prefer FileSystem over DeprecatedFile
Diffstat (limited to 'Userland/Utilities')
-rw-r--r--Userland/Utilities/CMakeLists.txt1
-rw-r--r--Userland/Utilities/install.cpp12
2 files changed, 7 insertions, 6 deletions
diff --git a/Userland/Utilities/CMakeLists.txt b/Userland/Utilities/CMakeLists.txt
index cc4f9b3418..e2d3d65805 100644
--- a/Userland/Utilities/CMakeLists.txt
+++ b/Userland/Utilities/CMakeLists.txt
@@ -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)
diff --git a/Userland/Utilities/install.cpp b/Userland/Utilities/install.cpp
index 8afe3f50a4..2c2ef4478f 100644
--- a/Userland/Utilities/install.cpp
+++ b/Userland/Utilities/install.cpp
@@ -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)));