summaryrefslogtreecommitdiff
path: root/postinst.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-20 03:48:34 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-20 03:48:34 -0700
commit407564b5683493323368fbbb22850d67b47e4743 (patch)
treeabd4dcfd7f48c676ff81c6313882942a11ca5013 /postinst.mm
parente1b682c524a0933c77e607a3a30ac7627b66ee46 (diff)
Use System_, not Firmware_, for APT repository.
Diffstat (limited to 'postinst.mm')
-rw-r--r--postinst.mm15
1 files changed, 9 insertions, 6 deletions
diff --git a/postinst.mm b/postinst.mm
index f55db81..b11a9ac 100644
--- a/postinst.mm
+++ b/postinst.mm
@@ -1,7 +1,9 @@
#include <strings.h>
#include <Sources.h>
-#include <UIKit/UIKit.h>
+#include <sys/types.h>
+#include <sys/sysctl.h>
+
#include <CydiaSubstrate/CydiaSubstrate.h>
#include "CyteKit/PerlCompatibleRegEx.hpp"
@@ -9,7 +11,7 @@ _H<NSMutableDictionary> Sources_;
_H<NSString> CydiaSource_;
bool Changed_;
-_H<NSString> Firmware_;
+_H<NSString> 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);