Skip to content

Commit

Permalink
wii: add constructor for defaulting to OSC repo
Browse files Browse the repository at this point in the history
  • Loading branch information
vgmoose committed Mar 16, 2024
1 parent 42677b5 commit a04821a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
9 changes: 7 additions & 2 deletions src/Get.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ bool debug = false;
Get::Get(
std::string_view config_dir,
std::string_view defaultRepo,
bool performInitialLoad
bool performInitialLoad,
std::string defaultRepoType
)
: mDefaultRepo(defaultRepo)
: mDefaultRepo(defaultRepo), mDefaultRepoType(defaultRepoType)
{

// the path for the get metadata folder
Expand Down Expand Up @@ -198,7 +199,11 @@ void Get::loadRepos()
{
printf("--> Could not load repos from %s, generating default GET repos.json\n", config_path.c_str());

#if defined(WII)
auto defaultRepo = GetRepo::createRepo("Default Repo", this->mDefaultRepo, true, this->mDefaultRepoType, mPkg_path);
#else
auto defaultRepo = std::make_unique<GetRepo>("Default Repo", this->mDefaultRepo, true);
#endif

Document d;
d.Parse(Repo::generateRepoJson(*defaultRepo).c_str());
Expand Down
4 changes: 3 additions & 1 deletion src/Get.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class Get
Get(
std::string_view config_dir,
std::string_view defaultRepo,
bool performInitialLoad = true
bool performInitialLoad = true,
std::string defaultRepoType = "get"
);

int install(Package& pkg_name); // download the given package name and manifest data
Expand Down Expand Up @@ -66,5 +67,6 @@ class Get
std::vector<std::shared_ptr<Package>> packages;

std::string mDefaultRepo;
std::string mDefaultRepoType;
};
#endif
22 changes: 11 additions & 11 deletions tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ int main()
// due to this dependency, if one fails, the rest don't execute
// they will always run in the order defined here, though
vector<std::unique_ptr<Test>> tests ;
// tests.push_back(std::make_unique<InitCheck>());
// tests.push_back(std::make_unique<CheckPackages>());
// tests.push_back(std::make_unique<InstallPackages>());
// tests.push_back(std::make_unique<InstallPackages2>());
// tests.push_back(std::make_unique<Search>());
// tests.push_back(std::make_unique<RemovePackages>());
// tests.push_back(std::make_unique<UpgradePackages>());
// tests.push_back(std::make_unique<ContentTest>());
// tests.push_back(std::make_unique<FakeManifestTest>());
// tests.push_back(std::make_unique<FakeManifestUpgradeTest>());
// tests.push_back(std::make_unique<PackagesSortedTest>());
tests.push_back(std::make_unique<InitCheck>());
tests.push_back(std::make_unique<CheckPackages>());
tests.push_back(std::make_unique<InstallPackages>());
tests.push_back(std::make_unique<InstallPackages2>());
tests.push_back(std::make_unique<Search>());
tests.push_back(std::make_unique<RemovePackages>());
tests.push_back(std::make_unique<UpgradePackages>());
tests.push_back(std::make_unique<ContentTest>());
tests.push_back(std::make_unique<FakeManifestTest>());
tests.push_back(std::make_unique<FakeManifestUpgradeTest>());
tests.push_back(std::make_unique<PackagesSortedTest>());
tests.push_back(std::make_unique<RepoAddAndRemoveTest>());

// main test loop that goes through all our tests, and prints out
Expand Down

0 comments on commit a04821a

Please sign in to comment.