Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ public class MainTmt extends Main {
private Optional<URI> TESTING_FARM_GIT_URL = Optional.empty();
private Map<String, List<LogEntry>> additionalLogs = new TreeMap<>();

private static final Pattern URL_PACKAGE_NAME_PATTERN = Pattern.compile(".*/rpms/(.*)");

private static String getenv(String key) {
var result = System.getenv(key);
if (result == null) {
Expand Down Expand Up @@ -225,15 +223,27 @@ protected Map<String, Validator> select(Map<String, Validator> validators) throw
@Override
protected Iterable<RpmPackage> findRpms() throws Exception {
logger.debug("TESTING_FARM_GIT_URL: {0}", Decorated.plain(TESTING_FARM_GIT_URL.map(String::valueOf).orElse("")));
var packageName = TESTING_FARM_GIT_URL.map(uri -> {
var uriPath = uri.getPath();
var begin = uriPath.lastIndexOf('/');
if (begin == -1) {
begin = 0;
}
var end = uriPath.length();
if (uriPath.endsWith(".git")) {
end -= 4;
}
return uriPath.substring(begin, end);
});
packageName.ifPresent(name -> {
logger.debug("Tested source package: {0}", Decorated.plain(name));
});
var rpms = new ArrayList<RpmPackage>();
var it = ArgFileIterator.create(parameters.argPaths);
while (it.hasNext()) {
var rpm = it.next();
if (TESTING_FARM_GIT_URL.isPresent()) {
var matcher = URL_PACKAGE_NAME_PATTERN.matcher(TESTING_FARM_GIT_URL.get().getPath());
if (matcher.matches() && !matcher.group(1).equals(rpm.getInfo().getSourceName())) {
continue;
}
if (packageName.isPresent() && packageName.get().equals(rpm.getInfo().getSourceName())) {
continue;
}
rpms.add(rpm);
}
Expand Down