X-Git-Url: https://git.saurik.com/cydia.git/blobdiff_plain/4e47935026ff175a7b1db931ac6263a2f34fd0fa..837b7c8801dabaec33c55494047540b6ac6ef22d:/Sources.mm?ds=sidebyside diff --git a/Sources.mm b/Sources.mm index 790dd1bf..418ea081 100644 --- a/Sources.mm +++ b/Sources.mm @@ -19,24 +19,35 @@ **/ /* }}} */ +#include "CyteKit/UCPlatform.h" + #include #include -#include #include #include "Sources.h" +NSString *Cache_; + +NSString *Cache(const char *file) { + return [NSString stringWithFormat:@"%@/%s", Cache_, file]; +} + extern _H 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]);