X-Git-Url: https://git.saurik.com/cydia.git/blobdiff_plain/6d9696a59dd8fe72d3c46e0703d2a019806b50ed..09e03d2385c301e68025da688831f50dd2e3734d:/Sources.mm diff --git a/Sources.mm b/Sources.mm index 21ab1419..f89ed189 100644 --- a/Sources.mm +++ b/Sources.mm @@ -1,5 +1,5 @@ /* Cydia - iPhone UIKit Front-End for Debian APT - * Copyright (C) 2008-2012 Jay Freeman (saurik) + * Copyright (C) 2008-2013 Jay Freeman (saurik) */ /* GNU General Public License, Version 3 {{{ */ @@ -20,21 +20,26 @@ /* }}} */ #include -#include +#include #include #include +#include "Sources.h" + extern _H Sources_; -extern bool Changed_; void CydiaWriteSources() { - FILE *file(fopen("/etc/apt/sources.list.d/cydia.list", "w")); + 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]); @@ -53,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) {