**/
/* }}} */
+#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]);