diff --git a/src/tools/get_package_dependencies/get_package_dependencies.cpp b/src/tools/get_package_dependencies/get_package_dependencies.cpp
index 63d5439..f51f101 100644
a
|
b
|
|
1 | 1 | /* |
2 | | * Copyright 2013, Haiku, Inc. All Rights Reserved. |
| 2 | * Copyright 2013-2016, Haiku, Inc. All Rights Reserved. |
3 | 3 | * Distributed under the terms of the MIT License. |
4 | 4 | * |
5 | 5 | * Authors: |
6 | 6 | * Ingo Weinhold <ingo_weinhold@gmx.de> |
| 7 | * Alexander von Gluck IV <kallisti5@unixzen.com> |
7 | 8 | */ |
8 | 9 | |
9 | 10 | |
… |
… |
|
13 | 14 | |
14 | 15 | #include <map> |
15 | 16 | |
16 | | #include <package/RepositoryCache.h> |
| 17 | #include <package/RepositoryConfig.h> |
17 | 18 | #include <package/manager/Exceptions.h> |
18 | 19 | #include <package/manager/RepositoryBuilder.h> |
19 | 20 | #include <package/solver/Solver.h> |
… |
… |
main(int argc, const char* const* argv)
|
93 | 94 | DIE(B_OK, "%s", e.Details().String()); |
94 | 95 | } |
95 | 96 | |
96 | | // add external repositories |
97 | | std::map<BSolverRepository*, BRepositoryInfo> repositoryInfos; |
| 97 | // add specified remote repositories |
| 98 | std::map<BSolverRepository*, BString> repositoryURLs; |
98 | 99 | for (int i = 0; i < repositoryCount; i++) { |
99 | 100 | BSolverRepository* repository = new BSolverRepository; |
100 | | BRepositoryCache cache; |
101 | | error = cache.SetTo(repositories[i]); |
| 101 | BRepositoryConfig config; |
| 102 | error = config.SetTo(repositories[i]); |
102 | 103 | if (error != B_OK) |
103 | | DIE(error, "failed to read repository file '%s'", repositories[i]); |
104 | | BRepositoryBuilder(*repository, cache) |
| 104 | DIE(error, "failed to read repository config '%s'", repositories[i]); |
| 105 | BRepositoryBuilder(*repository, config) |
105 | 106 | .AddToSolver(solver, false); |
106 | | repositoryInfos[repository] = cache.Info(); |
| 107 | repositoryURLs[repository] = config.BaseURL(); |
| 108 | printf("%s: BASE: %s\n", __func__, config.BaseURL().String()); |
107 | 109 | } |
108 | 110 | |
109 | 111 | // solve |
… |
… |
main(int argc, const char* const* argv)
|
152 | 154 | switch (element->Type()) { |
153 | 155 | case BSolverResultElement::B_TYPE_INSTALL: |
154 | 156 | if (package->Repository() != &installedRepository) { |
155 | | const BRepositoryInfo& info |
156 | | = repositoryInfos[package->Repository()]; |
157 | | BString url = info.OriginalBaseURL(); |
| 157 | BString url = repositoryURLs[package->Repository()]; |
158 | 158 | url << "/packages/" << package->Info().CanonicalFileName(); |
159 | 159 | printf("%s\n", url.String()); |
160 | 160 | } |