/* * Copyright (C) 2021-2022,2025 Riyyi * * SPDX-License-Identifier: MIT */ #pragma once #include // uint8_t #include #include #include #include "ruc/singleton.h" #define PACKAGE_FILE "./packages" class Package : public ruc::Singleton { public: Package(s); virtual ~Package(); enum class Distro : uint8_t { Unsupported, Arch, Debian, }; enum class InstallType : uint8_t { Install, AurInstall, }; void aurInstall(const std::vector& targets = {}); void install(const std::vector& targets = {}); void list(const std::vector& targets = {}, bool partialMatch = false); private: std::optional fetchAurHelper(); void installOrAurInstall(InstallType type, const std::string& file); bool findDependency(const std::string& search); bool distroDetect(); bool distroDependencies(); std::optional getPackageList(); Distro m_distro { Distro::Unsupported }; };