remove getDatabaseFromRegex

This commit is contained in:
AustrianToast 2023-06-19 22:37:52 +02:00
parent 82a854dd8b
commit 65b15f657d
No known key found for this signature in database
GPG Key ID: 5CD422268E489EB4

View File

@ -118,21 +118,10 @@ public class PacserverUtils {
public List<String> databasesToTransfer = new List<String>(); public List<String> databasesToTransfer = new List<String>();
public void filterDiffOutputForDatabases() { public void filterDiffOutputForDatabases() {
foreach (string database in diffOfPackagesOrDatabases) { foreach (string database in diffOfPackagesOrDatabases) {
databasesToTransfer.Add(getDatabaseFromRegex(database, @"\/(?:[\w.-]+\/)*[\w.-]+(?:\.\w+)*\/*db")); // https://regex101.com/r/Wm5M0P/1 databasesToTransfer.Add(Regex.Match(database, @"\/(?:[\w.-]+\/)*[\w.-]+(?:\.\w+)*\/*db").Value); // https://regex101.com/r/Wm5M0P/1
} }
} }
public string getDatabaseFromRegex(string input, string pattern) {
string match = string.Empty;
MatchCollection matchCollection = Regex.Matches(input, pattern);
foreach (Match matches in matchCollection) {
match = matches.Value;
}
return match;
}
private static List<String> newerPackagesAndDatabases = new List<String>(); private static List<String> newerPackagesAndDatabases = new List<String>();
public async void transferPacmanCache() { public async void transferPacmanCache() {
HttpClient client = new HttpClient(); HttpClient client = new HttpClient();