mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-24 03:25:02 +00:00
Utilities/pkg: Rename ports_database => default_ports_database_path
This commit is contained in:
parent
8b189b7eb0
commit
b201a91e72
|
@ -22,7 +22,7 @@ Optional<InstalledPort::Type> InstalledPort::type_from_string(StringView type)
|
||||||
|
|
||||||
ErrorOr<HashMap<String, InstalledPort>> InstalledPort::read_ports_database()
|
ErrorOr<HashMap<String, InstalledPort>> InstalledPort::read_ports_database()
|
||||||
{
|
{
|
||||||
auto file = TRY(Core::File::open(ports_database, Core::File::OpenMode::Read));
|
auto file = TRY(Core::File::open(default_ports_database_path, Core::File::OpenMode::Read));
|
||||||
auto buffered_file = TRY(Core::InputBufferedFile::create(move(file)));
|
auto buffered_file = TRY(Core::InputBufferedFile::create(move(file)));
|
||||||
auto buffer = TRY(ByteBuffer::create_uninitialized(PAGE_SIZE));
|
auto buffer = TRY(ByteBuffer::create_uninitialized(PAGE_SIZE));
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#include <AK/Variant.h>
|
#include <AK/Variant.h>
|
||||||
#include <LibSemVer/SemVer.h>
|
#include <LibSemVer/SemVer.h>
|
||||||
|
|
||||||
constexpr StringView ports_database = "/usr/Ports/installed.db"sv;
|
constexpr StringView default_ports_database_path = "/usr/Ports/installed.db"sv;
|
||||||
|
|
||||||
class InstalledPort : public Port {
|
class InstalledPort : public Port {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -81,8 +81,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
return_value = TRY(AvailablePort::update_available_ports_list_file());
|
return_value = TRY(AvailablePort::update_available_ports_list_file());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Core::System::access(ports_database, R_OK).is_error()) {
|
if (Core::System::access(default_ports_database_path, R_OK).is_error()) {
|
||||||
warnln("pkg: {} isn't accessible, did you install a package in the past?", ports_database);
|
warnln("pkg: {} isn't accessible, did you install a package in the past?", default_ports_database_path);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
HashMap<String, InstalledPort> installed_ports = TRY(InstalledPort::read_ports_database());
|
HashMap<String, InstalledPort> installed_ports = TRY(InstalledPort::read_ports_database());
|
||||||
|
|
Loading…
Reference in a new issue