]> git.saurik.com Git - cydia.git/blobdiff - Sources.mm
Allow user to select a specific candidate version.
[cydia.git] / Sources.mm
index 38eebf21cc30ddb35ae29c1a887ce05007494c61..790dd1bff51882ebb2e1fa3054d4edccb1bd07b9 100644 (file)
 /* }}} */
 
 #include <Foundation/Foundation.h>
-#include <CydiaSubstrate/CydiaSubstrate.h>
+#include <Menes/ObjectHandle.h>
 #include <CyteKit/UCPlatform.h>
 
 #include <cstdio>
 
+#include "Sources.h"
+
 extern _H<NSMutableDictionary> Sources_;
-extern bool Changed_;
 
 void CydiaWriteSources() {
-    seteuid(0);
-
-    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);
@@ -51,13 +51,10 @@ void CydiaWriteSources() {
     }
 
     fclose(file);
-
-    seteuid(501);
 }
 
 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) {