]> git.saurik.com Git - cydia.git/blobdiff - Sources.mm
Objective-C seriously didn't notice my mistake :/.
[cydia.git] / Sources.mm
index 790dd1bff51882ebb2e1fa3054d4edccb1bd07b9..418ea081914ce604b96abcc4010a70fe5030ab25 100644 (file)
 **/
 /* }}} */
 
+#include "CyteKit/UCPlatform.h"
+
 #include <Foundation/Foundation.h>
 #include <Menes/ObjectHandle.h>
-#include <CyteKit/UCPlatform.h>
 
 #include <cstdio>
 
 #include "Sources.h"
 
+NSString *Cache_;
+
+NSString *Cache(const char *file) {
+    return [NSString stringWithFormat:@"%@/%s", Cache_, file];
+}
+
 extern _H<NSMutableDictionary> Sources_;
 
 void CydiaWriteSources() {
-    unlink(SOURCES_LIST);
-    FILE *file(fopen(SOURCES_LIST, "w"));
+    auto sources([SOURCES_LIST UTF8String]);
+    unlink(sources);
+    FILE *file(fopen(sources, "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]);