]> git.saurik.com Git - cydia.git/blobdiff - Sources.mm
Removing a repository was just kind of locking up.
[cydia.git] / Sources.mm
index 4cc2f9e927d43db7ef8d867c5422e681a7e787ff..f89ed1890f8d36071c6b05445e3693266ce750a1 100644 (file)
 #include "Sources.h"
 
 extern _H<NSMutableDictionary> Sources_;
-extern bool Changed_;
 
 void CydiaWriteSources() {
+    unlink(SOURCES_LIST);
     FILE *file(fopen(SOURCES_LIST, "w"));
     _assert(file != NULL);
 
     fprintf(file, "deb http://apt.saurik.com/ ios/%.2f main\n", kCFCoreFoundationVersionNumber);
 
     for (NSString *key in [Sources_ allKeys]) {
+        if ([key hasPrefix:@"deb:http:"] && [Sources_ objectForKey:[NSString stringWithFormat:@"deb:https:%s", [key UTF8String] + 9]])
+            continue;
+
         NSDictionary *source([Sources_ objectForKey:key]);
 
         NSArray *sections([source objectForKey:@"Sections"] ?: [NSArray array]);
@@ -55,7 +58,6 @@ void CydiaWriteSources() {
 
 void CydiaAddSource(NSDictionary *source) {
     [Sources_ setObject:source forKey:[NSString stringWithFormat:@"%@:%@:%@", [source objectForKey:@"Type"], [source objectForKey:@"URI"], [source objectForKey:@"Distribution"]]];
-    Changed_ = true;
 }
 
 void CydiaAddSource(NSString *href, NSString *distribution, NSArray *sections) {