summaryrefslogtreecommitdiff
path: root/Sources.mm
diff options
context:
space:
mode:
authorSam Bingner <sam@bingner.com>2018-10-15 15:00:44 -1000
committerSam Bingner <sam@bingner.com>2019-05-27 14:27:40 -1000
commit59aa7ad8769041d89f7c635e887224d40503fa2b (patch)
tree8a1d2551a97b612f511668ae642e87eebd440f20 /Sources.mm
parent2dc87015cb656153fdf7d492b091424636b32d84 (diff)
Refuse to load electra repos
Diffstat (limited to 'Sources.mm')
-rw-r--r--Sources.mm12
1 files changed, 12 insertions, 0 deletions
diff --git a/Sources.mm b/Sources.mm
index 2580893..d3bf841 100644
--- a/Sources.mm
+++ b/Sources.mm
@@ -58,6 +58,10 @@ void CydiaWriteSources() {
if ([[source objectForKey:@"URI"] hasPrefix:@"http://apt.bingner.com"] || [[source objectForKey:@"URI"] hasPrefix:@"https://apt.bingner.com"])
continue;
+ // Don't add Electra sources
+ if ([[source objectForKey:@"URI"] rangeOfString:@"electra" options:NSCaseInsensitiveSearch].location != NSNotFound)
+ continue;
+
NSArray *sections([source objectForKey:@"Sections"] ?: [NSArray array]);
fprintf(file, "%s %s %s%s%s\n",
@@ -73,6 +77,14 @@ void CydiaWriteSources() {
}
void CydiaAddSource(NSDictionary *source) {
+ // Ignore it if main source is added again
+ if ([[source objectForKey:@"URI"] hasPrefix:@"http://apt.bingner.com"] || [[source objectForKey:@"URI"] hasPrefix:@"https://apt.bingner.com"])
+ return;
+
+ // Don't add Electra sources
+ if ([[source objectForKey:@"URI"] rangeOfString:@"electra" options:NSCaseInsensitiveSearch].location != NSNotFound)
+ return;
+
[Sources_ setObject:source forKey:[NSString stringWithFormat:@"%@:%@:%@", [source objectForKey:@"Type"], [source objectForKey:@"URI"], [source objectForKey:@"Distribution"]]];
}