@@ -60,14 +60,20 @@ struct Main {
60
60
}
61
61
62
62
auto make_realm_filter () const noexcept -> RMAN::Filter {
63
+ constexpr auto RE_FLAGS = std::regex::optimize | std::regex::icase | std::regex::basic;
64
+ if (cli.inrelease .ends_with (' /' )) {
65
+ return RMAN::Filter{
66
+ .path = std::regex{cli.inrelease + " .*" , RE_FLAGS},
67
+ };
68
+ }
63
69
if (auto [realm, rest] = str_split (cli.inrelease , " projects/" ); !realm.empty () && !rest.empty ()) {
64
70
return RMAN::Filter{
65
- .path = std::regex{std::string (realm) + " .*" , std::regex::optimize | std::regex::icase },
71
+ .path = std::regex{std::string (realm) + " .*" , RE_FLAGS },
66
72
};
67
73
}
68
74
if (auto [realm, rest] = str_split (cli.inrelease , " solutions/" ); !realm.empty () && !rest.empty ()) {
69
75
return RMAN::Filter{
70
- .path = std::regex{std::string (realm) + " .*" , std::regex::optimize | std::regex::icase },
76
+ .path = std::regex{std::string (realm) + " .*" , RE_FLAGS },
71
77
};
72
78
}
73
79
return {};
@@ -93,6 +99,9 @@ struct Main {
93
99
}
94
100
95
101
auto process (auto const & path, auto const & lookup, auto const & provider, auto && cb) const -> void {
102
+ if (path.ends_with (" /" )) {
103
+ return process_manual (path, lookup, cb);
104
+ }
96
105
if (path.find (" projects/" ) != std::string::npos) {
97
106
return process_rls (path, lookup, provider, cb);
98
107
}
@@ -120,6 +129,7 @@ struct Main {
120
129
auto process_rls (auto const & path, auto const & lookup, auto const & provider, auto && cb) const -> void {
121
130
try {
122
131
rlib_trace (" path: %s" , path.c_str ());
132
+ rlib_assert (path.ends_with (" releasemanifest" ));
123
133
auto data = read_file (path, lookup, provider);
124
134
auto [realm, rest] = str_split (path, " projects/" );
125
135
auto rls = rads::RLS::read (data);
@@ -145,6 +155,7 @@ struct Main {
145
155
auto process_sln (auto const & path, auto const & lookup, auto const & provider, auto && cb) const -> void {
146
156
try {
147
157
rlib_trace (" path: %s" , path.c_str ());
158
+ rlib_assert (path.ends_with (" solutionmanifest" ));
148
159
auto data = read_file (path, lookup, provider);
149
160
auto [realm, rest] = str_split (path, " solutions/" );
150
161
auto sln = rads::SLN::read (data);
@@ -166,6 +177,19 @@ struct Main {
166
177
error_stack ().clear ();
167
178
}
168
179
}
180
+
181
+ auto process_manual (auto path, auto const & lookup, auto && cb) const -> void {
182
+ rlib_trace (" path: %s" , path.c_str ());
183
+ std::transform (path.begin (), path.end (), path.begin (), ::tolower);
184
+ for (auto const & [name, file] : lookup) {
185
+ if (!name.starts_with (path)) {
186
+ continue ;
187
+ }
188
+ auto rfile = RMAN::File (*file);
189
+ rfile.path = rfile.path .substr (path.size ());
190
+ cb (std::move (rfile));
191
+ }
192
+ }
169
193
};
170
194
171
195
int main (int argc, char ** argv) {
0 commit comments