From: Jay Freeman (saurik) Date: Sun, 20 Mar 2011 10:48:34 +0000 (-0700) Subject: Use System_, not Firmware_, for APT repository. X-Git-Tag: v1.1.0%rc1~72 X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/407564b5683493323368fbbb22850d67b47e4743 Use System_, not Firmware_, for APT repository. --- diff --git a/MobileCydia.mm b/MobileCydia.mm index b8aca937..25215bda 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -685,7 +685,7 @@ static _H Font18Bold_; static _H Font22Bold_; static const char *Machine_ = NULL; -static NSString *System_ = nil; +_H System_; static NSString *SerialNumber_ = nil; static NSString *ChipID_ = nil; static NSString *BBSNum_ = nil; @@ -714,7 +714,7 @@ static time_t now_; bool IsWildcat_; static CGFloat ScreenScale_; static NSString *Idiom_; -_H Firmware_; +static _H Firmware_; static NSString *Major_; static _H SessionData_; @@ -4621,7 +4621,7 @@ static _H Diversions_; if (Safari_ != nil) application = [NSString stringWithFormat:@"Safari/%@ %@", Safari_, application]; if (System_ != nil) - application = [NSString stringWithFormat:@"Mobile/%@ %@", System_, application]; + application = [NSString stringWithFormat:@"Mobile/%@ %@", (id) System_, application]; if (Product_ != nil) application = [NSString stringWithFormat:@"Version/%@ %@", Product_, application]; diff --git a/Sources.mm b/Sources.mm index 5f5169b5..79ae3d42 100644 --- a/Sources.mm +++ b/Sources.mm @@ -45,7 +45,7 @@ extern _H Sources_; extern _H CydiaSource_; -extern _H Firmware_; +extern _H System_; extern bool Changed_; void CydiaWriteSources() { @@ -53,8 +53,8 @@ void CydiaWriteSources() { _assert(file != NULL); NSString *distribution(@"ios"); - if (Firmware_ != nil) - distribution = [distribution stringByAppendingString:[NSString stringWithFormat:@"/%@", (id) Firmware_]]; + if (System_ != nil) + distribution = [distribution stringByAppendingString:[NSString stringWithFormat:@"/%@", (id) System_]]; fprintf(file, "deb http://%s/ %s main\n", [CydiaSource_ UTF8String], diff --git a/postinst.mm b/postinst.mm index f55db811..b11a9aca 100644 --- a/postinst.mm +++ b/postinst.mm @@ -1,7 +1,9 @@ #include #include -#include +#include +#include + #include #include "CyteKit/PerlCompatibleRegEx.hpp" @@ -9,7 +11,7 @@ _H Sources_; _H CydiaSource_; bool Changed_; -_H Firmware_; +_H System_; int main(int argc, const char *argv[]) { if (argc < 2 || strcmp(argv[1], "configure") != 0) @@ -17,10 +19,11 @@ int main(int argc, const char *argv[]) { NSAutoreleasePool *pool([[NSAutoreleasePool alloc] init]); - Pcre pattern("^([0-9]+\\.[0-9]+)"); - - if (pattern([[UIDevice currentDevice] systemVersion])) - Firmware_ = pattern[1]; + size_t size; + sysctlbyname("kern.osversion", NULL, &size, NULL, 0); + char *osversion = new char[size]; + if (sysctlbyname("kern.osversion", osversion, &size, NULL, 0) != -1) + System_ = [NSString stringWithUTF8String:osversion]; NSDictionary *metadata([[[NSMutableDictionary alloc] initWithContentsOfFile:@"/var/lib/cydia/metadata.plist"] autorelease]); NSUInteger version(0);